diff options
| author | Michael Matz <matz@suse.de> | 2016-08-04 04:47:03 +0200 |
|---|---|---|
| committer | Michael Matz <matz@suse.de> | 2016-12-15 17:47:09 +0100 |
| commit | 4cb7047f0fa000c83ca5592d9a64a2cbc96d8fdc (patch) | |
| tree | fedcfc9ddf7dc61c2405a2ef7acb3bcc7c19937d /tests/asmtest.S | |
| parent | 8765826465e6103d419808f78e8fc3f97218e9a6 (diff) | |
| download | tinycc-4cb7047f0fa000c83ca5592d9a64a2cbc96d8fdc.tar.gz tinycc-4cb7047f0fa000c83ca5592d9a64a2cbc96d8fdc.tar.bz2 | |
x86-64-asm: Support high registers %r8 - %r15
This requires correctly handling the REX prefix.
As bonus we now also support the four 8bit registers
spl,bpl,sil,dil, which are decoded as ah,ch,dh,bh in non-long-mode
(and require a REX prefix as well).
Diffstat (limited to 'tests/asmtest.S')
| -rw-r--r-- | tests/asmtest.S | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/tests/asmtest.S b/tests/asmtest.S index ef5f83e..80fb362 100644 --- a/tests/asmtest.S +++ b/tests/asmtest.S @@ -76,6 +76,22 @@ movq %dr6, %rax movl %fs, %ecx movl %ebx, %fs +#ifdef __x86_64__ +movq %r8, %r9 +movq %r10, %r11 +movq %r12, %r13 +movq %r14, %r15 +movq %rax, %r9 +movq %r15, %rsi +inc %r9b +dec %r10w +not %r11d +negq %r12 +decb %r13b +incw %r14w +notl %r15d +#endif + movsbl 0x1000, %eax movsbw 0x1000, %ax movswl 0x1000, %eax @@ -184,6 +200,24 @@ addl $0x123, (%ebp) addl $0x123, (%esp) cmpl $0x123, (%esp) +#ifdef __x86_64__ +xor %bl,%ah +xor %bl,%r8b +xor %r9b,%bl +xor %sil,%cl +add %eax,(%r8d) +add %ebx,(%r9) +add %edx,(%r10d,%r11d) +add %ecx,(%r12,%r13) +add %esi,(%r14,%r15,4) +add %edi,0x1000(%rbx,%r12,8) +add %r11,0x1000(%ebp,%r9d,8) +movb $12, %ah +movb $13, %bpl +movb $14, %dil +movb $15, %r12b +#endif + add %eax, (%ebx) add (%ebx), %eax @@ -796,10 +830,10 @@ nop movd %rdi, %xmm2 movd (%rbx), %mm3 movd (%rbx), %xmm3 - movd %mm1, %rsi + movd %mm1, %r12 movd %xmm2, %rdi - movd %mm3, (%rdx) - movd %xmm3, (%rdx) + movd %mm3, (%r8) + movd %xmm3, (%r13) #endif movq (%ebp), %mm1 |
