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

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

Issue 487723002: [turbofan] Add proper conversion operators for int32<->int64. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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: src/compiler/change-lowering.cc
diff --git a/src/compiler/change-lowering.cc b/src/compiler/change-lowering.cc
index 03eaa398ab5da20314fb726afc31e49004453959..88398286842bc09714dfbcf6bf81e31a74fec6fd 100644
--- a/src/compiler/change-lowering.cc
+++ b/src/compiler/change-lowering.cc
@@ -88,7 +88,9 @@ Reduction ChangeLowering::ChangeFloat64ToTagged(Node* val, Node* control) {
Reduction ChangeLowering::ChangeInt32ToTagged(Node* val, Node* control) {
if (machine()->is64()) {
return Replace(
- graph()->NewNode(machine()->WordShl(), val, SmiShiftBitsConstant()));
+ graph()->NewNode(machine()->Word64Shl(),
+ graph()->NewNode(machine()->ChangeInt32ToInt64(), val),
+ SmiShiftBitsConstant()));
}
Node* add = graph()->NewNode(machine()->Int32AddWithOverflow(), val, val);
@@ -129,7 +131,7 @@ Reduction ChangeLowering::ChangeTaggedToInt32(Node* val, Node* control) {
graph()->NewNode(machine()->WordSar(), val, SmiShiftBitsConstant());
Node* number =
machine()->is64()
- ? graph()->NewNode(machine()->ConvertInt64ToInt32(), integer)
+ ? graph()->NewNode(machine()->TruncateInt64ToInt32(), integer)
: integer;
Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
@@ -158,7 +160,7 @@ Reduction ChangeLowering::ChangeTaggedToFloat64(Node* val, Node* control) {
Node* number = graph()->NewNode(
machine()->ChangeInt32ToFloat64(),
machine()->is64()
- ? graph()->NewNode(machine()->ConvertInt64ToInt32(), integer)
+ ? graph()->NewNode(machine()->TruncateInt64ToInt32(), integer)
: integer);
Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);

Powered by Google App Engine
This is Rietveld 408576698