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 8a6384dba4119d9727af674ab69326f8d032030e..0b388a585eefa320b58bcbee9262298735bc3ac7 100644 |
--- a/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc |
+++ b/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc |
@@ -1707,7 +1707,8 @@ TEST_F(InstructionSelectorTest, Word32ShrWithWord32AndWithImmediate) { |
EXPECT_EQ(kArm64Ubfx32, s[0]->arch_opcode()); |
ASSERT_EQ(3U, s[0]->InputCount()); |
EXPECT_EQ(lsb, s.ToInt32(s[0]->InputAt(1))); |
- EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2))); |
+ int32_t actual_width = (lsb + width > 32) ? (32 - lsb) : width; |
+ EXPECT_EQ(actual_width, s.ToInt32(s[0]->InputAt(2))); |
} |
} |
TRACED_FORRANGE(int32_t, lsb, 1, 31) { |
@@ -1761,7 +1762,8 @@ TEST_F(InstructionSelectorTest, Word64ShrWithWord64AndWithImmediate) { |
EXPECT_EQ(kArm64Ubfx, s[0]->arch_opcode()); |
ASSERT_EQ(3U, s[0]->InputCount()); |
EXPECT_EQ(lsb, s.ToInt64(s[0]->InputAt(1))); |
- EXPECT_EQ(width, s.ToInt64(s[0]->InputAt(2))); |
+ int64_t actual_width = (lsb + width > 64) ? (64 - lsb) : width; |
+ EXPECT_EQ(actual_width, s.ToInt64(s[0]->InputAt(2))); |
} |
} |
} |
@@ -1793,15 +1795,16 @@ TEST_F(InstructionSelectorTest, Word32AndWithImmediateWithWord32Shr) { |
EXPECT_EQ(kArm64Ubfx32, s[0]->arch_opcode()); |
ASSERT_EQ(3U, s[0]->InputCount()); |
EXPECT_EQ(lsb, s.ToInt32(s[0]->InputAt(1))); |
- EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2))); |
+ int32_t actual_width = (lsb + width > 32) ? (32 - lsb) : width; |
+ EXPECT_EQ(actual_width, s.ToInt32(s[0]->InputAt(2))); |
} |
} |
} |
TEST_F(InstructionSelectorTest, Word64AndWithImmediateWithWord64Shr) { |
- TRACED_FORRANGE(int32_t, lsb, 1, 31) { |
- TRACED_FORRANGE(int32_t, width, 1, 31) { |
+ TRACED_FORRANGE(int64_t, lsb, 1, 63) { |
+ TRACED_FORRANGE(int64_t, width, 1, 63) { |
uint64_t msk = (V8_UINT64_C(1) << width) - 1; |
StreamBuilder m(this, kMachInt64, kMachInt64); |
m.Return(m.Word64And(m.Word64Shr(m.Parameter(0), m.Int64Constant(lsb)), |
@@ -1811,11 +1814,12 @@ TEST_F(InstructionSelectorTest, Word64AndWithImmediateWithWord64Shr) { |
EXPECT_EQ(kArm64Ubfx, s[0]->arch_opcode()); |
ASSERT_EQ(3U, s[0]->InputCount()); |
EXPECT_EQ(lsb, s.ToInt64(s[0]->InputAt(1))); |
- EXPECT_EQ(width, s.ToInt64(s[0]->InputAt(2))); |
+ int64_t actual_width = (lsb + width > 64) ? (64 - lsb) : width; |
+ EXPECT_EQ(actual_width, s.ToInt64(s[0]->InputAt(2))); |
} |
} |
- TRACED_FORRANGE(int32_t, lsb, 1, 31) { |
- TRACED_FORRANGE(int32_t, width, 1, 31) { |
+ TRACED_FORRANGE(int64_t, lsb, 1, 63) { |
+ TRACED_FORRANGE(int64_t, width, 1, 63) { |
uint64_t msk = (V8_UINT64_C(1) << width) - 1; |
StreamBuilder m(this, kMachInt64, kMachInt64); |
m.Return(m.Word64And(m.Int64Constant(msk), |