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

Unified Diff: src/compiler/simplified-lowering.cc

Issue 1225993002: [turbofan] Add TruncationMode for TruncateFloat64ToInt32. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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/compiler/representation-change.h ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index 68e7567a5c7ccd346d766fe29ab2b27ad2ee9f67..006b6ab28f26454149e19b3d9ae404c346e5f4a3 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -727,8 +727,10 @@ class RepresentationSelector {
// Require the input in float64 format and perform truncation.
// TODO(turbofan): avoid a truncation with a smi check.
VisitUnop(node, kTypeInt32 | kRepFloat64, kTypeInt32 | kRepWord32);
- if (lower())
- node->set_op(lowering->machine()->TruncateFloat64ToInt32());
+ if (lower()) {
+ node->set_op(lowering->machine()->TruncateFloat64ToInt32(
+ TruncationMode::kJavaScript));
+ }
}
break;
}
@@ -755,8 +757,10 @@ class RepresentationSelector {
// Require the input in float64 format and perform truncation.
// TODO(turbofan): avoid a truncation with a smi check.
VisitUnop(node, kTypeUint32 | kRepFloat64, kTypeUint32 | kRepWord32);
- if (lower())
- node->set_op(lowering->machine()->TruncateFloat64ToInt32());
+ if (lower()) {
+ node->set_op(lowering->machine()->TruncateFloat64ToInt32(
+ TruncationMode::kJavaScript));
+ }
}
break;
}
@@ -1008,6 +1012,9 @@ class RepresentationSelector {
case IrOpcode::kTruncateFloat64ToFloat32:
return VisitUnop(node, kTypeNumber | kRepFloat64,
kTypeNumber | kRepFloat32);
+ case IrOpcode::kTruncateFloat64ToInt32:
+ return VisitUnop(node, kTypeNumber | kRepFloat64,
+ kTypeInt32 | kRepWord32);
case IrOpcode::kTruncateInt64ToInt32:
// TODO(titzer): Is kTypeInt32 correct here?
return VisitUnop(node, kTypeInt32 | kRepWord64,
« no previous file with comments | « src/compiler/representation-change.h ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698