xref: /aosp_15_r20/external/llvm/test/Analysis/CostModel/X86/vshift-ashr-cost.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -mattr=+sse2,-sse4.1 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE2
2*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE41
3*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7-avx -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX
4*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=core-avx2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX2
5*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=bdver2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=XOP -check-prefix=XOPAVX
6*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=bdver4 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=XOP -check-prefix=XOPAVX2
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker; Verify the cost of vector arithmetic shift right instructions.
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker;
11*9880d681SAndroid Build Coastguard Worker; Variable Shifts
12*9880d681SAndroid Build Coastguard Worker;
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @var_shift_v2i64(<2 x i64> %a, <2 x i64> %b) {
15*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_shift_v2i64':
16*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 12 for instruction:   %shift
17*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 12 for instruction:   %shift
18*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 12 for instruction:   %shift
19*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 4 for instruction:   %shift
20*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %shift
21*9880d681SAndroid Build Coastguard Worker  %shift = ashr <2 x i64> %a, %b
22*9880d681SAndroid Build Coastguard Worker  ret <2 x i64> %shift
23*9880d681SAndroid Build Coastguard Worker}
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Workerdefine <4 x i64> @var_shift_v4i64(<4 x i64> %a, <4 x i64> %b) {
26*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_shift_v4i64':
27*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 24 for instruction:   %shift
28*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 24 for instruction:   %shift
29*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 24 for instruction:   %shift
30*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 4 for instruction:   %shift
31*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction:   %shift
32*9880d681SAndroid Build Coastguard Worker  %shift = ashr <4 x i64> %a, %b
33*9880d681SAndroid Build Coastguard Worker  ret <4 x i64> %shift
34*9880d681SAndroid Build Coastguard Worker}
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard Workerdefine <4 x i32> @var_shift_v4i32(<4 x i32> %a, <4 x i32> %b) {
37*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_shift_v4i32':
38*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 16 for instruction:   %shift
39*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 16 for instruction:   %shift
40*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 16 for instruction:   %shift
41*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction:   %shift
42*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 2 for instruction:   %shift
43*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction:   %shift
44*9880d681SAndroid Build Coastguard Worker  %shift = ashr <4 x i32> %a, %b
45*9880d681SAndroid Build Coastguard Worker  ret <4 x i32> %shift
46*9880d681SAndroid Build Coastguard Worker}
47*9880d681SAndroid Build Coastguard Worker
48*9880d681SAndroid Build Coastguard Workerdefine <8 x i32> @var_shift_v8i32(<8 x i32> %a, <8 x i32> %b) {
49*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_shift_v8i32':
50*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 32 for instruction:   %shift
51*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 32 for instruction:   %shift
52*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 32 for instruction:   %shift
53*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction:   %shift
54*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 4 for instruction:   %shift
55*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction:   %shift
56*9880d681SAndroid Build Coastguard Worker  %shift = ashr <8 x i32> %a, %b
57*9880d681SAndroid Build Coastguard Worker  ret <8 x i32> %shift
58*9880d681SAndroid Build Coastguard Worker}
59*9880d681SAndroid Build Coastguard Worker
60*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @var_shift_v8i16(<8 x i16> %a, <8 x i16> %b) {
61*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_shift_v8i16':
62*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 32 for instruction:   %shift
63*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 32 for instruction:   %shift
64*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 32 for instruction:   %shift
65*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 32 for instruction:   %shift
66*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %shift
67*9880d681SAndroid Build Coastguard Worker  %shift = ashr <8 x i16> %a, %b
68*9880d681SAndroid Build Coastguard Worker  ret <8 x i16> %shift
69*9880d681SAndroid Build Coastguard Worker}
70*9880d681SAndroid Build Coastguard Worker
71*9880d681SAndroid Build Coastguard Workerdefine <16 x i16> @var_shift_v16i16(<16 x i16> %a, <16 x i16> %b) {
72*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_shift_v16i16':
73*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 64 for instruction:   %shift
74*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 64 for instruction:   %shift
75*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 64 for instruction:   %shift
76*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 10 for instruction:   %shift
77*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction:   %shift
78*9880d681SAndroid Build Coastguard Worker  %shift = ashr <16 x i16> %a, %b
79*9880d681SAndroid Build Coastguard Worker  ret <16 x i16> %shift
80*9880d681SAndroid Build Coastguard Worker}
81*9880d681SAndroid Build Coastguard Worker
82*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @var_shift_v16i8(<16 x i8> %a, <16 x i8> %b) {
83*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_shift_v16i8':
84*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 54 for instruction:   %shift
85*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 54 for instruction:   %shift
86*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 54 for instruction:   %shift
87*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 54 for instruction:   %shift
88*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %shift
89*9880d681SAndroid Build Coastguard Worker  %shift = ashr <16 x i8> %a, %b
90*9880d681SAndroid Build Coastguard Worker  ret <16 x i8> %shift
91*9880d681SAndroid Build Coastguard Worker}
92*9880d681SAndroid Build Coastguard Worker
93*9880d681SAndroid Build Coastguard Workerdefine <32 x i8> @var_shift_v32i8(<32 x i8> %a, <32 x i8> %b) {
94*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_shift_v32i8':
95*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 108 for instruction:   %shift
96*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 108 for instruction:   %shift
97*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 108 for instruction:   %shift
98*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 24 for instruction:   %shift
99*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction:   %shift
100*9880d681SAndroid Build Coastguard Worker  %shift = ashr <32 x i8> %a, %b
101*9880d681SAndroid Build Coastguard Worker  ret <32 x i8> %shift
102*9880d681SAndroid Build Coastguard Worker}
103*9880d681SAndroid Build Coastguard Worker
104*9880d681SAndroid Build Coastguard Worker;
105*9880d681SAndroid Build Coastguard Worker; Uniform Variable Shifts
106*9880d681SAndroid Build Coastguard Worker;
107*9880d681SAndroid Build Coastguard Worker
108*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @splatvar_shift_v2i64(<2 x i64> %a, <2 x i64> %b) {
109*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v2i64':
110*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 12 for instruction:   %shift
111*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 12 for instruction:   %shift
112*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 12 for instruction:   %shift
113*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 4 for instruction:   %shift
114*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %shift
115*9880d681SAndroid Build Coastguard Worker  %splat = shufflevector <2 x i64> %b, <2 x i64> undef, <2 x i32> zeroinitializer
116*9880d681SAndroid Build Coastguard Worker  %shift = ashr <2 x i64> %a, %splat
117*9880d681SAndroid Build Coastguard Worker  ret <2 x i64> %shift
118*9880d681SAndroid Build Coastguard Worker}
119*9880d681SAndroid Build Coastguard Worker
120*9880d681SAndroid Build Coastguard Workerdefine <4 x i64> @splatvar_shift_v4i64(<4 x i64> %a, <4 x i64> %b) {
121*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v4i64':
122*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 24 for instruction:   %shift
123*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 24 for instruction:   %shift
124*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 24 for instruction:   %shift
125*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 4 for instruction:   %shift
126*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction:   %shift
127*9880d681SAndroid Build Coastguard Worker  %splat = shufflevector <4 x i64> %b, <4 x i64> undef, <4 x i32> zeroinitializer
128*9880d681SAndroid Build Coastguard Worker  %shift = ashr <4 x i64> %a, %splat
129*9880d681SAndroid Build Coastguard Worker  ret <4 x i64> %shift
130*9880d681SAndroid Build Coastguard Worker}
131*9880d681SAndroid Build Coastguard Worker
132*9880d681SAndroid Build Coastguard Workerdefine <4 x i32> @splatvar_shift_v4i32(<4 x i32> %a, <4 x i32> %b) {
133*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v4i32':
134*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 16 for instruction:   %shift
135*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 16 for instruction:   %shift
136*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 16 for instruction:   %shift
137*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction:   %shift
138*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 2 for instruction:   %shift
139*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction:   %shift
140*9880d681SAndroid Build Coastguard Worker  %splat = shufflevector <4 x i32> %b, <4 x i32> undef, <4 x i32> zeroinitializer
141*9880d681SAndroid Build Coastguard Worker  %shift = ashr <4 x i32> %a, %splat
142*9880d681SAndroid Build Coastguard Worker  ret <4 x i32> %shift
143*9880d681SAndroid Build Coastguard Worker}
144*9880d681SAndroid Build Coastguard Worker
145*9880d681SAndroid Build Coastguard Workerdefine <8 x i32> @splatvar_shift_v8i32(<8 x i32> %a, <8 x i32> %b) {
146*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v8i32':
147*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 32 for instruction:   %shift
148*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 32 for instruction:   %shift
149*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 32 for instruction:   %shift
150*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction:   %shift
151*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 4 for instruction:   %shift
152*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction:   %shift
153*9880d681SAndroid Build Coastguard Worker  %splat = shufflevector <8 x i32> %b, <8 x i32> undef, <8 x i32> zeroinitializer
154*9880d681SAndroid Build Coastguard Worker  %shift = ashr <8 x i32> %a, %splat
155*9880d681SAndroid Build Coastguard Worker  ret <8 x i32> %shift
156*9880d681SAndroid Build Coastguard Worker}
157*9880d681SAndroid Build Coastguard Worker
158*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @splatvar_shift_v8i16(<8 x i16> %a, <8 x i16> %b) {
159*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v8i16':
160*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 32 for instruction:   %shift
161*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 32 for instruction:   %shift
162*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 32 for instruction:   %shift
163*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 32 for instruction:   %shift
164*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %shift
165*9880d681SAndroid Build Coastguard Worker  %splat = shufflevector <8 x i16> %b, <8 x i16> undef, <8 x i32> zeroinitializer
166*9880d681SAndroid Build Coastguard Worker  %shift = ashr <8 x i16> %a, %splat
167*9880d681SAndroid Build Coastguard Worker  ret <8 x i16> %shift
168*9880d681SAndroid Build Coastguard Worker}
169*9880d681SAndroid Build Coastguard Worker
170*9880d681SAndroid Build Coastguard Workerdefine <16 x i16> @splatvar_shift_v16i16(<16 x i16> %a, <16 x i16> %b) {
171*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v16i16':
172*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 64 for instruction:   %shift
173*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 64 for instruction:   %shift
174*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 64 for instruction:   %shift
175*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 10 for instruction:   %shift
176*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction:   %shift
177*9880d681SAndroid Build Coastguard Worker  %splat = shufflevector <16 x i16> %b, <16 x i16> undef, <16 x i32> zeroinitializer
178*9880d681SAndroid Build Coastguard Worker  %shift = ashr <16 x i16> %a, %splat
179*9880d681SAndroid Build Coastguard Worker  ret <16 x i16> %shift
180*9880d681SAndroid Build Coastguard Worker}
181*9880d681SAndroid Build Coastguard Worker
182*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @splatvar_shift_v16i8(<16 x i8> %a, <16 x i8> %b) {
183*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v16i8':
184*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 54 for instruction:   %shift
185*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 54 for instruction:   %shift
186*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 54 for instruction:   %shift
187*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 54 for instruction:   %shift
188*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %shift
189*9880d681SAndroid Build Coastguard Worker  %splat = shufflevector <16 x i8> %b, <16 x i8> undef, <16 x i32> zeroinitializer
190*9880d681SAndroid Build Coastguard Worker  %shift = ashr <16 x i8> %a, %splat
191*9880d681SAndroid Build Coastguard Worker  ret <16 x i8> %shift
192*9880d681SAndroid Build Coastguard Worker}
193*9880d681SAndroid Build Coastguard Worker
194*9880d681SAndroid Build Coastguard Workerdefine <32 x i8> @splatvar_shift_v32i8(<32 x i8> %a, <32 x i8> %b) {
195*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v32i8':
196*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 108 for instruction:   %shift
197*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 108 for instruction:   %shift
198*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 108 for instruction:   %shift
199*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 24 for instruction:   %shift
200*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction:   %shift
201*9880d681SAndroid Build Coastguard Worker  %splat = shufflevector <32 x i8> %b, <32 x i8> undef, <32 x i32> zeroinitializer
202*9880d681SAndroid Build Coastguard Worker  %shift = ashr <32 x i8> %a, %splat
203*9880d681SAndroid Build Coastguard Worker  ret <32 x i8> %shift
204*9880d681SAndroid Build Coastguard Worker}
205*9880d681SAndroid Build Coastguard Worker
206*9880d681SAndroid Build Coastguard Worker;
207*9880d681SAndroid Build Coastguard Worker; Constant Shifts
208*9880d681SAndroid Build Coastguard Worker;
209*9880d681SAndroid Build Coastguard Worker
210*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @constant_shift_v2i64(<2 x i64> %a) {
211*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'constant_shift_v2i64':
212*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 12 for instruction:   %shift
213*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 12 for instruction:   %shift
214*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 12 for instruction:   %shift
215*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 4 for instruction:   %shift
216*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %shift
217*9880d681SAndroid Build Coastguard Worker  %shift = ashr <2 x i64> %a, <i64 1, i64 7>
218*9880d681SAndroid Build Coastguard Worker  ret <2 x i64> %shift
219*9880d681SAndroid Build Coastguard Worker}
220*9880d681SAndroid Build Coastguard Worker
221*9880d681SAndroid Build Coastguard Workerdefine <4 x i64> @constant_shift_v4i64(<4 x i64> %a) {
222*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'constant_shift_v4i64':
223*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 24 for instruction:   %shift
224*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 24 for instruction:   %shift
225*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 24 for instruction:   %shift
226*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 4 for instruction:   %shift
227*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction:   %shift
228*9880d681SAndroid Build Coastguard Worker  %shift = ashr <4 x i64> %a, <i64 1, i64 7, i64 15, i64 31>
229*9880d681SAndroid Build Coastguard Worker  ret <4 x i64> %shift
230*9880d681SAndroid Build Coastguard Worker}
231*9880d681SAndroid Build Coastguard Worker
232*9880d681SAndroid Build Coastguard Workerdefine <4 x i32> @constant_shift_v4i32(<4 x i32> %a) {
233*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'constant_shift_v4i32':
234*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 16 for instruction:   %shift
235*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 16 for instruction:   %shift
236*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 16 for instruction:   %shift
237*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction:   %shift
238*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 2 for instruction:   %shift
239*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction:   %shift
240*9880d681SAndroid Build Coastguard Worker  %shift = ashr <4 x i32> %a, <i32 4, i32 5, i32 6, i32 7>
241*9880d681SAndroid Build Coastguard Worker  ret <4 x i32> %shift
242*9880d681SAndroid Build Coastguard Worker}
243*9880d681SAndroid Build Coastguard Worker
244*9880d681SAndroid Build Coastguard Workerdefine <8 x i32> @constant_shift_v8i32(<8 x i32> %a) {
245*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'constant_shift_v8i32':
246*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 32 for instruction:   %shift
247*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 32 for instruction:   %shift
248*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 32 for instruction:   %shift
249*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction:   %shift
250*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 4 for instruction:   %shift
251*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction:   %shift
252*9880d681SAndroid Build Coastguard Worker  %shift = ashr <8 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3>
253*9880d681SAndroid Build Coastguard Worker  ret <8 x i32> %shift
254*9880d681SAndroid Build Coastguard Worker}
255*9880d681SAndroid Build Coastguard Worker
256*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @constant_shift_v8i16(<8 x i16> %a) {
257*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'constant_shift_v8i16':
258*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 32 for instruction:   %shift
259*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 32 for instruction:   %shift
260*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 32 for instruction:   %shift
261*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 32 for instruction:   %shift
262*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %shift
263*9880d681SAndroid Build Coastguard Worker  %shift = ashr <8 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>
264*9880d681SAndroid Build Coastguard Worker  ret <8 x i16> %shift
265*9880d681SAndroid Build Coastguard Worker}
266*9880d681SAndroid Build Coastguard Worker
267*9880d681SAndroid Build Coastguard Workerdefine <16 x i16> @constant_shift_v16i16(<16 x i16> %a) {
268*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'constant_shift_v16i16':
269*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 64 for instruction:   %shift
270*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 64 for instruction:   %shift
271*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 64 for instruction:   %shift
272*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 10 for instruction:   %shift
273*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction:   %shift
274*9880d681SAndroid Build Coastguard Worker  %shift = ashr <16 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>
275*9880d681SAndroid Build Coastguard Worker  ret <16 x i16> %shift
276*9880d681SAndroid Build Coastguard Worker}
277*9880d681SAndroid Build Coastguard Worker
278*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @constant_shift_v16i8(<16 x i8> %a) {
279*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'constant_shift_v16i8':
280*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 54 for instruction:   %shift
281*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 54 for instruction:   %shift
282*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 54 for instruction:   %shift
283*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 54 for instruction:   %shift
284*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %shift
285*9880d681SAndroid Build Coastguard Worker  %shift = ashr <16 x i8> %a, <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, i8 1, i8 0>
286*9880d681SAndroid Build Coastguard Worker  ret <16 x i8> %shift
287*9880d681SAndroid Build Coastguard Worker}
288*9880d681SAndroid Build Coastguard Worker
289*9880d681SAndroid Build Coastguard Workerdefine <32 x i8> @constant_shift_v32i8(<32 x i8> %a) {
290*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'constant_shift_v32i8':
291*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 108 for instruction:   %shift
292*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 108 for instruction:   %shift
293*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 108 for instruction:   %shift
294*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 24 for instruction:   %shift
295*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction:   %shift
296*9880d681SAndroid Build Coastguard Worker  %shift = ashr <32 x i8> %a, <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, i8 1, i8 0, i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, i8 1, i8 0>
297*9880d681SAndroid Build Coastguard Worker  ret <32 x i8> %shift
298*9880d681SAndroid Build Coastguard Worker}
299*9880d681SAndroid Build Coastguard Worker
300*9880d681SAndroid Build Coastguard Worker;
301*9880d681SAndroid Build Coastguard Worker; Uniform Constant Shifts
302*9880d681SAndroid Build Coastguard Worker;
303*9880d681SAndroid Build Coastguard Worker
304*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @splatconstant_shift_v2i64(<2 x i64> %a) {
305*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v2i64':
306*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 4 for instruction:   %shift
307*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 4 for instruction:   %shift
308*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 4 for instruction:   %shift
309*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 4 for instruction:   %shift
310*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %shift
311*9880d681SAndroid Build Coastguard Worker  %shift = ashr <2 x i64> %a, <i64 7, i64 7>
312*9880d681SAndroid Build Coastguard Worker  ret <2 x i64> %shift
313*9880d681SAndroid Build Coastguard Worker}
314*9880d681SAndroid Build Coastguard Worker
315*9880d681SAndroid Build Coastguard Workerdefine <4 x i64> @splatconstant_shift_v4i64(<4 x i64> %a) {
316*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v4i64':
317*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 8 for instruction:   %shift
318*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 8 for instruction:   %shift
319*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 8 for instruction:   %shift
320*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 4 for instruction:   %shift
321*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction:   %shift
322*9880d681SAndroid Build Coastguard Worker  %shift = ashr <4 x i64> %a, <i64 7, i64 7, i64 7, i64 7>
323*9880d681SAndroid Build Coastguard Worker  ret <4 x i64> %shift
324*9880d681SAndroid Build Coastguard Worker}
325*9880d681SAndroid Build Coastguard Worker
326*9880d681SAndroid Build Coastguard Workerdefine <4 x i32> @splatconstant_shift_v4i32(<4 x i32> %a) {
327*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v4i32':
328*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 1 for instruction:   %shift
329*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 1 for instruction:   %shift
330*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 1 for instruction:   %shift
331*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction:   %shift
332*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 2 for instruction:   %shift
333*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction:   %shift
334*9880d681SAndroid Build Coastguard Worker  %shift = ashr <4 x i32> %a, <i32 5, i32 5, i32 5, i32 5>
335*9880d681SAndroid Build Coastguard Worker  ret <4 x i32> %shift
336*9880d681SAndroid Build Coastguard Worker}
337*9880d681SAndroid Build Coastguard Worker
338*9880d681SAndroid Build Coastguard Workerdefine <8 x i32> @splatconstant_shift_v8i32(<8 x i32> %a) {
339*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v8i32':
340*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 2 for instruction:   %shift
341*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 2 for instruction:   %shift
342*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 2 for instruction:   %shift
343*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction:   %shift
344*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 4 for instruction:   %shift
345*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction:   %shift
346*9880d681SAndroid Build Coastguard Worker  %shift = ashr <8 x i32> %a, <i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5>
347*9880d681SAndroid Build Coastguard Worker  ret <8 x i32> %shift
348*9880d681SAndroid Build Coastguard Worker}
349*9880d681SAndroid Build Coastguard Worker
350*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @splatconstant_shift_v8i16(<8 x i16> %a) {
351*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v8i16':
352*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 1 for instruction:   %shift
353*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 1 for instruction:   %shift
354*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 1 for instruction:   %shift
355*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction:   %shift
356*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %shift
357*9880d681SAndroid Build Coastguard Worker  %shift = ashr <8 x i16> %a, <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>
358*9880d681SAndroid Build Coastguard Worker  ret <8 x i16> %shift
359*9880d681SAndroid Build Coastguard Worker}
360*9880d681SAndroid Build Coastguard Worker
361*9880d681SAndroid Build Coastguard Workerdefine <16 x i16> @splatconstant_shift_v16i16(<16 x i16> %a) {
362*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v16i16':
363*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 2 for instruction:   %shift
364*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 2 for instruction:   %shift
365*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 2 for instruction:   %shift
366*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 10 for instruction:   %shift
367*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction:   %shift
368*9880d681SAndroid Build Coastguard Worker  %shift = ashr <16 x i16> %a, <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>
369*9880d681SAndroid Build Coastguard Worker  ret <16 x i16> %shift
370*9880d681SAndroid Build Coastguard Worker}
371*9880d681SAndroid Build Coastguard Worker
372*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @splatconstant_shift_v16i8(<16 x i8> %a) {
373*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v16i8':
374*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 4 for instruction:   %shift
375*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 4 for instruction:   %shift
376*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 4 for instruction:   %shift
377*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 4 for instruction:   %shift
378*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %shift
379*9880d681SAndroid Build Coastguard Worker  %shift = ashr <16 x i8> %a, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
380*9880d681SAndroid Build Coastguard Worker  ret <16 x i8> %shift
381*9880d681SAndroid Build Coastguard Worker}
382*9880d681SAndroid Build Coastguard Worker
383*9880d681SAndroid Build Coastguard Workerdefine <32 x i8> @splatconstant_shift_v32i8(<32 x i8> %a) {
384*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v32i8':
385*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 8 for instruction:   %shift
386*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 8 for instruction:   %shift
387*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 8 for instruction:   %shift
388*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 24 for instruction:   %shift
389*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction:   %shift
390*9880d681SAndroid Build Coastguard Worker  %shift = ashr <32 x i8> %a, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
391*9880d681SAndroid Build Coastguard Worker  ret <32 x i8> %shift
392*9880d681SAndroid Build Coastguard Worker}
393