[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}
This commit is contained in:
parent
7d08b5e4d2
commit
57040734d8
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user