Bug 1337059: Don't left-shift for null constant amounts on ARM; r=lth

MozReview-Commit-ID: 1NqJuSANKsr

--HG--
extra : rebase_source : 22377a0f02ef4cbcab8b86bd1305387ed7db24c8
This commit is contained in:
Benjamin Bouvier 2017-02-07 11:05:25 +01:00
parent e8c3962c5e
commit aa6e2f446c
2 changed files with 3 additions and 1 deletions

View File

@ -127,6 +127,7 @@ testBinary32('xor', 42, 2, 40);
testBinary32('shl', 40, 2, 160);
testBinary32('shr_s', -40, 2, -10);
testBinary32('shr_u', -40, 2, 1073741814);
testBinary32('shr_u', -40, 0, -40);
testTrap32('div_s', 42, 0, /integer divide by zero/);
testTrap32('div_s', 0x80000000 | 0, -1, /integer overflow/);

View File

@ -716,7 +716,8 @@ void
MacroAssembler::rshiftPtr(Imm32 imm, Register dest)
{
MOZ_ASSERT(0 <= imm.value && imm.value < 32);
ma_lsr(imm, dest, dest);
if (imm.value)
ma_lsr(imm, dest, dest);
}
void