mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 10:19:20 +00:00
LibJIT/X86_64: Allow mul32() with immediate operand
This commit is contained in:
parent
0bbf230e4f
commit
5479bb6ac9
Notes:
sideshowbarker
2024-07-16 21:34:08 +09:00
Author: https://github.com/awesomekling
Commit: 5479bb6ac9
Pull-request: https://github.com/SerenityOS/serenity/pull/21822
Reviewed-by: https://github.com/DanShaders
Reviewed-by: https://github.com/Hendiadyoin1
1 changed files with 14 additions and 0 deletions
|
@ -557,6 +557,20 @@ struct X86_64Assembler {
|
||||||
emit8(0x0f);
|
emit8(0x0f);
|
||||||
emit8(0xaf);
|
emit8(0xaf);
|
||||||
emit_modrm_rm(dest, src);
|
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 {
|
} else {
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue