• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -triple x86_64-unknown-unknown -x86-asm-syntax=intel %s > %t 2> %t.err
2// RUN: FileCheck < %t %s
3// RUN: FileCheck --check-prefix=CHECK-STDERR < %t.err %s
4
5_test:
6	xor	EAX, EAX
7	ret
8
9_main:
10// CHECK:	movl	$257, -4(%rsp)
11	mov	DWORD PTR [RSP - 4], 257
12// CHECK:	movl	$258, 4(%rsp)
13	mov	DWORD PTR [RSP + 4], 258
14// CHECK:	movq	$123, -16(%rsp)
15	mov	QWORD PTR [RSP - 16], 123
16// CHECK:	movb	$97, -17(%rsp)
17	mov	BYTE PTR [RSP - 17], 97
18// CHECK:	movl	-4(%rsp), %eax
19	mov	EAX, DWORD PTR [RSP - 4]
20// CHECK:	movq    (%rsp), %rax
21	mov     RAX, QWORD PTR [RSP]
22// CHECK:	movl	$-4, -4(%rsp)
23	mov	DWORD PTR [RSP - 4], -4
24// CHECK:	movq	0, %rcx
25	mov	RCX, QWORD PTR [0]
26// CHECK:	movl	-24(%rsp,%rax,4), %eax
27	mov	EAX, DWORD PTR [RSP + 4*RAX - 24]
28// CHECK:	movb	%dil, (%rdx,%rcx)
29	mov	BYTE PTR [RDX + RCX], DIL
30// CHECK:	movzwl	2(%rcx), %edi
31	movzx	EDI, WORD PTR [RCX + 2]
32// CHECK:	callq	_test
33	call	_test
34// CHECK:	andw	$12,	%ax
35	and	ax, 12
36// CHECK:	andw	$-12,	%ax
37	and	ax, -12
38// CHECK:	andw	$257,	%ax
39	and	ax, 257
40// CHECK:	andw	$-257,	%ax
41	and	ax, -257
42// CHECK:	andl	$12,	%eax
43	and	eax, 12
44// CHECK:	andl	$-12,	%eax
45	and	eax, -12
46// CHECK:	andl	$257,	%eax
47	and	eax, 257
48// CHECK:	andl	$-257,	%eax
49	and	eax, -257
50// CHECK:	andq	$12,	%rax
51	and	rax, 12
52// CHECK:	andq	$-12,	%rax
53	and	rax, -12
54// CHECK:	andq	$257,	%rax
55	and	rax, 257
56// CHECK:	andq	$-257,	%rax
57	and	rax, -257
58// CHECK:	fld	%st(0)
59	fld	ST(0)
60// CHECK:	movl	%fs:(%rdi), %eax
61    mov EAX, DWORD PTR FS:[RDI]
62// CHECK: leal (,%rdi,4), %r8d
63    lea R8D, DWORD PTR [4*RDI]
64// CHECK: movl _fnan(,%ecx,4), %ecx
65    mov ECX, DWORD PTR [4*ECX + _fnan]
66// CHECK: movq %fs:320, %rax
67    mov RAX, QWORD PTR FS:[320]
68// CHECK: movq %fs:320, %rax
69    mov RAX, QWORD PTR FS:320
70// CHECK: movq %rax, %fs:320
71    mov QWORD PTR FS:320, RAX
72// CHECK: movq %rax, %fs:20(%rbx)
73    mov QWORD PTR FS:20[rbx], RAX
74// CHECK: vshufpd $1, %xmm2, %xmm1, %xmm0
75    vshufpd XMM0, XMM1, XMM2, 1
76// CHECK: vpgatherdd %xmm8, (%r15,%xmm9,2), %xmm1
77    vpgatherdd XMM10, XMMWORD PTR [R15 + 2*XMM9], XMM8
78// CHECK: movsd -8, %xmm5
79    movsd   XMM5, QWORD PTR [-8]
80// CHECK: movl %ecx, (%eax)
81    mov [eax], ecx
82// CHECK: movl %ecx, (,%ebx,4)
83    mov [4*ebx], ecx
84 // CHECK:   movl %ecx, (,%ebx,4)
85    mov [ebx*4], ecx
86// CHECK: movl %ecx, 1024
87    mov [1024], ecx
88// CHECK: movl %ecx, 4132
89    mov [0x1024], ecx
90// CHECK: movl %ecx, 32
91    mov [16 + 16], ecx
92// CHECK: movl %ecx, 0
93    mov [16 - 16], ecx
94// CHECK: movl %ecx, 32
95    mov [16][16], ecx
96// CHECK: movl %ecx, (%eax,%ebx,4)
97    mov [eax + 4*ebx], ecx
98// CHECK: movl %ecx, (%eax,%ebx,4)
99    mov [eax + ebx*4], ecx
100// CHECK: movl %ecx, (%eax,%ebx,4)
101    mov [4*ebx + eax], ecx
102// CHECK: movl %ecx, (%eax,%ebx,4)
103    mov [ebx*4 + eax], ecx
104// CHECK: movl %ecx, (%eax,%ebx,4)
105    mov [eax][4*ebx], ecx
106// CHECK: movl %ecx, (%eax,%ebx,4)
107    mov [eax][ebx*4], ecx
108// CHECK: movl %ecx, (%eax,%ebx,4)
109    mov [4*ebx][eax], ecx
110// CHECK: movl %ecx, (%eax,%ebx,4)
111    mov [ebx*4][eax], ecx
112// CHECK: movl %ecx, 12(%eax)
113    mov [eax + 12], ecx
114// CHECK: movl %ecx, 12(%eax)
115    mov [12 + eax], ecx
116// CHECK: movl %ecx, 32(%eax)
117    mov [eax + 16 + 16], ecx
118// CHECK: movl %ecx, 32(%eax)
119    mov [16 + eax + 16], ecx
120// CHECK: movl %ecx, 32(%eax)
121    mov [16 + 16 + eax], ecx
122// CHECK: movl %ecx, 12(%eax)
123    mov [eax][12], ecx
124// CHECK: movl %ecx, 12(%eax)
125    mov [12][eax], ecx
126// CHECK: movl %ecx, 32(%eax)
127    mov [eax][16 + 16], ecx
128// CHECK: movl %ecx, 32(%eax)
129    mov [eax + 16][16], ecx
130// CHECK: movl %ecx, 32(%eax)
131    mov [eax][16][16], ecx
132// CHECK: movl %ecx, 32(%eax)
133    mov [16][eax + 16], ecx
134// CHECK: movl %ecx, 32(%eax)
135    mov [16 + eax][16], ecx
136// CHECK: movl %ecx, 32(%eax)
137    mov [16][16 + eax], ecx
138// CHECK: movl %ecx, 32(%eax)
139    mov [16 + 16][eax], ecx
140// CHECK: movl %ecx, 32(%eax)
141    mov [eax][16][16], ecx
142// CHECK: movl %ecx, 32(%eax)
143    mov [16][eax][16], ecx
144// CHECK: movl %ecx, 32(%eax)
145    mov [16][16][eax], ecx
146// CHECK: movl %ecx, 16(,%ebx,4)
147    mov [4*ebx + 16], ecx
148// CHECK: movl %ecx, 16(,%ebx,4)
149    mov [ebx*4 + 16], ecx
150// CHECK: movl %ecx, 16(,%ebx,4)
151    mov [4*ebx][16], ecx
152// CHECK: movl %ecx, 16(,%ebx,4)
153    mov [ebx*4][16], ecx
154// CHECK: movl %ecx, 16(,%ebx,4)
155    mov [16 + 4*ebx], ecx
156// CHECK: movl %ecx, 16(,%ebx,4)
157    mov [16 + ebx*4], ecx
158// CHECK: movl %ecx, 16(,%ebx,4)
159    mov [16][4*ebx], ecx
160// CHECK: movl %ecx, 16(,%ebx,4)
161    mov [16][ebx*4], ecx
162// CHECK: movl %ecx, 16(%eax,%ebx,4)
163    mov [eax + 4*ebx + 16], ecx
164// CHECK: movl %ecx, 16(%eax,%ebx,4)
165    mov [eax + 16 + 4*ebx], ecx
166// CHECK: movl %ecx, 16(%eax,%ebx,4)
167    mov [4*ebx + eax + 16], ecx
168// CHECK: movl %ecx, 16(%eax,%ebx,4)
169    mov [4*ebx + 16 + eax], ecx
170// CHECK: movl %ecx, 16(%eax,%ebx,4)
171    mov [16 + eax + 4*ebx], ecx
172// CHECK: movl %ecx, 16(%eax,%ebx,4)
173    mov [16 + eax + 4*ebx], ecx
174// CHECK: movl %ecx, 16(%eax,%ebx,4)
175    mov [eax][4*ebx + 16], ecx
176// CHECK: movl %ecx, 16(%eax,%ebx,4)
177    mov [eax][16 + 4*ebx], ecx
178// CHECK: movl %ecx, 16(%eax,%ebx,4)
179    mov [4*ebx][eax + 16], ecx
180// CHECK: movl %ecx, 16(%eax,%ebx,4)
181    mov [4*ebx][16 + eax], ecx
182// CHECK: movl %ecx, 16(%eax,%ebx,4)
183    mov [16][eax + 4*ebx], ecx
184// CHECK: movl %ecx, 16(%eax,%ebx,4)
185    mov [16][eax + 4*ebx], ecx
186// CHECK: movl %ecx, 16(%eax,%ebx,4)
187    mov [eax + 4*ebx][16], ecx
188// CHECK: movl %ecx, 16(%eax,%ebx,4)
189    mov [eax + 16][4*ebx], ecx
190// CHECK: movl %ecx, 16(%eax,%ebx,4)
191    mov [4*ebx + eax][16], ecx
192// CHECK: movl %ecx, 16(%eax,%ebx,4)
193    mov [4*ebx + 16][eax], ecx
194// CHECK: movl %ecx, 16(%eax,%ebx,4)
195    mov [16 + eax][4*ebx], ecx
196// CHECK: movl %ecx, 16(%eax,%ebx,4)
197    mov [16 + eax][4*ebx], ecx
198// CHECK: movl %ecx, 16(%eax,%ebx,4)
199    mov [eax][4*ebx][16], ecx
200// CHECK: movl %ecx, 16(%eax,%ebx,4)
201    mov [eax][16][4*ebx], ecx
202// CHECK: movl %ecx, 16(%eax,%ebx,4)
203    mov [4*ebx][eax][16], ecx
204// CHECK: movl %ecx, 16(%eax,%ebx,4)
205    mov [4*ebx][16][eax], ecx
206// CHECK: movl %ecx, 16(%eax,%ebx,4)
207    mov [16][eax][4*ebx], ecx
208// CHECK: movl %ecx, 16(%eax,%ebx,4)
209    mov [16][eax][4*ebx], ecx
210// CHECK: movl %ecx, 16(%eax,%ebx,4)
211    mov [eax + ebx*4 + 16], ecx
212// CHECK: movl %ecx, 16(%eax,%ebx,4)
213    mov [eax + 16 + ebx*4], ecx
214// CHECK: movl %ecx, 16(%eax,%ebx,4)
215    mov [ebx*4 + eax + 16], ecx
216// CHECK: movl %ecx, 16(%eax,%ebx,4)
217    mov [ebx*4 + 16 + eax], ecx
218// CHECK: movl %ecx, 16(%eax,%ebx,4)
219    mov [16 + eax + ebx*4], ecx
220// CHECK: movl %ecx, 16(%eax,%ebx,4)
221    mov [16 + eax + ebx*4], ecx
222// CHECK: movl %ecx, 16(%eax,%ebx,4)
223    mov [eax][ebx*4 + 16], ecx
224// CHECK: movl %ecx, 16(%eax,%ebx,4)
225    mov [eax][16 + ebx*4], ecx
226// CHECK: movl %ecx, 16(%eax,%ebx,4)
227    mov [ebx*4][eax + 16], ecx
228// CHECK: movl %ecx, 16(%eax,%ebx,4)
229    mov [ebx*4][16 + eax], ecx
230// CHECK: movl %ecx, 16(%eax,%ebx,4)
231    mov [16][eax + ebx*4], ecx
232// CHECK: movl %ecx, 16(%eax,%ebx,4)
233    mov [16][eax + ebx*4], ecx
234// CHECK: movl %ecx, 16(%eax,%ebx,4)
235    mov [eax + ebx*4][16], ecx
236// CHECK: movl %ecx, 16(%eax,%ebx,4)
237    mov [eax + 16][ebx*4], ecx
238// CHECK: movl %ecx, 16(%eax,%ebx,4)
239    mov [ebx*4 + eax][16], ecx
240// CHECK: movl %ecx, 16(%eax,%ebx,4)
241    mov [ebx*4 + 16][eax], ecx
242// CHECK: movl %ecx, 16(%eax,%ebx,4)
243    mov [16 + eax][ebx*4], ecx
244// CHECK: movl %ecx, 16(%eax,%ebx,4)
245    mov [16 + eax][ebx*4], ecx
246// CHECK: movl %ecx, 16(%eax,%ebx,4)
247    mov [eax][ebx*4][16], ecx
248// CHECK: movl %ecx, 16(%eax,%ebx,4)
249    mov [eax][16][ebx*4], ecx
250// CHECK: movl %ecx, 16(%eax,%ebx,4)
251    mov [ebx*4][eax][16], ecx
252// CHECK: movl %ecx, 16(%eax,%ebx,4)
253    mov [ebx*4][16][eax], ecx
254// CHECK: movl %ecx, 16(%eax,%ebx,4)
255    mov [16][eax][ebx*4], ecx
256// CHECK: movl %ecx, 16(%eax,%ebx,4)
257    mov [16][eax][ebx*4], ecx
258// CHECK: movl %ecx, -16(%eax,%ebx,4)
259    mov [eax][ebx*4 - 16], ecx
260
261// CHECK: prefetchnta 12800(%esi)
262    prefetchnta [esi + (200*64)]
263// CHECK: prefetchnta 32(%esi)
264    prefetchnta [esi + (64/2)]
265// CHECK: prefetchnta 128(%esi)
266    prefetchnta [esi + (64/2*4)]
267// CHECK: prefetchnta 8(%esi)
268    prefetchnta [esi + (64/(2*4))]
269// CHECK: prefetchnta 48(%esi)
270    prefetchnta [esi + (64/(2*4)+40)]
271
272// CHECK: movl %ecx, -16(%eax,%ebx,4)
273    mov [eax][ebx*4 - 2*8], ecx
274// CHECK: movl %ecx, -16(%eax,%ebx,4)
275    mov [eax][4*ebx - 2*8], ecx
276// CHECK: movl %ecx, -16(%eax,%ebx,4)
277    mov [eax + 4*ebx - 2*8], ecx
278// CHECK: movl %ecx, -16(%eax,%ebx,4)
279    mov [12 + eax + (4*ebx) - 2*14], ecx
280// CHECK: movl %ecx, -16(%eax,%ebx,4)
281    mov [eax][ebx*4 - 2*2*2*2], ecx
282// CHECK: movl %ecx, -16(%eax,%ebx,4)
283    mov [eax][ebx*4 - (2*8)], ecx
284// CHECK: movl %ecx, -16(%eax,%ebx,4)
285    mov [eax][ebx*4 - 2 * 8 + 4 - 4], ecx
286// CHECK: movl %ecx, -16(%eax,%ebx,4)
287    mov [eax + ebx*4 - 2 * 8 + 4 - 4], ecx
288// CHECK: movl %ecx, -16(%eax,%ebx,4)
289    mov [eax + ebx*4 - 2 * ((8 + 4) - 4)], ecx
290// CHECK: movl %ecx, -16(%eax,%ebx,4)
291    mov [-2 * ((8 + 4) - 4) + eax + ebx*4], ecx
292// CHECK: movl %ecx, -16(%eax,%ebx,4)
293    mov [((-2) * ((8 + 4) - 4)) + eax + ebx*4], ecx
294// CHECK: movl %ecx, -16(%eax,%ebx,4)
295    mov [eax + ((-2) * ((8 + 4) - 4)) + ebx*4], ecx
296// CHECK: movl %ecx, 96(%eax,%ebx,4)
297    mov [eax + ((-2) * ((8 + 4) * -4)) + ebx*4], ecx
298// CHECK: movl %ecx, -8(%eax,%ebx,4)
299    mov [eax][-8][ebx*4], ecx
300// CHECK: movl %ecx, -2(%eax,%ebx,4)
301    mov [eax][16/-8][ebx*4], ecx
302// CHECK: movl %ecx, -2(%eax,%ebx,4)
303    mov [eax][(16)/-8][ebx*4], ecx
304
305// CHECK: setb %al
306    setc al
307// CHECK: sete %al
308    setz al
309// CHECK: setbe %al
310    setna al
311// CHECK: setae %al
312    setnb al
313// CHECK: setae %al
314    setnc al
315// CHECK: setle %al
316    setng al
317// CHECK: setge %al
318    setnl al
319// CHECK: setne %al
320    setnz al
321// CHECK: setp %al
322    setpe al
323// CHECK: setnp %al
324    setpo al
325// CHECK: setb %al
326    setnae al
327// CHECK: seta %al
328    setnbe al
329// CHECK: setl %al
330    setnge al
331// CHECK: setg %al
332    setnle al
333// CHECK: jne _foo
334    jnz _foo
335// CHECK: outb %al, $4
336    out 4, al
337    ret
338
339// CHECK: cmovbl %ebx, %eax
340    cmovc eax, ebx
341// CHECK: cmovel %ebx, %eax
342    cmovz eax, ebx
343// CHECK: cmovbel %ebx, %eax
344    cmovna eax, ebx
345// CHECK: cmovael %ebx, %eax
346    cmovnb eax, ebx
347// CHECK: cmovael %ebx, %eax
348    cmovnc eax, ebx
349// CHECK: cmovlel %ebx, %eax
350    cmovng eax, ebx
351// CHECK: cmovgel %ebx, %eax
352    cmovnl eax, ebx
353// CHECK: cmovnel %ebx, %eax
354    cmovnz eax, ebx
355// CHECK: cmovpl %ebx, %eax
356    cmovpe eax, ebx
357// CHECK: cmovnpl %ebx, %eax
358    cmovpo eax, ebx
359// CHECK: cmovbl %ebx, %eax
360    cmovnae eax, ebx
361// CHECK: cmoval %ebx, %eax
362    cmovnbe eax, ebx
363// CHECK: cmovll %ebx, %eax
364    cmovnge eax, ebx
365// CHECK: cmovgl %ebx, %eax
366    cmovnle eax, ebx
367
368// CHECK: shldw	%cl, %bx, %dx
369// CHECK: shldw	%cl, %bx, %dx
370// CHECK: shldw	$1, %bx, %dx
371// CHECK: shldw	%cl, %bx, (%rax)
372// CHECK: shldw	%cl, %bx, (%rax)
373// CHECK: shrdw	%cl, %bx, %dx
374// CHECK: shrdw	%cl, %bx, %dx
375// CHECK: shrdw	$1, %bx, %dx
376// CHECK: shrdw	%cl, %bx, (%rax)
377// CHECK: shrdw	%cl, %bx, (%rax)
378
379shld  DX, BX
380shld  DX, BX, CL
381shld  DX, BX, 1
382shld  [RAX], BX
383shld  [RAX], BX, CL
384shrd  DX, BX
385shrd  DX, BX, CL
386shrd  DX, BX, 1
387shrd  [RAX], BX
388shrd  [RAX], BX, CL
389
390// CHECK: btl $1, (%eax)
391// CHECK: btsl $1, (%eax)
392// CHECK: btrl $1, (%eax)
393// CHECK: btcl $1, (%eax)
394    bt DWORD PTR [EAX], 1
395    bt DWORD PTR [EAX], 1
396    bts DWORD PTR [EAX], 1
397    btr DWORD PTR [EAX], 1
398    btc DWORD PTR [EAX], 1
399
400//CHECK: divb	%bl
401//CHECK: divw	%bx
402//CHECK: divl	%ecx
403//CHECK: divl	3735928559(%ebx,%ecx,8)
404//CHECK: divl	69
405//CHECK: divl	32493
406//CHECK: divl	3133065982
407//CHECK: divl	305419896
408//CHECK: idivb	%bl
409//CHECK: idivw	%bx
410//CHECK: idivl	%ecx
411//CHECK: idivl	3735928559(%ebx,%ecx,8)
412//CHECK: idivl	69
413//CHECK: idivl	32493
414//CHECK: idivl	3133065982
415//CHECK: idivl	305419896
416    div AL, BL
417    div AX, BX
418    div EAX, ECX
419    div EAX, [ECX*8+EBX+0xdeadbeef]
420    div EAX, [0x45]
421    div EAX, [0x7eed]
422    div EAX, [0xbabecafe]
423    div EAX, [0x12345678]
424    idiv AL, BL
425    idiv AX, BX
426    idiv EAX, ECX
427    idiv EAX, [ECX*8+EBX+0xdeadbeef]
428    idiv EAX, [0x45]
429    idiv EAX, [0x7eed]
430    idiv EAX, [0xbabecafe]
431    idiv EAX, [0x12345678]
432
433
434// CHECK: inb %dx, %al
435// CHECK: inw %dx, %ax
436// CHECK: inl %dx, %eax
437// CHECK: outb %al, %dx
438// CHECK: outw %ax, %dx
439// CHECK: outl %eax, %dx
440    inb DX
441    inw DX
442    inl DX
443    outb DX
444    outw DX
445    outl DX
446
447// CHECK: xchgq %rcx, %rax
448// CHECK: xchgq %rcx, %rax
449// CHECK: xchgl %ecx, %eax
450// CHECK: xchgl %ecx, %eax
451// CHECK: xchgw %cx, %ax
452// CHECK: xchgw %cx, %ax
453xchg RAX, RCX
454xchg RCX, RAX
455xchg EAX, ECX
456xchg ECX, EAX
457xchg AX, CX
458xchg CX, AX
459
460// CHECK: xchgq %rax, (%ecx)
461// CHECK: xchgq %rax, (%ecx)
462// CHECK: xchgl %eax, (%ecx)
463// CHECK: xchgl %eax, (%ecx)
464// CHECK: xchgw %ax, (%ecx)
465// CHECK: xchgw %ax, (%ecx)
466xchg RAX, [ECX]
467xchg [ECX], RAX
468xchg EAX, [ECX]
469xchg [ECX], EAX
470xchg AX, [ECX]
471xchg [ECX], AX
472
473// CHECK: testq (%ecx), %rax
474// CHECK: testq (%ecx), %rax
475// CHECK: testl (%ecx), %eax
476// CHECK: testl (%ecx), %eax
477// CHECK: testw (%ecx), %ax
478// CHECK: testw (%ecx), %ax
479// CHECK: testb (%ecx), %al
480// CHECK: testb (%ecx), %al
481test RAX, [ECX]
482test [ECX], RAX
483test EAX, [ECX]
484test [ECX], EAX
485test AX, [ECX]
486test [ECX], AX
487test AL, [ECX]
488test [ECX], AL
489
490// CHECK: fnstsw %ax
491// CHECK: fnstsw %ax
492// CHECK: fnstsw %ax
493// CHECK: fnstsw %ax
494// CHECK: fnstsw (%eax)
495fnstsw
496fnstsw AX
497fnstsw EAX
498fnstsw AL
499fnstsw WORD PTR [EAX]
500
501// CHECK: faddp %st(1)
502// CHECK: fmulp %st(1)
503// CHECK: fsubrp %st(1)
504// CHECK: fsubp %st(1)
505// CHECK: fdivrp %st(1)
506// CHECK: fdivp %st(1)
507faddp ST(1), ST(0)
508fmulp ST(1), ST(0)
509fsubp ST(1), ST(0)
510fsubrp ST(1), ST(0)
511fdivp ST(1), ST(0)
512fdivrp ST(1), ST(0)
513
514// CHECK: faddp %st(1)
515// CHECK: fmulp %st(1)
516// CHECK: fsubrp %st(1)
517// CHECK: fsubp %st(1)
518// CHECK: fdivrp %st(1)
519// CHECK: fdivp %st(1)
520faddp ST(0), ST(1)
521fmulp ST(0), ST(1)
522fsubp ST(0), ST(1)
523fsubrp ST(0), ST(1)
524fdivp ST(0), ST(1)
525fdivrp ST(0), ST(1)
526
527// CHECK: faddp %st(1)
528// CHECK: fmulp %st(1)
529// CHECK: fsubrp %st(1)
530// CHECK: fsubp %st(1)
531// CHECK: fdivrp %st(1)
532// CHECK: fdivp %st(1)
533faddp ST(1)
534fmulp ST(1)
535fsubp ST(1)
536fsubrp ST(1)
537fdivp ST(1)
538fdivrp ST(1)
539
540
541// CHECK: faddp %st(1)
542// CHECK: fmulp %st(1)
543// CHECK: fsubrp %st(1)
544// CHECK: fsubp %st(1)
545// CHECK: fdivrp %st(1)
546// CHECK: fdivp %st(1)
547fadd
548fmul
549fsub
550fsubr
551fdiv
552fdivr
553
554// CHECK: faddp %st(1)
555// CHECK: fmulp %st(1)
556// CHECK: fsubrp %st(1)
557// CHECK: fsubp %st(1)
558// CHECK: fdivrp %st(1)
559// CHECK: fdivp %st(1)
560faddp
561fmulp
562fsubp
563fsubrp
564fdivp
565fdivrp
566
567// CHECK: fadd %st(1)
568// CHECK: fmul %st(1)
569// CHECK: fsub %st(1)
570// CHECK: fsubr %st(1)
571// CHECK: fdiv %st(1)
572// CHECK: fdivr %st(1)
573fadd ST(0), ST(1)
574fmul ST(0), ST(1)
575fsub ST(0), ST(1)
576fsubr ST(0), ST(1)
577fdiv ST(0), ST(1)
578fdivr ST(0), ST(1)
579
580// CHECK: fadd %st(0), %st(1)
581// CHECK: fmul %st(0), %st(1)
582// CHECK: fsubr %st(0), %st(1)
583// CHECK: fsub %st(0), %st(1)
584// CHECK: fdivr %st(0), %st(1)
585// CHECK: fdiv %st(0), %st(1)
586fadd ST(1), ST(0)
587fmul ST(1), ST(0)
588fsub ST(1), ST(0)
589fsubr ST(1), ST(0)
590fdiv ST(1), ST(0)
591fdivr ST(1), ST(0)
592
593// CHECK: fadd %st(1)
594// CHECK: fmul %st(1)
595// CHECK: fsub %st(1)
596// CHECK: fsubr %st(1)
597// CHECK: fdiv %st(1)
598// CHECK: fdivr %st(1)
599fadd ST(1)
600fmul ST(1)
601fsub ST(1)
602fsubr ST(1)
603fdiv ST(1)
604fdivr ST(1)
605
606
607// CHECK: fxsave64 (%rax)
608// CHECK: fxrstor64 (%rax)
609fxsave64 opaque ptr [rax]
610fxrstor64 opaque ptr [rax]
611
612.bss
613.globl _g0
614.text
615
616// CHECK: movq _g0, %rbx
617// CHECK: movq _g0+8, %rcx
618mov rbx, qword ptr [_g0]
619mov rcx, qword ptr [_g0 + 8]
620
621"?half@?0??bar@@YAXXZ@4NA":
622	.quad   4602678819172646912
623
624fadd   dword ptr "?half@?0??bar@@YAXXZ@4NA"
625fadd   dword ptr "?half@?0??bar@@YAXXZ@4NA"@IMGREL
626// CHECK: fadds   "?half@?0??bar@@YAXXZ@4NA"
627// CHECK: fadds   "?half@?0??bar@@YAXXZ@4NA"@IMGREL
628
629inc qword ptr [rax]
630inc dword ptr [rax]
631inc word ptr [rax]
632inc byte ptr [rax]
633// CHECK: incq (%rax)
634// CHECK: incl (%rax)
635// CHECK: incw (%rax)
636// CHECK: incb (%rax)
637
638dec qword ptr [rax]
639dec dword ptr [rax]
640dec word ptr [rax]
641dec byte ptr [rax]
642// CHECK: decq (%rax)
643// CHECK: decl (%rax)
644// CHECK: decw (%rax)
645// CHECK: decb (%rax)
646
647add qword ptr [rax], 1
648add dword ptr [rax], 1
649add word ptr [rax], 1
650add byte ptr [rax], 1
651// CHECK: addq $1, (%rax)
652// CHECK: addl $1, (%rax)
653// CHECK: addw $1, (%rax)
654// CHECK: addb $1, (%rax)
655
656fstp tbyte ptr [rax]
657fstp xword ptr [rax]
658fstp qword ptr [rax]
659fstp dword ptr [rax]
660// CHECK: fstpt (%rax)
661// CHECK: fstpt (%rax)
662// CHECK: fstpl (%rax)
663// CHECK: fstps (%rax)
664
665fxsave [eax]
666fsave [eax]
667fxrstor [eax]
668frstor [eax]
669// CHECK: fxsave (%eax)
670// CHECK: wait
671// CHECK: fnsave (%eax)
672// CHECK: fxrstor (%eax)
673// CHECK: frstor (%eax)
674
675// FIXME: Should we accept this?  Masm accepts it, but gas does not.
676fxsave dword ptr [eax]
677fsave dword ptr [eax]
678fxrstor dword ptr [eax]
679frstor dword ptr [eax]
680// CHECK: fxsave (%eax)
681// CHECK: wait
682// CHECK: fnsave (%eax)
683// CHECK: fxrstor (%eax)
684// CHECK: frstor (%eax)
685
686// CHECK: cmpnless %xmm1, %xmm0
687cmpnless xmm0, xmm1
688
689insb
690insw
691insd
692// CHECK: insb %dx, %es:(%rdi)
693// CHECK: insw %dx, %es:(%rdi)
694// CHECK: insl %dx, %es:(%rdi)
695
696outsb
697outsw
698outsd
699// CHECK: outsb (%rsi), %dx
700// CHECK: outsw (%rsi), %dx
701// CHECK: outsl (%rsi), %dx
702
703imul bx, 123
704imul ebx, 123
705imul rbx, 123
706// CHECK: imulw $123, %bx
707// CHECK: imull $123, %ebx
708// CHECK: imulq $123, %rbx
709
710repe cmpsb
711repz cmpsb
712repne cmpsb
713repnz cmpsb
714// CHECK: rep
715// CHECK: cmpsb	%es:(%rdi), (%rsi)
716// CHECK: rep
717// CHECK: cmpsb	%es:(%rdi), (%rsi)
718// CHECK: repne
719// CHECK: cmpsb	%es:(%rdi), (%rsi)
720// CHECK: repne
721// CHECK: cmpsb	%es:(%rdi), (%rsi)
722
723sal eax, 123
724// CHECK: shll	$123, %eax
725
726psignw    mm0, MMWORD PTR t2
727// CHECK: psignw t2, %mm0
728
729comisd xmm0, QWORD PTR [eax]
730comiss xmm0, DWORD PTR [eax]
731vcomisd xmm0, QWORD PTR [eax]
732vcomiss xmm0, DWORD PTR [eax]
733
734// CHECK: comisd (%eax), %xmm0
735// CHECK: comiss (%eax), %xmm0
736// CHECK: vcomisd (%eax), %xmm0
737// CHECK: vcomiss (%eax), %xmm0
738
739fbld tbyte ptr [eax]
740fbstp tbyte ptr [eax]
741// CHECK: fbld (%eax)
742// CHECK: fbstp (%eax)
743
744fcomip st, st(2)
745fucomip st, st(2)
746// CHECK: fcompi  %st(2)
747// CHECK: fucompi  %st(2)
748
749loopz _foo
750loopnz _foo
751// CHECK: loope _foo
752// CHECK: loopne _foo
753
754sidt fword ptr [eax]
755// CHECK: sidtq (%eax)
756
757ins byte ptr [eax], dx
758// CHECK: insb %dx, %es:(%edi)
759// CHECK-STDERR: memory operand is only for determining the size, ES:(R|E)DI will be used for the location
760// CHECK-STDERR-NEXT: ins byte ptr [eax], dx
761outs dx, word ptr [eax]
762// CHECK: outsw (%esi), %dx
763// CHECK-STDERR: memory operand is only for determining the size, ES:(R|E)SI will be used for the location
764// CHECK-STDERR-NEXT: outs dx, word ptr [eax]
765lods dword ptr [eax]
766// CHECK: lodsl (%esi), %eax
767// CHECK-STDERR: memory operand is only for determining the size, ES:(R|E)SI will be used for the location
768// CHECK-STDERR-NEXT: lods dword ptr [eax]
769stos qword ptr [eax]
770// CHECK: stosq %rax, %es:(%edi)
771// CHECK-STDERR: memory operand is only for determining the size, ES:(R|E)DI will be used for the location
772// CHECK-STDERR-NEXT: stos qword ptr [eax]
773scas byte ptr [eax]
774// CHECK: scasb %es:(%edi), %al
775// CHECK-STDERR: memory operand is only for determining the size, ES:(R|E)DI will be used for the location
776// CHECK-STDERR-NEXT: scas byte ptr [eax]
777cmps word ptr [eax], word ptr [ebx]
778// CHECK: cmpsw %es:(%edi), (%esi)
779// CHECK-STDERR: memory operand is only for determining the size, ES:(R|E)SI will be used for the location
780// CHECK-STDERR-NEXT: cmps word ptr [eax], word ptr [ebx]
781// CHECK-STDERR: memory operand is only for determining the size, ES:(R|E)DI will be used for the location
782// CHECK-STDERR-NEXT: cmps word ptr [eax], word ptr [ebx]
783movs dword ptr [eax], dword ptr [ebx]
784// CHECK: movsl (%esi), %es:(%edi)
785// CHECK-STDERR: memory operand is only for determining the size, ES:(R|E)DI will be used for the location
786// CHECK-STDERR-NEXT: movs dword ptr [eax], dword ptr [ebx]
787// CHECK-STDERR: memory operand is only for determining the size, ES:(R|E)SI will be used for the location
788// CHECK-STDERR-NEXT: movs dword ptr [eax], dword ptr [ebx]
789
790movsd  qword ptr [rax], xmm0
791// CHECK: movsd %xmm0, (%rax)
792// CHECK-STDERR-NOT: movsd qword ptr [rax], xmm0
793
794xlat byte ptr [eax]
795// CHECK: xlatb
796// CHECK-STDERR: memory operand is only for determining the size, (R|E)BX will be used for the location
797