aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2016-05-14 04:33:41 +0200
committerMichael Matz <matz@suse.de>2016-05-14 04:33:41 +0200
commit4f27e217a864d8ddb74265d24a5aadea0a3ec92d (patch)
tree44f89ca1a324c0152954e335a5c4c184a2ce757d /tests
parent080ec9faddc4b7661ab05159b07655ae0224ec58 (diff)
downloadtinycc-4f27e217a864d8ddb74265d24a5aadea0a3ec92d.tar.gz
tinycc-4f27e217a864d8ddb74265d24a5aadea0a3ec92d.tar.bz2
x86-asm: Fix signed constants and opcode order
Two things: negative constants were rejected (e.g. "add $-15,%eax"). Second the insn order was such that the arithmetic IM8S forms weren't used (always the IM32 ones). Switching them prefers those but requires a fix for size calculation in case the opcodes were OPC_ARITH and OPC_WLX (whose size starts with 1, not zero).
Diffstat (limited to 'tests')
-rw-r--r--tests/asmtest.S7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/asmtest.S b/tests/asmtest.S
index e50a5d0..e8865f1 100644
--- a/tests/asmtest.S
+++ b/tests/asmtest.S
@@ -156,6 +156,8 @@ movl %ebx, %fs
addl $0x123, %eax
add $0x123, %ebx
+add $-16, %ecx
+add $-0x123, %esi
addl $0x123, 0x100
addl $0x123, 0x100(%ebx)
addl $0x123, 0x100(%ebx,%edx,2)
@@ -216,6 +218,8 @@ add (%ebx), %dl
div %bl
div %ecx, %eax
+and $15,%bx
+and $-20,%edx
shl %edx
shl $10, %edx
@@ -690,3 +694,6 @@ ft1: ft2: ft3: ft4: ft5: ft6: ft7: ft8: ft9:
.type ft8,"function"
pause
+.rept 6
+ nop
+.endr