cranelift: fix register for srem.i8 on x86_64 (#5540)
* Change register written to in specific srem case. Add regression test as filetest case. Fixes #5470 * Add another test case, newline * Update comment
This commit is contained in:
@@ -543,10 +543,10 @@ pub(crate) fn emit(
|
||||
|
||||
// Here, divisor == -1.
|
||||
if !kind.is_div() {
|
||||
// x % -1 = 0; put the result into the destination, $rdx.
|
||||
// x % -1 = 0; put the result into the destination, $rax.
|
||||
let done_label = sink.get_label();
|
||||
|
||||
let inst = Inst::imm(OperandSize::Size64, 0, Writable::from_reg(regs::rdx()));
|
||||
let inst = Inst::imm(OperandSize::Size64, 0, Writable::from_reg(regs::rax()));
|
||||
inst.emit(&[], sink, info, state);
|
||||
|
||||
let inst = Inst::jmp_known(done_label);
|
||||
|
||||
Reference in New Issue
Block a user