1 # gas comment with ``gnu'' style quotes
3 /* some directive tests */
13 /* .align 16, 0x90 gas is too clever for us with 0x90 fill */
15 .align 16, 0x91 /* 0x91 tests the non-clever behaviour */
18 .string "hello\0world"
19 /* Macro expansion should work like with C, the #n shouldn't be parsed
20 as asm line comment */
21 #define __stringify(n) #n
22 #define stringify(n) __stringify(n)
27 # 28 "asmtest.S" # a line directive (and a line comment)
28 movl %eax, %ebx # some more asm comment
29 /* some label tests */
40 /* instruction tests */
50 movb $2, 0x100(%ebx,%edx,2)
51 movw $2, 0x100(%ebx,%edx,2)
52 movl $2, 0x100(%ebx,%edx,2)
53 movl %eax, 0x100(%ebx,%edx,2)
54 movl 0x100(%ebx,%edx,2), %edx
55 movw %ax, 0x100(%ebx,%edx,2)
59 movl $0x80000000, %esi
60 movl $-0x7fffffff, %edi
64 mov $0x1122334455,%rbx
65 movq $0x1122334455,%rbx
66 movl $0x11334455,(%rbx)
69 mov %eax, 0x12(,%edx,2)
171 /* NOTE: gas is bugged here, so size must be added */
176 leal 0x1000(%ebx), %ecx
177 lea 0x1000(%ebx), %ecx
208 addl $0x123, 0x100(%ebx)
209 addl $0x123, 0x100(%ebx,%edx,2)
210 addl $0x123, 0x100(%esp)
211 addl $0x123, (3*8)(%esp)
223 add %edx,(%r10d,%r11d)
225 add %esi,(%r14,%r15,4)
226 add %edi,0x1000(%rbx,%r12,8)
227 add %r11,0x1000(%ebp,%r9d,8)
277 imul $0x1100000, %eax
317 lcall $0x100, $0x1000
544 cmpxchgl %eax, 0x1000
582 clc # another comment
583 cld # a comment with embedded ' tick
626 /* XXX: handle prefixes */
647 /* handle one-line prefix + ops */
671 prefetchnta 0x18(%rdx)
676 clflush 0x1000(%rax,%rcx)
786 #ifdef __ASSEMBLER__ // should be defined, for S files
791 ft1: ft2: ft3: ft4: ft5: ft6: ft7: ft8: ft9:
811 .section .text.one,"ax"
814 .pushsection .text.one,"ax"
816 .pushsection .text.two,"ax"
822 .pushsection __bug_table,"a"
840 .pushsection .text.three, "ax"
842 .skip (-((4b-3b) > 0) * 2) , 0x90
848 .globl notimplemented
851 .set overrideme, notimplemented
852 overrideme = notimplemented
882 /* movq mem64->xmm is encoded as f30f7e by GAS, but as
883 660f6e by tcc (which really is a movd and would need
884 a REX.W prefix to be movq). */
891 #define TEST_MMX_SSE(insn) \
895 #define TEST_MMX_SSE_I8(insn) \
900 TEST_MMX_SSE(packssdw)
901 TEST_MMX_SSE(packsswb)
902 TEST_MMX_SSE(packuswb)
908 TEST_MMX_SSE(paddusb)
909 TEST_MMX_SSE(paddusw)
912 TEST_MMX_SSE(pcmpeqb)
913 TEST_MMX_SSE(pcmpeqw)
914 TEST_MMX_SSE(pcmpeqd)
915 TEST_MMX_SSE(pcmpgtb)
916 TEST_MMX_SSE(pcmpgtw)
917 TEST_MMX_SSE(pcmpgtd)
918 TEST_MMX_SSE(pmaddwd)
923 TEST_MMX_SSE_I8(psllw)
925 TEST_MMX_SSE_I8(pslld)
927 TEST_MMX_SSE_I8(psllq)
929 TEST_MMX_SSE_I8(psraw)
931 TEST_MMX_SSE_I8(psrad)
933 TEST_MMX_SSE_I8(psrlw)
935 TEST_MMX_SSE_I8(psrld)
937 TEST_MMX_SSE_I8(psrlq)
943 TEST_MMX_SSE(psubusb)
944 TEST_MMX_SSE(psubusw)
945 TEST_MMX_SSE(punpckhbw)
946 TEST_MMX_SSE(punpckhwd)
947 TEST_MMX_SSE(punpckhdq)
948 TEST_MMX_SSE(punpcklbw)
949 TEST_MMX_SSE(punpcklwd)
950 TEST_MMX_SSE(punpckldq)
954 cvtpi2ps (%ebx), %xmm2