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

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

Issue 1476063002: [turbofan] Implemented the TruncateFloat32ToInt64 TurboFan operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Increased the type of opcodes from uint8_t to uint16_t. Created 5 years, 1 month 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/x64/macro-assembler-x64.cc ('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 f9487331166c2d7d26cc73c5cea0c3ac31525932..662cde72004f0ac8230c3881f89a89319e3beae3 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -5391,6 +5391,24 @@ TEST(RunBitcastFloat64ToInt64) {
}
+TEST(RunTruncateFloat32ToInt64) {
+ BufferedRawMachineAssemblerTester<int64_t> m(kMachFloat32);
+ m.Return(m.TruncateFloat32ToInt64(m.Parameter(0)));
+
+ FOR_INT64_INPUTS(i) {
+ float input = static_cast<float>(*i);
+ if (input < 9223372036854775808.0 && input > -9223372036854775809.0) {
+ CHECK_EQ(static_cast<int64_t>(input), m.Call(input));
+ }
+ }
+ FOR_FLOAT32_INPUTS(j) {
+ if (*j < 9223372036854775808.0 && *j > -9223372036854775809.0) {
+ CHECK_EQ(static_cast<int64_t>(*j), m.Call(*j));
+ }
+ }
+}
+
+
TEST(RunTruncateFloat64ToInt64) {
BufferedRawMachineAssemblerTester<int64_t> m(kMachFloat64);
m.Return(m.TruncateFloat64ToInt64(m.Parameter(0)));
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698