1// RUN: llvm-mc -triple x86_64-unknown-unknown -x86-asm-syntax=intel %s | FileCheck %s 2 3_test: 4 xor EAX, EAX 5 ret 6 7_main: 8// CHECK: movl $257, -4(%rsp) 9 mov DWORD PTR [RSP - 4], 257 10// CHECK: movl $258, 4(%rsp) 11 mov DWORD PTR [RSP + 4], 258 12// CHECK: movq $123, -16(%rsp) 13 mov QWORD PTR [RSP - 16], 123 14// CHECK: movb $97, -17(%rsp) 15 mov BYTE PTR [RSP - 17], 97 16// CHECK: movl -4(%rsp), %eax 17 mov EAX, DWORD PTR [RSP - 4] 18// CHECK: movq (%rsp), %rax 19 mov RAX, QWORD PTR [RSP] 20// CHECK: movl $-4, -4(%rsp) 21 mov DWORD PTR [RSP - 4], -4 22// CHECK: movq 0, %rcx 23 mov RCX, QWORD PTR [0] 24// CHECK: movl -24(%rsp,%rax,4), %eax 25 mov EAX, DWORD PTR [RSP + 4*RAX - 24] 26// CHECK: movb %dil, (%rdx,%rcx) 27 mov BYTE PTR [RDX + RCX], DIL 28// CHECK: movzwl 2(%rcx), %edi 29 movzx EDI, WORD PTR [RCX + 2] 30// CHECK: callq _test 31 call _test 32// CHECK: andw $12, %ax 33 and ax, 12 34// CHECK: andw $-12, %ax 35 and ax, -12 36// CHECK: andw $257, %ax 37 and ax, 257 38// CHECK: andw $-257, %ax 39 and ax, -257 40// CHECK: andl $12, %eax 41 and eax, 12 42// CHECK: andl $-12, %eax 43 and eax, -12 44// CHECK: andl $257, %eax 45 and eax, 257 46// CHECK: andl $-257, %eax 47 and eax, -257 48// CHECK: andq $12, %rax 49 and rax, 12 50// CHECK: andq $-12, %rax 51 and rax, -12 52// CHECK: andq $257, %rax 53 and rax, 257 54// CHECK: andq $-257, %rax 55 and rax, -257 56// CHECK: fld %st(0) 57 fld ST(0) 58// CHECK: movl %fs:(%rdi), %eax 59 mov EAX, DWORD PTR FS:[RDI] 60// CHECK: leal (,%rdi,4), %r8d 61 lea R8D, DWORD PTR [4*RDI] 62// CHECK: movl _fnan(,%ecx,4), %ecx 63 mov ECX, DWORD PTR [4*ECX + _fnan] 64// CHECK: movq %fs:320, %rax 65 mov RAX, QWORD PTR FS:[320] 66// CHECK: movq %fs:320, %rax 67 mov RAX, QWORD PTR FS:320 68// CHECK: movq %rax, %fs:320 69 mov QWORD PTR FS:320, RAX 70// CHECK: movq %rax, %fs:20(%rbx) 71 mov QWORD PTR FS:20[rbx], RAX 72// CHECK: vshufpd $1, %xmm2, %xmm1, %xmm0 73 vshufpd XMM0, XMM1, XMM2, 1 74// CHECK: vpgatherdd %xmm8, (%r15,%xmm9,2), %xmm1 75 vpgatherdd XMM10, DWORD PTR [R15 + 2*XMM9], XMM8 76// CHECK: movsd -8, %xmm5 77 movsd XMM5, QWORD PTR [-8] 78// CHECK: movl %ecx, (%eax) 79 mov [eax], ecx 80// CHECK: movl %ecx, (,%ebx,4) 81 mov [4*ebx], ecx 82 // CHECK: movl %ecx, (,%ebx,4) 83 mov [ebx*4], ecx 84// CHECK: movl %ecx, 1024 85 mov [1024], ecx 86// CHECK: movl %ecx, 4132 87 mov [0x1024], ecx 88// CHECK: movl %ecx, 32 89 mov [16 + 16], ecx 90// CHECK: movl %ecx, 0 91 mov [16 - 16], ecx 92// CHECK: movl %ecx, 32 93 mov [16][16], ecx 94// CHECK: movl %ecx, (%eax,%ebx,4) 95 mov [eax + 4*ebx], ecx 96// CHECK: movl %ecx, (%eax,%ebx,4) 97 mov [eax + ebx*4], ecx 98// CHECK: movl %ecx, (%eax,%ebx,4) 99 mov [4*ebx + eax], ecx 100// CHECK: movl %ecx, (%eax,%ebx,4) 101 mov [ebx*4 + eax], ecx 102// CHECK: movl %ecx, (%eax,%ebx,4) 103 mov [eax][4*ebx], ecx 104// CHECK: movl %ecx, (%eax,%ebx,4) 105 mov [eax][ebx*4], ecx 106// CHECK: movl %ecx, (%eax,%ebx,4) 107 mov [4*ebx][eax], ecx 108// CHECK: movl %ecx, (%eax,%ebx,4) 109 mov [ebx*4][eax], ecx 110// CHECK: movl %ecx, 12(%eax) 111 mov [eax + 12], ecx 112// CHECK: movl %ecx, 12(%eax) 113 mov [12 + eax], ecx 114// CHECK: movl %ecx, 32(%eax) 115 mov [eax + 16 + 16], ecx 116// CHECK: movl %ecx, 32(%eax) 117 mov [16 + eax + 16], ecx 118// CHECK: movl %ecx, 32(%eax) 119 mov [16 + 16 + eax], ecx 120// CHECK: movl %ecx, 12(%eax) 121 mov [eax][12], ecx 122// CHECK: movl %ecx, 12(%eax) 123 mov [12][eax], ecx 124// CHECK: movl %ecx, 32(%eax) 125 mov [eax][16 + 16], 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 [16][eax + 16], ecx 132// CHECK: movl %ecx, 32(%eax) 133 mov [16 + eax][16], ecx 134// CHECK: movl %ecx, 32(%eax) 135 mov [16][16 + eax], ecx 136// CHECK: movl %ecx, 32(%eax) 137 mov [16 + 16][eax], ecx 138// CHECK: movl %ecx, 32(%eax) 139 mov [eax][16][16], ecx 140// CHECK: movl %ecx, 32(%eax) 141 mov [16][eax][16], ecx 142// CHECK: movl %ecx, 32(%eax) 143 mov [16][16][eax], ecx 144// CHECK: movl %ecx, 16(,%ebx,4) 145 mov [4*ebx + 16], ecx 146// CHECK: movl %ecx, 16(,%ebx,4) 147 mov [ebx*4 + 16], ecx 148// CHECK: movl %ecx, 16(,%ebx,4) 149 mov [4*ebx][16], ecx 150// CHECK: movl %ecx, 16(,%ebx,4) 151 mov [ebx*4][16], ecx 152// CHECK: movl %ecx, 16(,%ebx,4) 153 mov [16 + 4*ebx], ecx 154// CHECK: movl %ecx, 16(,%ebx,4) 155 mov [16 + ebx*4], ecx 156// CHECK: movl %ecx, 16(,%ebx,4) 157 mov [16][4*ebx], ecx 158// CHECK: movl %ecx, 16(,%ebx,4) 159 mov [16][ebx*4], ecx 160// CHECK: movl %ecx, 16(%eax,%ebx,4) 161 mov [eax + 4*ebx + 16], ecx 162// CHECK: movl %ecx, 16(%eax,%ebx,4) 163 mov [eax + 16 + 4*ebx], ecx 164// CHECK: movl %ecx, 16(%eax,%ebx,4) 165 mov [4*ebx + eax + 16], ecx 166// CHECK: movl %ecx, 16(%eax,%ebx,4) 167 mov [4*ebx + 16 + eax], ecx 168// CHECK: movl %ecx, 16(%eax,%ebx,4) 169 mov [16 + eax + 4*ebx], 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 [eax][4*ebx + 16], ecx 174// CHECK: movl %ecx, 16(%eax,%ebx,4) 175 mov [eax][16 + 4*ebx], ecx 176// CHECK: movl %ecx, 16(%eax,%ebx,4) 177 mov [4*ebx][eax + 16], ecx 178// CHECK: movl %ecx, 16(%eax,%ebx,4) 179 mov [4*ebx][16 + eax], ecx 180// CHECK: movl %ecx, 16(%eax,%ebx,4) 181 mov [16][eax + 4*ebx], 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 [eax + 4*ebx][16], ecx 186// CHECK: movl %ecx, 16(%eax,%ebx,4) 187 mov [eax + 16][4*ebx], ecx 188// CHECK: movl %ecx, 16(%eax,%ebx,4) 189 mov [4*ebx + eax][16], ecx 190// CHECK: movl %ecx, 16(%eax,%ebx,4) 191 mov [4*ebx + 16][eax], ecx 192// CHECK: movl %ecx, 16(%eax,%ebx,4) 193 mov [16 + eax][4*ebx], 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 [eax][4*ebx][16], ecx 198// CHECK: movl %ecx, 16(%eax,%ebx,4) 199 mov [eax][16][4*ebx], ecx 200// CHECK: movl %ecx, 16(%eax,%ebx,4) 201 mov [4*ebx][eax][16], ecx 202// CHECK: movl %ecx, 16(%eax,%ebx,4) 203 mov [4*ebx][16][eax], ecx 204// CHECK: movl %ecx, 16(%eax,%ebx,4) 205 mov [16][eax][4*ebx], 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 [eax + ebx*4 + 16], ecx 210// CHECK: movl %ecx, 16(%eax,%ebx,4) 211 mov [eax + 16 + ebx*4], ecx 212// CHECK: movl %ecx, 16(%eax,%ebx,4) 213 mov [ebx*4 + eax + 16], ecx 214// CHECK: movl %ecx, 16(%eax,%ebx,4) 215 mov [ebx*4 + 16 + eax], ecx 216// CHECK: movl %ecx, 16(%eax,%ebx,4) 217 mov [16 + eax + ebx*4], 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 [eax][ebx*4 + 16], ecx 222// CHECK: movl %ecx, 16(%eax,%ebx,4) 223 mov [eax][16 + ebx*4], ecx 224// CHECK: movl %ecx, 16(%eax,%ebx,4) 225 mov [ebx*4][eax + 16], ecx 226// CHECK: movl %ecx, 16(%eax,%ebx,4) 227 mov [ebx*4][16 + eax], ecx 228// CHECK: movl %ecx, 16(%eax,%ebx,4) 229 mov [16][eax + ebx*4], 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 [eax + ebx*4][16], ecx 234// CHECK: movl %ecx, 16(%eax,%ebx,4) 235 mov [eax + 16][ebx*4], ecx 236// CHECK: movl %ecx, 16(%eax,%ebx,4) 237 mov [ebx*4 + eax][16], ecx 238// CHECK: movl %ecx, 16(%eax,%ebx,4) 239 mov [ebx*4 + 16][eax], ecx 240// CHECK: movl %ecx, 16(%eax,%ebx,4) 241 mov [16 + eax][ebx*4], 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 [eax][ebx*4][16], ecx 246// CHECK: movl %ecx, 16(%eax,%ebx,4) 247 mov [eax][16][ebx*4], ecx 248// CHECK: movl %ecx, 16(%eax,%ebx,4) 249 mov [ebx*4][eax][16], ecx 250// CHECK: movl %ecx, 16(%eax,%ebx,4) 251 mov [ebx*4][16][eax], ecx 252// CHECK: movl %ecx, 16(%eax,%ebx,4) 253 mov [16][eax][ebx*4], 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 [eax][ebx*4 - 16], ecx 258 259// CHECK: prefetchnta 12800(%esi) 260 prefetchnta [esi + (200*64)] 261// CHECK: prefetchnta 32(%esi) 262 prefetchnta [esi + (64/2)] 263// CHECK: prefetchnta 128(%esi) 264 prefetchnta [esi + (64/2*4)] 265// CHECK: prefetchnta 8(%esi) 266 prefetchnta [esi + (64/(2*4))] 267// CHECK: prefetchnta 48(%esi) 268 prefetchnta [esi + (64/(2*4)+40)] 269 270// CHECK: movl %ecx, -16(%eax,%ebx,4) 271 mov [eax][ebx*4 - 2*8], ecx 272// CHECK: movl %ecx, -16(%eax,%ebx,4) 273 mov [eax][4*ebx - 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 [12 + eax + (4*ebx) - 2*14], ecx 278// CHECK: movl %ecx, -16(%eax,%ebx,4) 279 mov [eax][ebx*4 - 2*2*2*2], ecx 280// CHECK: movl %ecx, -16(%eax,%ebx,4) 281 mov [eax][ebx*4 - (2*8)], ecx 282// CHECK: movl %ecx, -16(%eax,%ebx,4) 283 mov [eax][ebx*4 - 2 * 8 + 4 - 4], 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 [-2 * ((8 + 4) - 4) + eax + ebx*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 [eax + ((-2) * ((8 + 4) - 4)) + ebx*4], ecx 294// CHECK: movl %ecx, 96(%eax,%ebx,4) 295 mov [eax + ((-2) * ((8 + 4) * -4)) + ebx*4], ecx 296// CHECK: movl %ecx, -8(%eax,%ebx,4) 297 mov [eax][-8][ebx*4], ecx 298// CHECK: movl %ecx, -2(%eax,%ebx,4) 299 mov [eax][16/-8][ebx*4], ecx 300// CHECK: movl %ecx, -2(%eax,%ebx,4) 301 mov [eax][(16)/-8][ebx*4], ecx 302 303// CHECK: setb %al 304 setc al 305// CHECK: sete %al 306 setz al 307// CHECK: setbe %al 308 setna al 309// CHECK: setae %al 310 setnb al 311// CHECK: setae %al 312 setnc al 313// CHECK: setle %al 314 setng al 315// CHECK: setge %al 316 setnl al 317// CHECK: setne %al 318 setnz al 319// CHECK: setp %al 320 setpe al 321// CHECK: setnp %al 322 setpo al 323// CHECK: setb %al 324 setnae al 325// CHECK: seta %al 326 setnbe al 327// CHECK: setl %al 328 setnge al 329// CHECK: setg %al 330 setnle al 331// CHECK: jne _foo 332 jnz _foo 333// CHECK: outb %al, $4 334 out 4, al 335 ret 336 337// CHECK: cmovbl %ebx, %eax 338 cmovc eax, ebx 339// CHECK: cmovel %ebx, %eax 340 cmovz eax, ebx 341// CHECK: cmovbel %ebx, %eax 342 cmovna eax, ebx 343// CHECK: cmovael %ebx, %eax 344 cmovnb eax, ebx 345// CHECK: cmovael %ebx, %eax 346 cmovnc eax, ebx 347// CHECK: cmovlel %ebx, %eax 348 cmovng eax, ebx 349// CHECK: cmovgel %ebx, %eax 350 cmovnl eax, ebx 351// CHECK: cmovnel %ebx, %eax 352 cmovnz eax, ebx 353// CHECK: cmovpl %ebx, %eax 354 cmovpe eax, ebx 355// CHECK: cmovnpl %ebx, %eax 356 cmovpo eax, ebx 357// CHECK: cmovbl %ebx, %eax 358 cmovnae eax, ebx 359// CHECK: cmoval %ebx, %eax 360 cmovnbe eax, ebx 361// CHECK: cmovll %ebx, %eax 362 cmovnge eax, ebx 363// CHECK: cmovgl %ebx, %eax 364 cmovnle eax, ebx 365 366// CHECK: shldw %cl, %bx, %dx 367// CHECK: shldw %cl, %bx, %dx 368// CHECK: shldw $1, %bx, %dx 369// CHECK: shldw %cl, %bx, (%rax) 370// CHECK: shldw %cl, %bx, (%rax) 371// CHECK: shrdw %cl, %bx, %dx 372// CHECK: shrdw %cl, %bx, %dx 373// CHECK: shrdw $1, %bx, %dx 374// CHECK: shrdw %cl, %bx, (%rax) 375// CHECK: shrdw %cl, %bx, (%rax) 376 377shld DX, BX 378shld DX, BX, CL 379shld DX, BX, 1 380shld [RAX], BX 381shld [RAX], BX, CL 382shrd DX, BX 383shrd DX, BX, CL 384shrd DX, BX, 1 385shrd [RAX], BX 386shrd [RAX], BX, CL 387 388// CHECK: btl $1, (%eax) 389// CHECK: btsl $1, (%eax) 390// CHECK: btrl $1, (%eax) 391// CHECK: btcl $1, (%eax) 392 bt DWORD PTR [EAX], 1 393 bt DWORD PTR [EAX], 1 394 bts DWORD PTR [EAX], 1 395 btr DWORD PTR [EAX], 1 396 btc DWORD PTR [EAX], 1 397 398//CHECK: divb %bl 399//CHECK: divw %bx 400//CHECK: divl %ecx 401//CHECK: divl 3735928559(%ebx,%ecx,8) 402//CHECK: divl 69 403//CHECK: divl 32493 404//CHECK: divl 3133065982 405//CHECK: divl 305419896 406//CHECK: idivb %bl 407//CHECK: idivw %bx 408//CHECK: idivl %ecx 409//CHECK: idivl 3735928559(%ebx,%ecx,8) 410//CHECK: idivl 69 411//CHECK: idivl 32493 412//CHECK: idivl 3133065982 413//CHECK: idivl 305419896 414 div AL, BL 415 div AX, BX 416 div EAX, ECX 417 div EAX, [ECX*8+EBX+0xdeadbeef] 418 div EAX, [0x45] 419 div EAX, [0x7eed] 420 div EAX, [0xbabecafe] 421 div EAX, [0x12345678] 422 idiv AL, BL 423 idiv AX, BX 424 idiv EAX, ECX 425 idiv EAX, [ECX*8+EBX+0xdeadbeef] 426 idiv EAX, [0x45] 427 idiv EAX, [0x7eed] 428 idiv EAX, [0xbabecafe] 429 idiv EAX, [0x12345678] 430 431 432// CHECK: inb %dx, %al 433// CHECK: inw %dx, %ax 434// CHECK: inl %dx, %eax 435// CHECK: outb %al, %dx 436// CHECK: outw %ax, %dx 437// CHECK: outl %eax, %dx 438 inb DX 439 inw DX 440 inl DX 441 outb DX 442 outw DX 443 outl DX 444 445// CHECK: xchgq %rcx, %rax 446// CHECK: xchgq %rcx, %rax 447// CHECK: xchgl %ecx, %eax 448// CHECK: xchgl %ecx, %eax 449// CHECK: xchgw %cx, %ax 450// CHECK: xchgw %cx, %ax 451xchg RAX, RCX 452xchg RCX, RAX 453xchg EAX, ECX 454xchg ECX, EAX 455xchg AX, CX 456xchg CX, AX 457 458// CHECK: xchgq %rax, (%ecx) 459// CHECK: xchgq %rax, (%ecx) 460// CHECK: xchgl %eax, (%ecx) 461// CHECK: xchgl %eax, (%ecx) 462// CHECK: xchgw %ax, (%ecx) 463// CHECK: xchgw %ax, (%ecx) 464xchg RAX, [ECX] 465xchg [ECX], RAX 466xchg EAX, [ECX] 467xchg [ECX], EAX 468xchg AX, [ECX] 469xchg [ECX], AX 470 471// CHECK: testq (%ecx), %rax 472// CHECK: testq (%ecx), %rax 473// CHECK: testl (%ecx), %eax 474// CHECK: testl (%ecx), %eax 475// CHECK: testw (%ecx), %ax 476// CHECK: testw (%ecx), %ax 477// CHECK: testb (%ecx), %al 478// CHECK: testb (%ecx), %al 479test RAX, [ECX] 480test [ECX], RAX 481test EAX, [ECX] 482test [ECX], EAX 483test AX, [ECX] 484test [ECX], AX 485test AL, [ECX] 486test [ECX], AL 487 488// CHECK: fnstsw %ax 489// CHECK: fnstsw %ax 490// CHECK: fnstsw %ax 491// CHECK: fnstsw %ax 492fnstsw 493fnstsw AX 494fnstsw EAX 495fnstsw AL 496 497// CHECK: faddp %st(1) 498// CHECK: fmulp %st(1) 499// CHECK: fsubrp %st(1) 500// CHECK: fsubp %st(1) 501// CHECK: fdivrp %st(1) 502// CHECK: fdivp %st(1) 503faddp ST(1), ST(0) 504fmulp ST(1), ST(0) 505fsubp ST(1), ST(0) 506fsubrp ST(1), ST(0) 507fdivp ST(1), ST(0) 508fdivrp ST(1), ST(0) 509 510// CHECK: faddp %st(1) 511// CHECK: fmulp %st(1) 512// CHECK: fsubrp %st(1) 513// CHECK: fsubp %st(1) 514// CHECK: fdivrp %st(1) 515// CHECK: fdivp %st(1) 516faddp ST(0), ST(1) 517fmulp ST(0), ST(1) 518fsubp ST(0), ST(1) 519fsubrp ST(0), ST(1) 520fdivp ST(0), ST(1) 521fdivrp ST(0), ST(1) 522 523// CHECK: faddp %st(1) 524// CHECK: fmulp %st(1) 525// CHECK: fsubrp %st(1) 526// CHECK: fsubp %st(1) 527// CHECK: fdivrp %st(1) 528// CHECK: fdivp %st(1) 529faddp ST(1) 530fmulp ST(1) 531fsubp ST(1) 532fsubrp ST(1) 533fdivp ST(1) 534fdivrp ST(1) 535 536// CHECK: faddp %st(1) 537// CHECK: fmulp %st(1) 538// CHECK: fsubrp %st(1) 539// CHECK: fsubp %st(1) 540// CHECK: fdivrp %st(1) 541// CHECK: fdivp %st(1) 542faddp 543fmulp 544fsubp 545fsubrp 546fdivp 547fdivrp 548 549// CHECK: fadd %st(1) 550// CHECK: fmul %st(1) 551// CHECK: fsub %st(1) 552// CHECK: fsubr %st(1) 553// CHECK: fdiv %st(1) 554// CHECK: fdivr %st(1) 555fadd ST(0), ST(1) 556fmul ST(0), ST(1) 557fsub ST(0), ST(1) 558fsubr ST(0), ST(1) 559fdiv ST(0), ST(1) 560fdivr ST(0), ST(1) 561 562// CHECK: fadd %st(0), %st(1) 563// CHECK: fmul %st(0), %st(1) 564// CHECK: fsubr %st(0), %st(1) 565// CHECK: fsub %st(0), %st(1) 566// CHECK: fdivr %st(0), %st(1) 567// CHECK: fdiv %st(0), %st(1) 568fadd ST(1), ST(0) 569fmul ST(1), ST(0) 570fsub ST(1), ST(0) 571fsubr ST(1), ST(0) 572fdiv ST(1), ST(0) 573fdivr ST(1), ST(0) 574 575// CHECK: fadd %st(1) 576// CHECK: fmul %st(1) 577// CHECK: fsub %st(1) 578// CHECK: fsubr %st(1) 579// CHECK: fdiv %st(1) 580// CHECK: fdivr %st(1) 581fadd ST(1) 582fmul ST(1) 583fsub ST(1) 584fsubr ST(1) 585fdiv ST(1) 586fdivr ST(1) 587 588 589// CHECK: fxsave64 (%rax) 590// CHECK: fxrstor64 (%rax) 591fxsave64 opaque ptr [rax] 592fxrstor64 opaque ptr [rax] 593 594.bss 595.globl _g0 596.text 597 598// CHECK: movq _g0, %rbx 599// CHECK: movq _g0+8, %rcx 600mov rbx, qword ptr [_g0] 601mov rcx, qword ptr [_g0 + 8] 602 603"?half@?0??bar@@YAXXZ@4NA": 604 .quad 4602678819172646912 605 606fadd dword ptr "?half@?0??bar@@YAXXZ@4NA" 607fadd dword ptr "?half@?0??bar@@YAXXZ@4NA"@IMGREL 608// CHECK: fadds "?half@?0??bar@@YAXXZ@4NA" 609// CHECK: fadds "?half@?0??bar@@YAXXZ@4NA"@IMGREL 610 611inc qword ptr [rax] 612inc dword ptr [rax] 613inc word ptr [rax] 614inc byte ptr [rax] 615// CHECK: incq (%rax) 616// CHECK: incl (%rax) 617// CHECK: incw (%rax) 618// CHECK: incb (%rax) 619 620dec qword ptr [rax] 621dec dword ptr [rax] 622dec word ptr [rax] 623dec byte ptr [rax] 624// CHECK: decq (%rax) 625// CHECK: decl (%rax) 626// CHECK: decw (%rax) 627// CHECK: decb (%rax) 628 629add qword ptr [rax], 1 630add dword ptr [rax], 1 631add word ptr [rax], 1 632add byte ptr [rax], 1 633// CHECK: addq $1, (%rax) 634// CHECK: addl $1, (%rax) 635// CHECK: addw $1, (%rax) 636// CHECK: addb $1, (%rax) 637 638fstp xword ptr [rax] 639fstp qword ptr [rax] 640fstp dword ptr [rax] 641// CHECK: fstpt (%rax) 642// CHECK: fstpl (%rax) 643// CHECK: fstps (%rax) 644 645fxsave [eax] 646fsave [eax] 647fxrstor [eax] 648frstor [eax] 649// CHECK: fxsave (%eax) 650// CHECK: wait 651// CHECK: fnsave (%eax) 652// CHECK: fxrstor (%eax) 653// CHECK: frstor (%eax) 654 655// FIXME: Should we accept this? Masm accepts it, but gas does not. 656fxsave dword ptr [eax] 657fsave dword ptr [eax] 658fxrstor dword ptr [eax] 659frstor dword ptr [eax] 660// CHECK: fxsave (%eax) 661// CHECK: wait 662// CHECK: fnsave (%eax) 663// CHECK: fxrstor (%eax) 664// CHECK: frstor (%eax) 665