aboutsummaryrefslogtreecommitdiff
path: root/i386-asm.h
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2016-05-03 01:16:43 +0200
committerMichael Matz <matz@suse.de>2016-05-03 01:16:43 +0200
commit78ee3759b8215da7bacd8a2a9c4e7cfd0af3a0aa (patch)
treef72ffd734aba9a1a9156e8f853e7605342c97911 /i386-asm.h
parentd1515a0536d3906f96efa6ee399d6893f39532ce (diff)
downloadtinycc-78ee3759b8215da7bacd8a2a9c4e7cfd0af3a0aa.tar.gz
tinycc-78ee3759b8215da7bacd8a2a9c4e7cfd0af3a0aa.tar.bz2
x86-asm: Fix lcall/ljmp, xchg and inc/dec
Various x86 asm fixes: 64bit lcall/ljmp like 32bit a commit before, xchgw accepted wrong operands on 32 and 64bit, and 64bit used 0x40/0x48+reg for incw/decw, but those are REX prefixes, not instructions.
Diffstat (limited to 'i386-asm.h')
-rw-r--r--i386-asm.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/i386-asm.h b/i386-asm.h
index 2621db0..af21443 100644
--- a/i386-asm.h
+++ b/i386-asm.h
@@ -135,8 +135,8 @@ ALT(DEF_ASM_OP1(popw, 0x58, 0, OPC_REG | OPC_WL, OPT_REGW))
ALT(DEF_ASM_OP1(popw, 0x8f, 0, OPC_MODRM | OPC_WL, OPT_REGW | OPT_EA))
ALT(DEF_ASM_OP1(popw, 0x07, 0, OPC_WL, OPT_SEG))
-ALT(DEF_ASM_OP2(xchgw, 0x90, 0, OPC_REG | OPC_WL, OPT_REG, OPT_EAX))
-ALT(DEF_ASM_OP2(xchgw, 0x90, 0, OPC_REG | OPC_WL, OPT_EAX, OPT_REG))
+ALT(DEF_ASM_OP2(xchgw, 0x90, 0, OPC_REG | OPC_WL, OPT_REGW, OPT_EAX))
+ALT(DEF_ASM_OP2(xchgw, 0x90, 0, OPC_REG | OPC_WL, OPT_EAX, OPT_REGW))
ALT(DEF_ASM_OP2(xchgb, 0x86, 0, OPC_MODRM | OPC_BWL, OPT_REG, OPT_EA | OPT_REG))
ALT(DEF_ASM_OP2(xchgb, 0x86, 0, OPC_MODRM | OPC_BWL, OPT_EA | OPT_REG, OPT_REG))