mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:07:34 +00:00
LibJS/JIT: Fix encoding of CMP reg,reg
This commit is contained in:
parent
ea65214c57
commit
895c613400
1 changed files with 3 additions and 3 deletions
|
@ -262,10 +262,10 @@ struct Assembler {
|
||||||
{
|
{
|
||||||
if (lhs.type == Operand::Type::Reg && rhs.type == Operand::Type::Reg) {
|
if (lhs.type == Operand::Type::Reg && rhs.type == Operand::Type::Reg) {
|
||||||
emit8(0x48
|
emit8(0x48
|
||||||
| ((to_underlying(lhs.reg) >= 8) ? 1 << 2 : 0)
|
| ((to_underlying(rhs.reg) >= 8) ? 1 << 2 : 0)
|
||||||
| ((to_underlying(rhs.reg) >= 8) ? 1 << 0 : 0));
|
| ((to_underlying(lhs.reg) >= 8) ? 1 << 0 : 0));
|
||||||
emit8(0x39);
|
emit8(0x39);
|
||||||
emit8(0xc0 | (encode_reg(lhs.reg) << 3) | encode_reg(rhs.reg));
|
emit8(0xc0 | (encode_reg(rhs.reg) << 3) | encode_reg(lhs.reg));
|
||||||
} else if (lhs.type == Operand::Type::Reg && rhs.type == Operand::Type::Imm32) {
|
} else if (lhs.type == Operand::Type::Reg && rhs.type == Operand::Type::Imm32) {
|
||||||
emit8(0x48 | ((to_underlying(lhs.reg) >= 8) ? 1 << 0 : 0));
|
emit8(0x48 | ((to_underlying(lhs.reg) >= 8) ? 1 << 0 : 0));
|
||||||
emit8(0x81);
|
emit8(0x81);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue