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

Unified Diff: src/codegen.cc

Issue 866843003: Contribution of PowerPC port (continuation of 422063005) - AIX Common1 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
Index: src/codegen.cc
diff --git a/src/codegen.cc b/src/codegen.cc
index 627e8362e67c551641174d7b161d45b27bb7761d..5193843407fa22e3b7e96532c86bf5cec342c709 100644
--- a/src/codegen.cc
+++ b/src/codegen.cc
@@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#if defined(_AIX)
+#include <fenv.h>
+#endif
+
#include "src/v8.h"
#include "src/bootstrapper.h"
@@ -48,7 +52,17 @@ double modulo(double x, double y) {
#else // POSIX
double modulo(double x, double y) {
+#if defined(_AIX)
+ // AIX raises an underflow exception for (Number.MIN_VALUE % Number.MAX_VALUE)
+ double result;
Sven Panne 2015/01/27 11:47:05 Don't use a declaration without initialization her
michael_dawson 2015/01/29 00:08:29 Will do
+ int exception;
+ feclearexcept(FE_ALL_EXCEPT);
+ result = std::fmod(x, y);
+ exception = fetestexcept(FE_UNDERFLOW);
+ return (exception ? x : result);
+#else
return std::fmod(x, y);
+#endif
}
#endif // defined(_WIN64)

Powered by Google App Engine
This is Rietveld 408576698