Fix srem.{i8,i16}

This commit is contained in:
bjorn3
2021-04-13 10:16:32 +02:00
parent 8387bc0d76
commit b272d4b7da
3 changed files with 59 additions and 9 deletions

View File

@@ -489,7 +489,7 @@ pub(crate) fn emit(
// x % -1 = 0; put the result into the destination, $rdx.
let done_label = sink.get_label();
let inst = Inst::imm(*size, 0, Writable::from_reg(regs::rdx()));
let inst = Inst::imm(OperandSize::Size64, 0, Writable::from_reg(regs::rdx()));
inst.emit(sink, info, state);
let inst = Inst::jmp_known(done_label);
@@ -529,11 +529,6 @@ pub(crate) fn emit(
sink.bind_label(do_op);
}
assert!(
*size != OperandSize::Size8,
"CheckedDivOrRemSeq for i8 is not yet implemented"
);
// Fill in the high parts:
if kind.is_signed() {
// sign-extend the sign-bit of rax into rdx, for signed opcodes.