1 # RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s
6 0xc5 0x04 0xc2 0xc7 0x1f
9 0xc5 0x05 0xc2 0xc7 0x1f
11 # CHECK: vcmptrue_usss
12 0xc5 0x06 0xc2 0xc7 0x1f
14 # CHECK: vcmptrue_ussd
15 0xc5 0x07 0xc2 0xc7 0x1f
18 0xc5 0x04 0xc2 0xc7 0x08
21 0xc5 0x05 0xc2 0xc7 0x08
24 0xc5 0x06 0xc2 0xc7 0x08
27 0xc5 0x07 0xc2 0xc7 0x08
30 0xc5 0x04 0xc2 0xc7 0x00
33 0xc5 0x05 0xc2 0xc7 0x00
36 0xc5 0x06 0xc2 0xc7 0x00
39 0xc5 0x07 0xc2 0xc7 0x00
41 # CHECK: vcmptrue_usps %ymm7, %ymm15, %ymm0
42 0xc4 0xe1 0x84 0xc2 0xc7 0x1f
44 # CHECK: vcmptrue_uspd %ymm7, %ymm15, %ymm0
45 0xc4 0xe1 0x85 0xc2 0xc7 0x1f
51 0x66 0x0f 0xc2 0xc7 0x00
54 0xf3 0x0f 0xc2 0xc7 0x00
57 0xf2 0x0f 0xc2 0xc7 0x00
63 0x66 0x0f 0xc2 0xc7 0x07
66 0xf3 0x0f 0xc2 0xc7 0x07
69 0xf2 0x0f 0xc2 0xc7 0x07
71 # CHECK: extrq $2, $3, %xmm0
72 0x66 0x0f 0x78 0xc0 0x03 0x02
74 # CHECK: extrq %xmm1, %xmm0
77 # CHECK: insertq $6, $5, %xmm1, %xmm0
78 0xf2 0x0f 0x78 0xc1 0x05 0x06
80 # CHECK: insertq %xmm1, %xmm0
83 # CHECK: movntsd %xmm0, (%rdi)
86 # CHECK: movntss %xmm0, (%rdi)
89 # CHECK: adcxl %eax, %eax
90 0x66 0x0f 0x38 0xf6 0xc0
92 # CHECK: adcxl (%rax), %eax
93 0x66 0x0f 0x38 0xf6 0x00
95 # CHECK: adcxq %rax, %rax
96 0x66 0x48 0x0f 0x38 0xf6 0xc0
98 # CHECK: adcxq (%rax), %rax
99 0x66 0x48 0x0f 0x38 0xf6 0x00
101 # CHECK: adoxl %eax, %eax
102 0xf3 0x0f 0x38 0xf6 0xc0
104 # CHECK: adoxl (%rax), %eax
105 0xf3 0x0f 0x38 0xf6 0x00
107 # CHECK: adoxq %rax, %rax
108 0xf3 0x48 0x0f 0x38 0xf6 0xc0
110 # CHECK: adoxq (%rax), %rax
111 0xf3 0x48 0x0f 0x38 0xf6 0x00
114 0xc7 0xf8 0x35 0x00 0x00 0x00
117 0x66 0xc7 0xf8 0x35 0x00
125 # CHECK: xsave64 (%rax)
128 # CHECK: xrstor64 (%rax)
131 # CHECK: xsaveopt64 (%rax)
140 # CHECK: movabsb -6066930261531658096, %al
141 0xa0 0x90 0x78 0x56 0x34 0x12 0xef 0xcd 0xab
143 # CHECK: movabsb -6066930261531658096, %al
144 0x48 0xa0 0x90 0x78 0x56 0x34 0x12 0xef 0xcd 0xab
146 # CHECK: movabsw -6066930261531658096, %ax
147 0x66 0xa1 0x90 0x78 0x56 0x34 0x12 0xef 0xcd 0xab
149 # CHECK: movabsl -6066930261531658096, %eax
150 0xa1 0x90 0x78 0x56 0x34 0x12 0xef 0xcd 0xab
152 # CHECK: movabsq -6066930261531658096, %rax
153 0x48 0xa1 0x90 0x78 0x56 0x34 0x12 0xef 0xcd 0xab
155 # CHECK: movabsb %al, -6066930261531658096
156 0xa2 0x90 0x78 0x56 0x34 0x12 0xef 0xcd 0xab
158 # CHECK: movabsb %al, -6066930261531658096
159 0x48 0xa2 0x90 0x78 0x56 0x34 0x12 0xef 0xcd 0xab
161 # CHECK: movabsw %ax, -6066930261531658096
162 0x66 0xa3 0x90 0x78 0x56 0x34 0x12 0xef 0xcd 0xab
164 # CHECK: movabsl %eax, -6066930261531658096
165 0xa3 0x90 0x78 0x56 0x34 0x12 0xef 0xcd 0xab
167 # CHECK: movabsq %rax, -6066930261531658096
168 0x48 0xa3 0x90 0x78 0x56 0x34 0x12 0xef 0xcd 0xab
170 # CHECK: sha1rnds4 $1, %xmm1, %xmm2
171 0x0f 0x3a 0xcc 0xd1 0x01
173 # CHECK: sha1rnds4 $1, (%rax), %xmm2
174 0x0f 0x3a 0xcc 0x10 0x01
176 # CHECK: sha1nexte %xmm1, %xmm2
179 # CHECK: sha1nexte (%rax), %xmm2
182 # CHECK: sha1msg1 %xmm1, %xmm2
185 # CHECK: sha1msg1 (%rax), %xmm2
188 # CHECK: sha1msg2 %xmm1, %xmm2
191 # CHECK: sha1msg2 (%rax), %xmm2
194 # CHECK: sha256rnds2 %xmm0, (%rax), %xmm2
197 # CHECK: sha256rnds2 %xmm0, %xmm1, %xmm2
200 # CHECK: sha256msg1 %xmm1, %xmm2
203 # CHECK: sha256msg1 (%rax), %xmm2
206 # CHECK: sha256msg2 %xmm1, %xmm2
209 # CHECK: sha256msg2 (%rax), %xmm2
236 # CHECK: movq %xmm0, %xmm0
239 # CHECK: vmovq %xmm0, %xmm0
242 # CHECK: vmovq %xmm0, %rax
243 0xc4 0xe1 0xf9 0x7e 0xc0
245 # CHECK: movq (%rax), %mm0
248 # CHECK: movq %rax, %mm0
251 # CHECK: movq %mm0, (%rax)
254 # CHECK: movq %mm0, %rax
257 # CHECK: movq (%rax), %xmm0
258 0x66 0x48 0x0f 0x6e 0x00
260 # CHECK: movq %rax, %xmm0
261 0x66 0x48 0x0f 0x6e 0xc0
263 # CHECK: movq %xmm0, (%rax)
264 0x66 0x48 0x0f 0x7e 0x00
266 # CHECK: movq %xmm0, %rax
267 0x66 0x48 0x0f 0x7e 0xc0
269 # CHECK: pextrw $3, %xmm3, %ecx
270 0x66 0x0f 0x3a 0x15 0xd9 0x03
272 # CHECK: pextrw $3, %xmm3, (%rax)
273 0x66 0x0f 0x3a 0x15 0x18 0x03
275 # CHECK: addb $0, 305419896(,%r8)
276 0x43 0x80 0x04 0x05 0x78 0x56 0x34 0x12 0x00
278 # CHECK: addb $0, 305419896(%r13,%r8)
279 0x43 0x80 0x84 0x05 0x78 0x56 0x34 0x12 0x00
281 # CHECK: addb $0, 305419896(,%r8)
282 0x42 0x80 0x04 0x05 0x78 0x56 0x34 0x12 0x00
284 # CHECK: addb $0, 305419896(%rbp,%r8)
285 0x42 0x80 0x84 0x05 0x78 0x56 0x34 0x12 0x00
287 # CHECK: addb $0, 305419896(,%r12)
288 0x42 0x80 0x04 0x25 0x78 0x56 0x34 0x12 0x00
290 # CHECK: addb $0, 305419896(%rbp,%r12)
291 0x42 0x80 0x84 0x25 0x78 0x56 0x34 0x12 0x00
293 # CHECK: addb $0, 305419896
294 0x80 0x04 0x25 0x78 0x56 0x34 0x12 0x00
296 # CHECK: addb $0, 305419896(%rbp)
297 0x80 0x85 0x78 0x56 0x34 0x12 0x00
299 # CHECK: addb $0, 305419896(%rbp,%riz)
300 0x80 0x84 0x25 0x78 0x56 0x34 0x12 0x00
302 # CHECK: addb $0, 305419896(%rbp,%riz,2)
303 0x80 0x84 0x65 0x78 0x56 0x34 0x12 0x00
305 # CHECK: addb $0, 305419896(%rsp,%riz,2)
306 0x80 0x84 0x64 0x78 0x56 0x34 0x12 0x00
308 # CHECK: addb $0, 305419896(%r12,%riz,2)
309 0x41 0x80 0x84 0x64 0x78 0x56 0x34 0x12 0x00
311 # CHECK: addb $0, 305419896(%esp,%eiz,2)
312 0x67 0x80 0x84 0x64 0x78 0x56 0x34 0x12 0x00
314 # CHECK: addb $0, 305419896(%r12d,%eiz,2)
315 0x67 0x41 0x80 0x84 0x64 0x78 0x56 0x34 0x12 0x00
317 # CHECK: movabsq 6510615555426900570, %rax
318 0x48 0xa1 0x5a 0x5a 0x5a 0x5a 0x5a 0x5a 0x5a 0x5a
320 # CHECK: movq 1515870810, %rax
321 0x67, 0x48 0xa1 0x5a 0x5a 0x5a 0x5a
323 # CHECK: movabsq %rax, 6510615555426900570
324 0x48 0xa3 0x5a 0x5a 0x5a 0x5a 0x5a 0x5a 0x5a 0x5a
326 # CHECK: movq %rax, 1515870810
327 0x67, 0x48 0xa3 0x5a 0x5a 0x5a 0x5a
333 0x66 0x66 0x48 0xe8 0xff 0x7f
336 0xe9 0xff 0x7f 0xff 0xff
342 0x66 0x66 0x48 0xe9 0xff 0x7f
345 0x0f 0x80 0xff 0x7f 0xff 0xff
348 0x66 0x0f 0x80 0xff 0x7f
351 0x0f 0x81 0xff 0x7f 0xff 0xff
354 0x66 0x0f 0x81 0xff 0x7f
357 0x0f 0x82 0xff 0x7f 0xff 0xff
360 0x66 0x0f 0x82 0xff 0x7f
363 0x0f 0x83 0xff 0x7f 0xff 0xff
366 0x66 0x0f 0x83 0xff 0x7f
369 0x0f 0x84 0xff 0x7f 0xff 0xff
372 0x66 0x0f 0x84 0xff 0x7f
375 0x0f 0x85 0xff 0x7f 0xff 0xff
378 0x66 0x0f 0x85 0xff 0x7f
381 0x0f 0x86 0xff 0x7f 0xff 0xff
384 0x66 0x0f 0x86 0xff 0x7f
387 0x0f 0x87 0xff 0x7f 0xff 0xff
390 0x66 0x0f 0x87 0xff 0x7f
393 0x0f 0x88 0xff 0x7f 0xff 0xff
396 0x66 0x0f 0x88 0xff 0x7f
399 0x0f 0x89 0xff 0x7f 0xff 0xff
402 0x66 0x0f 0x89 0xff 0x7f
405 0x0f 0x8a 0xff 0x7f 0xff 0xff
408 0x66 0x0f 0x8a 0xff 0x7f
411 0x0f 0x8b 0xff 0x7f 0xff 0xff
414 0x66 0x0f 0x8b 0xff 0x7f
417 0x0f 0x8c 0xff 0x7f 0xff 0xff
420 0x66 0x0f 0x8c 0xff 0x7f
423 0x0f 0x8d 0xff 0x7f 0xff 0xff
426 0x66 0x0f 0x8d 0xff 0x7f
429 0x0f 0x8e 0xff 0x7f 0xff 0xff
432 0x66 0x0f 0x8e 0xff 0x7f
435 0x0f 0x8f 0xff 0x7f 0xff 0xff
438 0x66 0x0f 0x8f 0xff 0x7f
440 # CHECK: lcallw *-32769(%rip)
441 0x66 0xff 0x1d 0xff 0x7f 0xff 0xff
443 # CHECK: ljmpw *-32769(%rip)
444 0x66 0xff 0x2d 0xff 0x7f 0xff 0xff
446 # CHECK: psubsb (%rdx), %mm3
449 # CHECK: psubsb (%rdx), %xmm3
452 # CHECK: addq 255(%rip), %rbx
453 0x49, 0x03, 0x1d, 0xff, 0x00, 0x00, 0x00
455 # The following 4 encodings are equivalent, as confirmed by the 'xed64'
456 # decoder tool provided by Intel, which we assume to be canonical even
457 # if the real silicon does something different. If that should happen,
458 # then we'll all have disassembler bugs to repair.
460 # Try all combinations of EVEX.x and REX.b:
461 # CHECK: vaddps 287453952(%rip), %zmm20, %zmm15
462 0x62 0x11 0x5c 0x40 0x58 0x3d 0x00 0x33 0x22 0x11
463 # CHECK: vaddps 287453952(%rip), %zmm20, %zmm15
464 0x62 0x31 0x5c 0x40 0x58 0x3d 0x00 0x33 0x22 0x11
465 # CHECK: vaddps 287453952(%rip), %zmm20, %zmm15
466 0x62 0x51 0x5c 0x40 0x58 0x3d 0x00 0x33 0x22 0x11
467 # CHECK: vaddps 287453952(%rip), %zmm20, %zmm15
468 0x62 0x71 0x5c 0x40 0x58 0x3d 0x00 0x33 0x22 0x11
470 # CHECK: vaddps (%r10,%r9), %zmm20, %zmm15
471 0x62 0x11 0x5c 0x40 0x58 0x3c 0x0a
473 # CHECK: vaddps (%rdx,%r9), %zmm20, %zmm15
474 0x62 0x31 0x5c 0x40 0x58 0x3c 0x0a
476 # CHECK: vaddps (%r10,%rcx), %zmm20, %zmm15
477 0x62 0x51 0x5c 0x40 0x58 0x3c 0x0a
479 # CHECK: vaddps (%rdx,%rcx), %zmm20, %zmm15
480 0x62 0x71 0x5c 0x40 0x58 0x3c 0x0a
482 # CHECK: vpandd 32(%rsi,%r14,4){1to16}, %zmm26, %zmm21 {%k4} {z}
483 0x62 0xa1 0x2d 0xd4 0xdb 0x6c 0xb6 0x08
486 0xe8 0xff 0x7f 0x00 0x00
488 # CHECK: callq -32769
489 0xe8 0xff 0x7f 0xff 0xff
492 0x8f 0xe9 0xf8 0x12 0xc0
495 0x8f 0xe9 0xf8 0x12 0xc8
497 # CHECK: lwpins $305419896, %ebx, %rax
498 0x8f 0xea 0xf8 0x12 0xc3 0x78 0x56 0x34 0x12
500 # CHECK: lwpins $591751049, (%rsp), %rdx
501 0x8f 0xea 0xe8 0x12 0x04 0x24 0x89 0x67 0x45 0x23
503 # CHECK: lwpins $591751049, (%esp), %edx
504 0x67 0x8f 0xea 0x68 0x12 0x04 0x24 0x89 0x67 0x45 0x23
506 # CHECK: lwpval $1737075661, %ebx, %rax
507 0x8f 0xea 0xf8 0x12 0xcb 0xcd 0xab 0x89 0x67
509 # CHECK: lwpval $2309737967, (%rsp), %rdx
510 0x8f 0xea 0xe8 0x12 0x0c 0x24 0xef 0xcd 0xab 0x89
512 # CHECK: lwpval $2309737967, (%esp), %edx
513 0x67 0x8f 0xea 0x68 0x12 0x0c 0x24 0xef 0xcd 0xab 0x89
515 # CHECK: nopq -559038737(%rbx,%rcx,8)
516 0x48 0x0f 0x1f 0x84 0xcb 0xef 0xbe 0xad 0xde
527 # CHECK: xchgw %di, %ax
530 # CHECK: movq %rdx, %cs
533 # CHECK: movw %bx, %cs:(%rsi,%rbp)
534 0x2e 0x66 0x89 0x1c 0x2e
535 # CHECK: movl %ebx, %cs:(%esi,%ebp)
536 0x2e 0x67 0x89 0x1c 0x2e
537 # CHECK: movl %ebx, %cs:(%rsi,%rbp)
539 # CHECK: movw %bx, %cs:(%esi,%ebp)
540 0x2e 0x67 0x66 0x89 0x1c 0x2e
541 # CHECK: movw %bx, %cs:(%esi,%ebp)
542 0x2e 0x66 0x67 0x89 0x1c 0x2e
544 # CHECK: ptwritel -559038737(%rbx,%rcx,8)
545 0xf3 0x0f 0xae 0xa4 0xcb 0xef 0xbe 0xad 0xde
547 # CHECK: ptwritel %eax
550 # CHECK: ptwriteq -559038737(%rbx,%rcx,8)
551 0xf3 0x48 0x0f 0xae 0xa4 0xcb 0xef 0xbe 0xad 0xde
553 # CHECK: ptwriteq %rax
554 0xf3 0x48 0x0f 0xae 0xe0
559 # CHECK: cldemote 4(%rax)
562 # CHECK: cldemote -559038737(%rbx,%rcx,8)
563 0x0f,0x1c,0x84,0xcb,0xef,0xbe,0xad,0xde
565 # CHECK: umonitor %rax
568 # CHECK: umonitor %eax
569 0x67 0xf3 0x0f 0xae 0xf0
571 # CHECK: umonitor %r13
572 0xf3 0x41 0x0f 0xae 0xf5
575 0xf2 0x41 0x0f 0xae 0xf7
578 0x66 0x41 0x0f 0xae 0xf7
589 #CHECK: movdiri %r13d, 64(%rdx,%rax,4)
590 0x44 0x0f 0x38 0xf9 0x6c 0x82 0x40
592 #CHECK: movdir64b 485498096, %rax
593 0x66 0x0f 0x38 0xf8 0x04 0x25 0xf0 0x1c 0xf0 0x1c
595 #CHECK: movdir64b 485498096, %eax
596 0x67 0x66 0x0f 0x38 0xf8 0x04 0x25 0xf0 0x1c 0xf0 0x1c
610 # Make sure we ignore EVEX.X when the index register isn't being used.
611 #CHECK: vaddps (%rax), %xmm16, %xmm1
612 0x62 0xb1 0x7c 0x00 0x58 0x08
614 # Make sure we ignore EVEX.X when modrm.rm encodes a GPR.
615 #CHECK: vcvtusi2sd %rax, %xmm1, %xmm1
616 0x62 0xb1 0xf7 0x08 0x7b 0xc8
618 # Make sure we ignore EVEX.X when modrm.rm encodes a k-register.
619 #CHECK: vpmovm2b %k0, %xmm0
620 0x62,0xb2,0x7e,0x08,0x28,0xc0
622 # 0x67 prefix prints %eip instead of %rip
623 #CHECK: addb %al, (%eip)
624 0x67,0x00,0x05,0x00,0x00,0x00,0x00
626 # CHECK: movslq %eax, %eax
628 # CHECK: movslq %eax, %ax
630 # CHECK: movslq (%rax), %ecx
632 # CHECK: movslq (%rax), %cx
635 # CHECK: enqcmd 485498096, %eax
636 0x67,0xf2,0x0f,0x38,0xf8,0x04,0x25,0xf0,0x1c,0xf0,0x1c
638 # CHECK: enqcmd 268435456(%ebp,%r14d,8), %esi
639 0x67,0xf2,0x42,0x0f,0x38,0xf8,0xb4,0xf5,0x00,0x00,0x00,0x10
641 # CHECK: enqcmd (%r9d), %edi
642 0x67,0xf2,0x41,0x0f,0x38,0xf8,0x39
644 # CHECK: enqcmd 8128(%ecx), %eax
645 0x67,0xf2,0x0f,0x38,0xf8,0x81,0xc0,0x1f,0x00,0x00
647 # CHECK: enqcmd -8192(%edx), %ebx
648 0x67,0xf2,0x0f,0x38,0xf8,0x9a,0x00,0xe0,0xff,0xff
650 # CHECK: enqcmds 268435456(%ebp,%r14d,8), %esi
651 0x67,0xf3,0x42,0x0f,0x38,0xf8,0xb4,0xf5,0x00,0x00,0x00,0x10
653 # CHECK: enqcmds (%r9d), %edi
654 0x67,0xf3,0x41,0x0f,0x38,0xf8,0x39
656 # CHECK: enqcmds 8128(%ecx), %eax
657 0x67,0xf3,0x0f,0x38,0xf8,0x81,0xc0,0x1f,0x00,0x00
659 # CHECK: enqcmds -8192(%edx), %ebx
660 0x67,0xf3,0x0f,0x38,0xf8,0x9a,0x00,0xe0,0xff,0xff
662 # CHECK: enqcmds 485498096, %eax
663 0x67,0xf3,0x0f,0x38,0xf8,0x04,0x25,0xf0,0x1c,0xf0,0x1c
665 # CHECK: enqcmd 268435456(%rbp,%r14,8), %rsi
666 0xf2,0x42,0x0f,0x38,0xf8,0xb4,0xf5,0x00,0x00,0x00,0x10
668 # CHECK: enqcmd (%r9), %rdi
669 0xf2,0x41,0x0f,0x38,0xf8,0x39
671 # CHECK: enqcmd 8128(%rcx), %rax
672 0xf2,0x0f,0x38,0xf8,0x81,0xc0,0x1f,0x00,0x00
674 # CHECK: enqcmd -8192(%rdx), %rbx
675 0xf2,0x0f,0x38,0xf8,0x9a,0x00,0xe0,0xff,0xff
677 # CHECK: enqcmd 485498096, %rax
678 0xf2,0x0f,0x38,0xf8,0x04,0x25,0xf0,0x1c,0xf0,0x1c
680 # CHECK: enqcmds 268435456(%rbp,%r14,8), %rsi
681 0xf3,0x42,0x0f,0x38,0xf8,0xb4,0xf5,0x00,0x00,0x00,0x10
683 # CHECK: enqcmds (%r9), %rdi
684 0xf3,0x41,0x0f,0x38,0xf8,0x39
686 # CHECK: enqcmds 8128(%rcx), %rax
687 0xf3,0x0f,0x38,0xf8,0x81,0xc0,0x1f,0x00,0x00
689 # CHECK: enqcmds -8192(%rdx), %rbx
690 0xf3,0x0f,0x38,0xf8,0x9a,0x00,0xe0,0xff,0xff
692 # CHECK: enqcmds 485498096, %rax
693 0xf3,0x0f,0x38,0xf8,0x04,0x25,0xf0,0x1c,0xf0,0x1c