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)
593 clc # another comment
594 cld # a comment with embedded ' tick
637 /* XXX: handle prefixes */
658 /* handle one-line prefix + ops */
682 prefetchnta 0x18(%rdx)
687 clflush 0x1000(%rax,%rcx)
802 #ifdef __ASSEMBLER__ // should be defined, for S files
807 ft1: ft2: ft3: ft4: ft5: ft6: ft7: ft8: ft9:
827 .section .text.one,"ax"
830 .pushsection .text.one,"ax"
832 .pushsection .text.two,"ax"
838 .pushsection __bug_table,"a"
856 .pushsection .text.three, "ax"
858 .skip (-((4b-3b) > 0) * 2) , 0x90
864 .globl notimplemented
867 .set overrideme, notimplemented
868 overrideme = notimplemented
899 /* movq mem64->xmm is encoded as f30f7e by GAS, but as
900 660f6e by tcc (which really is a movd and would need
901 a REX.W prefix to be movq). */
908 #define TEST_MMX_SSE(insn) \
912 #define TEST_MMX_SSE_I8(insn) \
917 TEST_MMX_SSE(packssdw)
918 TEST_MMX_SSE(packsswb)
919 TEST_MMX_SSE(packuswb)
925 TEST_MMX_SSE(paddusb)
926 TEST_MMX_SSE(paddusw)
929 TEST_MMX_SSE(pcmpeqb)
930 TEST_MMX_SSE(pcmpeqw)
931 TEST_MMX_SSE(pcmpeqd)
932 TEST_MMX_SSE(pcmpgtb)
933 TEST_MMX_SSE(pcmpgtw)
934 TEST_MMX_SSE(pcmpgtd)
935 TEST_MMX_SSE(pmaddwd)
940 TEST_MMX_SSE_I8(psllw)
942 TEST_MMX_SSE_I8(pslld)
944 TEST_MMX_SSE_I8(psllq)
946 TEST_MMX_SSE_I8(psraw)
948 TEST_MMX_SSE_I8(psrad)
950 TEST_MMX_SSE_I8(psrlw)
952 TEST_MMX_SSE_I8(psrld)
954 TEST_MMX_SSE_I8(psrlq)
960 TEST_MMX_SSE(psubusb)
961 TEST_MMX_SSE(psubusw)
962 TEST_MMX_SSE(punpckhbw)
963 TEST_MMX_SSE(punpckhwd)
964 TEST_MMX_SSE(punpckhdq)
965 TEST_MMX_SSE(punpcklbw)
966 TEST_MMX_SSE(punpcklwd)
967 TEST_MMX_SSE(punpckldq)
971 cvtpi2ps (%ebx), %xmm2