diff --git a/src/arm/assembler-arm.cc b/src/arm/assembler-arm.cc index 7a091d0deb..2bf48e58dc 100644 --- a/src/arm/assembler-arm.cc +++ b/src/arm/assembler-arm.cc @@ -1011,7 +1011,8 @@ static bool fits_shifter(uint32_t imm32, Instr* instr) { // imm32 must be unsigned. for (int rot = 0; rot < 16; rot++) { - uint32_t imm8 = (imm32 << 2*rot) | (imm32 >> (32 - 2*rot)); + uint32_t imm8 = + rot == 0 ? imm32 : (imm32 << 2 * rot) | (imm32 >> (32 - 2 * rot)); if ((imm8 <= 0xff)) { *rotate_imm = rot; *immed_8 = imm8;