aboutsummaryrefslogtreecommitdiff
path: root/i386-asm.c
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2016-05-11 18:54:24 +0200
committerMichael Matz <matz@suse.de>2016-05-11 18:54:24 +0200
commitbd93dc6923a9fe202401666a1f2749fbdced9971 (patch)
tree0dbfb39ff75b6082d4e8bfa287b72ff1e170c678 /i386-asm.c
parent9645b62a65986738e6b70d748890d73daf40508b (diff)
downloadtinycc-bd93dc6923a9fe202401666a1f2749fbdced9971.tar.gz
tinycc-bd93dc6923a9fe202401666a1f2749fbdced9971.tar.bz2
x86: Improve cmov handling
cmov can accept multi sizes, but is also a OPC_TEST opcode, deal with this.
Diffstat (limited to 'i386-asm.c')
-rw-r--r--i386-asm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/i386-asm.c b/i386-asm.c
index 435dd15..69514c0 100644
--- a/i386-asm.c
+++ b/i386-asm.c
@@ -659,6 +659,11 @@ ST_FUNC void asm_opcode(TCCState *s1, int opcode)
} else if (pa->instr_type & OPC_TEST) {
if (!(opcode >= pa->sym && opcode < pa->sym + NB_TEST_OPCODES))
continue;
+ /* cmovxx is a test opcode but accepts multiple sizes.
+ TCC doesn't accept the suffixed mnemonic, instead we
+ simply force size autodetection always. */
+ if (pa->instr_type & OPC_WLX)
+ s = NBWLX - 1;
} else if (pa->instr_type & OPC_B) {
#ifdef TCC_TARGET_X86_64
/* Some instructions don't have the full size but only