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

Unified Diff: src/compiler/instruction-selector.cc

Issue 591023003: WIP: Add first-class support for float32 representations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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/ia32/instruction-selector-ia32.cc ('k') | src/compiler/machine-operator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector.cc
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc
index 6bc41f47dfcabdd1f14bb9b10847eb8d8bf0bb61..c99830927d9e209cfb82d5be19cab39bad286bee 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -494,114 +494,80 @@ void InstructionSelector::VisitNode(Node* node) {
}
case IrOpcode::kStore:
return VisitStore(node);
- case IrOpcode::kWord32And:
- return VisitWord32And(node);
- case IrOpcode::kWord32Or:
- return VisitWord32Or(node);
- case IrOpcode::kWord32Xor:
- return VisitWord32Xor(node);
- case IrOpcode::kWord32Shl:
- return VisitWord32Shl(node);
- case IrOpcode::kWord32Shr:
- return VisitWord32Shr(node);
- case IrOpcode::kWord32Sar:
- return VisitWord32Sar(node);
- case IrOpcode::kWord32Ror:
- return VisitWord32Ror(node);
- case IrOpcode::kWord32Equal:
- return VisitWord32Equal(node);
- case IrOpcode::kWord64And:
- return VisitWord64And(node);
- case IrOpcode::kWord64Or:
- return VisitWord64Or(node);
- case IrOpcode::kWord64Xor:
- return VisitWord64Xor(node);
- case IrOpcode::kWord64Shl:
- return VisitWord64Shl(node);
- case IrOpcode::kWord64Shr:
- return VisitWord64Shr(node);
- case IrOpcode::kWord64Sar:
- return VisitWord64Sar(node);
- case IrOpcode::kWord64Ror:
- return VisitWord64Ror(node);
- case IrOpcode::kWord64Equal:
- return VisitWord64Equal(node);
- case IrOpcode::kInt32Add:
- return VisitInt32Add(node);
- case IrOpcode::kInt32AddWithOverflow:
- return VisitInt32AddWithOverflow(node);
- case IrOpcode::kInt32Sub:
- return VisitInt32Sub(node);
- case IrOpcode::kInt32SubWithOverflow:
- return VisitInt32SubWithOverflow(node);
- case IrOpcode::kInt32Mul:
- return VisitInt32Mul(node);
- case IrOpcode::kInt32Div:
- return VisitInt32Div(node);
- case IrOpcode::kInt32UDiv:
- return VisitInt32UDiv(node);
- case IrOpcode::kInt32Mod:
- return VisitInt32Mod(node);
- case IrOpcode::kInt32UMod:
- return VisitInt32UMod(node);
- case IrOpcode::kInt32LessThan:
- return VisitInt32LessThan(node);
- case IrOpcode::kInt32LessThanOrEqual:
- return VisitInt32LessThanOrEqual(node);
- case IrOpcode::kUint32LessThan:
- return VisitUint32LessThan(node);
- case IrOpcode::kUint32LessThanOrEqual:
- return VisitUint32LessThanOrEqual(node);
- case IrOpcode::kInt64Add:
- return VisitInt64Add(node);
- case IrOpcode::kInt64Sub:
- return VisitInt64Sub(node);
- case IrOpcode::kInt64Mul:
- return VisitInt64Mul(node);
- case IrOpcode::kInt64Div:
- return VisitInt64Div(node);
- case IrOpcode::kInt64UDiv:
- return VisitInt64UDiv(node);
- case IrOpcode::kInt64Mod:
- return VisitInt64Mod(node);
- case IrOpcode::kInt64UMod:
- return VisitInt64UMod(node);
- case IrOpcode::kInt64LessThan:
- return VisitInt64LessThan(node);
- case IrOpcode::kInt64LessThanOrEqual:
- return VisitInt64LessThanOrEqual(node);
- case IrOpcode::kChangeInt32ToFloat64:
- return MarkAsDouble(node), VisitChangeInt32ToFloat64(node);
- case IrOpcode::kChangeUint32ToFloat64:
- return MarkAsDouble(node), VisitChangeUint32ToFloat64(node);
- case IrOpcode::kChangeFloat64ToInt32:
- return VisitChangeFloat64ToInt32(node);
- case IrOpcode::kChangeFloat64ToUint32:
- return VisitChangeFloat64ToUint32(node);
- case IrOpcode::kChangeInt32ToInt64:
- return VisitChangeInt32ToInt64(node);
- case IrOpcode::kChangeUint32ToUint64:
- return VisitChangeUint32ToUint64(node);
- case IrOpcode::kTruncateFloat64ToInt32:
- return VisitTruncateFloat64ToInt32(node);
- case IrOpcode::kTruncateInt64ToInt32:
- return VisitTruncateInt64ToInt32(node);
- case IrOpcode::kFloat64Add:
- return MarkAsDouble(node), VisitFloat64Add(node);
- case IrOpcode::kFloat64Sub:
- return MarkAsDouble(node), VisitFloat64Sub(node);
- case IrOpcode::kFloat64Mul:
- return MarkAsDouble(node), VisitFloat64Mul(node);
- case IrOpcode::kFloat64Div:
- return MarkAsDouble(node), VisitFloat64Div(node);
- case IrOpcode::kFloat64Mod:
- return MarkAsDouble(node), VisitFloat64Mod(node);
- case IrOpcode::kFloat64Equal:
- return VisitFloat64Equal(node);
- case IrOpcode::kFloat64LessThan:
- return VisitFloat64LessThan(node);
- case IrOpcode::kFloat64LessThanOrEqual:
- return VisitFloat64LessThanOrEqual(node);
+
+#define VISIT_DEFAULT(name) \
+ case IrOpcode::k##name: \
+ return Visit##name(node)
+#define VISIT_FLOAT64(name) \
+ case IrOpcode::k##name: \
+ return MarkAsDouble(node), Visit##name(node)
+#define VISIT_FLOAT32(name) \
+ case IrOpcode::k##name: \
+ return MarkAsDouble(node), Visit##name(node)
+
+ VISIT_DEFAULT(Word32And);
+ VISIT_DEFAULT(Word32Or);
+ VISIT_DEFAULT(Word32Xor);
+ VISIT_DEFAULT(Word32Shl);
+ VISIT_DEFAULT(Word32Shr);
+ VISIT_DEFAULT(Word32Sar);
+ VISIT_DEFAULT(Word32Ror);
+ VISIT_DEFAULT(Word32Equal);
+
+ VISIT_DEFAULT(Word64And);
+ VISIT_DEFAULT(Word64Or);
+ VISIT_DEFAULT(Word64Xor);
+ VISIT_DEFAULT(Word64Shl);
+ VISIT_DEFAULT(Word64Shr);
+ VISIT_DEFAULT(Word64Sar);
+ VISIT_DEFAULT(Word64Ror);
+ VISIT_DEFAULT(Word64Equal);
+
+ VISIT_DEFAULT(Int32Add);
+ VISIT_DEFAULT(Int32AddWithOverflow);
+ VISIT_DEFAULT(Int32Sub);
+ VISIT_DEFAULT(Int32SubWithOverflow);
+ VISIT_DEFAULT(Int32Mul);
+ VISIT_DEFAULT(Int32Div);
+ VISIT_DEFAULT(Int32UDiv);
+ VISIT_DEFAULT(Int32Mod);
+ VISIT_DEFAULT(Int32UMod);
+ VISIT_DEFAULT(Int32LessThan);
+ VISIT_DEFAULT(Int32LessThanOrEqual);
+ VISIT_DEFAULT(Uint32LessThan);
+ VISIT_DEFAULT(Uint32LessThanOrEqual);
+
+ VISIT_DEFAULT(Int64Add);
+ VISIT_DEFAULT(Int64Sub);
+ VISIT_DEFAULT(Int64Mul);
+ VISIT_DEFAULT(Int64Div);
+ VISIT_DEFAULT(Int64UDiv);
+ VISIT_DEFAULT(Int64Mod);
+ VISIT_DEFAULT(Int64UMod);
+ VISIT_DEFAULT(Int64LessThan);
+ VISIT_DEFAULT(Int64LessThanOrEqual);
+
+ VISIT_FLOAT64(ChangeFloat32ToFloat64);
+ VISIT_FLOAT32(ChangeFloat64ToFloat32);
+ VISIT_DEFAULT(ChangeFloat64ToInt32);
+ VISIT_DEFAULT(ChangeFloat64ToUint32);
+ VISIT_FLOAT64(ChangeInt32ToFloat64);
+ VISIT_DEFAULT(ChangeInt32ToInt64);
+ VISIT_FLOAT64(ChangeUint32ToFloat64);
+ VISIT_DEFAULT(ChangeUint32ToUint64);
+
+ VISIT_FLOAT32(TruncateFloat64ToFloat32);
+ VISIT_DEFAULT(TruncateFloat64ToInt32);
+ VISIT_DEFAULT(TruncateInt64ToInt32);
+
+ VISIT_FLOAT64(Float64Add);
+ VISIT_FLOAT64(Float64Sub);
+ VISIT_FLOAT64(Float64Mul);
+ VISIT_FLOAT64(Float64Div);
+ VISIT_FLOAT64(Float64Mod);
+ VISIT_DEFAULT(Float64Equal);
+ VISIT_DEFAULT(Float64LessThan);
+ VISIT_DEFAULT(Float64LessThanOrEqual);
default:
V8_Fatal(__FILE__, __LINE__, "Unexpected operator #%d:%s @ node #%d",
node->opcode(), node->op()->mnemonic(), node->id());
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/machine-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698