Skip to contentSkip to conversation

target/i386: fix x86_64 pushw op

PATCH Applied Thomas Ogrisegg 2 participants 2 messages Jul 15, 2025 – Oct 11, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/i386: fix x86_64 pushw op

For x86_64 a 16 bit push op (pushw) of a memory address would generate a 64 bit store on the stack instead of a 16 bit store.

For example:
pushw (%rax)

behaves like
pushq (%rax)

which is incorrect.

This patch fixes that.

---
 target/i386/tcg/decode-new.c.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/i386/tcg/decode-new.c.inc +1 -1
index cda32ee67..3892ec374 100644
@@ -1541,7 +1541,7 @@ static void decode_group4_5(DisasContext *s, CPUX86State *env, X86OpEntry *entry
         [0x0b] = X86_OP_ENTRYr(CALLF_m, M,p),
         [0x0c] = X86_OP_ENTRYr(JMP_m,   E,f64,                         zextT0),
         [0x0d] = X86_OP_ENTRYr(JMPF_m,  M,p),
-        [0x0e] = X86_OP_ENTRYr(PUSH,    E,f64),
+        [0x0e] = X86_OP_ENTRYr(PUSH,    E,d64),
     };
 
     int w = (*b & 1);
Signature · 1 line
2.39.5