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

Unified Diff: src/wasm/wasm-interpreter.cc

Issue 2252863003: [turbofan] Add Float32(Max|Min) machine operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Type is number now. Created 4 years, 4 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/utils.h ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-interpreter.cc
diff --git a/src/wasm/wasm-interpreter.cc b/src/wasm/wasm-interpreter.cc
index aabf4105634f0de9723c6f5b88810eb4e3855c6b..7e3127dd533220342e6ffed20725768558bec5f1 100644
--- a/src/wasm/wasm-interpreter.cc
+++ b/src/wasm/wasm-interpreter.cc
@@ -3,6 +3,8 @@
// found in the LICENSE file.
#include "src/wasm/wasm-interpreter.h"
+
+#include "src/utils.h"
#include "src/wasm/ast-decoder.h"
#include "src/wasm/decoder.h"
#include "src/wasm/wasm-external-refs.h"
@@ -323,15 +325,11 @@ static inline float ExecuteF32Sub(float a, float b, TrapReason* trap) {
}
static inline float ExecuteF32Min(float a, float b, TrapReason* trap) {
- if (std::isnan(a)) return quiet(a);
- if (std::isnan(b)) return quiet(b);
- return std::min(a, b);
+ return JSMin(a, b);
}
static inline float ExecuteF32Max(float a, float b, TrapReason* trap) {
- if (std::isnan(a)) return quiet(a);
- if (std::isnan(b)) return quiet(b);
- return std::max(a, b);
+ return JSMax(a, b);
}
static inline float ExecuteF32CopySign(float a, float b, TrapReason* trap) {
@@ -350,25 +348,11 @@ static inline double ExecuteF64Sub(double a, double b, TrapReason* trap) {
}
static inline double ExecuteF64Min(double a, double b, TrapReason* trap) {
- if (std::isnan(a)) return quiet(a);
- if (std::isnan(b)) return quiet(b);
- if ((a == 0.0) && (b == 0.0) && (copysign(1.0, a) != copysign(1.0, b))) {
- // a and b are zero, and the sign differs: return -0.0.
- return -0.0;
- } else {
- return (a < b) ? a : b;
- }
+ return JSMin(a, b);
}
static inline double ExecuteF64Max(double a, double b, TrapReason* trap) {
- if (std::isnan(a)) return quiet(a);
- if (std::isnan(b)) return quiet(b);
- if ((a == 0.0) && (b == 0.0) && (copysign(1.0, a) != copysign(1.0, b))) {
- // a and b are zero, and the sign differs: return 0.0.
- return 0.0;
- } else {
- return (a > b) ? a : b;
- }
+ return JSMax(a, b);
}
static inline double ExecuteF64CopySign(double a, double b, TrapReason* trap) {
« no previous file with comments | « src/utils.h ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698