Don't reuse registers in the x64 div lowering (#5356)
Introduce a temporary for an intermediate value in the lowering of div in the x64 backend. Additionally, add a src argument to the shift_r smart constructor, which is why the diff got larger than just the div lowering.
This commit is contained in:
@@ -431,6 +431,7 @@ impl Inst {
|
||||
size: OperandSize,
|
||||
kind: ShiftKind,
|
||||
num_bits: Imm8Gpr,
|
||||
src: Reg,
|
||||
dst: Writable<Reg>,
|
||||
) -> Inst {
|
||||
if let Imm8Reg::Imm8 { imm: num_bits } = num_bits.clone().to_imm8_reg() {
|
||||
@@ -440,7 +441,7 @@ impl Inst {
|
||||
Inst::ShiftR {
|
||||
size,
|
||||
kind,
|
||||
src: Gpr::new(dst.to_reg()).unwrap(),
|
||||
src: Gpr::new(src).unwrap(),
|
||||
num_bits,
|
||||
dst: WritableGpr::from_writable_reg(dst).unwrap(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user