Commit 57040734 authored by georgia.kouveli's avatar georgia.kouveli Committed by Commit bot

[arm64] Fix another ubfx corner case.

This issue was fixed in VisitWord64And in 2f8ad11f. Port the fix to
VisitWord32And.

BUG=

Review-Url: https://codereview.chromium.org/2815853002
Cr-Commit-Position: refs/heads/master@{#44636}
parent 7d08b5e4
......@@ -919,7 +919,8 @@ void InstructionSelector::VisitWord32And(Node* node) {
uint32_t mask = m.right().Value();
uint32_t mask_width = base::bits::CountPopulation32(mask);
uint32_t mask_msb = base::bits::CountLeadingZeros32(mask);
if ((mask_width != 0) && (mask_msb + mask_width == 32)) {
if ((mask_width != 0) && (mask_width != 32) &&
(mask_msb + mask_width == 32)) {
// The mask must be contiguous, and occupy the least-significant bits.
DCHECK_EQ(0u, base::bits::CountTrailingZeros32(mask));
......
......@@ -6778,6 +6778,14 @@ TEST(Regression6028) {
CHECK_EQ(1, m.Call());
}
TEST(Regression5951_32bit) {
BufferedRawMachineAssemblerTester<int32_t> m(MachineType::Int32());
m.Return(m.Word32And(m.Word32Shr(m.Parameter(0), m.Int32Constant(0)),
m.Int32Constant(0xffffffff)));
int32_t input = 1234;
CHECK_EQ(input, m.Call(input));
}
} // namespace compiler
} // namespace internal
} // namespace v8
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment