From 895c6134004c4e94a72aa19084ba3e1197f7b042 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 23 Oct 2023 10:52:46 +0200 Subject: [PATCH] LibJS/JIT: Fix encoding of CMP reg,reg --- Userland/Libraries/LibJS/JIT/Assembler.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibJS/JIT/Assembler.h b/Userland/Libraries/LibJS/JIT/Assembler.h index 72d9bfcb4e..3a75935e22 100644 --- a/Userland/Libraries/LibJS/JIT/Assembler.h +++ b/Userland/Libraries/LibJS/JIT/Assembler.h @@ -262,10 +262,10 @@ struct Assembler { { if (lhs.type == Operand::Type::Reg && rhs.type == Operand::Type::Reg) { emit8(0x48 - | ((to_underlying(lhs.reg) >= 8) ? 1 << 2 : 0) - | ((to_underlying(rhs.reg) >= 8) ? 1 << 0 : 0)); + | ((to_underlying(rhs.reg) >= 8) ? 1 << 2 : 0) + | ((to_underlying(lhs.reg) >= 8) ? 1 << 0 : 0)); 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) { emit8(0x48 | ((to_underlying(lhs.reg) >= 8) ? 1 << 0 : 0)); emit8(0x81);