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

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

Issue 1673583002: [wasm] min/max does not return signaling NaNs anymore. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: turned off tests on arm Created 4 years, 10 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/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 10152471e522e201711ef1fabd31080193f6ca5e..6d1981426aefd2c5a0bd914e08ad9e8d16d3eed4 100644
--- a/test/cctest/wasm/test-run-wasm.cc
+++ b/test/cctest/wasm/test-run-wasm.cc
@@ -3122,6 +3122,74 @@ TEST(Run_Wasm_F64Max) {
}
}
+// TODO(ahaas): Fix on arm and reenable.
+#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64
+
+TEST(Run_Wasm_F32Min_Snan) {
+ // Test that the instruction does not return a signalling NaN.
+ {
+ WasmRunner<float> r;
+ BUILD(r,
+ WASM_F32_MIN(WASM_F32(bit_cast<float>(0xff80f1e2)), WASM_F32(57.67)));
+ CHECK_EQ(0xffc0f1e2, bit_cast<uint32_t>(r.Call()));
+ }
+ {
+ WasmRunner<float> r;
+ BUILD(r,
+ WASM_F32_MIN(WASM_F32(45.73), WASM_F32(bit_cast<float>(0x7f80f1e2))));
+ CHECK_EQ(0x7fc0f1e2, bit_cast<uint32_t>(r.Call()));
+ }
+}
+
+TEST(Run_Wasm_F32Max_Snan) {
+ // Test that the instruction does not return a signalling NaN.
+ {
+ WasmRunner<float> r;
+ BUILD(r,
+ WASM_F32_MAX(WASM_F32(bit_cast<float>(0xff80f1e2)), WASM_F32(57.67)));
+ CHECK_EQ(0xffc0f1e2, bit_cast<uint32_t>(r.Call()));
+ }
+ {
+ WasmRunner<float> r;
+ BUILD(r,
+ WASM_F32_MAX(WASM_F32(45.73), WASM_F32(bit_cast<float>(0x7f80f1e2))));
+ CHECK_EQ(0x7fc0f1e2, bit_cast<uint32_t>(r.Call()));
+ }
+}
+
+TEST(Run_Wasm_F64Min_Snan) {
+ // Test that the instruction does not return a signalling NaN.
+ {
+ WasmRunner<double> r;
+ BUILD(r, WASM_F64_MIN(WASM_F64(bit_cast<double>(0xfff000000000f1e2)),
+ WASM_F64(57.67)));
+ CHECK_EQ(0xfff800000000f1e2, bit_cast<uint64_t>(r.Call()));
+ }
+ {
+ WasmRunner<double> r;
+ BUILD(r, WASM_F64_MIN(WASM_F64(45.73),
+ WASM_F64(bit_cast<double>(0x7ff000000000f1e2))));
+ CHECK_EQ(0x7ff800000000f1e2, bit_cast<uint64_t>(r.Call()));
+ }
+}
+
+TEST(Run_Wasm_F64Max_Snan) {
+ // Test that the instruction does not return a signalling NaN.
+ {
+ WasmRunner<double> r;
+ BUILD(r, WASM_F64_MAX(WASM_F64(bit_cast<double>(0xfff000000000f1e2)),
+ WASM_F64(57.67)));
+ CHECK_EQ(0xfff800000000f1e2, bit_cast<uint64_t>(r.Call()));
+ }
+ {
+ WasmRunner<double> r;
+ BUILD(r, WASM_F64_MAX(WASM_F64(45.73),
+ WASM_F64(bit_cast<double>(0x7ff000000000f1e2))));
+ CHECK_EQ(0x7ff800000000f1e2, bit_cast<uint64_t>(r.Call()));
+ }
+}
+
+#endif
#if WASM_64
TEST(Run_Wasm_F32SConvertI64) {
« 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