Index: src/compiler/representation-change.cc |
diff --git a/src/compiler/representation-change.cc b/src/compiler/representation-change.cc |
index 2f7720beb3705599929416c442e2f1ab910677dc..073f03632d32876ef83daf82129c0a1fc5f53d03 100644 |
--- a/src/compiler/representation-change.cc |
+++ b/src/compiler/representation-change.cc |
@@ -137,6 +137,8 @@ Node* RepresentationChanger::GetRepresentationFor( |
case MachineRepresentation::kFloat64: |
return GetFloat64RepresentationFor(node, output_rep, output_type, |
truncation); |
+ case MachineRepresentation::kSimd128: |
+ return GetSimd128RepresentationFor(node, output_rep, output_type); |
case MachineRepresentation::kBit: |
return GetBitRepresentationFor(node, output_rep, output_type); |
case MachineRepresentation::kWord8: |
@@ -145,9 +147,6 @@ Node* RepresentationChanger::GetRepresentationFor( |
return GetWord32RepresentationFor(node, output_rep, output_type); |
case MachineRepresentation::kWord64: |
return GetWord64RepresentationFor(node, output_rep, output_type); |
- case MachineRepresentation::kSimd128: // Fall through. |
- // TODO(bbudge) Handle conversions between tagged and untagged. |
- break; |
case MachineRepresentation::kNone: |
return node; |
} |
@@ -314,12 +313,23 @@ Node* RepresentationChanger::GetFloat64RepresentationFor( |
return jsgraph()->graph()->NewNode(op, node); |
} |
+Node* RepresentationChanger::GetSimd128RepresentationFor( |
+ Node* node, MachineRepresentation output_rep, Type* output_type) { |
+ // Select the correct X -> Simd128 operator. |
+ const Operator* op; |
+ if (output_rep == MachineRepresentation::kTagged) { |
+ op = nullptr; |
+ } else { |
+ return TypeError(node, output_rep, output_type, |
+ MachineRepresentation::kFloat64); |
+ } |
+ return jsgraph()->graph()->NewNode(op, node); |
+} |
Node* RepresentationChanger::MakeTruncatedInt32Constant(double value) { |
return jsgraph()->Int32Constant(DoubleToInt32(value)); |
} |
- |
Node* RepresentationChanger::GetWord32RepresentationFor( |
Node* node, MachineRepresentation output_rep, Type* output_type) { |
// Eagerly fold representation changes for constants. |