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

Unified Diff: src/compiler/machine-node-factory.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-node-factory.h
diff --git a/src/compiler/machine-node-factory.h b/src/compiler/machine-node-factory.h
index cc9d5d903596c472feb0841c756f224817f4600d..014dbda06ad8e1da93649bca26387b0293df5031 100644
--- a/src/compiler/machine-node-factory.h
+++ b/src/compiler/machine-node-factory.h
@@ -280,12 +280,13 @@ class MachineNodeFactory {
return Int64LessThanOrEqual(b, a);
}
+ // TODO(turbofan): What is this used for?
Node* ConvertIntPtrToInt32(Node* a) {
- return kPointerSize == 8 ? NEW_NODE_1(MACHINE()->ConvertInt64ToInt32(), a)
+ return kPointerSize == 8 ? NEW_NODE_1(MACHINE()->TruncateInt64ToInt32(), a)
: a;
}
Node* ConvertInt32ToIntPtr(Node* a) {
- return kPointerSize == 8 ? NEW_NODE_1(MACHINE()->ConvertInt32ToInt64(), a)
+ return kPointerSize == 8 ? NEW_NODE_1(MACHINE()->ChangeInt32ToInt64(), a)
: a;
}
@@ -339,12 +340,6 @@ class MachineNodeFactory {
}
// Conversions.
- Node* ConvertInt32ToInt64(Node* a) {
- return NEW_NODE_1(MACHINE()->ConvertInt32ToInt64(), a);
- }
- Node* ConvertInt64ToInt32(Node* a) {
- return NEW_NODE_1(MACHINE()->ConvertInt64ToInt32(), a);
- }
Node* ChangeInt32ToFloat64(Node* a) {
return NEW_NODE_1(MACHINE()->ChangeInt32ToFloat64(), a);
}
@@ -357,6 +352,15 @@ class MachineNodeFactory {
Node* ChangeFloat64ToUint32(Node* a) {
return NEW_NODE_1(MACHINE()->ChangeFloat64ToUint32(), a);
}
+ Node* ChangeInt32ToInt64(Node* a) {
+ return NEW_NODE_1(MACHINE()->ChangeInt32ToInt64(), a);
+ }
+ Node* ChangeUint32ToUint64(Node* a) {
+ return NEW_NODE_1(MACHINE()->ChangeUint32ToUint64(), a);
+ }
+ Node* TruncateInt64ToInt32(Node* a) {
+ return NEW_NODE_1(MACHINE()->TruncateInt64ToInt32(), a);
+ }
#ifdef MACHINE_ASSEMBLER_SUPPORTS_CALL_C
// Call to C.

Powered by Google App Engine
This is Rietveld 408576698