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

Unified Diff: src/arm/codegen-arm.cc

Issue 6368050: Fix Math.pow(-0, 0.5) and Math.pow(-0, -0.5). These are not equal to sqrt(-0... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 11 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 | « no previous file | src/assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/codegen-arm.cc
===================================================================
--- src/arm/codegen-arm.cc (revision 6572)
+++ src/arm/codegen-arm.cc (working copy)
@@ -4698,12 +4698,15 @@
runtime.entry_label(),
AVOID_NANS_AND_INFINITIES);
+ // Convert -0 into +0 by adding +0.
+ __ vmov(d2, 0.0);
+ __ vadd(d0, d2, d0);
// Load 1.0 into d2.
__ vmov(d2, 1.0);
- // Calculate the reciprocal of the square root. 1/sqrt(x) = sqrt(1/x).
+ // Calculate the reciprocal of the square root.
+ __ vsqrt(d0, d0);
__ vdiv(d0, d2, d0);
- __ vsqrt(d0, d0);
__ b(&allocate_return);
@@ -4717,6 +4720,9 @@
scratch1, scratch2, heap_number_map, s0,
runtime.entry_label(),
AVOID_NANS_AND_INFINITIES);
+ // Convert -0 into +0 by adding +0.
+ __ vmov(d2, 0.0);
+ __ vadd(d0, d2, d0);
__ vsqrt(d0, d0);
__ bind(&allocate_return);
« no previous file with comments | « no previous file | src/assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698