mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-24 03:25:02 +00:00
LibJIT/X86_64: Allow mul32() with immediate operand
This commit is contained in:
parent
0bbf230e4f
commit
5479bb6ac9
|
@ -557,6 +557,20 @@ struct X86_64Assembler {
|
|||
emit8(0x0f);
|
||||
emit8(0xaf);
|
||||
emit_modrm_rm(dest, src);
|
||||
} else if (dest.type == Operand::Type::Reg && src.type == Operand::Type::Imm) {
|
||||
if (src.fits_in_i8()) {
|
||||
emit_rex_for_rm(dest, dest, REX_W::No);
|
||||
emit8(0x6b);
|
||||
emit_modrm_rm(dest, dest);
|
||||
emit8(src.offset_or_immediate);
|
||||
} else if (src.fits_in_i32()) {
|
||||
emit_rex_for_rm(dest, dest, REX_W::No);
|
||||
emit8(0x69);
|
||||
emit_modrm_rm(dest, dest);
|
||||
emit32(src.offset_or_immediate);
|
||||
} else {
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
} else {
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue