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

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

Issue 1693563004: Convert between tagged and untagged kSimd128 values. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 9 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/representation-change.h ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « src/compiler/representation-change.h ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698