From aeb9bd3bf17dbaec6ea056d072d9dc39d8d969b5 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 23 Oct 2023 10:19:52 +0200 Subject: [PATCH] LibJS/JIT: Fix encoding of x86_64 AND 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 b67c364d27..773fe78337 100644 --- a/Userland/Libraries/LibJS/JIT/Assembler.h +++ b/Userland/Libraries/LibJS/JIT/Assembler.h @@ -295,10 +295,10 @@ struct Assembler { // and dst,src if (dst.type == Operand::Type::Reg && src.type == Operand::Type::Reg) { emit8(0x48 - | ((to_underlying(dst.reg) >= 8) ? 1 << 2 : 0) - | ((to_underlying(src.reg) >= 8) ? 1 << 0 : 0)); + | ((to_underlying(src.reg) >= 8) ? 1 << 2 : 0) + | ((to_underlying(dst.reg) >= 8) ? 1 << 0 : 0)); emit8(0x21); - emit8(0xc0 | (encode_reg(dst.reg) << 3) | encode_reg(src.reg)); + emit8(0xc0 | (encode_reg(src.reg) << 3) | encode_reg(dst.reg)); } else if (dst.type == Operand::Type::Reg && src.type == Operand::Type::Imm32) { emit8(0x48 | ((to_underlying(dst.reg) >= 8) ? 1 << 0 : 0)); emit8(0x81);