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

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

Issue 1627263002: [turbofan] Add TruncateFloat32ToUint32 operator to Turbofan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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
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 52672c8a89204cdf1fcc7d275311813bbeaf9a46..1c43585778a9ac5e5a4b51d385f8d3c25d0be64d 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -4136,6 +4136,21 @@ TEST(RunTruncateFloat32ToInt32) {
}
+TEST(RunTruncateFloat32ToUint32) {
+ BufferedRawMachineAssemblerTester<uint32_t> m(MachineType::Float32());
+ m.Return(m.TruncateFloat32ToUint32(m.Parameter(0)));
+
+ FOR_UINT32_INPUTS(i) {
ahaas 2016/01/29 10:45:08 Could you also run tests for FOR_FLOAT32_INPUTS wh
+ float input = static_cast<float>(*i);
+ // This condition on 'input' is required because
+ // static_cast<float>(UINT32_MAX) results in a value outside uint32 range.
+ if (input < static_cast<float>(UINT32_MAX)) {
+ CHECK_EQ(static_cast<uint32_t>(input), m.Call(input));
+ }
+ }
+}
+
+
TEST(RunChangeFloat64ToInt32_A) {
BufferedRawMachineAssemblerTester<int32_t> m;
double magic = 11.1;
« src/compiler/ia32/code-generator-ia32.cc ('K') | « src/ia32/macro-assembler-ia32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698