Commit 7a6138ae authored by bbudge's avatar bbudge Committed by Commit bot

[WASM] Skip SIMD test values that may result in denormalized numbers.

On ARM Neon at least, denormals flush to zero, which may not match
regular FP behavior.

LOG=N
BUG=v8:4124

Review-Url: https://codereview.chromium.org/2598583002
Cr-Commit-Position: refs/heads/master@{#41895}
parent 679b31c2
...@@ -236,7 +236,12 @@ void RunF32x4BinOpTest(WasmOpcode simd_op, FloatBinOp expected_op) { ...@@ -236,7 +236,12 @@ void RunF32x4BinOpTest(WasmOpcode simd_op, FloatBinOp expected_op) {
if (std::isnan(*i)) continue; if (std::isnan(*i)) continue;
FOR_FLOAT32_INPUTS(j) { FOR_FLOAT32_INPUTS(j) {
if (std::isnan(*j)) continue; if (std::isnan(*j)) continue;
CHECK_EQ(1, r.Call(*i, *j, expected_op(*i, *j))); float expected = expected_op(*i, *j);
// SIMD on some platforms may handle denormalized numbers differently.
// TODO(bbudge) On platforms that flush denorms to zero, test with
// expected == 0.
if (std::fpclassify(expected) == FP_SUBNORMAL) continue;
CHECK_EQ(1, r.Call(*i, *j, expected));
} }
} }
} }
...@@ -265,6 +270,9 @@ void RunF32x4CompareOpTest(WasmOpcode simd_op, FloatCompareOp expected_op) { ...@@ -265,6 +270,9 @@ void RunF32x4CompareOpTest(WasmOpcode simd_op, FloatCompareOp expected_op) {
if (std::isnan(*i)) continue; if (std::isnan(*i)) continue;
FOR_FLOAT32_INPUTS(j) { FOR_FLOAT32_INPUTS(j) {
if (std::isnan(*j)) continue; 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))); CHECK_EQ(1, r.Call(*i, *j, expected_op(*i, *j)));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment