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

Unified Diff: src/compiler/machine-operator.h

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/machine-operator.h
diff --git a/src/compiler/machine-operator.h b/src/compiler/machine-operator.h
index 219831c0cfedd92986ed4c4d8dd84cf4f3ee5b17..4b2d3417613555748201384ae10cdfdec09db21f 100644
--- a/src/compiler/machine-operator.h
+++ b/src/compiler/machine-operator.h
@@ -121,19 +121,22 @@ class MachineOperatorBuilder {
Operator* Int64LessThan() { BINOP(Int64LessThan); }
Operator* Int64LessThanOrEqual() { BINOP(Int64LessThanOrEqual); }
- Operator* ConvertInt32ToInt64() { UNOP(ConvertInt32ToInt64); }
- Operator* ConvertInt64ToInt32() { UNOP(ConvertInt64ToInt32); }
-
// Convert representation of integers between float64 and int32/uint32.
// The precise rounding mode and handling of out of range inputs are *not*
// defined for these operators, since they are intended only for use with
// integers.
- // TODO(titzer): rename ConvertXXX to ChangeXXX in machine operators.
Operator* ChangeInt32ToFloat64() { UNOP(ChangeInt32ToFloat64); }
Operator* ChangeUint32ToFloat64() { UNOP(ChangeUint32ToFloat64); }
Operator* ChangeFloat64ToInt32() { UNOP(ChangeFloat64ToInt32); }
Operator* ChangeFloat64ToUint32() { UNOP(ChangeFloat64ToUint32); }
+ // Sign/zero extend int32/uint32 to int64/uint64.
+ Operator* ChangeInt32ToInt64() { UNOP(ChangeInt32ToInt64); }
+ Operator* ChangeUint32ToUint64() { UNOP(ChangeUint32ToUint64); }
+
+ // Truncate the high order bits and convert the remaining bits to int32.
+ Operator* TruncateInt64ToInt32() { UNOP(TruncateInt64ToInt32); }
+
// Floating point operators always operate with IEEE 754 round-to-nearest.
Operator* Float64Add() { BINOP_C(Float64Add); }
Operator* Float64Sub() { BINOP(Float64Sub); }

Powered by Google App Engine
This is Rietveld 408576698