mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14: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,12 +499,18 @@ struct Assembler {
|
||||||
emit8(0x49);
|
emit8(0x49);
|
||||||
emit8(0x50 | encode_reg(op.reg));
|
emit8(0x50 | encode_reg(op.reg));
|
||||||
} else if (op.type == Operand::Type::Imm) {
|
} else if (op.type == Operand::Type::Imm) {
|
||||||
VERIFY(op.fits_in_i32());
|
if (op.fits_in_i8()) {
|
||||||
|
emit8(0x6a);
|
||||||
|
emit8(op.offset_or_immediate);
|
||||||
|
} else if (op.fits_in_i32()) {
|
||||||
emit8(0x68);
|
emit8(0x68);
|
||||||
emit32(op.offset_or_immediate);
|
emit32(op.offset_or_immediate);
|
||||||
} else {
|
} else {
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
VERIFY_NOT_REACHED();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void pop(Operand op)
|
void pop(Operand op)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue