Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 220723017: Add optimization for pow(base, 0.5) to the other architectures as well. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 34708)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -4778,7 +4778,7 @@
Register temp = locs()->temp(kObjectTempIndex).reg();
XmmRegister zero_temp = locs()->temp(kDoubleTempIndex).fpu_reg();
- Label do_call, check_base, return_nan;
+ Label try_sqrt, check_base, return_nan;
__ LoadObject(temp, Double::ZoneHandle(Double::NewCanonical(0)));
__ movsd(zero_temp, FieldAddress(temp, Double::value_offset()));
__ LoadObject(temp, Double::ZoneHandle(Double::NewCanonical(1)));
@@ -4799,7 +4799,7 @@
// Note: 'base' could be NaN.
__ comisd(exp, base);
// Neither 'exp' nor 'base' is NaN.
- __ j(PARITY_ODD, &do_call, Assembler::kNearJump);
+ __ j(PARITY_ODD, &try_sqrt, Assembler::kNearJump);
// Return NaN.
__ Bind(&return_nan);
__ LoadObject(temp, Double::ZoneHandle(Double::NewCanonical(NAN)));
@@ -4807,8 +4807,8 @@
__ jmp(&skip_call);
Label do_pow, return_zero;
- __ Bind(&do_call);
- // Before calling check if we could use sqrt instead of pow.
+ __ Bind(&try_sqrt);
+ // Before calling pow, check if we could use sqrt instead of pow.
__ LoadObject(temp, Double::ZoneHandle(Double::NewCanonical(-INFINITY)));
__ movsd(result, FieldAddress(temp, Double::value_offset()));
// base == -Infinity -> call pow;
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698