llvm.org GIT mirror llvm / 4de1039
Fix AVX512 Gather and Scatter execution domains. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204804 91177308-0d34-0410-b5e6-96231b3b80d8 Cameron McInally 6 years ago
2 changed file(s) with 94 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
38083808 " \t{$src2, ${dst} {${mask}}|${dst} {${mask}}, $src2}"),
38093809 []>, EVEX, EVEX_K;
38103810 }
3811
3812 let ExeDomain = SSEPackedDouble in {
38113813 defm VGATHERDPDZ : avx512_gather<0x92, "vgatherdpd", VK8WM, VR512, vy64xmem>,
38123814 EVEX_V512, VEX_W, EVEX_CD8<64, CD8VT1>;
3815 defm VGATHERQPDZ : avx512_gather<0x93, "vgatherqpd", VK8WM, VR512, vz64mem>,
3816 EVEX_V512, VEX_W, EVEX_CD8<64, CD8VT1>;
3817 }
3818
3819 let ExeDomain = SSEPackedSingle in {
38133820 defm VGATHERDPSZ : avx512_gather<0x92, "vgatherdps", VK16WM, VR512, vz32mem>,
38143821 EVEX_V512, EVEX_CD8<32, CD8VT1>;
3815
3816 defm VGATHERQPDZ : avx512_gather<0x93, "vgatherqpd", VK8WM, VR512, vz64mem>,
3817 EVEX_V512, VEX_W, EVEX_CD8<64, CD8VT1>;
38183822 defm VGATHERQPSZ : avx512_gather<0x93, "vgatherqps", VK8WM, VR256X, vz64mem>,
38193823 EVEX_V512, EVEX_CD8<32, CD8VT1>;
3824 }
38203825
38213826 defm VPGATHERDQZ : avx512_gather<0x90, "vpgatherdq", VK8WM, VR512, vy64xmem>,
38223827 EVEX_V512, VEX_W, EVEX_CD8<64, CD8VT1>;
38383843 []>, EVEX, EVEX_K;
38393844 }
38403845
3846 let ExeDomain = SSEPackedDouble in {
38413847 defm VSCATTERDPDZ : avx512_scatter<0xA2, "vscatterdpd", VK8WM, VR512, vy64xmem>,
38423848 EVEX_V512, VEX_W, EVEX_CD8<64, CD8VT1>;
3849 defm VSCATTERQPDZ : avx512_scatter<0xA3, "vscatterqpd", VK8WM, VR512, vz64mem>,
3850 EVEX_V512, VEX_W, EVEX_CD8<64, CD8VT1>;
3851 }
3852
3853 let ExeDomain = SSEPackedSingle in {
38433854 defm VSCATTERDPSZ : avx512_scatter<0xA2, "vscatterdps", VK16WM, VR512, vz32mem>,
38443855 EVEX_V512, EVEX_CD8<32, CD8VT1>;
3845
3846 defm VSCATTERQPDZ : avx512_scatter<0xA3, "vscatterqpd", VK8WM, VR512, vz64mem>,
3847 EVEX_V512, VEX_W, EVEX_CD8<64, CD8VT1>;
38483856 defm VSCATTERQPSZ : avx512_scatter<0xA3, "vscatterqps", VK8WM, VR256X, vz64mem>,
38493857 EVEX_V512, EVEX_CD8<32, CD8VT1>;
3850
3858 }
3859
38513860 defm VPSCATTERDQZ : avx512_scatter<0xA0, "vpscatterdq", VK8WM, VR512, vy64xmem>,
38523861 EVEX_V512, VEX_W, EVEX_CD8<64, CD8VT1>;
38533862 defm VPSCATTERDDZ : avx512_scatter<0xA0, "vpscatterdd", VK16WM, VR512, vz32mem>,
222222 call void @llvm.x86.avx512.scatter.qpi.512 (i8* %stbuf, <8 x i64>%ind2, <8 x i32> %x, i32 4)
223223 ret void
224224 }
225
226 ;CHECK-LABEL: gather_mask_dpd_execdomain
227 ;CHECK: vgatherdpd
228 ;CHECK: vmovapd
229 ;CHECK: ret
230 define void @gather_mask_dpd_execdomain(<8 x i32> %ind, <8 x double> %src, i8 %mask, i8* %base, <8 x double>* %stbuf) {
231 %x = call <8 x double> @llvm.x86.avx512.gather.dpd.mask.512 (<8 x double> %src, i8 %mask, <8 x i32>%ind, i8* %base, i32 4)
232 store <8 x double> %x, <8 x double>* %stbuf
233 ret void
234 }
235
236 ;CHECK-LABEL: gather_mask_qpd_execdomain
237 ;CHECK: vgatherqpd
238 ;CHECK: vmovapd
239 ;CHECK: ret
240 define void @gather_mask_qpd_execdomain(<8 x i64> %ind, <8 x double> %src, i8 %mask, i8* %base, <8 x double>* %stbuf) {
241 %x = call <8 x double> @llvm.x86.avx512.gather.qpd.mask.512 (<8 x double> %src, i8 %mask, <8 x i64>%ind, i8* %base, i32 4)
242 store <8 x double> %x, <8 x double>* %stbuf
243 ret void
244 }
245
246 ;CHECK-LABEL: gather_mask_dps_execdomain
247 ;CHECK: vgatherdps
248 ;CHECK: vmovaps
249 ;CHECK: ret
250 define <16 x float> @gather_mask_dps_execdomain(<16 x i32> %ind, <16 x float> %src, i16 %mask, i8* %base) {
251 %res = call <16 x float> @llvm.x86.avx512.gather.dps.mask.512 (<16 x float> %src, i16 %mask, <16 x i32>%ind, i8* %base, i32 4)
252 ret <16 x float> %res;
253 }
254
255 ;CHECK-LABEL: gather_mask_qps_execdomain
256 ;CHECK: vgatherqps
257 ;CHECK: vmovaps
258 ;CHECK: ret
259 define <8 x float> @gather_mask_qps_execdomain(<8 x i64> %ind, <8 x float> %src, i8 %mask, i8* %base) {
260 %res = call <8 x float> @llvm.x86.avx512.gather.qps.mask.512 (<8 x float> %src, i8 %mask, <8 x i64>%ind, i8* %base, i32 4)
261 ret <8 x float> %res;
262 }
263
264 ;CHECK-LABEL: scatter_mask_dpd_execdomain
265 ;CHECK: vmovapd
266 ;CHECK: vscatterdpd
267 ;CHECK: ret
268 define void @scatter_mask_dpd_execdomain(<8 x i32> %ind, <8 x double>* %src, i8 %mask, i8* %base, i8* %stbuf) {
269 %x = load <8 x double>* %src, align 64
270 call void @llvm.x86.avx512.scatter.dpd.mask.512 (i8* %stbuf, i8 %mask, <8 x i32>%ind, <8 x double> %x, i32 4)
271 ret void
272 }
273
274 ;CHECK-LABEL: scatter_mask_qpd_execdomain
275 ;CHECK: vmovapd
276 ;CHECK: vscatterqpd
277 ;CHECK: ret
278 define void @scatter_mask_qpd_execdomain(<8 x i64> %ind, <8 x double>* %src, i8 %mask, i8* %base, i8* %stbuf) {
279 %x = load <8 x double>* %src, align 64
280 call void @llvm.x86.avx512.scatter.qpd.mask.512 (i8* %stbuf, i8 %mask, <8 x i64>%ind, <8 x double> %x, i32 4)
281 ret void
282 }
283
284 ;CHECK-LABEL: scatter_mask_dps_execdomain
285 ;CHECK: vmovaps
286 ;CHECK: vscatterdps
287 ;CHECK: ret
288 define void @scatter_mask_dps_execdomain(<16 x i32> %ind, <16 x float>* %src, i16 %mask, i8* %base, i8* %stbuf) {
289 %x = load <16 x float>* %src, align 64
290 call void @llvm.x86.avx512.scatter.dps.mask.512 (i8* %stbuf, i16 %mask, <16 x i32>%ind, <16 x float> %x, i32 4)
291 ret void
292 }
293
294 ;CHECK-LABEL: scatter_mask_qps_execdomain
295 ;CHECK: vmovaps
296 ;CHECK: vscatterqps
297 ;CHECK: ret
298 define void @scatter_mask_qps_execdomain(<8 x i64> %ind, <8 x float>* %src, i8 %mask, i8* %base, i8* %stbuf) {
299 %x = load <8 x float>* %src, align 32
300 call void @llvm.x86.avx512.scatter.qps.mask.512 (i8* %stbuf, i8 %mask, <8 x i64>%ind, <8 x float> %x, i32 4)
301 ret void
302 }