machinst x64: fix encoding of movzx/movsx with non-ABCD input registers;
Using an input register that doesn't belong to the ABCD family (al, etc.) as the source of movsx/movzx requires a redundant REX prefix, that was not emitted.
This commit is contained in:
@@ -1401,6 +1401,11 @@ fn test_x64_emit() {
|
||||
|
||||
// ========================================================
|
||||
// MovZX_RM_R
|
||||
insns.push((
|
||||
Inst::movzx_rm_r(ExtMode::BL, RegMem::reg(rdi), w_rdi, None),
|
||||
"400FB6FF",
|
||||
"movzbl %dil, %edi",
|
||||
));
|
||||
insns.push((
|
||||
Inst::movzx_rm_r(ExtMode::BL, RegMem::reg(rax), w_rsi, None),
|
||||
"0FB6F0",
|
||||
@@ -1723,6 +1728,11 @@ fn test_x64_emit() {
|
||||
|
||||
// ========================================================
|
||||
// MovSX_RM_R
|
||||
insns.push((
|
||||
Inst::movsx_rm_r(ExtMode::BL, RegMem::reg(rdi), w_rdi, None),
|
||||
"400FBEFF",
|
||||
"movsbl %dil, %edi",
|
||||
));
|
||||
insns.push((
|
||||
Inst::movsx_rm_r(ExtMode::BL, RegMem::reg(rcx), w_rsi, None),
|
||||
"0FBEF1",
|
||||
|
||||
Reference in New Issue
Block a user