1*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Worker// PR7195 4*9880d681SAndroid Build Coastguard Worker// CHECK: callw 42 5*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x66,0xe8,A,A] 6*9880d681SAndroid Build Coastguard Worker callw 42 7*9880d681SAndroid Build Coastguard Worker 8*9880d681SAndroid Build Coastguard Worker// rdar://8127102 9*9880d681SAndroid Build Coastguard Worker// CHECK: movq %gs:(%rdi), %rax 10*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x65,0x48,0x8b,0x07] 11*9880d681SAndroid Build Coastguard Workermovq %gs:(%rdi), %rax 12*9880d681SAndroid Build Coastguard Worker 13*9880d681SAndroid Build Coastguard Worker// CHECK: crc32b %bl, %eax 14*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xf2,0x0f,0x38,0xf0,0xc3] 15*9880d681SAndroid Build Coastguard Worker crc32b %bl, %eax 16*9880d681SAndroid Build Coastguard Worker 17*9880d681SAndroid Build Coastguard Worker// CHECK: crc32b 4(%rbx), %eax 18*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xf2,0x0f,0x38,0xf0,0x43,0x04] 19*9880d681SAndroid Build Coastguard Worker crc32b 4(%rbx), %eax 20*9880d681SAndroid Build Coastguard Worker 21*9880d681SAndroid Build Coastguard Worker// CHECK: crc32w %bx, %eax 22*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x66,0xf2,0x0f,0x38,0xf1,0xc3] 23*9880d681SAndroid Build Coastguard Worker crc32w %bx, %eax 24*9880d681SAndroid Build Coastguard Worker 25*9880d681SAndroid Build Coastguard Worker// CHECK: crc32w 4(%rbx), %eax 26*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x66,0xf2,0x0f,0x38,0xf1,0x43,0x04] 27*9880d681SAndroid Build Coastguard Worker crc32w 4(%rbx), %eax 28*9880d681SAndroid Build Coastguard Worker 29*9880d681SAndroid Build Coastguard Worker// CHECK: crc32l %ebx, %eax 30*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0xc3] 31*9880d681SAndroid Build Coastguard Worker crc32l %ebx, %eax 32*9880d681SAndroid Build Coastguard Worker 33*9880d681SAndroid Build Coastguard Worker// CHECK: crc32l 4(%rbx), %eax 34*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x43,0x04] 35*9880d681SAndroid Build Coastguard Worker crc32l 4(%rbx), %eax 36*9880d681SAndroid Build Coastguard Worker 37*9880d681SAndroid Build Coastguard Worker// CHECK: crc32l 3735928559(%rbx,%rcx,8), %ecx 38*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x8c,0xcb,0xef,0xbe,0xad,0xde] 39*9880d681SAndroid Build Coastguard Worker crc32l 0xdeadbeef(%rbx,%rcx,8),%ecx 40*9880d681SAndroid Build Coastguard Worker 41*9880d681SAndroid Build Coastguard Worker// CHECK: crc32l 69, %ecx 42*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x0c,0x25,0x45,0x00,0x00,0x00] 43*9880d681SAndroid Build Coastguard Worker crc32l 0x45,%ecx 44*9880d681SAndroid Build Coastguard Worker 45*9880d681SAndroid Build Coastguard Worker// CHECK: crc32l 32493, %ecx 46*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x0c,0x25,0xed,0x7e,0x00,0x00] 47*9880d681SAndroid Build Coastguard Worker crc32l 0x7eed,%ecx 48*9880d681SAndroid Build Coastguard Worker 49*9880d681SAndroid Build Coastguard Worker// CHECK: crc32l 3133065982, %ecx 50*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x0c,0x25,0xfe,0xca,0xbe,0xba] 51*9880d681SAndroid Build Coastguard Worker crc32l 0xbabecafe,%ecx 52*9880d681SAndroid Build Coastguard Worker 53*9880d681SAndroid Build Coastguard Worker// CHECK: crc32l %ecx, %ecx 54*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0xc9] 55*9880d681SAndroid Build Coastguard Worker crc32l %ecx,%ecx 56*9880d681SAndroid Build Coastguard Worker 57*9880d681SAndroid Build Coastguard Worker// CHECK: crc32b %r11b, %eax 58*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xf2,0x41,0x0f,0x38,0xf0,0xc3] 59*9880d681SAndroid Build Coastguard Worker crc32b %r11b, %eax 60*9880d681SAndroid Build Coastguard Worker 61*9880d681SAndroid Build Coastguard Worker// CHECK: crc32b 4(%rbx), %eax 62*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xf2,0x0f,0x38,0xf0,0x43,0x04] 63*9880d681SAndroid Build Coastguard Worker crc32b 4(%rbx), %eax 64*9880d681SAndroid Build Coastguard Worker 65*9880d681SAndroid Build Coastguard Worker// CHECK: crc32b %dil, %rax 66*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf0,0xc7] 67*9880d681SAndroid Build Coastguard Worker crc32b %dil,%rax 68*9880d681SAndroid Build Coastguard Worker 69*9880d681SAndroid Build Coastguard Worker// CHECK: crc32b %r11b, %rax 70*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xf2,0x49,0x0f,0x38,0xf0,0xc3] 71*9880d681SAndroid Build Coastguard Worker crc32b %r11b,%rax 72*9880d681SAndroid Build Coastguard Worker 73*9880d681SAndroid Build Coastguard Worker// CHECK: crc32b 4(%rbx), %rax 74*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf0,0x43,0x04] 75*9880d681SAndroid Build Coastguard Worker crc32b 4(%rbx), %rax 76*9880d681SAndroid Build Coastguard Worker 77*9880d681SAndroid Build Coastguard Worker// CHECK: crc32q %rbx, %rax 78*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf1,0xc3] 79*9880d681SAndroid Build Coastguard Worker crc32q %rbx, %rax 80*9880d681SAndroid Build Coastguard Worker 81*9880d681SAndroid Build Coastguard Worker// CHECK: crc32q 4(%rbx), %rax 82*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf1,0x43,0x04] 83*9880d681SAndroid Build Coastguard Worker crc32q 4(%rbx), %rax 84*9880d681SAndroid Build Coastguard Worker 85*9880d681SAndroid Build Coastguard Worker// CHECK: movd %r8, %mm1 86*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x49,0x0f,0x6e,0xc8] 87*9880d681SAndroid Build Coastguard Workermovd %r8, %mm1 88*9880d681SAndroid Build Coastguard Worker 89*9880d681SAndroid Build Coastguard Worker// CHECK: movd %r8d, %mm1 90*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x41,0x0f,0x6e,0xc8] 91*9880d681SAndroid Build Coastguard Workermovd %r8d, %mm1 92*9880d681SAndroid Build Coastguard Worker 93*9880d681SAndroid Build Coastguard Worker// CHECK: movd %rdx, %mm1 94*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x48,0x0f,0x6e,0xca] 95*9880d681SAndroid Build Coastguard Workermovd %rdx, %mm1 96*9880d681SAndroid Build Coastguard Worker 97*9880d681SAndroid Build Coastguard Worker// CHECK: movd %edx, %mm1 98*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x6e,0xca] 99*9880d681SAndroid Build Coastguard Workermovd %edx, %mm1 100*9880d681SAndroid Build Coastguard Worker 101*9880d681SAndroid Build Coastguard Worker// CHECK: movd %mm1, %r8 102*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x49,0x0f,0x7e,0xc8] 103*9880d681SAndroid Build Coastguard Workermovd %mm1, %r8 104*9880d681SAndroid Build Coastguard Worker 105*9880d681SAndroid Build Coastguard Worker// CHECK: movd %mm1, %r8d 106*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x41,0x0f,0x7e,0xc8] 107*9880d681SAndroid Build Coastguard Workermovd %mm1, %r8d 108*9880d681SAndroid Build Coastguard Worker 109*9880d681SAndroid Build Coastguard Worker// CHECK: movd %mm1, %rdx 110*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x48,0x0f,0x7e,0xca] 111*9880d681SAndroid Build Coastguard Workermovd %mm1, %rdx 112*9880d681SAndroid Build Coastguard Worker 113*9880d681SAndroid Build Coastguard Worker// CHECK: movd %mm1, %edx 114*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x7e,0xca] 115*9880d681SAndroid Build Coastguard Workermovd %mm1, %edx 116*9880d681SAndroid Build Coastguard Worker 117*9880d681SAndroid Build Coastguard Worker// rdar://7840289 118*9880d681SAndroid Build Coastguard Worker// CHECK: pshufb CPI1_0(%rip), %xmm1 119*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x66,0x0f,0x38,0x00,0x0d,A,A,A,A] 120*9880d681SAndroid Build Coastguard Worker// CHECK: fixup A - offset: 5, value: CPI1_0-4 121*9880d681SAndroid Build Coastguard Workerpshufb CPI1_0(%rip), %xmm1 122*9880d681SAndroid Build Coastguard Worker 123*9880d681SAndroid Build Coastguard Worker// CHECK: sha1rnds4 $1, %xmm1, %xmm2 124*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x3a,0xcc,0xd1,0x01] 125*9880d681SAndroid Build Coastguard Workersha1rnds4 $1, %xmm1, %xmm2 126*9880d681SAndroid Build Coastguard Worker 127*9880d681SAndroid Build Coastguard Worker// CHECK: sha1rnds4 $1, (%rax), %xmm2 128*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x3a,0xcc,0x10,0x01] 129*9880d681SAndroid Build Coastguard Workersha1rnds4 $1, (%rax), %xmm2 130*9880d681SAndroid Build Coastguard Worker 131*9880d681SAndroid Build Coastguard Worker// CHECK: sha1nexte %xmm1, %xmm2 132*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x38,0xc8,0xd1] 133*9880d681SAndroid Build Coastguard Workersha1nexte %xmm1, %xmm2 134*9880d681SAndroid Build Coastguard Worker 135*9880d681SAndroid Build Coastguard Worker// CHECK: sha1msg1 %xmm1, %xmm2 136*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x38,0xc9,0xd1] 137*9880d681SAndroid Build Coastguard Workersha1msg1 %xmm1, %xmm2 138*9880d681SAndroid Build Coastguard Worker 139*9880d681SAndroid Build Coastguard Worker// CHECK: sha1msg1 (%rax), %xmm2 140*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x38,0xc9,0x10] 141*9880d681SAndroid Build Coastguard Workersha1msg1 (%rax), %xmm2 142*9880d681SAndroid Build Coastguard Worker 143*9880d681SAndroid Build Coastguard Worker// CHECK: sha1msg2 %xmm1, %xmm2 144*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x38,0xca,0xd1] 145*9880d681SAndroid Build Coastguard Workersha1msg2 %xmm1, %xmm2 146*9880d681SAndroid Build Coastguard Worker 147*9880d681SAndroid Build Coastguard Worker// CHECK: sha1msg2 (%rax), %xmm2 148*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x38,0xca,0x10] 149*9880d681SAndroid Build Coastguard Workersha1msg2 (%rax), %xmm2 150*9880d681SAndroid Build Coastguard Worker 151*9880d681SAndroid Build Coastguard Worker// CHECK: sha256rnds2 (%rax), %xmm2 152*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x38,0xcb,0x10] 153*9880d681SAndroid Build Coastguard Workersha256rnds2 (%rax), %xmm2 154*9880d681SAndroid Build Coastguard Worker 155*9880d681SAndroid Build Coastguard Worker// CHECK: sha256rnds2 %xmm1, %xmm2 156*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x38,0xcb,0xd1] 157*9880d681SAndroid Build Coastguard Workersha256rnds2 %xmm1, %xmm2 158*9880d681SAndroid Build Coastguard Worker 159*9880d681SAndroid Build Coastguard Worker// CHECK: sha256rnds2 (%rax), %xmm2 160*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x38,0xcb,0x10] 161*9880d681SAndroid Build Coastguard Workersha256rnds2 %xmm0, (%rax), %xmm2 162*9880d681SAndroid Build Coastguard Worker 163*9880d681SAndroid Build Coastguard Worker// CHECK: sha256rnds2 %xmm1, %xmm2 164*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x38,0xcb,0xd1] 165*9880d681SAndroid Build Coastguard Workersha256rnds2 %xmm0, %xmm1, %xmm2 166*9880d681SAndroid Build Coastguard Worker 167*9880d681SAndroid Build Coastguard Worker// CHECK: sha256msg1 %xmm1, %xmm2 168*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x38,0xcc,0xd1] 169*9880d681SAndroid Build Coastguard Workersha256msg1 %xmm1, %xmm2 170*9880d681SAndroid Build Coastguard Worker 171*9880d681SAndroid Build Coastguard Worker// CHECK: sha256msg1 (%rax), %xmm2 172*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x38,0xcc,0x10] 173*9880d681SAndroid Build Coastguard Workersha256msg1 (%rax), %xmm2 174*9880d681SAndroid Build Coastguard Worker 175*9880d681SAndroid Build Coastguard Worker// CHECK: sha256msg2 %xmm1, %xmm2 176*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x38,0xcd,0xd1] 177*9880d681SAndroid Build Coastguard Workersha256msg2 %xmm1, %xmm2 178*9880d681SAndroid Build Coastguard Worker 179*9880d681SAndroid Build Coastguard Worker// CHECK: sha256msg2 (%rax), %xmm2 180*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x0f,0x38,0xcd,0x10] 181*9880d681SAndroid Build Coastguard Workersha256msg2 (%rax), %xmm2 182*9880d681SAndroid Build Coastguard Worker 183*9880d681SAndroid Build Coastguard Worker// CHECK: movq 57005(,%riz), %rbx 184*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x48,0x8b,0x1c,0x25,0xad,0xde,0x00,0x00] 185*9880d681SAndroid Build Coastguard Worker movq 57005(,%riz), %rbx 186*9880d681SAndroid Build Coastguard Worker 187*9880d681SAndroid Build Coastguard Worker// CHECK: movq 48879(,%riz), %rax 188*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x48,0x8b,0x04,0x25,0xef,0xbe,0x00,0x00] 189*9880d681SAndroid Build Coastguard Worker movq 48879(,%riz), %rax 190*9880d681SAndroid Build Coastguard Worker 191*9880d681SAndroid Build Coastguard Worker// CHECK: movq -4(,%riz,8), %rax 192*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x48,0x8b,0x04,0xe5,0xfc,0xff,0xff,0xff] 193*9880d681SAndroid Build Coastguard Worker movq -4(,%riz,8), %rax 194*9880d681SAndroid Build Coastguard Worker 195*9880d681SAndroid Build Coastguard Worker// CHECK: movq (%rcx,%riz), %rax 196*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x48,0x8b,0x04,0x21] 197*9880d681SAndroid Build Coastguard Worker movq (%rcx,%riz), %rax 198*9880d681SAndroid Build Coastguard Worker 199*9880d681SAndroid Build Coastguard Worker// CHECK: movq (%rcx,%riz,8), %rax 200*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x48,0x8b,0x04,0xe1] 201*9880d681SAndroid Build Coastguard Worker movq (%rcx,%riz,8), %rax 202*9880d681SAndroid Build Coastguard Worker 203*9880d681SAndroid Build Coastguard Worker// CHECK: fxsave64 (%rax) 204*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x48,0x0f,0xae,0x00] 205*9880d681SAndroid Build Coastguard Worker fxsaveq (%rax) 206*9880d681SAndroid Build Coastguard Worker 207*9880d681SAndroid Build Coastguard Worker// CHECK: fxsave64 (%rax) 208*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x48,0x0f,0xae,0x00] 209*9880d681SAndroid Build Coastguard Worker fxsave64 (%rax) 210*9880d681SAndroid Build Coastguard Worker 211*9880d681SAndroid Build Coastguard Worker// CHECK: fxrstor64 (%rax) 212*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x48,0x0f,0xae,0x08] 213*9880d681SAndroid Build Coastguard Worker fxrstorq (%rax) 214*9880d681SAndroid Build Coastguard Worker 215*9880d681SAndroid Build Coastguard Worker// CHECK: fxrstor64 (%rax) 216*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x48,0x0f,0xae,0x08] 217*9880d681SAndroid Build Coastguard Worker fxrstor64 (%rax) 218*9880d681SAndroid Build Coastguard Worker 219*9880d681SAndroid Build Coastguard Worker// CHECK: leave 220*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xc9] 221*9880d681SAndroid Build Coastguard Worker leave 222*9880d681SAndroid Build Coastguard Worker 223*9880d681SAndroid Build Coastguard Worker// CHECK: leave 224*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xc9] 225*9880d681SAndroid Build Coastguard Worker leaveq 226*9880d681SAndroid Build Coastguard Worker 227*9880d681SAndroid Build Coastguard Worker// CHECK: flds (%edi) 228*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x67,0xd9,0x07] 229*9880d681SAndroid Build Coastguard Worker flds (%edi) 230*9880d681SAndroid Build Coastguard Worker 231*9880d681SAndroid Build Coastguard Worker// CHECK: filds (%edi) 232*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x67,0xdf,0x07] 233*9880d681SAndroid Build Coastguard Worker filds (%edi) 234*9880d681SAndroid Build Coastguard Worker 235*9880d681SAndroid Build Coastguard Worker// CHECK: flds (%rdi) 236*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xd9,0x07] 237*9880d681SAndroid Build Coastguard Worker flds (%rdi) 238*9880d681SAndroid Build Coastguard Worker 239*9880d681SAndroid Build Coastguard Worker// CHECK: filds (%rdi) 240*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0xdf,0x07] 241*9880d681SAndroid Build Coastguard Worker filds (%rdi) 242*9880d681SAndroid Build Coastguard Worker 243*9880d681SAndroid Build Coastguard Worker// CHECK: pmovmskb %xmm5, %ecx 244*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x66,0x0f,0xd7,0xcd] 245*9880d681SAndroid Build Coastguard Worker pmovmskb %xmm5,%rcx 246*9880d681SAndroid Build Coastguard Worker 247*9880d681SAndroid Build Coastguard Worker// CHECK: pinsrw $3, %ecx, %xmm5 248*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x66,0x0f,0xc4,0xe9,0x03] 249*9880d681SAndroid Build Coastguard Worker pinsrw $3, %ecx, %xmm5 250*9880d681SAndroid Build Coastguard Worker 251*9880d681SAndroid Build Coastguard Worker// CHECK: pinsrw $3, %ecx, %xmm5 252*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x66,0x0f,0xc4,0xe9,0x03] 253*9880d681SAndroid Build Coastguard Worker pinsrw $3, %rcx, %xmm5 254