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

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

Issue 470593002: Unify MachineType and RepType. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Forgot a RepresentationOf() in arm64. 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: 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 092a5f7d90cab204aa9fe1a055240f87d382b0f4..080ccd66383b349cc7df2f79e2ceeaea62b12afe 100644
--- a/test/cctest/compiler/test-representation-change.cc
+++ b/test/cctest/compiler/test-representation-change.cc
@@ -65,16 +65,16 @@ class RepresentationChangerTester : public HandleAndZoneScope,
return graph()->NewNode(common()->Parameter(index), graph()->start());
}
- void CheckTypeError(RepTypeUnion from, RepTypeUnion to) {
+ void CheckTypeError(MachineTypeUnion from, MachineTypeUnion to) {
changer()->testing_type_errors_ = true;
changer()->type_error_ = false;
Node* n = Parameter(0);
Node* c = changer()->GetRepresentationFor(n, from, to);
- CHECK_EQ(n, c);
CHECK(changer()->type_error_);
+ CHECK_EQ(n, c);
}
- void CheckNop(RepTypeUnion from, RepTypeUnion to) {
+ void CheckNop(MachineTypeUnion from, MachineTypeUnion to) {
Node* n = Parameter(0);
Node* c = changer()->GetRepresentationFor(n, from, to);
CHECK_EQ(n, c);
@@ -85,7 +85,8 @@ class RepresentationChangerTester : public HandleAndZoneScope,
} // namespace v8::internal::compiler
-static const RepType all_reps[] = {rBit, rWord32, rWord64, rFloat64, rTagged};
+static const MachineType all_reps[] = {rBit, rWord32, rWord64, rFloat64,
+ rTagged};
// TODO(titzer): lift this to ValueHelper
@@ -156,8 +157,8 @@ TEST(ToTagged_constant) {
}
-static void CheckChange(IrOpcode::Value expected, RepTypeUnion from,
- RepTypeUnion to) {
+static void CheckChange(IrOpcode::Value expected, MachineTypeUnion from,
+ MachineTypeUnion to) {
RepresentationChangerTester r;
Node* n = r.Parameter();
@@ -214,7 +215,20 @@ TEST(Nops) {
r.CheckNop(rWord64, rBit);
r.CheckNop(rWord64, rBit | tBool);
+ // 32-bit words can be used as smaller word sizes and vice versa, because
+ // loads from memory implicitly sign or zero extend the value to the
+ // full machine word size, and stores implicitly truncate.
+ r.CheckNop(rWord32, rWord8);
+ r.CheckNop(rWord32, rWord16);
+ r.CheckNop(rWord32, rWord32);
+ r.CheckNop(rWord8, rWord32);
+ r.CheckNop(rWord16, rWord32);
+
// rBit (result of comparison) is implicitly a wordish thing.
+ r.CheckNop(rBit, rWord8);
+ r.CheckNop(rBit | tBool, rWord8);
+ r.CheckNop(rBit, rWord16);
+ r.CheckNop(rBit | tBool, rWord16);
r.CheckNop(rBit, rWord32);
r.CheckNop(rBit | tBool, rWord32);
r.CheckNop(rBit, rWord64);

Powered by Google App Engine
This is Rietveld 408576698