[turboshaft] fix signed div with power of 2

Bug: chromium:1392953
Change-Id: I392d5e0b12d840e08cd4f97b092a74208b30ac9b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4055862
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84467}
This commit is contained in:
Tobias Tebbi 2022-11-24 16:39:02 +01:00 committed by V8 LUCI CQ
parent 9acc6f96d8
commit 0d04ebd575

View File

@ -1865,7 +1865,7 @@ class MachineOptimizationReducer : public Next {
Asm().ShiftRightArithmetic(quotient, rep.bit_width() - 1, rep);
}
quotient =
Asm().ShiftRightArithmetic(quotient, rep.bit_width() - shift, rep);
Asm().ShiftRightLogical(quotient, rep.bit_width() - shift, rep);
quotient = Asm().WordAdd(quotient, left, rep);
quotient = Asm().ShiftRightArithmetic(quotient, shift, rep);
return quotient;