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

Unified Diff: src/utils.h

Issue 2333663002: [turbofan] Do constant folding for Float64Pow. (Closed)
Patch Set: Make sure to have exponent 0/-0 properly. Created 4 years, 3 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 | « src/compiler/machine-operator-reducer.cc ('k') | src/wasm/wasm-external-refs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils.h
diff --git a/src/utils.h b/src/utils.h
index 8eca39207d4aa55b222870a2e36e7ce53a273bc8..e85b88a12671e491118591be28c29b4f69c7a8c3 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -234,6 +234,10 @@ inline double Floor(double x) {
}
inline double Pow(double x, double y) {
+ if (y == 0.0) return 1.0;
+ if (std::isnan(y) || ((x == 1 || x == -1) && std::isinf(y))) {
+ return std::numeric_limits<double>::quiet_NaN();
+ }
#if (defined(__MINGW64_VERSION_MAJOR) && \
(!defined(__MINGW64_VERSION_RC) || __MINGW64_VERSION_RC < 1)) || \
defined(V8_OS_AIX)
« no previous file with comments | « src/compiler/machine-operator-reducer.cc ('k') | src/wasm/wasm-external-refs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698