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

Unified Diff: test/cctest/wasm/test-run-wasm.cc

Issue 1532513002: [wasm] Fixed FxxNeg for inputs of NaN. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/wasm-compiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/test-run-wasm.cc
diff --git a/test/cctest/wasm/test-run-wasm.cc b/test/cctest/wasm/test-run-wasm.cc
index 08859e1dec85c6a197d42aecdbcc8c562675ac23..3bf68a98e4cfbcd3db67dd8991376702f8232652 100644
--- a/test/cctest/wasm/test-run-wasm.cc
+++ b/test/cctest/wasm/test-run-wasm.cc
@@ -1157,11 +1157,10 @@ TEST(Run_WasmFloat32Neg) {
WasmRunner<float> r(MachineType::Float32());
BUILD(r, WASM_F32_NEG(WASM_GET_LOCAL(0)));
- FOR_FLOAT32_INPUTS(i) { CheckFloatEq(-(*i), r.Call(*i)); }
-
- // The difference between +0 and -0 matters here.
- CHECK_EQ(bit_cast<uint32_t>(-0.0f), bit_cast<uint32_t>(r.Call(0.0f)));
- CHECK_EQ(bit_cast<uint32_t>(0.0f), bit_cast<uint32_t>(r.Call(-0.0f)));
+ FOR_FLOAT32_INPUTS(i) {
+ CHECK_EQ(0x80000000,
+ bit_cast<uint32_t>(*i) ^ bit_cast<uint32_t>(r.Call(*i)));
+ }
}
@@ -1169,11 +1168,10 @@ TEST(Run_WasmFloat64Neg) {
WasmRunner<double> r(MachineType::Float64());
BUILD(r, WASM_F64_NEG(WASM_GET_LOCAL(0)));
- FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(-(*i), r.Call(*i)); }
-
- // The difference between +0 and -0 matters here.
- CHECK_EQ(bit_cast<uint64_t>(-0.0), bit_cast<uint64_t>(r.Call(0.0)));
- CHECK_EQ(bit_cast<uint64_t>(0.0), bit_cast<uint64_t>(r.Call(-0.0)));
+ FOR_FLOAT64_INPUTS(i) {
+ CHECK_EQ(0x8000000000000000,
+ bit_cast<uint64_t>(*i) ^ bit_cast<uint64_t>(r.Call(*i)));
+ }
}
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698