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

Unified Diff: test/cctest/compiler/test-run-machops.cc

Issue 2105313002: [wasm] Detect unrepresentability in the float32-to-int32 conversion correctly on arm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: use i.OutputRegister32() instead of i.OutputRegister() Created 4 years, 6 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/wasm/wasm-interpreter.cc ('k') | test/cctest/compiler/value-helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-machops.cc
diff --git a/test/cctest/compiler/test-run-machops.cc b/test/cctest/compiler/test-run-machops.cc
index 685918af7d974065ca82c1f59323e37a2ad686dc..aba0700306d0b3beb4949ce91872118b80671de6 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -4030,25 +4030,20 @@ TEST(RunTruncateFloat32ToInt32) {
TEST(RunTruncateFloat32ToUint32) {
BufferedRawMachineAssemblerTester<uint32_t> m(MachineType::Float32());
m.Return(m.TruncateFloat32ToUint32(m.Parameter(0)));
- {
FOR_UINT32_INPUTS(i) {
volatile float input = static_cast<float>(*i);
// This condition on 'input' is required because
- // static_cast<float>(std::numeric_limits<uint32_t>::max()) results in a
- // value outside uint32 range.
- if (input < static_cast<float>(std::numeric_limits<uint32_t>::max())) {
+ // static_cast<float>(UINT32_MAX) results in a value outside uint32 range.
+ if (input < (static_cast<float>(static_cast<uint64_t>(UINT32_MAX) + 1))) {
titzer 2016/06/30 10:55:26 Why don't we just spell out the constant as a floa
ahaas 2016/06/30 12:02:27 I wrote it this way because I think it is more rea
CHECK_EQ(static_cast<uint32_t>(input), m.Call(input));
}
}
- }
- {
- FOR_FLOAT32_INPUTS(i) {
- if (*i <= static_cast<float>(std::numeric_limits<uint32_t>::max()) &&
- *i >= static_cast<float>(std::numeric_limits<uint32_t>::min())) {
- CHECK_FLOAT_EQ(static_cast<uint32_t>(*i), m.Call(*i));
+ FOR_FLOAT32_INPUTS(j) {
+ if (*j < (static_cast<float>(static_cast<uint64_t>(UINT32_MAX) + 1)) &&
+ *j > -1) {
+ CHECK_FLOAT_EQ(static_cast<uint32_t>(*j), m.Call(*j));
}
}
- }
}
« no previous file with comments | « src/wasm/wasm-interpreter.cc ('k') | test/cctest/compiler/value-helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698