xref: /aosp_15_r20/external/llvm/test/Analysis/CostModel/X86/cast.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=knl | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-AVX512
2*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=core-avx2 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-AVX2
3*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-AVX
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
6*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-apple-macosx10.8.0"
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Workerdefine i32 @add(i32 %arg) {
9*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: for function 'add'
10*9880d681SAndroid Build Coastguard Worker  ; -- Same size registeres --
11*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 1 {{.*}} zext
12*9880d681SAndroid Build Coastguard Worker  %A = zext <4 x i1> undef to <4 x i32>
13*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 2 {{.*}} sext
14*9880d681SAndroid Build Coastguard Worker  %B = sext <4 x i1> undef to <4 x i32>
15*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 0 {{.*}} trunc
16*9880d681SAndroid Build Coastguard Worker  %C = trunc <4 x i32> undef to <4 x i1>
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker  ; -- Different size registers --
19*9880d681SAndroid Build Coastguard Worker  ;CHECK-NOT: cost of 1 {{.*}} zext
20*9880d681SAndroid Build Coastguard Worker  %D = zext <8 x i1> undef to <8 x i32>
21*9880d681SAndroid Build Coastguard Worker  ;CHECK-NOT: cost of 2 {{.*}} sext
22*9880d681SAndroid Build Coastguard Worker  %E = sext <8 x i1> undef to <8 x i32>
23*9880d681SAndroid Build Coastguard Worker  ;CHECK-NOT: cost of 2 {{.*}} trunc
24*9880d681SAndroid Build Coastguard Worker  %F = trunc <8 x i32> undef to <8 x i1>
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Worker  ; -- scalars --
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 1 {{.*}} zext
29*9880d681SAndroid Build Coastguard Worker  %G = zext i1 undef to i32
30*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 0 {{.*}} trunc
31*9880d681SAndroid Build Coastguard Worker  %H = trunc i32 undef to i1
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Worker  ;CHECK: cost of 0 {{.*}} ret
34*9880d681SAndroid Build Coastguard Worker  ret i32 undef
35*9880d681SAndroid Build Coastguard Worker}
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Workerdefine i32 @zext_sext(<8 x i1> %in) {
38*9880d681SAndroid Build Coastguard Worker; CHECK-AVX2-LABEL: for function 'zext_sext'
39*9880d681SAndroid Build Coastguard Worker; CHECK-AVX-LABEL: for function 'zext_sext'
40*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 3 {{.*}} zext
41*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 4 {{.*}} zext
42*9880d681SAndroid Build Coastguard Worker  %Z = zext <8 x i1> %in to <8 x i32>
43*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 3 {{.*}} sext
44*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 7 {{.*}} sext
45*9880d681SAndroid Build Coastguard Worker  %S = sext <8 x i1> %in to <8 x i32>
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 1 {{.*}} zext
48*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 4 {{.*}} zext
49*9880d681SAndroid Build Coastguard Worker  %A1 = zext <16 x i8> undef to <16 x i16>
50*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 1 {{.*}} sext
51*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 4 {{.*}} sext
52*9880d681SAndroid Build Coastguard Worker  %A2 = sext <16 x i8> undef to <16 x i16>
53*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 1 {{.*}} sext
54*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 4 {{.*}} sext
55*9880d681SAndroid Build Coastguard Worker  %A = sext <8 x i16> undef to <8 x i32>
56*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 1 {{.*}} zext
57*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 4 {{.*}} zext
58*9880d681SAndroid Build Coastguard Worker  %B = zext <8 x i16> undef to <8 x i32>
59*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 1 {{.*}} sext
60*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 4 {{.*}} sext
61*9880d681SAndroid Build Coastguard Worker  %C = sext <4 x i32> undef to <4 x i64>
62*9880d681SAndroid Build Coastguard Worker
63*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 3 {{.*}} zext
64*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 4 {{.*}} zext
65*9880d681SAndroid Build Coastguard Worker  %C.v8i8.z = zext <8 x i8> undef to <8 x i32>
66*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 3 {{.*}} sext
67*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 7 {{.*}} sext
68*9880d681SAndroid Build Coastguard Worker  %C.v8i8.s = sext <8 x i8> undef to <8 x i32>
69*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 3 {{.*}} zext
70*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 3 {{.*}} zext
71*9880d681SAndroid Build Coastguard Worker  %C.v4i16.z = zext <4 x i16> undef to <4 x i64>
72*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 3 {{.*}} sext
73*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 6 {{.*}} sext
74*9880d681SAndroid Build Coastguard Worker  %C.v4i16.s = sext <4 x i16> undef to <4 x i64>
75*9880d681SAndroid Build Coastguard Worker
76*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 3 {{.*}} zext
77*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 4 {{.*}} zext
78*9880d681SAndroid Build Coastguard Worker  %C.v4i8.z = zext <4 x i8> undef to <4 x i64>
79*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 3 {{.*}} sext
80*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 6 {{.*}} sext
81*9880d681SAndroid Build Coastguard Worker  %C.v4i8.s = sext <4 x i8> undef to <4 x i64>
82*9880d681SAndroid Build Coastguard Worker
83*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 1 {{.*}} zext
84*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 4 {{.*}} zext
85*9880d681SAndroid Build Coastguard Worker  %D = zext <4 x i32> undef to <4 x i64>
86*9880d681SAndroid Build Coastguard Worker
87*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX512: cost of 1 {{.*}} %D1 = zext
88*9880d681SAndroid Build Coastguard Worker  %D1 = zext <8 x i32> undef to <8 x i64>
89*9880d681SAndroid Build Coastguard Worker
90*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX512: cost of 1 {{.*}} %D2 = sext
91*9880d681SAndroid Build Coastguard Worker  %D2 = sext <8 x i32> undef to <8 x i64>
92*9880d681SAndroid Build Coastguard Worker
93*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX512: cost of 1 {{.*}} %D3 = zext
94*9880d681SAndroid Build Coastguard Worker  %D3 = zext <16 x i16> undef to <16 x i32>
95*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX512: cost of 1 {{.*}} %D4 = zext
96*9880d681SAndroid Build Coastguard Worker  %D4 = zext <16 x i8> undef to <16 x i32>
97*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX512: cost of 2 {{.*}} %D5 = zext
98*9880d681SAndroid Build Coastguard Worker  %D5 = zext <16 x i1> undef to <16 x i32>
99*9880d681SAndroid Build Coastguard Worker
100*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 2 {{.*}} trunc
101*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 4 {{.*}} trunc
102*9880d681SAndroid Build Coastguard Worker  %E = trunc <4 x i64> undef to <4 x i32>
103*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 2 {{.*}} trunc
104*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 5 {{.*}} trunc
105*9880d681SAndroid Build Coastguard Worker  %F = trunc <8 x i32> undef to <8 x i16>
106*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 4 {{.*}} trunc
107*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 4 {{.*}} trunc
108*9880d681SAndroid Build Coastguard Worker  %F1 = trunc <16 x i16> undef to <16 x i8>
109*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 2 {{.*}} trunc
110*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 4 {{.*}} trunc
111*9880d681SAndroid Build Coastguard Worker  %F2 = trunc <8 x i32> undef to <8 x i8>
112*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 2 {{.*}} trunc
113*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 4 {{.*}} trunc
114*9880d681SAndroid Build Coastguard Worker  %F3 = trunc <4 x i64> undef to <4 x i8>
115*9880d681SAndroid Build Coastguard Worker
116*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 4 {{.*}} trunc
117*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 9 {{.*}} trunc
118*9880d681SAndroid Build Coastguard Worker  ;CHECK_AVX512: cost of 1 {{.*}} G = trunc
119*9880d681SAndroid Build Coastguard Worker  %G = trunc <8 x i64> undef to <8 x i32>
120*9880d681SAndroid Build Coastguard Worker
121*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX512: cost of 1 {{.*}} %G1 = trunc
122*9880d681SAndroid Build Coastguard Worker  %G1 = trunc <16 x i32> undef to <16 x i16>
123*9880d681SAndroid Build Coastguard Worker
124*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX512: cost of 1 {{.*}} %G2 = trunc
125*9880d681SAndroid Build Coastguard Worker  %G2 = trunc <16 x i32> undef to <16 x i8>
126*9880d681SAndroid Build Coastguard Worker  ret i32 undef
127*9880d681SAndroid Build Coastguard Worker}
128*9880d681SAndroid Build Coastguard Worker
129*9880d681SAndroid Build Coastguard Workerdefine i32 @masks8(<8 x i1> %in) {
130*9880d681SAndroid Build Coastguard Worker; CHECK-AVX2-LABEL: for function 'masks8'
131*9880d681SAndroid Build Coastguard Worker; CHECK-AVX-LABEL: for function 'masks8'
132*9880d681SAndroid Build Coastguard Worker
133*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 3 {{.*}} zext
134*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 4 {{.*}} zext
135*9880d681SAndroid Build Coastguard Worker  %Z = zext <8 x i1> %in to <8 x i32>
136*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 3 {{.*}} sext
137*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 7 {{.*}} sext
138*9880d681SAndroid Build Coastguard Worker  %S = sext <8 x i1> %in to <8 x i32>
139*9880d681SAndroid Build Coastguard Worker  ret i32 undef
140*9880d681SAndroid Build Coastguard Worker}
141*9880d681SAndroid Build Coastguard Worker
142*9880d681SAndroid Build Coastguard Workerdefine i32 @masks4(<4 x i1> %in) {
143*9880d681SAndroid Build Coastguard Worker; CHECK-AVX2-LABEL: for function 'masks4'
144*9880d681SAndroid Build Coastguard Worker; CHECK-AVX-LABEL: for function 'masks4'
145*9880d681SAndroid Build Coastguard Worker
146*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 3 {{.*}} zext
147*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 4 {{.*}} zext
148*9880d681SAndroid Build Coastguard Worker  %Z = zext <4 x i1> %in to <4 x i64>
149*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX2: cost of 3 {{.*}} sext
150*9880d681SAndroid Build Coastguard Worker  ;CHECK-AVX: cost of 6 {{.*}} sext
151*9880d681SAndroid Build Coastguard Worker  %S = sext <4 x i1> %in to <4 x i64>
152*9880d681SAndroid Build Coastguard Worker  ret i32 undef
153*9880d681SAndroid Build Coastguard Worker}
154*9880d681SAndroid Build Coastguard Worker
155*9880d681SAndroid Build Coastguard Workerdefine void @sitofp4(<4 x i1> %a, <4 x i8> %b, <4 x i16> %c, <4 x i32> %d) {
156*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: for function 'sitofp4'
157*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 3 {{.*}} sitofp
158*9880d681SAndroid Build Coastguard Worker  %A1 = sitofp <4 x i1> %a to <4 x float>
159*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 3 {{.*}} sitofp
160*9880d681SAndroid Build Coastguard Worker  %A2 = sitofp <4 x i1> %a to <4 x double>
161*9880d681SAndroid Build Coastguard Worker
162*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 3 {{.*}} sitofp
163*9880d681SAndroid Build Coastguard Worker  %B1 = sitofp <4 x i8> %b to <4 x float>
164*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 3 {{.*}} sitofp
165*9880d681SAndroid Build Coastguard Worker  %B2 = sitofp <4 x i8> %b to <4 x double>
166*9880d681SAndroid Build Coastguard Worker
167*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 3 {{.*}} sitofp
168*9880d681SAndroid Build Coastguard Worker  %C1 = sitofp <4 x i16> %c to <4 x float>
169*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 3 {{.*}} sitofp
170*9880d681SAndroid Build Coastguard Worker  %C2 = sitofp <4 x i16> %c to <4 x double>
171*9880d681SAndroid Build Coastguard Worker
172*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} sitofp
173*9880d681SAndroid Build Coastguard Worker  %D1 = sitofp <4 x i32> %d to <4 x float>
174*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} sitofp
175*9880d681SAndroid Build Coastguard Worker  %D2 = sitofp <4 x i32> %d to <4 x double>
176*9880d681SAndroid Build Coastguard Worker  ret void
177*9880d681SAndroid Build Coastguard Worker}
178*9880d681SAndroid Build Coastguard Worker
179*9880d681SAndroid Build Coastguard Workerdefine void @sitofp8(<8 x i1> %a, <8 x i8> %b, <8 x i16> %c, <8 x i32> %d) {
180*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: for function 'sitofp8'
181*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 8 {{.*}} sitofp
182*9880d681SAndroid Build Coastguard Worker  %A1 = sitofp <8 x i1> %a to <8 x float>
183*9880d681SAndroid Build Coastguard Worker
184*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 8 {{.*}} sitofp
185*9880d681SAndroid Build Coastguard Worker  %B1 = sitofp <8 x i8> %b to <8 x float>
186*9880d681SAndroid Build Coastguard Worker
187*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 5 {{.*}} sitofp
188*9880d681SAndroid Build Coastguard Worker  %C1 = sitofp <8 x i16> %c to <8 x float>
189*9880d681SAndroid Build Coastguard Worker
190*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} sitofp
191*9880d681SAndroid Build Coastguard Worker  %D1 = sitofp <8 x i32> %d to <8 x float>
192*9880d681SAndroid Build Coastguard Worker  ret void
193*9880d681SAndroid Build Coastguard Worker}
194*9880d681SAndroid Build Coastguard Worker
195*9880d681SAndroid Build Coastguard Workerdefine void @uitofp4(<4 x i1> %a, <4 x i8> %b, <4 x i16> %c, <4 x i32> %d) {
196*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: for function 'uitofp4'
197*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 7 {{.*}} uitofp
198*9880d681SAndroid Build Coastguard Worker  %A1 = uitofp <4 x i1> %a to <4 x float>
199*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 7 {{.*}} uitofp
200*9880d681SAndroid Build Coastguard Worker  %A2 = uitofp <4 x i1> %a to <4 x double>
201*9880d681SAndroid Build Coastguard Worker
202*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 2 {{.*}} uitofp
203*9880d681SAndroid Build Coastguard Worker  %B1 = uitofp <4 x i8> %b to <4 x float>
204*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 2 {{.*}} uitofp
205*9880d681SAndroid Build Coastguard Worker  %B2 = uitofp <4 x i8> %b to <4 x double>
206*9880d681SAndroid Build Coastguard Worker
207*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 2 {{.*}} uitofp
208*9880d681SAndroid Build Coastguard Worker  %C1 = uitofp <4 x i16> %c to <4 x float>
209*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 2 {{.*}} uitofp
210*9880d681SAndroid Build Coastguard Worker  %C2 = uitofp <4 x i16> %c to <4 x double>
211*9880d681SAndroid Build Coastguard Worker
212*9880d681SAndroid Build Coastguard Worker  ; CHECK-AVX2: cost of 6 {{.*}} uitofp
213*9880d681SAndroid Build Coastguard Worker  %D1 = uitofp <4 x i32> %d to <4 x float>
214*9880d681SAndroid Build Coastguard Worker  ; CHECK-AVX2: cost of 6 {{.*}} uitofp
215*9880d681SAndroid Build Coastguard Worker  %D2 = uitofp <4 x i32> %d to <4 x double>
216*9880d681SAndroid Build Coastguard Worker  ret void
217*9880d681SAndroid Build Coastguard Worker}
218*9880d681SAndroid Build Coastguard Worker
219*9880d681SAndroid Build Coastguard Workerdefine void @uitofp8(<8 x i1> %a, <8 x i8> %b, <8 x i16> %c, <8 x i32> %d) {
220*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: for function 'uitofp8'
221*9880d681SAndroid Build Coastguard Worker  ; CHECK-AVX2: cost of 6 {{.*}} uitofp
222*9880d681SAndroid Build Coastguard Worker  %A1 = uitofp <8 x i1> %a to <8 x float>
223*9880d681SAndroid Build Coastguard Worker
224*9880d681SAndroid Build Coastguard Worker  ; CHECK-AVX2: cost of 5 {{.*}} uitofp
225*9880d681SAndroid Build Coastguard Worker  ; CHECK-AVX512: cost of 2 {{.*}} uitofp
226*9880d681SAndroid Build Coastguard Worker  %B1 = uitofp <8 x i8> %b to <8 x float>
227*9880d681SAndroid Build Coastguard Worker
228*9880d681SAndroid Build Coastguard Worker  ; CHECK-AVX2: cost of 5 {{.*}} uitofp
229*9880d681SAndroid Build Coastguard Worker  ; CHECK-AVX512: cost of 2 {{.*}} uitofp
230*9880d681SAndroid Build Coastguard Worker  %C1 = uitofp <8 x i16> %c to <8 x float>
231*9880d681SAndroid Build Coastguard Worker
232*9880d681SAndroid Build Coastguard Worker  ; CHECK-AVX2: cost of 8 {{.*}} uitofp
233*9880d681SAndroid Build Coastguard Worker  ; CHECK-AVX512: cost of 1 {{.*}} uitofp
234*9880d681SAndroid Build Coastguard Worker  ; CHECK-AVX: cost of 9 {{.*}} uitofp
235*9880d681SAndroid Build Coastguard Worker  %D1 = uitofp <8 x i32> %d to <8 x float>
236*9880d681SAndroid Build Coastguard Worker  ret void
237*9880d681SAndroid Build Coastguard Worker}
238*9880d681SAndroid Build Coastguard Worker
239*9880d681SAndroid Build Coastguard Workerdefine void @fp_conv(<8 x float> %a, <16 x float>%b, <4 x float> %c) {
240*9880d681SAndroid Build Coastguard Worker;CHECK-LABEL: for function 'fp_conv'
241*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} %A1 = fpext
242*9880d681SAndroid Build Coastguard Worker  %A1 = fpext <4 x float> %c to <4 x double>
243*9880d681SAndroid Build Coastguard Worker
244*9880d681SAndroid Build Coastguard Worker  ; CHECK-AVX:    cost of 3 {{.*}} %A2 = fpext
245*9880d681SAndroid Build Coastguard Worker  ; CHECK-AVX2:   cost of 3 {{.*}} %A2 = fpext
246*9880d681SAndroid Build Coastguard Worker  ; CHECK-AVX512: cost of 1 {{.*}} %A2 = fpext
247*9880d681SAndroid Build Coastguard Worker  %A2 = fpext <8 x float> %a to <8 x double>
248*9880d681SAndroid Build Coastguard Worker
249*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} %A3 = fptrunc
250*9880d681SAndroid Build Coastguard Worker  %A3 = fptrunc <4 x double> undef to <4 x float>
251*9880d681SAndroid Build Coastguard Worker
252*9880d681SAndroid Build Coastguard Worker  ; CHECK-AVX:    cost of 3 {{.*}} %A4 = fptrunc
253*9880d681SAndroid Build Coastguard Worker  ; CHECK-AVX2:   cost of 3 {{.*}} %A4 = fptrunc
254*9880d681SAndroid Build Coastguard Worker  ; CHECK-AVX512: cost of 1 {{.*}} %A4 = fptrunc
255*9880d681SAndroid Build Coastguard Worker  %A4 = fptrunc <8 x double> undef to <8 x float>
256*9880d681SAndroid Build Coastguard Worker
257*9880d681SAndroid Build Coastguard Worker  ret void
258*9880d681SAndroid Build Coastguard Worker}
259