Index: test/cctest/wasm/test-run-wasm-simd.cc |
diff --git a/test/cctest/wasm/test-run-wasm-simd.cc b/test/cctest/wasm/test-run-wasm-simd.cc |
index eb05a02ac1e014cb50346639d00fd1d3e15b8690..cee924d87c10f050e34e00b8cfdcc73e22d45272 100644 |
--- a/test/cctest/wasm/test-run-wasm-simd.cc |
+++ b/test/cctest/wasm/test-run-wasm-simd.cc |
@@ -236,7 +236,10 @@ void RunF32x4BinOpTest(WasmOpcode simd_op, FloatBinOp expected_op) { |
if (std::isnan(*i)) continue; |
FOR_FLOAT32_INPUTS(j) { |
if (std::isnan(*j)) continue; |
- CHECK_EQ(1, r.Call(*i, *j, expected_op(*i, *j))); |
+ float expected = expected_op(*i, *j); |
titzer
2016/12/21 10:19:08
IIUC, arm does flush-to-zero for sub-normal number
bbudge
2016/12/21 15:03:39
Done.
|
+ // SIMD on some platforms may handle denormalized numbers differently. |
+ if (std::fpclassify(expected) == FP_SUBNORMAL) continue; |
+ CHECK_EQ(1, r.Call(*i, *j, expected)); |
} |
} |
} |
@@ -265,6 +268,9 @@ void RunF32x4CompareOpTest(WasmOpcode simd_op, FloatCompareOp expected_op) { |
if (std::isnan(*i)) continue; |
FOR_FLOAT32_INPUTS(j) { |
if (std::isnan(*j)) continue; |
+ // SIMD on some platforms may handle denormalized numbers differently. |
+ // Check for number pairs that are very close together. |
+ if (std::fpclassify(*i - *j) == FP_SUBNORMAL) continue; |
CHECK_EQ(1, r.Call(*i, *j, expected_op(*i, *j))); |
} |
} |