1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512dq --show-mc-encoding | FileCheck %s --check-prefixes=CHECK,X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512dq --show-mc-encoding | FileCheck %s --check-prefixes=CHECK,X64
5 declare <2 x double> @llvm.x86.avx512.mask.vextractf64x2.512(<8 x double>, i32, <2 x double>, i8)
7 define <2 x double>@test_int_x86_avx512_vextractf64x2_512(<8 x double> %x0, <2 x double> %x2) {
8 ; CHECK-LABEL: test_int_x86_avx512_vextractf64x2_512:
10 ; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0 # encoding: [0xc4,0xe3,0x7d,0x19,0xc0,0x01]
11 ; CHECK-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
12 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
13 %res = call <2 x double> @llvm.x86.avx512.mask.vextractf64x2.512(<8 x double> %x0,i32 1, <2 x double> zeroinitializer, i8 -1)
17 define <2 x double>@test_int_x86_avx512_mask_vextractf64x2_512(<8 x double> %x0, <2 x double> %x2, i8 %x3) {
18 ; X86-LABEL: test_int_x86_avx512_mask_vextractf64x2_512:
20 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x04]
21 ; X86-NEXT: vextractf64x2 $1, %zmm0, %xmm1 {%k1} # encoding: [0x62,0xf3,0xfd,0x49,0x19,0xc1,0x01]
22 ; X86-NEXT: vmovapd %xmm1, %xmm0 # encoding: [0xc5,0xf9,0x28,0xc1]
23 ; X86-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
24 ; X86-NEXT: retl # encoding: [0xc3]
26 ; X64-LABEL: test_int_x86_avx512_mask_vextractf64x2_512:
28 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
29 ; X64-NEXT: vextractf64x2 $1, %zmm0, %xmm1 {%k1} # encoding: [0x62,0xf3,0xfd,0x49,0x19,0xc1,0x01]
30 ; X64-NEXT: vmovapd %xmm1, %xmm0 # encoding: [0xc5,0xf9,0x28,0xc1]
31 ; X64-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
32 ; X64-NEXT: retq # encoding: [0xc3]
33 %res = call <2 x double> @llvm.x86.avx512.mask.vextractf64x2.512(<8 x double> %x0,i32 1, <2 x double> %x2, i8 %x3)
37 define <2 x double>@test_int_x86_avx512_maskz_vextractf64x2_512(<8 x double> %x0, i8 %x3) {
38 ; X86-LABEL: test_int_x86_avx512_maskz_vextractf64x2_512:
40 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x04]
41 ; X86-NEXT: vextractf64x2 $1, %zmm0, %xmm0 {%k1} {z} # encoding: [0x62,0xf3,0xfd,0xc9,0x19,0xc0,0x01]
42 ; X86-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
43 ; X86-NEXT: retl # encoding: [0xc3]
45 ; X64-LABEL: test_int_x86_avx512_maskz_vextractf64x2_512:
47 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
48 ; X64-NEXT: vextractf64x2 $1, %zmm0, %xmm0 {%k1} {z} # encoding: [0x62,0xf3,0xfd,0xc9,0x19,0xc0,0x01]
49 ; X64-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
50 ; X64-NEXT: retq # encoding: [0xc3]
51 %res = call <2 x double> @llvm.x86.avx512.mask.vextractf64x2.512(<8 x double> %x0,i32 1, <2 x double> zeroinitializer, i8 %x3)
55 declare <8 x float> @llvm.x86.avx512.mask.vextractf32x8.512(<16 x float>, i32, <8 x float>, i8)
57 define <8 x float>@test_int_x86_avx512_vextractf32x8(<16 x float> %x0, <8 x float> %x2) {
58 ; CHECK-LABEL: test_int_x86_avx512_vextractf32x8:
60 ; CHECK-NEXT: vextractf64x4 $1, %zmm0, %ymm0 # encoding: [0x62,0xf3,0xfd,0x48,0x1b,0xc0,0x01]
61 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
62 %res = call <8 x float> @llvm.x86.avx512.mask.vextractf32x8.512(<16 x float> %x0,i32 1, <8 x float> zeroinitializer, i8 -1)
66 define <8 x float>@test_int_x86_avx512_mask_vextractf32x8(<16 x float> %x0, <8 x float> %x2, i8 %x3) {
67 ; X86-LABEL: test_int_x86_avx512_mask_vextractf32x8:
69 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x04]
70 ; X86-NEXT: vextractf32x8 $1, %zmm0, %ymm1 {%k1} # encoding: [0x62,0xf3,0x7d,0x49,0x1b,0xc1,0x01]
71 ; X86-NEXT: vmovaps %ymm1, %ymm0 # encoding: [0xc5,0xfc,0x28,0xc1]
72 ; X86-NEXT: retl # encoding: [0xc3]
74 ; X64-LABEL: test_int_x86_avx512_mask_vextractf32x8:
76 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
77 ; X64-NEXT: vextractf32x8 $1, %zmm0, %ymm1 {%k1} # encoding: [0x62,0xf3,0x7d,0x49,0x1b,0xc1,0x01]
78 ; X64-NEXT: vmovaps %ymm1, %ymm0 # encoding: [0xc5,0xfc,0x28,0xc1]
79 ; X64-NEXT: retq # encoding: [0xc3]
80 %res = call <8 x float> @llvm.x86.avx512.mask.vextractf32x8.512(<16 x float> %x0,i32 1, <8 x float> %x2, i8 %x3)
84 define <8 x float>@test_int_x86_avx512_maskz_vextractf32x8(<16 x float> %x0, i8 %x3) {
85 ; X86-LABEL: test_int_x86_avx512_maskz_vextractf32x8:
87 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x04]
88 ; X86-NEXT: vextractf32x8 $1, %zmm0, %ymm0 {%k1} {z} # encoding: [0x62,0xf3,0x7d,0xc9,0x1b,0xc0,0x01]
89 ; X86-NEXT: retl # encoding: [0xc3]
91 ; X64-LABEL: test_int_x86_avx512_maskz_vextractf32x8:
93 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
94 ; X64-NEXT: vextractf32x8 $1, %zmm0, %ymm0 {%k1} {z} # encoding: [0x62,0xf3,0x7d,0xc9,0x1b,0xc0,0x01]
95 ; X64-NEXT: retq # encoding: [0xc3]
96 %res = call <8 x float> @llvm.x86.avx512.mask.vextractf32x8.512(<16 x float> %x0,i32 1, <8 x float> zeroinitializer, i8 %x3)
100 declare <16 x float> @llvm.x86.avx512.mask.insertf32x8.512(<16 x float>, <8 x float>, i32, <16 x float>, i16)
102 define <16 x float>@test_int_x86_avx512_insertf32x8_512(<16 x float> %x0, <8 x float> %x1, <16 x float> %x3) {
103 ; CHECK-LABEL: test_int_x86_avx512_insertf32x8_512:
105 ; CHECK-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 # encoding: [0x62,0xf3,0xfd,0x48,0x1a,0xc1,0x01]
106 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
107 %res = call <16 x float> @llvm.x86.avx512.mask.insertf32x8.512(<16 x float> %x0, <8 x float> %x1, i32 1, <16 x float> %x3, i16 -1)
108 ret <16 x float> %res
111 define <16 x float>@test_int_x86_avx512_mask_insertf32x8_512(<16 x float> %x0, <8 x float> %x1, <16 x float> %x3, i16 %x4) {
112 ; X86-LABEL: test_int_x86_avx512_mask_insertf32x8_512:
114 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf8,0x90,0x4c,0x24,0x04]
115 ; X86-NEXT: vinsertf32x8 $1, %ymm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf3,0x7d,0x49,0x1a,0xd1,0x01]
116 ; X86-NEXT: vmovaps %zmm2, %zmm0 # encoding: [0x62,0xf1,0x7c,0x48,0x28,0xc2]
117 ; X86-NEXT: retl # encoding: [0xc3]
119 ; X64-LABEL: test_int_x86_avx512_mask_insertf32x8_512:
121 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
122 ; X64-NEXT: vinsertf32x8 $1, %ymm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf3,0x7d,0x49,0x1a,0xd1,0x01]
123 ; X64-NEXT: vmovaps %zmm2, %zmm0 # encoding: [0x62,0xf1,0x7c,0x48,0x28,0xc2]
124 ; X64-NEXT: retq # encoding: [0xc3]
125 %res = call <16 x float> @llvm.x86.avx512.mask.insertf32x8.512(<16 x float> %x0, <8 x float> %x1, i32 1, <16 x float> %x3, i16 %x4)
126 ret <16 x float> %res
129 define <16 x float>@test_int_x86_avx512_maskz_insertf32x8_512(<16 x float> %x0, <8 x float> %x1, i16 %x4) {
130 ; X86-LABEL: test_int_x86_avx512_maskz_insertf32x8_512:
132 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf8,0x90,0x4c,0x24,0x04]
133 ; X86-NEXT: vinsertf32x8 $1, %ymm1, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf3,0x7d,0xc9,0x1a,0xc1,0x01]
134 ; X86-NEXT: retl # encoding: [0xc3]
136 ; X64-LABEL: test_int_x86_avx512_maskz_insertf32x8_512:
138 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
139 ; X64-NEXT: vinsertf32x8 $1, %ymm1, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf3,0x7d,0xc9,0x1a,0xc1,0x01]
140 ; X64-NEXT: retq # encoding: [0xc3]
141 %res = call <16 x float> @llvm.x86.avx512.mask.insertf32x8.512(<16 x float> %x0, <8 x float> %x1, i32 1, <16 x float> zeroinitializer, i16 %x4)
142 ret <16 x float> %res
145 declare <8 x double> @llvm.x86.avx512.mask.insertf64x2.512(<8 x double>, <2 x double>, i32, <8 x double>, i8)
147 define <8 x double>@test_int_x86_avx512_insertf64x2_512(<8 x double> %x0, <2 x double> %x1,<8 x double> %x3) {
148 ; CHECK-LABEL: test_int_x86_avx512_insertf64x2_512:
150 ; CHECK-NEXT: vinsertf32x4 $1, %xmm1, %zmm0, %zmm0 # encoding: [0x62,0xf3,0x7d,0x48,0x18,0xc1,0x01]
151 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
152 %res = call <8 x double> @llvm.x86.avx512.mask.insertf64x2.512(<8 x double> %x0, <2 x double> %x1, i32 1, <8 x double> %x3, i8 -1)
153 ret <8 x double> %res
156 define <8 x double>@test_int_x86_avx512_mask_insertf64x2_512(<8 x double> %x0, <2 x double> %x1,<8 x double> %x3, i8 %x4) {
157 ; X86-LABEL: test_int_x86_avx512_mask_insertf64x2_512:
159 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x04]
160 ; X86-NEXT: vinsertf64x2 $1, %xmm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf3,0xfd,0x49,0x18,0xd1,0x01]
161 ; X86-NEXT: vmovapd %zmm2, %zmm0 # encoding: [0x62,0xf1,0xfd,0x48,0x28,0xc2]
162 ; X86-NEXT: retl # encoding: [0xc3]
164 ; X64-LABEL: test_int_x86_avx512_mask_insertf64x2_512:
166 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
167 ; X64-NEXT: vinsertf64x2 $1, %xmm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf3,0xfd,0x49,0x18,0xd1,0x01]
168 ; X64-NEXT: vmovapd %zmm2, %zmm0 # encoding: [0x62,0xf1,0xfd,0x48,0x28,0xc2]
169 ; X64-NEXT: retq # encoding: [0xc3]
170 %res = call <8 x double> @llvm.x86.avx512.mask.insertf64x2.512(<8 x double> %x0, <2 x double> %x1, i32 1, <8 x double> %x3, i8 %x4)
171 ret <8 x double> %res
174 define <8 x double>@test_int_x86_avx512_maskz_insertf64x2_512(<8 x double> %x0, <2 x double> %x1, i8 %x4) {
175 ; X86-LABEL: test_int_x86_avx512_maskz_insertf64x2_512:
177 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x04]
178 ; X86-NEXT: vinsertf64x2 $1, %xmm1, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf3,0xfd,0xc9,0x18,0xc1,0x01]
179 ; X86-NEXT: retl # encoding: [0xc3]
181 ; X64-LABEL: test_int_x86_avx512_maskz_insertf64x2_512:
183 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
184 ; X64-NEXT: vinsertf64x2 $1, %xmm1, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf3,0xfd,0xc9,0x18,0xc1,0x01]
185 ; X64-NEXT: retq # encoding: [0xc3]
186 %res = call <8 x double> @llvm.x86.avx512.mask.insertf64x2.512(<8 x double> %x0, <2 x double> %x1, i32 1, <8 x double> zeroinitializer, i8 %x4)
187 ret <8 x double> %res
190 declare <16 x i32> @llvm.x86.avx512.mask.inserti32x8.512(<16 x i32>, <8 x i32>, i32, <16 x i32>, i16)
192 define <16 x i32>@test_int_x86_avx512_inserti32x8_512(<16 x i32> %x0, <8 x i32> %x1, <16 x i32> %x3) {
193 ; CHECK-LABEL: test_int_x86_avx512_inserti32x8_512:
195 ; CHECK-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 # encoding: [0x62,0xf3,0xfd,0x48,0x1a,0xc1,0x01]
196 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
197 %res = call <16 x i32> @llvm.x86.avx512.mask.inserti32x8.512(<16 x i32> %x0, <8 x i32> %x1, i32 1, <16 x i32> %x3, i16 -1)
201 define <16 x i32>@test_int_x86_avx512_mask_inserti32x8_512(<16 x i32> %x0, <8 x i32> %x1, <16 x i32> %x3, i16 %x4) {
202 ; X86-LABEL: test_int_x86_avx512_mask_inserti32x8_512:
204 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf8,0x90,0x4c,0x24,0x04]
205 ; X86-NEXT: vinserti32x8 $1, %ymm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf3,0x7d,0x49,0x3a,0xd1,0x01]
206 ; X86-NEXT: vmovdqa64 %zmm2, %zmm0 # encoding: [0x62,0xf1,0xfd,0x48,0x6f,0xc2]
207 ; X86-NEXT: retl # encoding: [0xc3]
209 ; X64-LABEL: test_int_x86_avx512_mask_inserti32x8_512:
211 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
212 ; X64-NEXT: vinserti32x8 $1, %ymm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf3,0x7d,0x49,0x3a,0xd1,0x01]
213 ; X64-NEXT: vmovdqa64 %zmm2, %zmm0 # encoding: [0x62,0xf1,0xfd,0x48,0x6f,0xc2]
214 ; X64-NEXT: retq # encoding: [0xc3]
215 %res = call <16 x i32> @llvm.x86.avx512.mask.inserti32x8.512(<16 x i32> %x0, <8 x i32> %x1, i32 1, <16 x i32> %x3, i16 %x4)
219 define <16 x i32>@test_int_x86_avx512_maskz_inserti32x8_512(<16 x i32> %x0, <8 x i32> %x1, i16 %x4) {
220 ; X86-LABEL: test_int_x86_avx512_maskz_inserti32x8_512:
222 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf8,0x90,0x4c,0x24,0x04]
223 ; X86-NEXT: vinserti32x8 $1, %ymm1, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf3,0x7d,0xc9,0x3a,0xc1,0x01]
224 ; X86-NEXT: retl # encoding: [0xc3]
226 ; X64-LABEL: test_int_x86_avx512_maskz_inserti32x8_512:
228 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
229 ; X64-NEXT: vinserti32x8 $1, %ymm1, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf3,0x7d,0xc9,0x3a,0xc1,0x01]
230 ; X64-NEXT: retq # encoding: [0xc3]
231 %res = call <16 x i32> @llvm.x86.avx512.mask.inserti32x8.512(<16 x i32> %x0, <8 x i32> %x1, i32 1, <16 x i32> zeroinitializer, i16 %x4)
235 declare <8 x i64> @llvm.x86.avx512.mask.inserti64x2.512(<8 x i64>, <2 x i64>, i32, <8 x i64>, i8)
237 define <8 x i64>@test_int_x86_avx512_inserti64x2_512(<8 x i64> %x0, <2 x i64> %x1, <8 x i64> %x3) {
238 ; CHECK-LABEL: test_int_x86_avx512_inserti64x2_512:
240 ; CHECK-NEXT: vinsertf32x4 $1, %xmm1, %zmm0, %zmm0 # encoding: [0x62,0xf3,0x7d,0x48,0x18,0xc1,0x01]
241 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
242 %res = call <8 x i64> @llvm.x86.avx512.mask.inserti64x2.512(<8 x i64> %x0, <2 x i64> %x1, i32 1, <8 x i64> %x3, i8 -1)
246 define <8 x i64>@test_int_x86_avx512_mask_inserti64x2_512(<8 x i64> %x0, <2 x i64> %x1, <8 x i64> %x3, i8 %x4) {
247 ; X86-LABEL: test_int_x86_avx512_mask_inserti64x2_512:
249 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x04]
250 ; X86-NEXT: vinserti64x2 $1, %xmm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf3,0xfd,0x49,0x38,0xd1,0x01]
251 ; X86-NEXT: vmovdqa64 %zmm2, %zmm0 # encoding: [0x62,0xf1,0xfd,0x48,0x6f,0xc2]
252 ; X86-NEXT: retl # encoding: [0xc3]
254 ; X64-LABEL: test_int_x86_avx512_mask_inserti64x2_512:
256 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
257 ; X64-NEXT: vinserti64x2 $1, %xmm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf3,0xfd,0x49,0x38,0xd1,0x01]
258 ; X64-NEXT: vmovdqa64 %zmm2, %zmm0 # encoding: [0x62,0xf1,0xfd,0x48,0x6f,0xc2]
259 ; X64-NEXT: retq # encoding: [0xc3]
260 %res = call <8 x i64> @llvm.x86.avx512.mask.inserti64x2.512(<8 x i64> %x0, <2 x i64> %x1, i32 1, <8 x i64> %x3, i8 %x4)
264 define <8 x i64>@test_int_x86_avx512_maskz_inserti64x2_512(<8 x i64> %x0, <2 x i64> %x1, i8 %x4) {
265 ; X86-LABEL: test_int_x86_avx512_maskz_inserti64x2_512:
267 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x04]
268 ; X86-NEXT: vinserti64x2 $1, %xmm1, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf3,0xfd,0xc9,0x38,0xc1,0x01]
269 ; X86-NEXT: retl # encoding: [0xc3]
271 ; X64-LABEL: test_int_x86_avx512_maskz_inserti64x2_512:
273 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
274 ; X64-NEXT: vinserti64x2 $1, %xmm1, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf3,0xfd,0xc9,0x38,0xc1,0x01]
275 ; X64-NEXT: retq # encoding: [0xc3]
276 %res = call <8 x i64> @llvm.x86.avx512.mask.inserti64x2.512(<8 x i64> %x0, <2 x i64> %x1, i32 1, <8 x i64> zeroinitializer, i8 %x4)
281 declare <16 x i32> @llvm.x86.avx512.cvtmask2d.512(i16)
283 define <16 x i32>@test_int_x86_avx512_cvtmask2d_512(i16 %x0) {
284 ; X86-LABEL: test_int_x86_avx512_cvtmask2d_512:
286 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k0 # encoding: [0xc5,0xf8,0x90,0x44,0x24,0x04]
287 ; X86-NEXT: vpmovm2d %k0, %zmm0 # encoding: [0x62,0xf2,0x7e,0x48,0x38,0xc0]
288 ; X86-NEXT: retl # encoding: [0xc3]
290 ; X64-LABEL: test_int_x86_avx512_cvtmask2d_512:
292 ; X64-NEXT: kmovw %edi, %k0 # encoding: [0xc5,0xf8,0x92,0xc7]
293 ; X64-NEXT: vpmovm2d %k0, %zmm0 # encoding: [0x62,0xf2,0x7e,0x48,0x38,0xc0]
294 ; X64-NEXT: retq # encoding: [0xc3]
295 %res = call <16 x i32> @llvm.x86.avx512.cvtmask2d.512(i16 %x0)
299 declare <8 x i64> @llvm.x86.avx512.cvtmask2q.512(i8)
301 define <8 x i64>@test_int_x86_avx512_cvtmask2q_512(i8 %x0) {
302 ; X86-LABEL: test_int_x86_avx512_cvtmask2q_512:
304 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k0 # encoding: [0xc5,0xf9,0x90,0x44,0x24,0x04]
305 ; X86-NEXT: vpmovm2q %k0, %zmm0 # encoding: [0x62,0xf2,0xfe,0x48,0x38,0xc0]
306 ; X86-NEXT: retl # encoding: [0xc3]
308 ; X64-LABEL: test_int_x86_avx512_cvtmask2q_512:
310 ; X64-NEXT: kmovw %edi, %k0 # encoding: [0xc5,0xf8,0x92,0xc7]
311 ; X64-NEXT: vpmovm2q %k0, %zmm0 # encoding: [0x62,0xf2,0xfe,0x48,0x38,0xc0]
312 ; X64-NEXT: retq # encoding: [0xc3]
313 %res = call <8 x i64> @llvm.x86.avx512.cvtmask2q.512(i8 %x0)
317 declare <16 x float> @llvm.x86.avx512.mask.broadcastf32x8.512(<8 x float>, <16 x float>, i16)
319 define <16 x float>@test_int_x86_avx512_broadcastf32x8_512(<8 x float> %x0, <16 x float> %x2) {
320 ; CHECK-LABEL: test_int_x86_avx512_broadcastf32x8_512:
322 ; CHECK-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
323 ; CHECK-NEXT: vinsertf64x4 $1, %ymm0, %zmm0, %zmm0 # encoding: [0x62,0xf3,0xfd,0x48,0x1a,0xc0,0x01]
324 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
326 %res = call <16 x float> @llvm.x86.avx512.mask.broadcastf32x8.512(<8 x float> %x0, <16 x float> %x2, i16 -1)
327 ret <16 x float> %res
330 define <16 x float>@test_int_x86_avx512_mask_broadcastf32x8_512(<8 x float> %x0, <16 x float> %x2, i16 %mask) {
331 ; X86-LABEL: test_int_x86_avx512_mask_broadcastf32x8_512:
333 ; X86-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
334 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf8,0x90,0x4c,0x24,0x04]
335 ; X86-NEXT: vinsertf32x8 $1, %ymm0, %zmm0, %zmm1 {%k1} # encoding: [0x62,0xf3,0x7d,0x49,0x1a,0xc8,0x01]
336 ; X86-NEXT: vmovaps %zmm1, %zmm0 # encoding: [0x62,0xf1,0x7c,0x48,0x28,0xc1]
337 ; X86-NEXT: retl # encoding: [0xc3]
339 ; X64-LABEL: test_int_x86_avx512_mask_broadcastf32x8_512:
341 ; X64-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
342 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
343 ; X64-NEXT: vinsertf32x8 $1, %ymm0, %zmm0, %zmm1 {%k1} # encoding: [0x62,0xf3,0x7d,0x49,0x1a,0xc8,0x01]
344 ; X64-NEXT: vmovaps %zmm1, %zmm0 # encoding: [0x62,0xf1,0x7c,0x48,0x28,0xc1]
345 ; X64-NEXT: retq # encoding: [0xc3]
347 %res = call <16 x float> @llvm.x86.avx512.mask.broadcastf32x8.512(<8 x float> %x0, <16 x float> %x2, i16 %mask)
348 ret <16 x float> %res
351 define <16 x float>@test_int_x86_avx512_maskz_broadcastf32x8_512(<8 x float> %x0, i16 %mask) {
352 ; X86-LABEL: test_int_x86_avx512_maskz_broadcastf32x8_512:
354 ; X86-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
355 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf8,0x90,0x4c,0x24,0x04]
356 ; X86-NEXT: vinsertf32x8 $1, %ymm0, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf3,0x7d,0xc9,0x1a,0xc0,0x01]
357 ; X86-NEXT: retl # encoding: [0xc3]
359 ; X64-LABEL: test_int_x86_avx512_maskz_broadcastf32x8_512:
361 ; X64-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
362 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
363 ; X64-NEXT: vinsertf32x8 $1, %ymm0, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf3,0x7d,0xc9,0x1a,0xc0,0x01]
364 ; X64-NEXT: retq # encoding: [0xc3]
366 %res = call <16 x float> @llvm.x86.avx512.mask.broadcastf32x8.512(<8 x float> %x0, <16 x float> zeroinitializer, i16 %mask)
367 ret <16 x float> %res
370 define <16 x float>@test_int_x86_avx512_mask_broadcastf32x8_512_load(ptr %x0ptr, <16 x float> %x2, i16 %mask) {
371 ; X86-LABEL: test_int_x86_avx512_mask_broadcastf32x8_512_load:
373 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
374 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf8,0x90,0x4c,0x24,0x08]
375 ; X86-NEXT: vbroadcastf32x8 (%eax), %zmm0 {%k1} # encoding: [0x62,0xf2,0x7d,0x49,0x1b,0x00]
376 ; X86-NEXT: # zmm0 {%k1} = mem[0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7]
377 ; X86-NEXT: retl # encoding: [0xc3]
379 ; X64-LABEL: test_int_x86_avx512_mask_broadcastf32x8_512_load:
381 ; X64-NEXT: kmovw %esi, %k1 # encoding: [0xc5,0xf8,0x92,0xce]
382 ; X64-NEXT: vbroadcastf32x8 (%rdi), %zmm0 {%k1} # encoding: [0x62,0xf2,0x7d,0x49,0x1b,0x07]
383 ; X64-NEXT: # zmm0 {%k1} = mem[0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7]
384 ; X64-NEXT: retq # encoding: [0xc3]
386 %x0 = load <8 x float>, ptr %x0ptr
387 %res = call <16 x float> @llvm.x86.avx512.mask.broadcastf32x8.512(<8 x float> %x0, <16 x float> %x2, i16 %mask)
388 ret <16 x float> %res
391 declare <8 x double> @llvm.x86.avx512.mask.broadcastf64x2.512(<2 x double>, <8 x double>, i8)
393 define <8 x double>@test_int_x86_avx512_broadcastf64x2_512(<2 x double> %x0, <8 x double> %x2) {
394 ; CHECK-LABEL: test_int_x86_avx512_broadcastf64x2_512:
396 ; CHECK-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
397 ; CHECK-NEXT: vshuff64x2 $0, %zmm0, %zmm0, %zmm0 # encoding: [0x62,0xf3,0xfd,0x48,0x23,0xc0,0x00]
398 ; CHECK-NEXT: # zmm0 = zmm0[0,1,0,1,0,1,0,1]
399 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
401 %res = call <8 x double> @llvm.x86.avx512.mask.broadcastf64x2.512(<2 x double> %x0, <8 x double> %x2, i8 -1)
402 ret <8 x double> %res
405 define <8 x double>@test_int_x86_avx512_mask_broadcastf64x2_512(<2 x double> %x0, <8 x double> %x2, i8 %mask) {
406 ; X86-LABEL: test_int_x86_avx512_mask_broadcastf64x2_512:
408 ; X86-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
409 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x04]
410 ; X86-NEXT: vshuff64x2 $0, %zmm0, %zmm0, %zmm1 {%k1} # encoding: [0x62,0xf3,0xfd,0x49,0x23,0xc8,0x00]
411 ; X86-NEXT: # zmm1 {%k1} = zmm0[0,1,0,1,0,1,0,1]
412 ; X86-NEXT: vmovapd %zmm1, %zmm0 # encoding: [0x62,0xf1,0xfd,0x48,0x28,0xc1]
413 ; X86-NEXT: retl # encoding: [0xc3]
415 ; X64-LABEL: test_int_x86_avx512_mask_broadcastf64x2_512:
417 ; X64-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
418 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
419 ; X64-NEXT: vshuff64x2 $0, %zmm0, %zmm0, %zmm1 {%k1} # encoding: [0x62,0xf3,0xfd,0x49,0x23,0xc8,0x00]
420 ; X64-NEXT: # zmm1 {%k1} = zmm0[0,1,0,1,0,1,0,1]
421 ; X64-NEXT: vmovapd %zmm1, %zmm0 # encoding: [0x62,0xf1,0xfd,0x48,0x28,0xc1]
422 ; X64-NEXT: retq # encoding: [0xc3]
424 %res = call <8 x double> @llvm.x86.avx512.mask.broadcastf64x2.512(<2 x double> %x0, <8 x double> %x2, i8 %mask)
425 ret <8 x double> %res
428 define <8 x double>@test_int_x86_avx512_maskz_broadcastf64x2_512(<2 x double> %x0, i8 %mask) {
429 ; X86-LABEL: test_int_x86_avx512_maskz_broadcastf64x2_512:
431 ; X86-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
432 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x04]
433 ; X86-NEXT: vshuff64x2 $0, %zmm0, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf3,0xfd,0xc9,0x23,0xc0,0x00]
434 ; X86-NEXT: # zmm0 {%k1} {z} = zmm0[0,1,0,1,0,1,0,1]
435 ; X86-NEXT: retl # encoding: [0xc3]
437 ; X64-LABEL: test_int_x86_avx512_maskz_broadcastf64x2_512:
439 ; X64-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
440 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
441 ; X64-NEXT: vshuff64x2 $0, %zmm0, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf3,0xfd,0xc9,0x23,0xc0,0x00]
442 ; X64-NEXT: # zmm0 {%k1} {z} = zmm0[0,1,0,1,0,1,0,1]
443 ; X64-NEXT: retq # encoding: [0xc3]
445 %res = call <8 x double> @llvm.x86.avx512.mask.broadcastf64x2.512(<2 x double> %x0, <8 x double> zeroinitializer, i8 %mask)
446 ret <8 x double> %res
449 define <8 x double>@test_int_x86_avx512_mask_broadcastf64x2_512_load(ptr %x0ptr, <8 x double> %x2, i8 %mask) {
450 ; X86-LABEL: test_int_x86_avx512_mask_broadcastf64x2_512_load:
452 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
453 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x08]
454 ; X86-NEXT: vbroadcastf64x2 (%eax), %zmm0 {%k1} # encoding: [0x62,0xf2,0xfd,0x49,0x1a,0x00]
455 ; X86-NEXT: # zmm0 {%k1} = mem[0,1,0,1,0,1,0,1]
456 ; X86-NEXT: retl # encoding: [0xc3]
458 ; X64-LABEL: test_int_x86_avx512_mask_broadcastf64x2_512_load:
460 ; X64-NEXT: kmovw %esi, %k1 # encoding: [0xc5,0xf8,0x92,0xce]
461 ; X64-NEXT: vbroadcastf64x2 (%rdi), %zmm0 {%k1} # encoding: [0x62,0xf2,0xfd,0x49,0x1a,0x07]
462 ; X64-NEXT: # zmm0 {%k1} = mem[0,1,0,1,0,1,0,1]
463 ; X64-NEXT: retq # encoding: [0xc3]
465 %x0 = load <2 x double>, ptr %x0ptr
466 %res = call <8 x double> @llvm.x86.avx512.mask.broadcastf64x2.512(<2 x double> %x0, <8 x double> %x2, i8 %mask)
467 ret <8 x double> %res
470 declare <16 x i32> @llvm.x86.avx512.mask.broadcasti32x8.512(<8 x i32>, <16 x i32>, i16)
472 define <16 x i32>@test_int_x86_avx512_broadcasti32x8_512(<8 x i32> %x0, <16 x i32> %x2) {
473 ; CHECK-LABEL: test_int_x86_avx512_broadcasti32x8_512:
475 ; CHECK-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
476 ; CHECK-NEXT: vinsertf64x4 $1, %ymm0, %zmm0, %zmm0 # encoding: [0x62,0xf3,0xfd,0x48,0x1a,0xc0,0x01]
477 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
479 %res = call <16 x i32> @llvm.x86.avx512.mask.broadcasti32x8.512(<8 x i32> %x0, <16 x i32> %x2, i16 -1)
483 define <16 x i32>@test_int_x86_avx512_mask_broadcasti32x8_512(<8 x i32> %x0, <16 x i32> %x2, i16 %mask) {
484 ; X86-LABEL: test_int_x86_avx512_mask_broadcasti32x8_512:
486 ; X86-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
487 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf8,0x90,0x4c,0x24,0x04]
488 ; X86-NEXT: vinserti32x8 $1, %ymm0, %zmm0, %zmm1 {%k1} # encoding: [0x62,0xf3,0x7d,0x49,0x3a,0xc8,0x01]
489 ; X86-NEXT: vmovdqa64 %zmm1, %zmm0 # encoding: [0x62,0xf1,0xfd,0x48,0x6f,0xc1]
490 ; X86-NEXT: retl # encoding: [0xc3]
492 ; X64-LABEL: test_int_x86_avx512_mask_broadcasti32x8_512:
494 ; X64-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
495 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
496 ; X64-NEXT: vinserti32x8 $1, %ymm0, %zmm0, %zmm1 {%k1} # encoding: [0x62,0xf3,0x7d,0x49,0x3a,0xc8,0x01]
497 ; X64-NEXT: vmovdqa64 %zmm1, %zmm0 # encoding: [0x62,0xf1,0xfd,0x48,0x6f,0xc1]
498 ; X64-NEXT: retq # encoding: [0xc3]
500 %res = call <16 x i32> @llvm.x86.avx512.mask.broadcasti32x8.512(<8 x i32> %x0, <16 x i32> %x2, i16 %mask)
504 define <16 x i32>@test_int_x86_avx512_maskz_broadcasti32x8_512(<8 x i32> %x0, i16 %mask) {
505 ; X86-LABEL: test_int_x86_avx512_maskz_broadcasti32x8_512:
507 ; X86-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
508 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf8,0x90,0x4c,0x24,0x04]
509 ; X86-NEXT: vinserti32x8 $1, %ymm0, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf3,0x7d,0xc9,0x3a,0xc0,0x01]
510 ; X86-NEXT: retl # encoding: [0xc3]
512 ; X64-LABEL: test_int_x86_avx512_maskz_broadcasti32x8_512:
514 ; X64-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
515 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
516 ; X64-NEXT: vinserti32x8 $1, %ymm0, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf3,0x7d,0xc9,0x3a,0xc0,0x01]
517 ; X64-NEXT: retq # encoding: [0xc3]
519 %res = call <16 x i32> @llvm.x86.avx512.mask.broadcasti32x8.512(<8 x i32> %x0, <16 x i32> zeroinitializer, i16 %mask)
523 define <16 x i32>@test_int_x86_avx512_mask_broadcasti32x8_512_load(ptr %x0ptr, <16 x i32> %x2, i16 %mask) {
524 ; X86-LABEL: test_int_x86_avx512_mask_broadcasti32x8_512_load:
526 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
527 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf8,0x90,0x4c,0x24,0x08]
528 ; X86-NEXT: vbroadcasti32x8 (%eax), %zmm0 {%k1} # encoding: [0x62,0xf2,0x7d,0x49,0x5b,0x00]
529 ; X86-NEXT: # zmm0 {%k1} = mem[0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7]
530 ; X86-NEXT: retl # encoding: [0xc3]
532 ; X64-LABEL: test_int_x86_avx512_mask_broadcasti32x8_512_load:
534 ; X64-NEXT: kmovw %esi, %k1 # encoding: [0xc5,0xf8,0x92,0xce]
535 ; X64-NEXT: vbroadcasti32x8 (%rdi), %zmm0 {%k1} # encoding: [0x62,0xf2,0x7d,0x49,0x5b,0x07]
536 ; X64-NEXT: # zmm0 {%k1} = mem[0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7]
537 ; X64-NEXT: retq # encoding: [0xc3]
539 %x0 = load <8 x i32>, ptr %x0ptr
540 %res = call <16 x i32> @llvm.x86.avx512.mask.broadcasti32x8.512(<8 x i32> %x0, <16 x i32> %x2, i16 %mask)
544 declare <8 x i64> @llvm.x86.avx512.mask.broadcasti64x2.512(<2 x i64>, <8 x i64>, i8)
546 define <8 x i64>@test_int_x86_avx512_broadcasti64x2_512(<2 x i64> %x0, <8 x i64> %x2) {
547 ; CHECK-LABEL: test_int_x86_avx512_broadcasti64x2_512:
549 ; CHECK-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
550 ; CHECK-NEXT: vshufi64x2 $0, %zmm0, %zmm0, %zmm0 # encoding: [0x62,0xf3,0xfd,0x48,0x43,0xc0,0x00]
551 ; CHECK-NEXT: # zmm0 = zmm0[0,1,0,1,0,1,0,1]
552 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
554 %res = call <8 x i64> @llvm.x86.avx512.mask.broadcasti64x2.512(<2 x i64> %x0, <8 x i64> %x2, i8 -1)
558 define <8 x i64>@test_int_x86_avx512_mask_broadcasti64x2_512(<2 x i64> %x0, <8 x i64> %x2, i8 %mask) {
559 ; X86-LABEL: test_int_x86_avx512_mask_broadcasti64x2_512:
561 ; X86-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
562 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x04]
563 ; X86-NEXT: vshufi64x2 $0, %zmm0, %zmm0, %zmm1 {%k1} # encoding: [0x62,0xf3,0xfd,0x49,0x43,0xc8,0x00]
564 ; X86-NEXT: # zmm1 {%k1} = zmm0[0,1,0,1,0,1,0,1]
565 ; X86-NEXT: vmovdqa64 %zmm1, %zmm0 # encoding: [0x62,0xf1,0xfd,0x48,0x6f,0xc1]
566 ; X86-NEXT: retl # encoding: [0xc3]
568 ; X64-LABEL: test_int_x86_avx512_mask_broadcasti64x2_512:
570 ; X64-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
571 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
572 ; X64-NEXT: vshufi64x2 $0, %zmm0, %zmm0, %zmm1 {%k1} # encoding: [0x62,0xf3,0xfd,0x49,0x43,0xc8,0x00]
573 ; X64-NEXT: # zmm1 {%k1} = zmm0[0,1,0,1,0,1,0,1]
574 ; X64-NEXT: vmovdqa64 %zmm1, %zmm0 # encoding: [0x62,0xf1,0xfd,0x48,0x6f,0xc1]
575 ; X64-NEXT: retq # encoding: [0xc3]
577 %res = call <8 x i64> @llvm.x86.avx512.mask.broadcasti64x2.512(<2 x i64> %x0, <8 x i64> %x2, i8 %mask)
581 define <8 x i64>@test_int_x86_avx512_maskz_broadcasti64x2_512(<2 x i64> %x0, i8 %mask) {
582 ; X86-LABEL: test_int_x86_avx512_maskz_broadcasti64x2_512:
584 ; X86-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
585 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x04]
586 ; X86-NEXT: vshufi64x2 $0, %zmm0, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf3,0xfd,0xc9,0x43,0xc0,0x00]
587 ; X86-NEXT: # zmm0 {%k1} {z} = zmm0[0,1,0,1,0,1,0,1]
588 ; X86-NEXT: retl # encoding: [0xc3]
590 ; X64-LABEL: test_int_x86_avx512_maskz_broadcasti64x2_512:
592 ; X64-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
593 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
594 ; X64-NEXT: vshufi64x2 $0, %zmm0, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf3,0xfd,0xc9,0x43,0xc0,0x00]
595 ; X64-NEXT: # zmm0 {%k1} {z} = zmm0[0,1,0,1,0,1,0,1]
596 ; X64-NEXT: retq # encoding: [0xc3]
598 %res = call <8 x i64> @llvm.x86.avx512.mask.broadcasti64x2.512(<2 x i64> %x0, <8 x i64> zeroinitializer, i8 %mask)
602 define <8 x i64>@test_int_x86_avx512_mask_broadcasti64x2_512_load(ptr %x0ptr, <8 x i64> %x2, i8 %mask) {
603 ; X86-LABEL: test_int_x86_avx512_mask_broadcasti64x2_512_load:
605 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
606 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x08]
607 ; X86-NEXT: vbroadcasti64x2 (%eax), %zmm0 {%k1} # encoding: [0x62,0xf2,0xfd,0x49,0x5a,0x00]
608 ; X86-NEXT: # zmm0 {%k1} = mem[0,1,0,1,0,1,0,1]
609 ; X86-NEXT: retl # encoding: [0xc3]
611 ; X64-LABEL: test_int_x86_avx512_mask_broadcasti64x2_512_load:
613 ; X64-NEXT: kmovw %esi, %k1 # encoding: [0xc5,0xf8,0x92,0xce]
614 ; X64-NEXT: vbroadcasti64x2 (%rdi), %zmm0 {%k1} # encoding: [0x62,0xf2,0xfd,0x49,0x5a,0x07]
615 ; X64-NEXT: # zmm0 {%k1} = mem[0,1,0,1,0,1,0,1]
616 ; X64-NEXT: retq # encoding: [0xc3]
618 %x0 = load <2 x i64>, ptr %x0ptr
619 %res = call <8 x i64> @llvm.x86.avx512.mask.broadcasti64x2.512(<2 x i64> %x0, <8 x i64> %x2, i8 %mask)
623 declare i16 @llvm.x86.avx512.cvtd2mask.512(<16 x i32>)
625 define i16@test_int_x86_avx512_cvtd2mask_512(<16 x i32> %x0) {
626 ; CHECK-LABEL: test_int_x86_avx512_cvtd2mask_512:
628 ; CHECK-NEXT: vpmovd2m %zmm0, %k0 # encoding: [0x62,0xf2,0x7e,0x48,0x39,0xc0]
629 ; CHECK-NEXT: kmovw %k0, %eax # encoding: [0xc5,0xf8,0x93,0xc0]
630 ; CHECK-NEXT: # kill: def $ax killed $ax killed $eax
631 ; CHECK-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
632 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
633 %res = call i16 @llvm.x86.avx512.cvtd2mask.512(<16 x i32> %x0)
637 declare i8 @llvm.x86.avx512.cvtq2mask.512(<8 x i64>)
639 define i8@test_int_x86_avx512_cvtq2mask_512(<8 x i64> %x0) {
640 ; CHECK-LABEL: test_int_x86_avx512_cvtq2mask_512:
642 ; CHECK-NEXT: vpmovq2m %zmm0, %k0 # encoding: [0x62,0xf2,0xfe,0x48,0x39,0xc0]
643 ; CHECK-NEXT: kmovw %k0, %eax # encoding: [0xc5,0xf8,0x93,0xc0]
644 ; CHECK-NEXT: # kill: def $al killed $al killed $eax
645 ; CHECK-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
646 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
647 %res = call i8 @llvm.x86.avx512.cvtq2mask.512(<8 x i64> %x0)
651 declare i8 @llvm.x86.avx512.mask.fpclass.pd.512(<8 x double>, i32, i8)
653 define i8 @test_int_x86_avx512_mask_fpclass_pd_512(<8 x double> %x0) {
654 ; CHECK-LABEL: test_int_x86_avx512_mask_fpclass_pd_512:
656 ; CHECK-NEXT: vfpclasspd $2, %zmm0, %k1 # encoding: [0x62,0xf3,0xfd,0x48,0x66,0xc8,0x02]
657 ; CHECK-NEXT: vfpclasspd $4, %zmm0, %k0 {%k1} # encoding: [0x62,0xf3,0xfd,0x49,0x66,0xc0,0x04]
658 ; CHECK-NEXT: kmovw %k0, %eax # encoding: [0xc5,0xf8,0x93,0xc0]
659 ; CHECK-NEXT: # kill: def $al killed $al killed $eax
660 ; CHECK-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
661 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
662 %res = call i8 @llvm.x86.avx512.mask.fpclass.pd.512(<8 x double> %x0, i32 4, i8 -1)
663 %res1 = call i8 @llvm.x86.avx512.mask.fpclass.pd.512(<8 x double> %x0, i32 2, i8 %res)
666 declare i16 @llvm.x86.avx512.mask.fpclass.ps.512(<16 x float>, i32, i16)
668 define i16@test_int_x86_avx512_mask_fpclass_ps_512(<16 x float> %x0) {
669 ; CHECK-LABEL: test_int_x86_avx512_mask_fpclass_ps_512:
671 ; CHECK-NEXT: vfpclassps $2, %zmm0, %k1 # encoding: [0x62,0xf3,0x7d,0x48,0x66,0xc8,0x02]
672 ; CHECK-NEXT: vfpclassps $4, %zmm0, %k0 {%k1} # encoding: [0x62,0xf3,0x7d,0x49,0x66,0xc0,0x04]
673 ; CHECK-NEXT: kmovw %k0, %eax # encoding: [0xc5,0xf8,0x93,0xc0]
674 ; CHECK-NEXT: # kill: def $ax killed $ax killed $eax
675 ; CHECK-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
676 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
677 %res = call i16 @llvm.x86.avx512.mask.fpclass.ps.512(<16 x float> %x0, i32 4, i16 -1)
678 %res1 = call i16 @llvm.x86.avx512.mask.fpclass.ps.512(<16 x float> %x0, i32 2, i16 %res)
682 declare <8 x double> @llvm.x86.avx512.mask.cvtqq2pd.512(<8 x i64>, <8 x double>, i8, i32)
684 define <8 x double>@test_int_x86_avx512_mask_cvt_qq2pd_512(<8 x i64> %x0, <8 x double> %x1, i8 %x2) {
685 ; X86-LABEL: test_int_x86_avx512_mask_cvt_qq2pd_512:
687 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x04]
688 ; X86-NEXT: vcvtqq2pd %zmm0, %zmm1 {%k1} # encoding: [0x62,0xf1,0xfe,0x49,0xe6,0xc8]
689 ; X86-NEXT: vcvtqq2pd {rn-sae}, %zmm0, %zmm0 # encoding: [0x62,0xf1,0xfe,0x18,0xe6,0xc0]
690 ; X86-NEXT: vaddpd %zmm0, %zmm1, %zmm0 # encoding: [0x62,0xf1,0xf5,0x48,0x58,0xc0]
691 ; X86-NEXT: retl # encoding: [0xc3]
693 ; X64-LABEL: test_int_x86_avx512_mask_cvt_qq2pd_512:
695 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
696 ; X64-NEXT: vcvtqq2pd %zmm0, %zmm1 {%k1} # encoding: [0x62,0xf1,0xfe,0x49,0xe6,0xc8]
697 ; X64-NEXT: vcvtqq2pd {rn-sae}, %zmm0, %zmm0 # encoding: [0x62,0xf1,0xfe,0x18,0xe6,0xc0]
698 ; X64-NEXT: vaddpd %zmm0, %zmm1, %zmm0 # encoding: [0x62,0xf1,0xf5,0x48,0x58,0xc0]
699 ; X64-NEXT: retq # encoding: [0xc3]
700 %res = call <8 x double> @llvm.x86.avx512.mask.cvtqq2pd.512(<8 x i64> %x0, <8 x double> %x1, i8 %x2, i32 4)
701 %res1 = call <8 x double> @llvm.x86.avx512.mask.cvtqq2pd.512(<8 x i64> %x0, <8 x double> %x1, i8 -1, i32 8)
702 %res2 = fadd <8 x double> %res, %res1
703 ret <8 x double> %res2
706 declare <8 x float> @llvm.x86.avx512.mask.cvtqq2ps.512(<8 x i64>, <8 x float>, i8, i32)
708 define <8 x float> @test_int_x86_avx512_mask_cvt_qq2ps_512(<8 x i64> %x0, <8 x float> %x1, i8 %x2) {
709 ; X86-LABEL: test_int_x86_avx512_mask_cvt_qq2ps_512:
711 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x04]
712 ; X86-NEXT: vcvtqq2ps %zmm0, %ymm1 {%k1} # encoding: [0x62,0xf1,0xfc,0x49,0x5b,0xc8]
713 ; X86-NEXT: vcvtqq2ps {rn-sae}, %zmm0, %ymm0 # encoding: [0x62,0xf1,0xfc,0x18,0x5b,0xc0]
714 ; X86-NEXT: vaddps %ymm0, %ymm1, %ymm0 # encoding: [0xc5,0xf4,0x58,0xc0]
715 ; X86-NEXT: retl # encoding: [0xc3]
717 ; X64-LABEL: test_int_x86_avx512_mask_cvt_qq2ps_512:
719 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
720 ; X64-NEXT: vcvtqq2ps %zmm0, %ymm1 {%k1} # encoding: [0x62,0xf1,0xfc,0x49,0x5b,0xc8]
721 ; X64-NEXT: vcvtqq2ps {rn-sae}, %zmm0, %ymm0 # encoding: [0x62,0xf1,0xfc,0x18,0x5b,0xc0]
722 ; X64-NEXT: vaddps %ymm0, %ymm1, %ymm0 # encoding: [0xc5,0xf4,0x58,0xc0]
723 ; X64-NEXT: retq # encoding: [0xc3]
724 %res = call <8 x float> @llvm.x86.avx512.mask.cvtqq2ps.512(<8 x i64> %x0, <8 x float> %x1, i8 %x2, i32 4)
725 %res1 = call <8 x float> @llvm.x86.avx512.mask.cvtqq2ps.512(<8 x i64> %x0, <8 x float> %x1, i8 -1, i32 8)
726 %res2 = fadd <8 x float> %res, %res1
727 ret <8 x float> %res2
730 declare <8 x double> @llvm.x86.avx512.mask.cvtuqq2pd.512(<8 x i64>, <8 x double>, i8, i32)
732 define <8 x double> @test_int_x86_avx512_mask_cvt_uqq2pd_512(<8 x i64> %x0, <8 x double> %x1, i8 %x2) {
733 ; X86-LABEL: test_int_x86_avx512_mask_cvt_uqq2pd_512:
735 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x04]
736 ; X86-NEXT: vcvtuqq2pd %zmm0, %zmm1 {%k1} # encoding: [0x62,0xf1,0xfe,0x49,0x7a,0xc8]
737 ; X86-NEXT: vcvtuqq2pd {rn-sae}, %zmm0, %zmm0 # encoding: [0x62,0xf1,0xfe,0x18,0x7a,0xc0]
738 ; X86-NEXT: vaddpd %zmm0, %zmm1, %zmm0 # encoding: [0x62,0xf1,0xf5,0x48,0x58,0xc0]
739 ; X86-NEXT: retl # encoding: [0xc3]
741 ; X64-LABEL: test_int_x86_avx512_mask_cvt_uqq2pd_512:
743 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
744 ; X64-NEXT: vcvtuqq2pd %zmm0, %zmm1 {%k1} # encoding: [0x62,0xf1,0xfe,0x49,0x7a,0xc8]
745 ; X64-NEXT: vcvtuqq2pd {rn-sae}, %zmm0, %zmm0 # encoding: [0x62,0xf1,0xfe,0x18,0x7a,0xc0]
746 ; X64-NEXT: vaddpd %zmm0, %zmm1, %zmm0 # encoding: [0x62,0xf1,0xf5,0x48,0x58,0xc0]
747 ; X64-NEXT: retq # encoding: [0xc3]
748 %res = call <8 x double> @llvm.x86.avx512.mask.cvtuqq2pd.512(<8 x i64> %x0, <8 x double> %x1, i8 %x2, i32 4)
749 %res1 = call <8 x double> @llvm.x86.avx512.mask.cvtuqq2pd.512(<8 x i64> %x0, <8 x double> %x1, i8 -1, i32 8)
750 %res2 = fadd <8 x double> %res, %res1
751 ret <8 x double> %res2
754 declare <8 x float> @llvm.x86.avx512.mask.cvtuqq2ps.512(<8 x i64>, <8 x float>, i8, i32)
756 define <8 x float> @test_int_x86_avx512_mask_cvt_uqq2ps_512(<8 x i64> %x0, <8 x float> %x1, i8 %x2) {
757 ; X86-LABEL: test_int_x86_avx512_mask_cvt_uqq2ps_512:
759 ; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x04]
760 ; X86-NEXT: vcvtuqq2ps %zmm0, %ymm1 {%k1} # encoding: [0x62,0xf1,0xff,0x49,0x7a,0xc8]
761 ; X86-NEXT: vcvtuqq2ps {rn-sae}, %zmm0, %ymm0 # encoding: [0x62,0xf1,0xff,0x18,0x7a,0xc0]
762 ; X86-NEXT: vaddps %ymm0, %ymm1, %ymm0 # encoding: [0xc5,0xf4,0x58,0xc0]
763 ; X86-NEXT: retl # encoding: [0xc3]
765 ; X64-LABEL: test_int_x86_avx512_mask_cvt_uqq2ps_512:
767 ; X64-NEXT: kmovw %edi, %k1 # encoding: [0xc5,0xf8,0x92,0xcf]
768 ; X64-NEXT: vcvtuqq2ps %zmm0, %ymm1 {%k1} # encoding: [0x62,0xf1,0xff,0x49,0x7a,0xc8]
769 ; X64-NEXT: vcvtuqq2ps {rn-sae}, %zmm0, %ymm0 # encoding: [0x62,0xf1,0xff,0x18,0x7a,0xc0]
770 ; X64-NEXT: vaddps %ymm0, %ymm1, %ymm0 # encoding: [0xc5,0xf4,0x58,0xc0]
771 ; X64-NEXT: retq # encoding: [0xc3]
772 %res = call <8 x float> @llvm.x86.avx512.mask.cvtuqq2ps.512(<8 x i64> %x0, <8 x float> %x1, i8 %x2, i32 4)
773 %res1 = call <8 x float> @llvm.x86.avx512.mask.cvtuqq2ps.512(<8 x i64> %x0, <8 x float> %x1, i8 -1, i32 8)
774 %res2 = fadd <8 x float> %res, %res1
775 ret <8 x float> %res2