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

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

Issue 1583323004: [turbofan] Add the TruncateFloat32ToInt32 operator to turbofan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed a small bug 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
« no previous file with comments | « test/cctest/compiler/codegen-tester.h ('k') | no next file » | 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 11a3582cbb5d07e022ad09ae40cb08e3595abccb..5c74e0f000357436c062b615a596541acaa36768 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -4124,6 +4124,18 @@ TEST(RunChangeUint32ToFloat64) {
}
+TEST(RunTruncateFloat32ToInt32) {
+ BufferedRawMachineAssemblerTester<int32_t> m(MachineType::Float32());
+ m.Return(m.TruncateFloat32ToInt32(m.Parameter(0)));
+ FOR_FLOAT32_INPUTS(i) {
+ if (*i <= static_cast<float>(std::numeric_limits<int32_t>::max()) &&
+ *i >= static_cast<float>(std::numeric_limits<int32_t>::min())) {
+ CheckFloatEq(static_cast<int32_t>(*i), m.Call(*i));
+ }
+ }
+}
+
+
TEST(RunChangeFloat64ToInt32_A) {
BufferedRawMachineAssemblerTester<int32_t> m;
double magic = 11.1;
« no previous file with comments | « test/cctest/compiler/codegen-tester.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698