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

Unified Diff: src/assembler.cc

Issue 10026017: Fix incorrect Math.pow() calculations with MinGW-w64 (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler.cc
===================================================================
--- src/assembler.cc (revision 11248)
+++ src/assembler.cc (working copy)
@@ -1153,6 +1153,22 @@
double power_double_double(double x, double y) {
+#ifdef __MINGW64_VERSION_MAJOR
+ if ((x == 0.0 || isinf(x)) && isfinite(y)) {
+ double f;
+
+ if (modf(y, &f) != 0.0)
+ return (x == 0.0) ^ (y > 0) ? V8_INFINITY : 0;
+ }
+
+ if (x == 2.0) {
+ int y_int = static_cast<int>(y);
+
+ if (y == y_int)
+ return ldexp(1.0, y);
alexeif 2012/04/17 16:40:13 nit: y_int
+ }
+#endif
+
// The checks for special cases can be dropped in ia32 because it has already
// been done in generated code before bailing out here.
if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) return OS::nan_value();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698