1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-linux -mcpu=skylake -mattr=+avx2 < %s | FileCheck %s
4 define <2 x float> @gather_v2f32_scale_512(ptr %result, <2 x i64> %idx, <2 x i1> %mask) {
5 ; CHECK-LABEL: gather_v2f32_scale_512:
7 ; CHECK-NEXT: vpsllq $9, %xmm0, %xmm2
8 ; CHECK-NEXT: vpshufd {{.*#+}} xmm0 = xmm1[0,2,2,3]
9 ; CHECK-NEXT: vpslld $31, %xmm0, %xmm1
10 ; CHECK-NEXT: vpxor %xmm0, %xmm0, %xmm0
11 ; CHECK-NEXT: vgatherqps %xmm1, (%rdi,%xmm2), %xmm0
13 %gep = getelementptr inbounds [512 x i8], ptr %result, <2 x i64> %idx
14 %res = call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> %gep, i32 0, <2 x i1> %mask, <2 x float> zeroinitializer)
18 define <2 x float> @gather_v2f32_scale_16(ptr %result, <2 x i64> %idx, <2 x i1> %mask) {
19 ; CHECK-LABEL: gather_v2f32_scale_16:
21 ; CHECK-NEXT: vpsllq $4, %xmm0, %xmm2
22 ; CHECK-NEXT: vpshufd {{.*#+}} xmm0 = xmm1[0,2,2,3]
23 ; CHECK-NEXT: vpslld $31, %xmm0, %xmm1
24 ; CHECK-NEXT: vpxor %xmm0, %xmm0, %xmm0
25 ; CHECK-NEXT: vgatherqps %xmm1, (%rdi,%xmm2), %xmm0
27 %gep = getelementptr inbounds [16 x i8], ptr %result, <2 x i64> %idx
28 %res = call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> %gep, i32 0, <2 x i1> %mask, <2 x float> zeroinitializer)
32 define <2 x float> @gather_v2f32_scale_8(ptr %result, <2 x i64> %idx, <2 x i1> %mask) {
33 ; CHECK-LABEL: gather_v2f32_scale_8:
35 ; CHECK-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
36 ; CHECK-NEXT: vpslld $31, %xmm1, %xmm2
37 ; CHECK-NEXT: vpxor %xmm1, %xmm1, %xmm1
38 ; CHECK-NEXT: vgatherqps %xmm2, (%rdi,%xmm0,8), %xmm1
39 ; CHECK-NEXT: vmovaps %xmm1, %xmm0
41 %gep = getelementptr inbounds [8 x i8], ptr %result, <2 x i64> %idx
42 %res = call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> %gep, i32 0, <2 x i1> %mask, <2 x float> zeroinitializer)
46 define <2 x float> @gather_v2f32_scale_4(ptr %result, <2 x i64> %idx, <2 x i1> %mask) {
47 ; CHECK-LABEL: gather_v2f32_scale_4:
49 ; CHECK-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
50 ; CHECK-NEXT: vpslld $31, %xmm1, %xmm2
51 ; CHECK-NEXT: vpxor %xmm1, %xmm1, %xmm1
52 ; CHECK-NEXT: vgatherqps %xmm2, (%rdi,%xmm0,4), %xmm1
53 ; CHECK-NEXT: vmovaps %xmm1, %xmm0
55 %gep = getelementptr inbounds [4 x i8], ptr %result, <2 x i64> %idx
56 %res = call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> %gep, i32 0, <2 x i1> %mask, <2 x float> zeroinitializer)
60 define <2 x float> @gather_v2f32_scale_3(ptr %result, <2 x i64> %idx, <2 x i1> %mask) {
61 ; CHECK-LABEL: gather_v2f32_scale_3:
63 ; CHECK-NEXT: vpaddq %xmm0, %xmm0, %xmm2
64 ; CHECK-NEXT: vpaddq %xmm0, %xmm2, %xmm2
65 ; CHECK-NEXT: vpshufd {{.*#+}} xmm0 = xmm1[0,2,2,3]
66 ; CHECK-NEXT: vpslld $31, %xmm0, %xmm1
67 ; CHECK-NEXT: vpxor %xmm0, %xmm0, %xmm0
68 ; CHECK-NEXT: vgatherqps %xmm1, (%rdi,%xmm2), %xmm0
70 %gep = getelementptr inbounds [3 x i8], ptr %result, <2 x i64> %idx
71 %res = call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> %gep, i32 0, <2 x i1> %mask, <2 x float> zeroinitializer)
75 define <2 x float> @gather_v2f32_scale_1(ptr %result, <2 x i64> %idx, <2 x i1> %mask) {
76 ; CHECK-LABEL: gather_v2f32_scale_1:
78 ; CHECK-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
79 ; CHECK-NEXT: vpslld $31, %xmm1, %xmm2
80 ; CHECK-NEXT: vpxor %xmm1, %xmm1, %xmm1
81 ; CHECK-NEXT: vgatherqps %xmm2, (%rdi,%xmm0), %xmm1
82 ; CHECK-NEXT: vmovaps %xmm1, %xmm0
84 %gep = getelementptr inbounds [1 x i8], ptr %result, <2 x i64> %idx
85 %res = call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> %gep, i32 0, <2 x i1> %mask, <2 x float> zeroinitializer)
89 declare <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr>, i32 immarg, <2 x i1>, <2 x float>)