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

Unified Diff: test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc

Issue 2318043002: [arm64] Use CMN for cmp(a,sub(0,b)) only when checking equality/inequality. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « test/mjsunit/compiler/regress-compare-negate.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc
diff --git a/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc b/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc
index 6ca5e5e6840d11116e8b5a16243cfb73e5a1b036..457e157d05af4e18ebe7c1ac72f198a25074528a 100644
--- a/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc
+++ b/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc
@@ -3142,11 +3142,20 @@ const IntegerCmp kIntegerCmpInstructions[] = {
kUnsignedLessThanOrEqual,
kUnsignedGreaterThanOrEqual}};
+const IntegerCmp kIntegerCmpEqualityInstructions[] = {
+ {{&RawMachineAssembler::Word32Equal, "Word32Equal", kArm64Cmp32,
+ MachineType::Int32()},
+ kEqual,
+ kEqual},
+ {{&RawMachineAssembler::Word32NotEqual, "Word32NotEqual", kArm64Cmp32,
+ MachineType::Int32()},
+ kNotEqual,
+ kNotEqual}};
} // namespace
TEST_F(InstructionSelectorTest, Word32CompareNegateWithWord32Shift) {
- TRACED_FOREACH(IntegerCmp, cmp, kIntegerCmpInstructions) {
+ TRACED_FOREACH(IntegerCmp, cmp, kIntegerCmpEqualityInstructions) {
TRACED_FOREACH(Shift, shift, kShiftInstructions) {
// Test 32-bit operations. Ignore ROR shifts, as compare-negate does not
// support them.
@@ -3203,7 +3212,7 @@ TEST_F(InstructionSelectorTest, CmpWithImmediateOnLeft) {
}
TEST_F(InstructionSelectorTest, CmnWithImmediateOnLeft) {
- TRACED_FOREACH(IntegerCmp, cmp, kIntegerCmpInstructions) {
+ TRACED_FOREACH(IntegerCmp, cmp, kIntegerCmpEqualityInstructions) {
TRACED_FOREACH(int32_t, imm, kAddSubImmediates) {
// kEqual and kNotEqual trigger the cbz/cbnz optimization, which
// is tested elsewhere.
@@ -3244,7 +3253,7 @@ TEST_F(InstructionSelectorTest, CmpSignedExtendByteOnLeft) {
}
TEST_F(InstructionSelectorTest, CmnSignedExtendByteOnLeft) {
- TRACED_FOREACH(IntegerCmp, cmp, kIntegerCmpInstructions) {
+ TRACED_FOREACH(IntegerCmp, cmp, kIntegerCmpEqualityInstructions) {
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
MachineType::Int32());
Node* sub = m.Int32Sub(m.Int32Constant(0), m.Parameter(0));
@@ -3294,7 +3303,7 @@ TEST_F(InstructionSelectorTest, CmpShiftByImmediateOnLeft) {
}
TEST_F(InstructionSelectorTest, CmnShiftByImmediateOnLeft) {
- TRACED_FOREACH(IntegerCmp, cmp, kIntegerCmpInstructions) {
+ TRACED_FOREACH(IntegerCmp, cmp, kIntegerCmpEqualityInstructions) {
TRACED_FOREACH(Shift, shift, kShiftInstructions) {
// Only test relevant shifted operands.
if (shift.mi.machine_type != MachineType::Int32()) continue;
« no previous file with comments | « test/mjsunit/compiler/regress-compare-negate.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698