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

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

Issue 2598583002: [WASM] Skip SIMD test values that may result in denormalized numbers. (Closed)
Patch Set: Add a TODO. Created 4 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 | « no previous file | 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-simd.cc
diff --git a/test/cctest/wasm/test-run-wasm-simd.cc b/test/cctest/wasm/test-run-wasm-simd.cc
index eb05a02ac1e014cb50346639d00fd1d3e15b8690..32e1f1621ee1ec4e5bd68179c8e21cb25dac0e05 100644
--- a/test/cctest/wasm/test-run-wasm-simd.cc
+++ b/test/cctest/wasm/test-run-wasm-simd.cc
@@ -236,7 +236,12 @@ 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);
+ // 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) {
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)));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698