mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:07:45 +00:00
LibJIT: Emit 8-bit PUSH imm when possible
This commit is contained in:
parent
fff82c5ffe
commit
bbde64e0b6
1 changed files with 9 additions and 3 deletions
|
@ -499,9 +499,15 @@ struct Assembler {
|
|||
emit8(0x49);
|
||||
emit8(0x50 | encode_reg(op.reg));
|
||||
} else if (op.type == Operand::Type::Imm) {
|
||||
VERIFY(op.fits_in_i32());
|
||||
emit8(0x68);
|
||||
emit32(op.offset_or_immediate);
|
||||
if (op.fits_in_i8()) {
|
||||
emit8(0x6a);
|
||||
emit8(op.offset_or_immediate);
|
||||
} else if (op.fits_in_i32()) {
|
||||
emit8(0x68);
|
||||
emit32(op.offset_or_immediate);
|
||||
} else {
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
} else {
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue