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)
129 mov $0x123456789abcdef0,%rax
130 mov $0x123456789abcdef0,%rcx
131 mov $0x123456789abcdef0,%r11
180 /* NOTE: gas is bugged here, so size must be added */
185 leal 0x1000(%ebx), %ecx
186 lea 0x1000(%ebx), %ecx
217 addl $0x123, 0x100(%ebx)
218 addl $0x123, 0x100(%ebx,%edx,2)
219 addl $0x123, 0x100(%esp)
220 addl $0x123, (3*8)(%esp)
232 add %edx,(%r10d,%r11d)
234 add %esi,(%r14,%r15,4)
235 add %edi,0x1000(%rbx,%r12,8)
236 add %r11,0x1000(%ebp,%r9d,8)
286 imul $0x1100000, %eax
326 lcall $0x100, $0x1000
553 cmpxchgl %eax, 0x1000
558 cmpxchg16b (%r10,%r11)
596 clc # another comment
597 cld # a comment with embedded ' tick
640 /* XXX: handle prefixes */
661 /* handle one-line prefix + ops */
685 prefetchnta 0x18(%rdx)
690 clflush 0x1000(%rax,%rcx)
805 #ifdef __ASSEMBLER__ // should be defined, for S files
810 ft1: ft2: ft3: ft4: ft5: ft6: ft7: ft8: ft9:
830 .section .text.one,"ax"
833 .pushsection .text.one,"ax"
835 .pushsection .text.two,"ax"
841 .pushsection __bug_table,"a"
859 .pushsection .text.three, "ax"
861 .skip (-((4b-3b) > 0) * 2) , 0x90
867 .globl notimplemented
870 .set overrideme, notimplemented
871 overrideme = notimplemented
902 /* movq mem64->xmm is encoded as f30f7e by GAS, but as
903 660f6e by tcc (which really is a movd and would need
904 a REX.W prefix to be movq). */
911 #define TEST_MMX_SSE(insn) \
915 #define TEST_MMX_SSE_I8(insn) \
920 TEST_MMX_SSE(packssdw)
921 TEST_MMX_SSE(packsswb)
922 TEST_MMX_SSE(packuswb)
928 TEST_MMX_SSE(paddusb)
929 TEST_MMX_SSE(paddusw)
932 TEST_MMX_SSE(pcmpeqb)
933 TEST_MMX_SSE(pcmpeqw)
934 TEST_MMX_SSE(pcmpeqd)
935 TEST_MMX_SSE(pcmpgtb)
936 TEST_MMX_SSE(pcmpgtw)
937 TEST_MMX_SSE(pcmpgtd)
938 TEST_MMX_SSE(pmaddwd)
943 TEST_MMX_SSE_I8(psllw)
945 TEST_MMX_SSE_I8(pslld)
947 TEST_MMX_SSE_I8(psllq)
949 TEST_MMX_SSE_I8(psraw)
951 TEST_MMX_SSE_I8(psrad)
953 TEST_MMX_SSE_I8(psrlw)
955 TEST_MMX_SSE_I8(psrld)
957 TEST_MMX_SSE_I8(psrlq)
963 TEST_MMX_SSE(psubusb)
964 TEST_MMX_SSE(psubusw)
965 TEST_MMX_SSE(punpckhbw)
966 TEST_MMX_SSE(punpckhwd)
967 TEST_MMX_SSE(punpckhdq)
968 TEST_MMX_SSE(punpcklbw)
969 TEST_MMX_SSE(punpcklwd)
970 TEST_MMX_SSE(punpckldq)
974 cvtpi2ps (%ebx), %xmm2