1 # RUN: llvm-mc --disassemble %s -triple=x86_64-apple-darwin9 -mcpu=knl | FileCheck %s
2 # RUN: llvm-mc --disassemble %s -triple=x86_64-apple-darwin9 -mcpu=skx | FileCheck --check-prefix=CHECK-SKX %s
3 # RUN: llvm-mc --disassemble %s -triple=x86_64-apple-darwin9 -mattr=+avx512vpopcntdq | FileCheck %s --check-prefix=AVX512VPOPCNTDQ
5 # CHECK: vpbroadcastd %xmm18, %zmm28 {%k7} {z}
6 0x62 0x22 0x7d 0xcf 0x58 0xe2
8 # CHECK: vbroadcastss (%rsp), %zmm28
9 0x62 0x62 0x7d 0x48 0x18 0x24 0x24
11 # CHECK: vblendmpd (%rsi), %zmm2, %zmm8 {%k7}
12 0x62 0x72 0xed 0x4f 0x65 0x06
14 # CHECK: vpermpd (%rsi,%r10,4), %zmm2, %zmm8
15 0x62 0x32 0xed 0x48 0x16 0x04 0x96
17 # CHECK: vpbroadcastmw2d %k2, %zmm8
18 0x62 0x72 0x7e 0x48 0x3a 0xc2
20 # CHECK-SKX: vpbroadcastmw2d %k2, %xmm8
21 0x62 0x72 0x7e 0x08 0x3a 0xc2
23 # CHECK-SKX: vpbroadcastmw2d %k2, %ymm8
24 0x62 0x72 0x7e 0x28 0x3a 0xc2
26 # CHECK: vpbroadcastq (%r9,%rax), %zmm28
27 0x62 0x42 0xfd 0x48 0x59 0x24 0x01
29 # CHECK: vbroadcastss %xmm0, %zmm1
30 0x62 0xf2 0x7d 0x48 0x18 0xc8
32 # CHECK: vextracti32x4 $4, %zmm0, (%r10)
33 0x62 0xd3 0x7d 0x48 0x39 0x02 0x04
35 # CHECK: vextracti32x4 $4, %zmm0, %xmm1
36 0x62 0xf3 0x7d 0x48 0x39 0xc1 0x04
38 # CHECK: vinserti32x4 $1, %xmm21, %zmm5, %zmm17
39 0x62 0xa3 0x55 0x48 0x38 0xcd 0x01
41 # CHECK: vmovaps %zmm21, %zmm5 {%k3}
42 0x62 0xb1 0x7c 0x4b 0x28 0xed
44 # CHECK: vgatherdps (%rsi,%zmm0,4), %zmm1 {%k2}
45 0x62 0xf2 0x7d 0x4a 0x92 0x0c 0x86
47 # CHECK: vgatherdpd (%rsi,%ymm0,4), %zmm1 {%k2}
48 0x62 0xf2 0xfd 0x4a 0x92 0x0c 0x86
50 # CHECK: vgatherqps (%r13,%zmm4), %ymm5 {%k2}
51 0x62 0xd2 0x7d 0x4a 0x93 0x6c 0x25 0x00
53 # CHECK: vpslld $16, %zmm21, %zmm22
54 0x62 0xb1 0x4d 0x40 0x72 0xf5 0x10
56 # CHECK: vpord %zmm22, %zmm21, %zmm23
57 0x62 0xa1 0x55 0x40 0xeb 0xfe
59 #####################################################
61 #####################################################
63 # CHECK: kshiftlw $3, %k1, %k2
64 0xc4 0xe3 0xf9 0x32 0xd1 0x03
66 # CHECK: kmovw (%rdi), %k1
69 # CHECK: kmovw %k1, %eax
72 # CHECK: kandw %k1, %k2, %k3
75 # CHECK: kmovw %k5, %k1
78 #####################################################
79 # COMPRESSED DISPLACEMENT #
80 #####################################################
83 # CHECK: vmovdqu32 %zmm0, -448(%rcx)
84 0x62 0xf1 0x7e 0x48 0x7f 0x41 0xf9
86 # TupleType = T1S, 64-bit eltsize
87 # CHECK: vaddsd 256(%rdx), %xmm0, %xmm16
88 0x62 0xe1 0xff 0x08 0x58 0x42 0x20
90 # TupleType = T1S, 32-bit eltsize
91 # CHECK: vaddss 256(%rdx), %xmm0, %xmm16
92 0x62 0xe1 0x7e 0x08 0x58 0x42 0x40
95 # CHECK: vaddpd 256(%rdx), %zmm0, %zmm16
96 0x62 0xe1 0xfd 0x48 0x58 0x42 0x04
98 # TupleType = FV, broadcast, 64-bit eltsize
99 # CHECK: vaddpd 256(%rdx){1to8}, %zmm0, %zmm16
100 0x62 0xe1 0xfd 0x58 0x58 0x42 0x20
102 # TupleType = FV, broadcast, 32-bit eltsize
103 # CHECK: vaddps 256(%rdx){1to16}, %zmm0, %zmm16
104 0x62 0xe1 0x7c 0x58 0x58 0x42 0x40
107 # CHECK: vbroadcasti32x4 256(%rdx), %zmm16
108 0x62 0xe2 0x7d 0x48 0x5a 0x42 0x10
110 # Cases where we can't use cdisp8
111 # CHECK: vaddss 255(%rdx), %xmm0, %xmm16
112 0x62 0xe1 0x7e 0x08 0x58 0x82 0xff 0x00 0x00 0x00
114 # CHECK: vaddss 1024(%rdx), %xmm0, %xmm16
115 0x62 0xe1 0x7e 0x08 0x58 0x82 0x00 0x04 0x00 0x00
117 # CHECK: vpcmpeqd %zmm10, %zmm25, %k5
118 0x62 0xd3 0x35 0x40 0x1f 0xea 0x0
120 # CHECK: vpcmpltd %zmm10, %zmm25, %k5
121 0x62 0xd3 0x35 0x40 0x1f 0xea 0x1
123 # CHECK: vpcmpled %zmm10, %zmm25, %k5
124 0x62 0xd3 0x35 0x40 0x1f 0xea 0x2
126 # CHECK: vpcmpd $3, %zmm10, %zmm25, %k5
127 0x62 0xd3 0x35 0x40 0x1f 0xea 0x3
129 # CHECK: vpcmpneqd %zmm10, %zmm25, %k5
130 0x62 0xd3 0x35 0x40 0x1f 0xea 0x4
132 # CHECK: vpcmpnltd %zmm10, %zmm25, %k5
133 0x62 0xd3 0x35 0x40 0x1f 0xea 0x5
135 # CHECK: vpcmpnled %zmm10, %zmm25, %k5
136 0x62 0xd3 0x35 0x40 0x1f 0xea 0x6
138 # CHECK: vpcmpd $7, %zmm10, %zmm25, %k5
139 0x62 0xd3 0x35 0x40 0x1f 0xea 0x7
141 # CHECK: vpcmpd $8, %zmm10, %zmm25, %k5
142 0x62 0xd3 0x35 0x40 0x1f 0xea 0x8
144 # CHECK: vcmppd $127, {sae}, %zmm27, %zmm11, %k4
145 0x62 0x91 0xa5 0x58 0xc2 0xe3 0x7f
147 # CHECK: vcmpsd $204, (%rax), %xmm4, %k5
148 0x62 0xf1 0xdf 0x8 0xc2 0x28 0xcc
150 # CHECK: vcmpss $204, (%rax), %xmm4, %k5
151 0x62 0xf1 0x5e 0x08 0xc2 0x28 0xcc
153 # CHECK: vcmpsd $204, %xmm3, %xmm4, %k5
154 0x62 0xf1 0xdf 0x08 0xc2 0xeb 0xcc
156 # CHECK: vcmpss $204, %xmm3, %xmm4, %k5
157 0x62 0xf1 0x5e 0x08 0xc2 0xeb 0xcc
159 # CHECK: vcmpsd $204, {sae}, %xmm3, %xmm4, %k5
160 0x62 0xf1 0xdf 0x18 0xc2 0xeb 0xcc
162 # CHECK: vcmpss $204, {sae}, %xmm3, %xmm4, %k5
163 0x62 0xf1 0x5e 0x18 0xc2 0xeb 0xcc
165 # CHECK: vcmppd $127, %ymm27, %ymm11, %k4
166 0x62 0x91 0xa5 0x28 0xc2 0xe3 0x7f
168 # CHECK: vcmpps $127, %ymm27, %ymm11, %k4
169 0x62 0x91 0x24 0x28 0xc2 0xe3 0x7f
171 # CHECK: vcmppd $127, %xmm27, %xmm11, %k4
172 0x62 0x91 0xa5 0x08 0xc2 0xe3 0x7f
174 # CHECK: vcmpps $127, %xmm27, %xmm11, %k4
175 0x62 0x91 0x24 0x08 0xc2 0xe3 0x7f
177 # CHECK: vpgatherdd 256(%r9,%xmm31), %xmm17 {%k1}
178 0x62 0x82 0x7d 0x01 0x90 0x4c 0x39 0x40
180 # CHECK: vpgatherdd 256(%r9,%ymm31), %ymm19 {%k1}
181 0x62 0x82 0x7d 0x21 0x90 0x5c 0x39 0x40
183 # CHECK: vpgatherdq 256(%r9,%xmm31), %xmm17 {%k1}
184 0x62 0x82 0xfd 0x01 0x90 0x4c 0x39 0x20
186 # CHECK: vpgatherdq 256(%r9,%xmm31), %ymm26 {%k1}
187 0x62 0x02 0xfd 0x21 0x90 0x54 0x39 0x20
189 # CHECK: vpgatherqd 256(%r9,%xmm31), %xmm21 {%k1}
190 0x62 0x82 0x7d 0x01 0x91 0x6c 0x39 0x40
192 # CHECK: vpgatherqd 256(%r9,%ymm31), %xmm25 {%k1}
193 0x62 0x02 0x7d 0x21 0x91 0x4c 0x39 0x40
195 # CHECK: vpgatherqq 256(%r9,%xmm31), %xmm18 {%k1}
196 0x62 0x82 0xfd 0x01 0x91 0x54 0x39 0x20
198 # CHECK: vpgatherqq 256(%r9,%ymm31), %ymm19 {%k1}
199 0x62 0x82 0xfd 0x21 0x91 0x5c 0x39 0x20
201 # CHECK: vgatherdpd 256(%r9,%xmm31), %xmm17 {%k1}
202 0x62 0x82 0xfd 0x01 0x92 0x4c 0x39 0x20
204 # CHECK: vgatherdpd 256(%r9,%xmm31), %ymm23 {%k1}
205 0x62 0x82 0xfd 0x21 0x92 0x7c 0x39 0x20
207 # CHECK: vgatherdps 256(%r9,%xmm31), %xmm18 {%k1}
208 0x62 0x82 0x7d 0x01 0x92 0x54 0x39 0x40
210 # CHECK: vgatherdps 256(%r9,%ymm31), %ymm27 {%k1}
211 0x62 0x02 0x7d 0x21 0x92 0x5c 0x39 0x40
213 # CHECK: vgatherqpd 256(%r9,%xmm31), %xmm17 {%k1}
214 0x62 0x82 0xfd 0x01 0x93 0x4c 0x39 0x20
216 # CHECK: vgatherqpd 256(%r9,%ymm31), %ymm29 {%k1}
217 0x62 0x02 0xfd 0x21 0x93 0x6c 0x39 0x20
219 # CHECK: vgatherqps 256(%r9,%xmm31), %xmm21 {%k1}
220 0x62 0x82 0x7d 0x01 0x93 0x6c 0x39 0x40
222 # CHECK: vgatherqps 256(%r9,%ymm31), %xmm19 {%k1}
223 0x62 0x82 0x7d 0x21 0x93 0x5c 0x39 0x40
225 # CHECK: vpscatterdd %xmm20, 256(%r9,%xmm31) {%k1}
226 0x62 0x82 0x7d 0x01 0xa0 0x64 0x39 0x40
228 # CHECK: vpscatterdd %ymm28, 256(%r9,%ymm31) {%k1}
229 0x62 0x02 0x7d 0x21 0xa0 0x64 0x39 0x40
231 # CHECK: vpscatterdq %xmm21, 256(%r9,%xmm31) {%k1}
232 0x62 0x82 0xfd 0x01 0xa0 0x6c 0x39 0x20
234 # CHECK: vpscatterdq %ymm28, 256(%r9,%xmm31) {%k1}
235 0x62 0x02 0xfd 0x21 0xa0 0x64 0x39 0x20
237 # CHECK: vpscatterqd %xmm22, 256(%r9,%xmm31) {%k1}
238 0x62 0x82 0x7d 0x01 0xa1 0x74 0x39 0x40
240 # CHECK: vpscatterqd %xmm24, 256(%r9,%ymm31) {%k1}
241 0x62 0x02 0x7d 0x21 0xa1 0x44 0x39 0x40
243 # CHECK: vpscatterqq %xmm28, 256(%r9,%xmm31) {%k1}
244 0x62 0x02 0xfd 0x01 0xa1 0x64 0x39 0x20
246 # CHECK: vpscatterqq %ymm19, 256(%r9,%ymm31) {%k1}
247 0x62 0x82 0xfd 0x21 0xa1 0x5c 0x39 0x20
249 # CHECK: vscatterdps %xmm20, 256(%r9,%xmm31) {%k1}
250 0x62 0x82 0x7d 0x01 0xa2 0x64 0x39 0x40
252 # CHECK: vscatterdps %ymm28, 256(%r9,%ymm31) {%k1}
253 0x62 0x02 0x7d 0x21 0xa2 0x64 0x39 0x40
255 # CHECK: vscatterdpd %xmm21, 256(%r9,%xmm31) {%k1}
256 0x62 0x82 0xfd 0x01 0xa2 0x6c 0x39 0x20
258 # CHECK: vscatterdpd %ymm28, 256(%r9,%xmm31) {%k1}
259 0x62 0x02 0xfd 0x21 0xa2 0x64 0x39 0x20
261 # CHECK: vscatterqps %xmm22, 256(%r9,%xmm31) {%k1}
262 0x62 0x82 0x7d 0x01 0xa3 0x74 0x39 0x40
264 # CHECK: vscatterqps %xmm24, 256(%r9,%ymm31) {%k1}
265 0x62 0x02 0x7d 0x21 0xa3 0x44 0x39 0x40
267 # CHECK: vscatterqpd %xmm28, 256(%r9,%xmm31) {%k1}
268 0x62 0x02 0xfd 0x01 0xa3 0x64 0x39 0x20
270 # CHECK: vscatterqpd %ymm19, 256(%r9,%ymm31) {%k1}
271 0x62 0x82 0xfd 0x21 0xa3 0x5c 0x39 0x20
273 #####################################################
275 #####################################################
277 # AVX512VPOPCNTDQ: vpopcntd %zmm21, %zmm26 {%k4}
278 0x62 0x22 0x7d 0x4c 0x55 0xd5
280 # AVX512VPOPCNTDQ: vpopcntd %zmm21, %zmm26 {%k4} {z}
281 0x62 0x22 0x7d 0xcc 0x55 0xd5
283 # AVX512VPOPCNTDQ: vpopcntd (%rcx), %zmm26
284 0x62 0x62 0x7d 0x48 0x55 0x11
286 # AVX512VPOPCNTDQ: vpopcntq %zmm21, %zmm17 {%k6}
287 0x62 0xa2 0xfd 0x4e 0x55 0xcd
289 # AVX512VPOPCNTDQ: vpopcntq %zmm21, %zmm17 {%k6} {z}
290 0x62 0xa2 0xfd 0xce 0x55 0xcd
292 # AVX512VPOPCNTDQ: vpopcntq (%rcx), %zmm17
293 0x62 0xe2 0xfd 0x48 0x55 0x09
295 #####################################################
297 #####################################################
299 # CHECK: vcomisd {sae}, %xmm2, %xmm1
300 0x62 0xf1 0xfd 0x18 0x2f 0xca
302 # Same as above but ignore EVEX L'L bits.
303 # CHECK: vcomisd {sae}, %xmm2, %xmm1
304 0x62 0xf1 0xfd 0x78 0x2f 0xca
306 # CHECK: vminpd {sae}, %zmm2, %zmm17, %zmm19
307 0x62 0xe1 0xf5 0x10 0x5d 0xda
309 # Ignore EVEX L'L bits.
310 # CHECK: vminpd {sae}, %zmm2, %zmm17, %zmm19
311 0x62 0xe1 0xf5 0x30 0x5d 0xda
313 # Ignore EVEX L'L bits.
314 # CHECK: vminpd {sae}, %zmm2, %zmm17, %zmm19
315 0x62 0xe1 0xf5 0x50 0x5d 0xda
317 # Ignore EVEX L'L bits.
318 # CHECK: vminpd {sae}, %zmm2, %zmm17, %zmm19
319 0x62 0xe1 0xf5 0x70 0x5d 0xda
321 # CHECK: vcmppd $127, {sae}, %zmm27, %zmm11, %k4
322 0x62 0x91 0xa5 0x18 0xc2 0xe3 0x7f
324 # CHECK: vrsqrt28pd {sae}, %zmm2, %zmm17
325 0x62 0xe2 0xfd 0x18 0xcc 0xca
327 #####################################################
329 #####################################################
331 # Verify all rounding modes work.
333 # CHECK: vaddps {rn-sae}, %zmm2, %zmm17, %zmm19
334 0x62 0xe1 0x74 0x10 0x58 0xda
336 # CHECK: vaddps {rd-sae}, %zmm2, %zmm17, %zmm19
337 0x62 0xe1 0x74 0x30 0x58 0xda
339 # CHECK: vaddps {ru-sae}, %zmm2, %zmm17, %zmm19
340 0x62 0xe1 0x74 0x50 0x58 0xda
342 # CHECK: vaddps {rz-sae}, %zmm2, %zmm17, %zmm19
343 0x62 0xe1 0x74 0x70 0x58 0xda
345 # CHECK: vmulss {rn-sae}, %xmm2, %xmm17, %xmm19
346 0x62 0xe1 0x76 0x10 0x59 0xda
348 # CHECK: vmulss {rd-sae}, %xmm2, %xmm17, %xmm19
349 0x62 0xe1 0x76 0x30 0x59 0xda
351 # CHECK: vmulss {ru-sae}, %xmm2, %xmm17, %xmm19
352 0x62 0xe1 0x76 0x50 0x59 0xda
354 # CHECK: vmulss {rz-sae}, %xmm2, %xmm17, %xmm19
355 0x62 0xe1 0x76 0x70 0x59 0xda
357 # CHECK: vscalefpd {rn-sae}, %zmm2, %zmm17, %zmm19
358 0x62 0xe2 0xf5 0x10 0x2c 0xda
360 # CHECK: vscalefpd {rd-sae}, %zmm2, %zmm17, %zmm19
361 0x62 0xe2 0xf5 0x30 0x2c 0xda
363 # CHECK: vscalefpd {ru-sae}, %zmm2, %zmm17, %zmm19
364 0x62 0xe2 0xf5 0x50 0x2c 0xda
366 # CHECK: vscalefpd {rz-sae}, %zmm2, %zmm17, %zmm19
367 0x62 0xe2 0xf5 0x70 0x2c 0xda
369 # CHECK: vcvtqq2ps {rd-sae}, %zmm2, %ymm17
370 0x62 0xe1 0xfc 0x38 0x5b 0xca
372 # CHECK: vsqrtpd {rd-sae}, %zmm2, %zmm17
373 0x62 0xe1 0xfd 0x38 0x51 0xca