1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -mtriple=x86_64-unknown -basicaa -slp-vectorizer -instcombine -S | FileCheck %s --check-prefix=CHECK --check-prefix=SSE
3 ; RUN: opt < %s -mtriple=x86_64-unknown -mcpu=slm -basicaa -slp-vectorizer -instcombine -S | FileCheck %s --check-prefix=CHECK --check-prefix=SLM
4 ; RUN: opt < %s -mtriple=x86_64-unknown -mcpu=corei7-avx -basicaa -slp-vectorizer -instcombine -S | FileCheck %s --check-prefix=CHECK --check-prefix=AVX --check-prefix=AVX1
5 ; RUN: opt < %s -mtriple=x86_64-unknown -mcpu=core-avx2 -basicaa -slp-vectorizer -instcombine -S | FileCheck %s --check-prefix=CHECK --check-prefix=AVX --check-prefix=AVX2
6 ; RUN: opt < %s -mtriple=x86_64-unknown -mcpu=knl -basicaa -slp-vectorizer -instcombine -S | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F
7 ; RUN: opt < %s -mtriple=x86_64-unknown -mcpu=skx -basicaa -slp-vectorizer -instcombine -S | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512BW
9 define <8 x float> @sitofp_uitofp(<8 x i32> %a) {
10 ; SSE-LABEL: @sitofp_uitofp(
11 ; SSE-NEXT: [[A0:%.*]] = extractelement <8 x i32> [[A:%.*]], i32 0
12 ; SSE-NEXT: [[A1:%.*]] = extractelement <8 x i32> [[A]], i32 1
13 ; SSE-NEXT: [[A2:%.*]] = extractelement <8 x i32> [[A]], i32 2
14 ; SSE-NEXT: [[A3:%.*]] = extractelement <8 x i32> [[A]], i32 3
15 ; SSE-NEXT: [[A4:%.*]] = extractelement <8 x i32> [[A]], i32 4
16 ; SSE-NEXT: [[A5:%.*]] = extractelement <8 x i32> [[A]], i32 5
17 ; SSE-NEXT: [[A6:%.*]] = extractelement <8 x i32> [[A]], i32 6
18 ; SSE-NEXT: [[A7:%.*]] = extractelement <8 x i32> [[A]], i32 7
19 ; SSE-NEXT: [[AB0:%.*]] = sitofp i32 [[A0]] to float
20 ; SSE-NEXT: [[AB1:%.*]] = sitofp i32 [[A1]] to float
21 ; SSE-NEXT: [[AB2:%.*]] = sitofp i32 [[A2]] to float
22 ; SSE-NEXT: [[AB3:%.*]] = sitofp i32 [[A3]] to float
23 ; SSE-NEXT: [[AB4:%.*]] = uitofp i32 [[A4]] to float
24 ; SSE-NEXT: [[AB5:%.*]] = uitofp i32 [[A5]] to float
25 ; SSE-NEXT: [[AB6:%.*]] = uitofp i32 [[A6]] to float
26 ; SSE-NEXT: [[AB7:%.*]] = uitofp i32 [[A7]] to float
27 ; SSE-NEXT: [[R0:%.*]] = insertelement <8 x float> undef, float [[AB0]], i32 0
28 ; SSE-NEXT: [[R1:%.*]] = insertelement <8 x float> [[R0]], float [[AB1]], i32 1
29 ; SSE-NEXT: [[R2:%.*]] = insertelement <8 x float> [[R1]], float [[AB2]], i32 2
30 ; SSE-NEXT: [[R3:%.*]] = insertelement <8 x float> [[R2]], float [[AB3]], i32 3
31 ; SSE-NEXT: [[R4:%.*]] = insertelement <8 x float> [[R3]], float [[AB4]], i32 4
32 ; SSE-NEXT: [[R5:%.*]] = insertelement <8 x float> [[R4]], float [[AB5]], i32 5
33 ; SSE-NEXT: [[R6:%.*]] = insertelement <8 x float> [[R5]], float [[AB6]], i32 6
34 ; SSE-NEXT: [[R7:%.*]] = insertelement <8 x float> [[R6]], float [[AB7]], i32 7
35 ; SSE-NEXT: ret <8 x float> [[R7]]
37 ; SLM-LABEL: @sitofp_uitofp(
38 ; SLM-NEXT: [[A0:%.*]] = extractelement <8 x i32> [[A:%.*]], i32 0
39 ; SLM-NEXT: [[A1:%.*]] = extractelement <8 x i32> [[A]], i32 1
40 ; SLM-NEXT: [[A2:%.*]] = extractelement <8 x i32> [[A]], i32 2
41 ; SLM-NEXT: [[A3:%.*]] = extractelement <8 x i32> [[A]], i32 3
42 ; SLM-NEXT: [[A4:%.*]] = extractelement <8 x i32> [[A]], i32 4
43 ; SLM-NEXT: [[A5:%.*]] = extractelement <8 x i32> [[A]], i32 5
44 ; SLM-NEXT: [[A6:%.*]] = extractelement <8 x i32> [[A]], i32 6
45 ; SLM-NEXT: [[A7:%.*]] = extractelement <8 x i32> [[A]], i32 7
46 ; SLM-NEXT: [[AB0:%.*]] = sitofp i32 [[A0]] to float
47 ; SLM-NEXT: [[AB1:%.*]] = sitofp i32 [[A1]] to float
48 ; SLM-NEXT: [[AB2:%.*]] = sitofp i32 [[A2]] to float
49 ; SLM-NEXT: [[AB3:%.*]] = sitofp i32 [[A3]] to float
50 ; SLM-NEXT: [[AB4:%.*]] = uitofp i32 [[A4]] to float
51 ; SLM-NEXT: [[AB5:%.*]] = uitofp i32 [[A5]] to float
52 ; SLM-NEXT: [[AB6:%.*]] = uitofp i32 [[A6]] to float
53 ; SLM-NEXT: [[AB7:%.*]] = uitofp i32 [[A7]] to float
54 ; SLM-NEXT: [[R0:%.*]] = insertelement <8 x float> undef, float [[AB0]], i32 0
55 ; SLM-NEXT: [[R1:%.*]] = insertelement <8 x float> [[R0]], float [[AB1]], i32 1
56 ; SLM-NEXT: [[R2:%.*]] = insertelement <8 x float> [[R1]], float [[AB2]], i32 2
57 ; SLM-NEXT: [[R3:%.*]] = insertelement <8 x float> [[R2]], float [[AB3]], i32 3
58 ; SLM-NEXT: [[R4:%.*]] = insertelement <8 x float> [[R3]], float [[AB4]], i32 4
59 ; SLM-NEXT: [[R5:%.*]] = insertelement <8 x float> [[R4]], float [[AB5]], i32 5
60 ; SLM-NEXT: [[R6:%.*]] = insertelement <8 x float> [[R5]], float [[AB6]], i32 6
61 ; SLM-NEXT: [[R7:%.*]] = insertelement <8 x float> [[R6]], float [[AB7]], i32 7
62 ; SLM-NEXT: ret <8 x float> [[R7]]
64 ; AVX-LABEL: @sitofp_uitofp(
65 ; AVX-NEXT: [[TMP1:%.*]] = sitofp <8 x i32> [[A:%.*]] to <8 x float>
66 ; AVX-NEXT: [[TMP2:%.*]] = uitofp <8 x i32> [[A]] to <8 x float>
67 ; AVX-NEXT: [[R7:%.*]] = shufflevector <8 x float> [[TMP1]], <8 x float> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>
68 ; AVX-NEXT: ret <8 x float> [[R7]]
70 ; AVX512-LABEL: @sitofp_uitofp(
71 ; AVX512-NEXT: [[TMP1:%.*]] = sitofp <8 x i32> [[A:%.*]] to <8 x float>
72 ; AVX512-NEXT: [[TMP2:%.*]] = uitofp <8 x i32> [[A]] to <8 x float>
73 ; AVX512-NEXT: [[R7:%.*]] = shufflevector <8 x float> [[TMP1]], <8 x float> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>
74 ; AVX512-NEXT: ret <8 x float> [[R7]]
76 %a0 = extractelement <8 x i32> %a, i32 0
77 %a1 = extractelement <8 x i32> %a, i32 1
78 %a2 = extractelement <8 x i32> %a, i32 2
79 %a3 = extractelement <8 x i32> %a, i32 3
80 %a4 = extractelement <8 x i32> %a, i32 4
81 %a5 = extractelement <8 x i32> %a, i32 5
82 %a6 = extractelement <8 x i32> %a, i32 6
83 %a7 = extractelement <8 x i32> %a, i32 7
84 %ab0 = sitofp i32 %a0 to float
85 %ab1 = sitofp i32 %a1 to float
86 %ab2 = sitofp i32 %a2 to float
87 %ab3 = sitofp i32 %a3 to float
88 %ab4 = uitofp i32 %a4 to float
89 %ab5 = uitofp i32 %a5 to float
90 %ab6 = uitofp i32 %a6 to float
91 %ab7 = uitofp i32 %a7 to float
92 %r0 = insertelement <8 x float> undef, float %ab0, i32 0
93 %r1 = insertelement <8 x float> %r0, float %ab1, i32 1
94 %r2 = insertelement <8 x float> %r1, float %ab2, i32 2
95 %r3 = insertelement <8 x float> %r2, float %ab3, i32 3
96 %r4 = insertelement <8 x float> %r3, float %ab4, i32 4
97 %r5 = insertelement <8 x float> %r4, float %ab5, i32 5
98 %r6 = insertelement <8 x float> %r5, float %ab6, i32 6
99 %r7 = insertelement <8 x float> %r6, float %ab7, i32 7
103 define <8 x i32> @fptosi_fptoui(<8 x float> %a) {
104 ; SSE-LABEL: @fptosi_fptoui(
105 ; SSE-NEXT: [[A0:%.*]] = extractelement <8 x float> [[A:%.*]], i32 0
106 ; SSE-NEXT: [[A1:%.*]] = extractelement <8 x float> [[A]], i32 1
107 ; SSE-NEXT: [[A2:%.*]] = extractelement <8 x float> [[A]], i32 2
108 ; SSE-NEXT: [[A3:%.*]] = extractelement <8 x float> [[A]], i32 3
109 ; SSE-NEXT: [[A4:%.*]] = extractelement <8 x float> [[A]], i32 4
110 ; SSE-NEXT: [[A5:%.*]] = extractelement <8 x float> [[A]], i32 5
111 ; SSE-NEXT: [[A6:%.*]] = extractelement <8 x float> [[A]], i32 6
112 ; SSE-NEXT: [[A7:%.*]] = extractelement <8 x float> [[A]], i32 7
113 ; SSE-NEXT: [[AB0:%.*]] = fptosi float [[A0]] to i32
114 ; SSE-NEXT: [[AB1:%.*]] = fptosi float [[A1]] to i32
115 ; SSE-NEXT: [[AB2:%.*]] = fptosi float [[A2]] to i32
116 ; SSE-NEXT: [[AB3:%.*]] = fptosi float [[A3]] to i32
117 ; SSE-NEXT: [[AB4:%.*]] = fptoui float [[A4]] to i32
118 ; SSE-NEXT: [[AB5:%.*]] = fptoui float [[A5]] to i32
119 ; SSE-NEXT: [[AB6:%.*]] = fptoui float [[A6]] to i32
120 ; SSE-NEXT: [[AB7:%.*]] = fptoui float [[A7]] to i32
121 ; SSE-NEXT: [[R0:%.*]] = insertelement <8 x i32> undef, i32 [[AB0]], i32 0
122 ; SSE-NEXT: [[R1:%.*]] = insertelement <8 x i32> [[R0]], i32 [[AB1]], i32 1
123 ; SSE-NEXT: [[R2:%.*]] = insertelement <8 x i32> [[R1]], i32 [[AB2]], i32 2
124 ; SSE-NEXT: [[R3:%.*]] = insertelement <8 x i32> [[R2]], i32 [[AB3]], i32 3
125 ; SSE-NEXT: [[R4:%.*]] = insertelement <8 x i32> [[R3]], i32 [[AB4]], i32 4
126 ; SSE-NEXT: [[R5:%.*]] = insertelement <8 x i32> [[R4]], i32 [[AB5]], i32 5
127 ; SSE-NEXT: [[R6:%.*]] = insertelement <8 x i32> [[R5]], i32 [[AB6]], i32 6
128 ; SSE-NEXT: [[R7:%.*]] = insertelement <8 x i32> [[R6]], i32 [[AB7]], i32 7
129 ; SSE-NEXT: ret <8 x i32> [[R7]]
131 ; SLM-LABEL: @fptosi_fptoui(
132 ; SLM-NEXT: [[A0:%.*]] = extractelement <8 x float> [[A:%.*]], i32 0
133 ; SLM-NEXT: [[A1:%.*]] = extractelement <8 x float> [[A]], i32 1
134 ; SLM-NEXT: [[A2:%.*]] = extractelement <8 x float> [[A]], i32 2
135 ; SLM-NEXT: [[A3:%.*]] = extractelement <8 x float> [[A]], i32 3
136 ; SLM-NEXT: [[A4:%.*]] = extractelement <8 x float> [[A]], i32 4
137 ; SLM-NEXT: [[A5:%.*]] = extractelement <8 x float> [[A]], i32 5
138 ; SLM-NEXT: [[A6:%.*]] = extractelement <8 x float> [[A]], i32 6
139 ; SLM-NEXT: [[A7:%.*]] = extractelement <8 x float> [[A]], i32 7
140 ; SLM-NEXT: [[AB0:%.*]] = fptosi float [[A0]] to i32
141 ; SLM-NEXT: [[AB1:%.*]] = fptosi float [[A1]] to i32
142 ; SLM-NEXT: [[AB2:%.*]] = fptosi float [[A2]] to i32
143 ; SLM-NEXT: [[AB3:%.*]] = fptosi float [[A3]] to i32
144 ; SLM-NEXT: [[AB4:%.*]] = fptoui float [[A4]] to i32
145 ; SLM-NEXT: [[AB5:%.*]] = fptoui float [[A5]] to i32
146 ; SLM-NEXT: [[AB6:%.*]] = fptoui float [[A6]] to i32
147 ; SLM-NEXT: [[AB7:%.*]] = fptoui float [[A7]] to i32
148 ; SLM-NEXT: [[R0:%.*]] = insertelement <8 x i32> undef, i32 [[AB0]], i32 0
149 ; SLM-NEXT: [[R1:%.*]] = insertelement <8 x i32> [[R0]], i32 [[AB1]], i32 1
150 ; SLM-NEXT: [[R2:%.*]] = insertelement <8 x i32> [[R1]], i32 [[AB2]], i32 2
151 ; SLM-NEXT: [[R3:%.*]] = insertelement <8 x i32> [[R2]], i32 [[AB3]], i32 3
152 ; SLM-NEXT: [[R4:%.*]] = insertelement <8 x i32> [[R3]], i32 [[AB4]], i32 4
153 ; SLM-NEXT: [[R5:%.*]] = insertelement <8 x i32> [[R4]], i32 [[AB5]], i32 5
154 ; SLM-NEXT: [[R6:%.*]] = insertelement <8 x i32> [[R5]], i32 [[AB6]], i32 6
155 ; SLM-NEXT: [[R7:%.*]] = insertelement <8 x i32> [[R6]], i32 [[AB7]], i32 7
156 ; SLM-NEXT: ret <8 x i32> [[R7]]
158 ; AVX-LABEL: @fptosi_fptoui(
159 ; AVX-NEXT: [[A0:%.*]] = extractelement <8 x float> [[A:%.*]], i32 0
160 ; AVX-NEXT: [[A1:%.*]] = extractelement <8 x float> [[A]], i32 1
161 ; AVX-NEXT: [[A2:%.*]] = extractelement <8 x float> [[A]], i32 2
162 ; AVX-NEXT: [[A3:%.*]] = extractelement <8 x float> [[A]], i32 3
163 ; AVX-NEXT: [[A4:%.*]] = extractelement <8 x float> [[A]], i32 4
164 ; AVX-NEXT: [[A5:%.*]] = extractelement <8 x float> [[A]], i32 5
165 ; AVX-NEXT: [[A6:%.*]] = extractelement <8 x float> [[A]], i32 6
166 ; AVX-NEXT: [[A7:%.*]] = extractelement <8 x float> [[A]], i32 7
167 ; AVX-NEXT: [[AB0:%.*]] = fptosi float [[A0]] to i32
168 ; AVX-NEXT: [[AB1:%.*]] = fptosi float [[A1]] to i32
169 ; AVX-NEXT: [[AB2:%.*]] = fptosi float [[A2]] to i32
170 ; AVX-NEXT: [[AB3:%.*]] = fptosi float [[A3]] to i32
171 ; AVX-NEXT: [[AB4:%.*]] = fptoui float [[A4]] to i32
172 ; AVX-NEXT: [[AB5:%.*]] = fptoui float [[A5]] to i32
173 ; AVX-NEXT: [[AB6:%.*]] = fptoui float [[A6]] to i32
174 ; AVX-NEXT: [[AB7:%.*]] = fptoui float [[A7]] to i32
175 ; AVX-NEXT: [[R0:%.*]] = insertelement <8 x i32> undef, i32 [[AB0]], i32 0
176 ; AVX-NEXT: [[R1:%.*]] = insertelement <8 x i32> [[R0]], i32 [[AB1]], i32 1
177 ; AVX-NEXT: [[R2:%.*]] = insertelement <8 x i32> [[R1]], i32 [[AB2]], i32 2
178 ; AVX-NEXT: [[R3:%.*]] = insertelement <8 x i32> [[R2]], i32 [[AB3]], i32 3
179 ; AVX-NEXT: [[R4:%.*]] = insertelement <8 x i32> [[R3]], i32 [[AB4]], i32 4
180 ; AVX-NEXT: [[R5:%.*]] = insertelement <8 x i32> [[R4]], i32 [[AB5]], i32 5
181 ; AVX-NEXT: [[R6:%.*]] = insertelement <8 x i32> [[R5]], i32 [[AB6]], i32 6
182 ; AVX-NEXT: [[R7:%.*]] = insertelement <8 x i32> [[R6]], i32 [[AB7]], i32 7
183 ; AVX-NEXT: ret <8 x i32> [[R7]]
185 ; AVX512-LABEL: @fptosi_fptoui(
186 ; AVX512-NEXT: [[TMP1:%.*]] = fptosi <8 x float> [[A:%.*]] to <8 x i32>
187 ; AVX512-NEXT: [[TMP2:%.*]] = fptoui <8 x float> [[A]] to <8 x i32>
188 ; AVX512-NEXT: [[R7:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>
189 ; AVX512-NEXT: ret <8 x i32> [[R7]]
191 %a0 = extractelement <8 x float> %a, i32 0
192 %a1 = extractelement <8 x float> %a, i32 1
193 %a2 = extractelement <8 x float> %a, i32 2
194 %a3 = extractelement <8 x float> %a, i32 3
195 %a4 = extractelement <8 x float> %a, i32 4
196 %a5 = extractelement <8 x float> %a, i32 5
197 %a6 = extractelement <8 x float> %a, i32 6
198 %a7 = extractelement <8 x float> %a, i32 7
199 %ab0 = fptosi float %a0 to i32
200 %ab1 = fptosi float %a1 to i32
201 %ab2 = fptosi float %a2 to i32
202 %ab3 = fptosi float %a3 to i32
203 %ab4 = fptoui float %a4 to i32
204 %ab5 = fptoui float %a5 to i32
205 %ab6 = fptoui float %a6 to i32
206 %ab7 = fptoui float %a7 to i32
207 %r0 = insertelement <8 x i32> undef, i32 %ab0, i32 0
208 %r1 = insertelement <8 x i32> %r0, i32 %ab1, i32 1
209 %r2 = insertelement <8 x i32> %r1, i32 %ab2, i32 2
210 %r3 = insertelement <8 x i32> %r2, i32 %ab3, i32 3
211 %r4 = insertelement <8 x i32> %r3, i32 %ab4, i32 4
212 %r5 = insertelement <8 x i32> %r4, i32 %ab5, i32 5
213 %r6 = insertelement <8 x i32> %r5, i32 %ab6, i32 6
214 %r7 = insertelement <8 x i32> %r6, i32 %ab7, i32 7
218 define <8 x float> @fneg_fabs(<8 x float> %a) {
219 ; CHECK-LABEL: @fneg_fabs(
220 ; CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x float> [[A:%.*]] to <8 x i32>
221 ; CHECK-NEXT: [[TMP2:%.*]] = xor <8 x i32> [[TMP1]], <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 undef, i32 undef, i32 undef, i32 undef>
222 ; CHECK-NEXT: [[TMP3:%.*]] = and <8 x i32> [[TMP1]], <i32 undef, i32 undef, i32 undef, i32 undef, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>
223 ; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <8 x i32> [[TMP2]], <8 x i32> [[TMP3]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>
224 ; CHECK-NEXT: [[TMP5:%.*]] = bitcast <8 x i32> [[TMP4]] to <8 x float>
225 ; CHECK-NEXT: ret <8 x float> [[TMP5]]
227 %a0 = extractelement <8 x float> %a, i32 0
228 %a1 = extractelement <8 x float> %a, i32 1
229 %a2 = extractelement <8 x float> %a, i32 2
230 %a3 = extractelement <8 x float> %a, i32 3
231 %a4 = extractelement <8 x float> %a, i32 4
232 %a5 = extractelement <8 x float> %a, i32 5
233 %a6 = extractelement <8 x float> %a, i32 6
234 %a7 = extractelement <8 x float> %a, i32 7
235 %aa0 = bitcast float %a0 to i32
236 %aa1 = bitcast float %a1 to i32
237 %aa2 = bitcast float %a2 to i32
238 %aa3 = bitcast float %a3 to i32
239 %aa4 = bitcast float %a4 to i32
240 %aa5 = bitcast float %a5 to i32
241 %aa6 = bitcast float %a6 to i32
242 %aa7 = bitcast float %a7 to i32
243 %ab0 = xor i32 %aa0, -2147483648
244 %ab1 = xor i32 %aa1, -2147483648
245 %ab2 = xor i32 %aa2, -2147483648
246 %ab3 = xor i32 %aa3, -2147483648
247 %ab4 = and i32 %aa4, 2147483647
248 %ab5 = and i32 %aa5, 2147483647
249 %ab6 = and i32 %aa6, 2147483647
250 %ab7 = and i32 %aa7, 2147483647
251 %ac0 = bitcast i32 %ab0 to float
252 %ac1 = bitcast i32 %ab1 to float
253 %ac2 = bitcast i32 %ab2 to float
254 %ac3 = bitcast i32 %ab3 to float
255 %ac4 = bitcast i32 %ab4 to float
256 %ac5 = bitcast i32 %ab5 to float
257 %ac6 = bitcast i32 %ab6 to float
258 %ac7 = bitcast i32 %ab7 to float
259 %r0 = insertelement <8 x float> undef, float %ac0, i32 0
260 %r1 = insertelement <8 x float> %r0, float %ac1, i32 1
261 %r2 = insertelement <8 x float> %r1, float %ac2, i32 2
262 %r3 = insertelement <8 x float> %r2, float %ac3, i32 3
263 %r4 = insertelement <8 x float> %r3, float %ac4, i32 4
264 %r5 = insertelement <8 x float> %r4, float %ac5, i32 5
265 %r6 = insertelement <8 x float> %r5, float %ac6, i32 6
266 %r7 = insertelement <8 x float> %r6, float %ac7, i32 7
270 define <8 x i32> @sext_zext(<8 x i16> %a) {
271 ; CHECK-LABEL: @sext_zext(
272 ; CHECK-NEXT: [[TMP1:%.*]] = sext <8 x i16> [[A:%.*]] to <8 x i32>
273 ; CHECK-NEXT: [[TMP2:%.*]] = zext <8 x i16> [[A]] to <8 x i32>
274 ; CHECK-NEXT: [[R7:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>
275 ; CHECK-NEXT: ret <8 x i32> [[R7]]
277 %a0 = extractelement <8 x i16> %a, i32 0
278 %a1 = extractelement <8 x i16> %a, i32 1
279 %a2 = extractelement <8 x i16> %a, i32 2
280 %a3 = extractelement <8 x i16> %a, i32 3
281 %a4 = extractelement <8 x i16> %a, i32 4
282 %a5 = extractelement <8 x i16> %a, i32 5
283 %a6 = extractelement <8 x i16> %a, i32 6
284 %a7 = extractelement <8 x i16> %a, i32 7
285 %ab0 = sext i16 %a0 to i32
286 %ab1 = sext i16 %a1 to i32
287 %ab2 = sext i16 %a2 to i32
288 %ab3 = sext i16 %a3 to i32
289 %ab4 = zext i16 %a4 to i32
290 %ab5 = zext i16 %a5 to i32
291 %ab6 = zext i16 %a6 to i32
292 %ab7 = zext i16 %a7 to i32
293 %r0 = insertelement <8 x i32> undef, i32 %ab0, i32 0
294 %r1 = insertelement <8 x i32> %r0, i32 %ab1, i32 1
295 %r2 = insertelement <8 x i32> %r1, i32 %ab2, i32 2
296 %r3 = insertelement <8 x i32> %r2, i32 %ab3, i32 3
297 %r4 = insertelement <8 x i32> %r3, i32 %ab4, i32 4
298 %r5 = insertelement <8 x i32> %r4, i32 %ab5, i32 5
299 %r6 = insertelement <8 x i32> %r5, i32 %ab6, i32 6
300 %r7 = insertelement <8 x i32> %r6, i32 %ab7, i32 7
304 define <8 x float> @sitofp_4i32_8i16(<4 x i32> %a, <8 x i16> %b) {
305 ; CHECK-LABEL: @sitofp_4i32_8i16(
306 ; CHECK-NEXT: [[B0:%.*]] = extractelement <8 x i16> [[B:%.*]], i32 0
307 ; CHECK-NEXT: [[B1:%.*]] = extractelement <8 x i16> [[B]], i32 1
308 ; CHECK-NEXT: [[B2:%.*]] = extractelement <8 x i16> [[B]], i32 2
309 ; CHECK-NEXT: [[B3:%.*]] = extractelement <8 x i16> [[B]], i32 3
310 ; CHECK-NEXT: [[TMP1:%.*]] = sitofp <4 x i32> [[A:%.*]] to <4 x float>
311 ; CHECK-NEXT: [[AB4:%.*]] = sitofp i16 [[B0]] to float
312 ; CHECK-NEXT: [[AB5:%.*]] = sitofp i16 [[B1]] to float
313 ; CHECK-NEXT: [[AB6:%.*]] = sitofp i16 [[B2]] to float
314 ; CHECK-NEXT: [[AB7:%.*]] = sitofp i16 [[B3]] to float
315 ; CHECK-NEXT: [[TMP2:%.*]] = extractelement <4 x float> [[TMP1]], i32 0
316 ; CHECK-NEXT: [[R0:%.*]] = insertelement <8 x float> undef, float [[TMP2]], i32 0
317 ; CHECK-NEXT: [[TMP3:%.*]] = extractelement <4 x float> [[TMP1]], i32 1
318 ; CHECK-NEXT: [[R1:%.*]] = insertelement <8 x float> [[R0]], float [[TMP3]], i32 1
319 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x float> [[TMP1]], i32 2
320 ; CHECK-NEXT: [[R2:%.*]] = insertelement <8 x float> [[R1]], float [[TMP4]], i32 2
321 ; CHECK-NEXT: [[TMP5:%.*]] = extractelement <4 x float> [[TMP1]], i32 3
322 ; CHECK-NEXT: [[R3:%.*]] = insertelement <8 x float> [[R2]], float [[TMP5]], i32 3
323 ; CHECK-NEXT: [[R4:%.*]] = insertelement <8 x float> [[R3]], float [[AB4]], i32 4
324 ; CHECK-NEXT: [[R5:%.*]] = insertelement <8 x float> [[R4]], float [[AB5]], i32 5
325 ; CHECK-NEXT: [[R6:%.*]] = insertelement <8 x float> [[R5]], float [[AB6]], i32 6
326 ; CHECK-NEXT: [[R7:%.*]] = insertelement <8 x float> [[R6]], float [[AB7]], i32 7
327 ; CHECK-NEXT: ret <8 x float> [[R7]]
329 %a0 = extractelement <4 x i32> %a, i32 0
330 %a1 = extractelement <4 x i32> %a, i32 1
331 %a2 = extractelement <4 x i32> %a, i32 2
332 %a3 = extractelement <4 x i32> %a, i32 3
333 %b0 = extractelement <8 x i16> %b, i32 0
334 %b1 = extractelement <8 x i16> %b, i32 1
335 %b2 = extractelement <8 x i16> %b, i32 2
336 %b3 = extractelement <8 x i16> %b, i32 3
337 %ab0 = sitofp i32 %a0 to float
338 %ab1 = sitofp i32 %a1 to float
339 %ab2 = sitofp i32 %a2 to float
340 %ab3 = sitofp i32 %a3 to float
341 %ab4 = sitofp i16 %b0 to float
342 %ab5 = sitofp i16 %b1 to float
343 %ab6 = sitofp i16 %b2 to float
344 %ab7 = sitofp i16 %b3 to float
345 %r0 = insertelement <8 x float> undef, float %ab0, i32 0
346 %r1 = insertelement <8 x float> %r0, float %ab1, i32 1
347 %r2 = insertelement <8 x float> %r1, float %ab2, i32 2
348 %r3 = insertelement <8 x float> %r2, float %ab3, i32 3
349 %r4 = insertelement <8 x float> %r3, float %ab4, i32 4
350 %r5 = insertelement <8 x float> %r4, float %ab5, i32 5
351 %r6 = insertelement <8 x float> %r5, float %ab6, i32 6
352 %r7 = insertelement <8 x float> %r6, float %ab7, i32 7
356 ; Inspired by PR38154
357 define <8 x float> @sitofp_uitofp_4i32_8i16_16i8(<4 x i32> %a, <8 x i16> %b, <16 x i8> %c) {
358 ; SSE-LABEL: @sitofp_uitofp_4i32_8i16_16i8(
359 ; SSE-NEXT: [[A0:%.*]] = extractelement <4 x i32> [[A:%.*]], i32 0
360 ; SSE-NEXT: [[A1:%.*]] = extractelement <4 x i32> [[A]], i32 1
361 ; SSE-NEXT: [[A2:%.*]] = extractelement <4 x i32> [[A]], i32 2
362 ; SSE-NEXT: [[A3:%.*]] = extractelement <4 x i32> [[A]], i32 3
363 ; SSE-NEXT: [[B0:%.*]] = extractelement <8 x i16> [[B:%.*]], i32 0
364 ; SSE-NEXT: [[B1:%.*]] = extractelement <8 x i16> [[B]], i32 1
365 ; SSE-NEXT: [[C0:%.*]] = extractelement <16 x i8> [[C:%.*]], i32 0
366 ; SSE-NEXT: [[C1:%.*]] = extractelement <16 x i8> [[C]], i32 1
367 ; SSE-NEXT: [[AB0:%.*]] = sitofp i32 [[A0]] to float
368 ; SSE-NEXT: [[AB1:%.*]] = sitofp i32 [[A1]] to float
369 ; SSE-NEXT: [[AB2:%.*]] = uitofp i32 [[A2]] to float
370 ; SSE-NEXT: [[AB3:%.*]] = uitofp i32 [[A3]] to float
371 ; SSE-NEXT: [[AB4:%.*]] = sitofp i16 [[B0]] to float
372 ; SSE-NEXT: [[AB5:%.*]] = uitofp i16 [[B1]] to float
373 ; SSE-NEXT: [[AB6:%.*]] = sitofp i8 [[C0]] to float
374 ; SSE-NEXT: [[AB7:%.*]] = uitofp i8 [[C1]] to float
375 ; SSE-NEXT: [[R0:%.*]] = insertelement <8 x float> undef, float [[AB0]], i32 0
376 ; SSE-NEXT: [[R1:%.*]] = insertelement <8 x float> [[R0]], float [[AB1]], i32 1
377 ; SSE-NEXT: [[R2:%.*]] = insertelement <8 x float> [[R1]], float [[AB2]], i32 2
378 ; SSE-NEXT: [[R3:%.*]] = insertelement <8 x float> [[R2]], float [[AB3]], i32 3
379 ; SSE-NEXT: [[R4:%.*]] = insertelement <8 x float> [[R3]], float [[AB4]], i32 4
380 ; SSE-NEXT: [[R5:%.*]] = insertelement <8 x float> [[R4]], float [[AB5]], i32 5
381 ; SSE-NEXT: [[R6:%.*]] = insertelement <8 x float> [[R5]], float [[AB6]], i32 6
382 ; SSE-NEXT: [[R7:%.*]] = insertelement <8 x float> [[R6]], float [[AB7]], i32 7
383 ; SSE-NEXT: ret <8 x float> [[R7]]
385 ; SLM-LABEL: @sitofp_uitofp_4i32_8i16_16i8(
386 ; SLM-NEXT: [[A0:%.*]] = extractelement <4 x i32> [[A:%.*]], i32 0
387 ; SLM-NEXT: [[A1:%.*]] = extractelement <4 x i32> [[A]], i32 1
388 ; SLM-NEXT: [[A2:%.*]] = extractelement <4 x i32> [[A]], i32 2
389 ; SLM-NEXT: [[A3:%.*]] = extractelement <4 x i32> [[A]], i32 3
390 ; SLM-NEXT: [[B0:%.*]] = extractelement <8 x i16> [[B:%.*]], i32 0
391 ; SLM-NEXT: [[B1:%.*]] = extractelement <8 x i16> [[B]], i32 1
392 ; SLM-NEXT: [[C0:%.*]] = extractelement <16 x i8> [[C:%.*]], i32 0
393 ; SLM-NEXT: [[C1:%.*]] = extractelement <16 x i8> [[C]], i32 1
394 ; SLM-NEXT: [[AB0:%.*]] = sitofp i32 [[A0]] to float
395 ; SLM-NEXT: [[AB1:%.*]] = sitofp i32 [[A1]] to float
396 ; SLM-NEXT: [[AB2:%.*]] = uitofp i32 [[A2]] to float
397 ; SLM-NEXT: [[AB3:%.*]] = uitofp i32 [[A3]] to float
398 ; SLM-NEXT: [[AB4:%.*]] = sitofp i16 [[B0]] to float
399 ; SLM-NEXT: [[AB5:%.*]] = uitofp i16 [[B1]] to float
400 ; SLM-NEXT: [[AB6:%.*]] = sitofp i8 [[C0]] to float
401 ; SLM-NEXT: [[AB7:%.*]] = uitofp i8 [[C1]] to float
402 ; SLM-NEXT: [[R0:%.*]] = insertelement <8 x float> undef, float [[AB0]], i32 0
403 ; SLM-NEXT: [[R1:%.*]] = insertelement <8 x float> [[R0]], float [[AB1]], i32 1
404 ; SLM-NEXT: [[R2:%.*]] = insertelement <8 x float> [[R1]], float [[AB2]], i32 2
405 ; SLM-NEXT: [[R3:%.*]] = insertelement <8 x float> [[R2]], float [[AB3]], i32 3
406 ; SLM-NEXT: [[R4:%.*]] = insertelement <8 x float> [[R3]], float [[AB4]], i32 4
407 ; SLM-NEXT: [[R5:%.*]] = insertelement <8 x float> [[R4]], float [[AB5]], i32 5
408 ; SLM-NEXT: [[R6:%.*]] = insertelement <8 x float> [[R5]], float [[AB6]], i32 6
409 ; SLM-NEXT: [[R7:%.*]] = insertelement <8 x float> [[R6]], float [[AB7]], i32 7
410 ; SLM-NEXT: ret <8 x float> [[R7]]
412 ; AVX-LABEL: @sitofp_uitofp_4i32_8i16_16i8(
413 ; AVX-NEXT: [[A0:%.*]] = extractelement <4 x i32> [[A:%.*]], i32 0
414 ; AVX-NEXT: [[A1:%.*]] = extractelement <4 x i32> [[A]], i32 1
415 ; AVX-NEXT: [[A2:%.*]] = extractelement <4 x i32> [[A]], i32 2
416 ; AVX-NEXT: [[A3:%.*]] = extractelement <4 x i32> [[A]], i32 3
417 ; AVX-NEXT: [[B0:%.*]] = extractelement <8 x i16> [[B:%.*]], i32 0
418 ; AVX-NEXT: [[B1:%.*]] = extractelement <8 x i16> [[B]], i32 1
419 ; AVX-NEXT: [[C0:%.*]] = extractelement <16 x i8> [[C:%.*]], i32 0
420 ; AVX-NEXT: [[C1:%.*]] = extractelement <16 x i8> [[C]], i32 1
421 ; AVX-NEXT: [[AB0:%.*]] = sitofp i32 [[A0]] to float
422 ; AVX-NEXT: [[AB1:%.*]] = sitofp i32 [[A1]] to float
423 ; AVX-NEXT: [[AB2:%.*]] = uitofp i32 [[A2]] to float
424 ; AVX-NEXT: [[AB3:%.*]] = uitofp i32 [[A3]] to float
425 ; AVX-NEXT: [[AB4:%.*]] = sitofp i16 [[B0]] to float
426 ; AVX-NEXT: [[AB5:%.*]] = uitofp i16 [[B1]] to float
427 ; AVX-NEXT: [[AB6:%.*]] = sitofp i8 [[C0]] to float
428 ; AVX-NEXT: [[AB7:%.*]] = uitofp i8 [[C1]] to float
429 ; AVX-NEXT: [[R0:%.*]] = insertelement <8 x float> undef, float [[AB0]], i32 0
430 ; AVX-NEXT: [[R1:%.*]] = insertelement <8 x float> [[R0]], float [[AB1]], i32 1
431 ; AVX-NEXT: [[R2:%.*]] = insertelement <8 x float> [[R1]], float [[AB2]], i32 2
432 ; AVX-NEXT: [[R3:%.*]] = insertelement <8 x float> [[R2]], float [[AB3]], i32 3
433 ; AVX-NEXT: [[R4:%.*]] = insertelement <8 x float> [[R3]], float [[AB4]], i32 4
434 ; AVX-NEXT: [[R5:%.*]] = insertelement <8 x float> [[R4]], float [[AB5]], i32 5
435 ; AVX-NEXT: [[R6:%.*]] = insertelement <8 x float> [[R5]], float [[AB6]], i32 6
436 ; AVX-NEXT: [[R7:%.*]] = insertelement <8 x float> [[R6]], float [[AB7]], i32 7
437 ; AVX-NEXT: ret <8 x float> [[R7]]
439 ; AVX512-LABEL: @sitofp_uitofp_4i32_8i16_16i8(
440 ; AVX512-NEXT: [[B0:%.*]] = extractelement <8 x i16> [[B:%.*]], i32 0
441 ; AVX512-NEXT: [[B1:%.*]] = extractelement <8 x i16> [[B]], i32 1
442 ; AVX512-NEXT: [[C0:%.*]] = extractelement <16 x i8> [[C:%.*]], i32 0
443 ; AVX512-NEXT: [[C1:%.*]] = extractelement <16 x i8> [[C]], i32 1
444 ; AVX512-NEXT: [[TMP1:%.*]] = sitofp <4 x i32> [[A:%.*]] to <4 x float>
445 ; AVX512-NEXT: [[TMP2:%.*]] = uitofp <4 x i32> [[A]] to <4 x float>
446 ; AVX512-NEXT: [[AB4:%.*]] = sitofp i16 [[B0]] to float
447 ; AVX512-NEXT: [[AB5:%.*]] = uitofp i16 [[B1]] to float
448 ; AVX512-NEXT: [[AB6:%.*]] = sitofp i8 [[C0]] to float
449 ; AVX512-NEXT: [[AB7:%.*]] = uitofp i8 [[C1]] to float
450 ; AVX512-NEXT: [[TMP3:%.*]] = extractelement <4 x float> [[TMP1]], i32 0
451 ; AVX512-NEXT: [[R0:%.*]] = insertelement <8 x float> undef, float [[TMP3]], i32 0
452 ; AVX512-NEXT: [[TMP4:%.*]] = extractelement <4 x float> [[TMP1]], i32 1
453 ; AVX512-NEXT: [[R1:%.*]] = insertelement <8 x float> [[R0]], float [[TMP4]], i32 1
454 ; AVX512-NEXT: [[TMP5:%.*]] = extractelement <4 x float> [[TMP2]], i32 2
455 ; AVX512-NEXT: [[R2:%.*]] = insertelement <8 x float> [[R1]], float [[TMP5]], i32 2
456 ; AVX512-NEXT: [[TMP6:%.*]] = extractelement <4 x float> [[TMP2]], i32 3
457 ; AVX512-NEXT: [[R3:%.*]] = insertelement <8 x float> [[R2]], float [[TMP6]], i32 3
458 ; AVX512-NEXT: [[R4:%.*]] = insertelement <8 x float> [[R3]], float [[AB4]], i32 4
459 ; AVX512-NEXT: [[R5:%.*]] = insertelement <8 x float> [[R4]], float [[AB5]], i32 5
460 ; AVX512-NEXT: [[R6:%.*]] = insertelement <8 x float> [[R5]], float [[AB6]], i32 6
461 ; AVX512-NEXT: [[R7:%.*]] = insertelement <8 x float> [[R6]], float [[AB7]], i32 7
462 ; AVX512-NEXT: ret <8 x float> [[R7]]
464 %a0 = extractelement <4 x i32> %a, i32 0
465 %a1 = extractelement <4 x i32> %a, i32 1
466 %a2 = extractelement <4 x i32> %a, i32 2
467 %a3 = extractelement <4 x i32> %a, i32 3
468 %b0 = extractelement <8 x i16> %b, i32 0
469 %b1 = extractelement <8 x i16> %b, i32 1
470 %c0 = extractelement <16 x i8> %c, i32 0
471 %c1 = extractelement <16 x i8> %c, i32 1
472 %ab0 = sitofp i32 %a0 to float
473 %ab1 = sitofp i32 %a1 to float
474 %ab2 = uitofp i32 %a2 to float
475 %ab3 = uitofp i32 %a3 to float
476 %ab4 = sitofp i16 %b0 to float
477 %ab5 = uitofp i16 %b1 to float
478 %ab6 = sitofp i8 %c0 to float
479 %ab7 = uitofp i8 %c1 to float
480 %r0 = insertelement <8 x float> undef, float %ab0, i32 0
481 %r1 = insertelement <8 x float> %r0, float %ab1, i32 1
482 %r2 = insertelement <8 x float> %r1, float %ab2, i32 2
483 %r3 = insertelement <8 x float> %r2, float %ab3, i32 3
484 %r4 = insertelement <8 x float> %r3, float %ab4, i32 4
485 %r5 = insertelement <8 x float> %r4, float %ab5, i32 5
486 %r6 = insertelement <8 x float> %r5, float %ab6, i32 6
487 %r7 = insertelement <8 x float> %r6, float %ab7, i32 7