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

Unified Diff: test/cctest/compiler/test-representation-change.cc

Issue 2191503002: [turbofan] Add the CheckedTruncateTaggedToWord32 opcode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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/verifier.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-representation-change.cc
diff --git a/test/cctest/compiler/test-representation-change.cc b/test/cctest/compiler/test-representation-change.cc
index 8d70ca23d9e096cda0007d7e5720f897459dfa73..b475e9a5b9d76e79148bd4fb4c4d78e84c32ba84 100644
--- a/test/cctest/compiler/test-representation-change.cc
+++ b/test/cctest/compiler/test-representation-change.cc
@@ -442,7 +442,6 @@ TEST(ToUint32_constant) {
}
}
-
static void CheckChange(IrOpcode::Value expected, MachineRepresentation from,
Type* from_type, MachineRepresentation to) {
RepresentationChangerTester r;
@@ -477,6 +476,20 @@ static void CheckTwoChanges(IrOpcode::Value expected2,
CHECK_EQ(n, c2->InputAt(0));
}
+static void CheckChange(IrOpcode::Value expected, MachineRepresentation from,
+ Type* from_type, MachineRepresentation to,
+ UseInfo use_info) {
+ RepresentationChangerTester r;
+
+ Node* n = r.Parameter();
+ Node* use = r.Return(n);
+ Node* c =
+ r.changer()->GetRepresentationFor(n, from, from_type, use, use_info);
+
+ CHECK_NE(c, n);
+ CHECK_EQ(expected, c->opcode());
+ CHECK_EQ(n, c->InputAt(0));
+}
TEST(SingleChanges) {
CheckChange(IrOpcode::kChangeTaggedToBit, MachineRepresentation::kTagged,
@@ -580,6 +593,10 @@ TEST(SignednessInWord32) {
CheckChange(IrOpcode::kTruncateFloat64ToWord32,
MachineRepresentation::kFloat64, Type::Number(),
MachineRepresentation::kWord32);
+ CheckChange(IrOpcode::kCheckedTruncateTaggedToWord32,
+ MachineRepresentation::kTagged, Type::NumberOrOddball(),
+ MachineRepresentation::kWord32,
+ UseInfo::CheckedNumberOrOddballAsWord32());
CheckTwoChanges(IrOpcode::kChangeInt32ToFloat64,
IrOpcode::kTruncateFloat64ToFloat32,
« no previous file with comments | « src/compiler/verifier.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698