Skip to content

Commit

Permalink
[maglev][arm] Fix shift to zero
Browse files Browse the repository at this point in the history
Arm does a shift of 32 if the immediate is equal to 0.

Fixed: chromium:1459681
Bug: v8:7700
Change-Id: I358756fd2921498f4080ffbcdcf4a44ce7a579a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4664108
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#88615}
  • Loading branch information
victorgomes authored and V8 LUCI CQ committed Jul 3, 2023
1 parent fadb405 commit 2b014d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/maglev/arm/maglev-ir-arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -482,15 +482,15 @@ DEF_BITWISE_BINOP(Int32BitwiseXor, eor)
Register out = ToRegister(result()); \
if (Int32Constant* constant = \
right_input().node()->TryCast<Int32Constant>()) { \
if (constant->value() == 0) { \
uint32_t shift = constant->value() & 31; \
if (shift == 0) { \
/* TODO(victorgomes): Arm will do a shift of 32 if right == 0. Ideally \
* we should not even emit the shift in the first place. We do a move \
* here for the moment. */ \
__ Move(out, left); \
return; \
} \
__ opcode(out, left, \
Operand(static_cast<uint32_t>(constant->value()) & 31)); \
__ opcode(out, left, Operand(shift)); \
} else { \
MaglevAssembler::ScratchRegisterScope temps(masm); \
Register scratch = temps.Acquire(); \
Expand Down

0 comments on commit 2b014d0

Please sign in to comment.