mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +00:00
LibJS/JIT: Fix encoding of x86_64 AND reg, reg
This commit is contained in:
parent
e4c4fb09f9
commit
aeb9bd3bf1
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue