Skip to content

Commit 09c5d73

Browse files
committed
[GR-30587] Force second operand of idiv to be in a register.
PullRequest: graal/13626
2 parents 4b7c019 + b7c1cc9 commit 09c5d73

File tree

1 file changed

+6
-2
lines changed
  • compiler/src/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64

1 file changed

+6
-2
lines changed

compiler/src/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MulDivOp.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import static org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64MOp.MUL;
3535
import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL;
3636
import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG;
37-
import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.STACK;
3837

3938
import org.graalvm.compiler.asm.amd64.AMD64Address;
4039
import org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64MOp;
@@ -66,7 +65,12 @@ public class AMD64MulDivOp extends AMD64LIRInstruction {
6665
@Use({REG, ILLEGAL}) protected AllocatableValue highX;
6766
@Use({REG}) protected AllocatableValue lowX;
6867

69-
@Use({REG, STACK}) protected AllocatableValue y;
68+
// Even though an idiv instruction can use a memory address for its
69+
// second operand, HotSpot on Windows does not recognize this form of
70+
// instruction when handling the special case of MININT/-1:
71+
// https://github.com/openjdk/jdk/blob/4b0e656bb6a823f50507039df7855183ab98cd83/src/hotspot/os/windows/os_windows.cpp#L2397
72+
// As such, force the operand to be in a register.
73+
@Use({REG}) protected AllocatableValue y;
7074

7175
@State protected LIRFrameState state;
7276

0 commit comments

Comments
 (0)