mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-01 13:49:05 +00:00
LibJS/JIT: Fix encoding of CMP reg,reg
This commit is contained in:
parent
ea65214c57
commit
895c613400
Notes:
sideshowbarker
2024-07-17 02:59:43 +09:00
Author: https://github.com/awesomekling
Commit: 895c613400
Pull-request: https://github.com/SerenityOS/serenity/pull/21619
Reviewed-by: https://github.com/Hendiadyoin1
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