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

Unified Diff: test/cctest/compiler/test-run-load-store.cc

Issue 1968453002: [turbofan] Take the immediate size in account when narrowing ia32/x64 word comparison operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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/x64/instruction-selector-x64.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-run-load-store.cc
diff --git a/test/cctest/compiler/test-run-load-store.cc b/test/cctest/compiler/test-run-load-store.cc
index 6484d30a2b0902cc1f2db65e52e6a240b01c3228..fd25926544a71902c0f7101cecd4041bd3e0be34 100644
--- a/test/cctest/compiler/test-run-load-store.cc
+++ b/test/cctest/compiler/test-run-load-store.cc
@@ -251,6 +251,26 @@ TEST(RunLoadStoreSignExtend32) {
}
}
+TEST(RunLoadEliminationWithCompareAndTest) {
+ int8_t byte = 0x81;
+ int16_t word = 0xf00f;
+ RawMachineAssemblerTester<int32_t> m;
+ Node* load8 = m.LoadFromPointer(&byte, MachineType::Int8());
+ RawMachineLabel a, b, c, d;
+ m.Branch(m.Word32And(load8, m.Int32Constant(-0x80)), &b, &a);
+ m.Bind(&a);
+ m.Return(m.Int32Constant(0));
+ m.Bind(&b);
+ Node* load16 = m.LoadFromPointer(&word, MachineType::Int16());
+ m.Branch(m.Word32And(load16, m.Int32Constant(-0x7fff)), &d, &c);
+ m.Bind(&c);
+ m.Return(m.Int32Constant(0));
+ m.Bind(&d);
+ m.Return(m.Int32Constant(1));
+
+ CHECK_EQ(1, m.Call());
+}
+
TEST(RunLoadStoreZeroExtend32) {
uint32_t buffer[4];
RawMachineAssemblerTester<uint32_t> m;
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698