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

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

Issue 576973003: Hack representation inference to assume current behavior of float32 loads and stores, which include… (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
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 9c55a802c2c924961b3b034e4f21e4a3ad4d658d..6c9026b2e018ee7147b684239fbd3fc516249902 100644
--- a/test/cctest/compiler/test-representation-change.cc
+++ b/test/cctest/compiler/test-representation-change.cc
@@ -88,6 +88,7 @@ class RepresentationChangerTester : public HandleAndZoneScope,
} // namespace v8::internal::compiler
+// TODO(titzer): add kRepFloat32 when fully supported.
static const MachineType all_reps[] = {kRepBit, kRepWord32, kRepWord64,
kRepFloat64, kRepTagged};
@@ -225,6 +226,11 @@ TEST(Nops) {
r.CheckNop(all_reps[i], all_reps[i]);
}
+ // 32-bit floats.
+ r.CheckNop(kRepFloat32, kRepFloat32);
+ r.CheckNop(kRepFloat32 | kTypeNumber, kRepFloat32);
+ r.CheckNop(kRepFloat32, kRepFloat32 | kTypeNumber);
+
// 32-bit or 64-bit words can be used as branch conditions (kRepBit).
r.CheckNop(kRepWord32, kRepBit);
r.CheckNop(kRepWord32, kRepBit | kTypeBool);
@@ -261,6 +267,12 @@ TEST(TypeErrors) {
r.CheckTypeError(kRepBit, kRepFloat64);
r.CheckTypeError(kRepBit | kTypeBool, kRepFloat64);
+ // Floats cannot be implicitly converted to/from comparison conditions.
+ r.CheckTypeError(kRepFloat32, kRepBit);
+ r.CheckTypeError(kRepFloat32, kRepBit | kTypeBool);
+ r.CheckTypeError(kRepBit, kRepFloat32);
+ r.CheckTypeError(kRepBit | kTypeBool, kRepFloat32);
+
// Word64 is internal and shouldn't be implicitly converted.
r.CheckTypeError(kRepWord64, kRepTagged | kTypeBool);
r.CheckTypeError(kRepWord64, kRepTagged);
@@ -283,24 +295,11 @@ TEST(TypeErrors) {
r.CheckTypeError(all_reps[i] | all_reps[j], kRepTagged);
}
}
-}
-
-TEST(CompleteMatrix) {
- // TODO(titzer): test all variants in the matrix.
- // rB
- // tBrB
- // tBrT
- // rW32
- // tIrW32
- // tUrW32
- // rW64
- // tIrW64
- // tUrW64
- // rF64
- // tIrF64
- // tUrF64
- // tArF64
- // rT
- // tArT
+ // TODO(titzer): Float32 representation changes trigger type errors now.
+ // Enforce current behavior to test all paths through representation changer.
+ for (size_t i = 0; i < arraysize(all_reps); i++) {
+ r.CheckTypeError(all_reps[i], kRepFloat32);
+ r.CheckTypeError(kRepFloat32, all_reps[i]);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698