Tweak to shorten generated code in Math.pow.
Review URL: http://codereview.chromium.org/8834007 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10189 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
f6eab29d73
commit
10675502f8
@ -3130,11 +3130,9 @@ void MathPowStub::Generate(MacroAssembler* masm) {
|
||||
__ movsd(double_scratch2, double_result); // Load double_exponent with 1.
|
||||
|
||||
// Get absolute value of exponent.
|
||||
Label no_neg, while_true, no_multiply;
|
||||
__ cmp(exponent, 0);
|
||||
__ j(greater_equal, &no_neg, Label::kNear);
|
||||
__ neg(exponent);
|
||||
__ bind(&no_neg);
|
||||
Label while_true, no_multiply;
|
||||
const uint32_t kClearSignBitMask = 0x7FFFFFFF;
|
||||
__ and_(exponent, Immediate(kClearSignBitMask));
|
||||
|
||||
__ bind(&while_true);
|
||||
__ shr(exponent, 1);
|
||||
|
@ -2181,11 +2181,9 @@ void MathPowStub::Generate(MacroAssembler* masm) {
|
||||
__ movsd(double_scratch2, double_result); // Load double_exponent with 1.
|
||||
|
||||
// Get absolute value of exponent.
|
||||
Label no_neg, while_true, no_multiply;
|
||||
__ cmpl(scratch, Immediate(0));
|
||||
__ j(positive, &no_neg, Label::kNear);
|
||||
__ negl(scratch);
|
||||
__ bind(&no_neg);
|
||||
Label while_true, no_multiply;
|
||||
const uint32_t kClearSignBitMask = 0x7FFFFFFF;
|
||||
__ andl(scratch, Immediate(kClearSignBitMask));
|
||||
|
||||
__ bind(&while_true);
|
||||
__ shrl(scratch, Immediate(1));
|
||||
|
Loading…
Reference in New Issue
Block a user