Reviewers: Yang, Kasper Lund, yuqiang.xian,
Message:
Hi,Yang, Kasper and Yuqiang
I have a patch for intrinsic power function on ia32. Would you please help
to
review it?
Thanks,
-Xi
Description:
Improve the assembly code for power function with integer exponential.
The change removes one unused multiply and reschedules
the shift, multiply and jump instructions to reduce
stall. Experiment shows it improve about 20% performance
on x86 for exponetials from about 100 to 2000.
Please review this at https://codereview.chromium.org/10916311/
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M src/ia32/code-stubs-ia32.cc
Index: src/ia32/code-stubs-ia32.cc
===================================================================
--- src/ia32/code-stubs-ia32.cc (revision 12493)
+++ src/ia32/code-stubs-ia32.cc (working copy)
@@ -3213,21 +3213,26 @@
__ movsd(double_scratch2, double_result); // Load double_exponent with
1.
// Get absolute value of exponent.
- Label no_neg, while_true, no_multiply;
+ Label no_neg, while_true, no_multiply, while_false;
__ test(scratch, scratch);
__ j(positive, &no_neg, Label::kNear);
__ neg(scratch);
__ bind(&no_neg);
- __ bind(&while_true);
+ __ j(zero, &while_false, Label::kNear);
__ shr(scratch, 1);
- __ j(not_carry, &no_multiply, Label::kNear);
+ __ j(above, &while_true, Label::kNear);
__ mulsd(double_result, double_scratch);
- __ bind(&no_multiply);
+ __ j(zero, &while_false, Label::kNear);
+ __ bind(&while_true);
+ __ shr(scratch, 1);
__ mulsd(double_scratch, double_scratch);
+ __ j(above, &while_true, Label::kNear);
+ __ mulsd(double_result, double_scratch);
__ j(not_zero, &while_true);
+ __ bind(&while_false);
// scratch has the original value of the exponent - if the exponent is
// negative, return 1/result.
__ test(exponent, exponent);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev