1 ; RUN: opt < %s -mtriple=aarch64--linux-gnu -cost-model -analyze | FileCheck %s --check-prefix=COST
2 ; RUN: llc < %s -mtriple=aarch64--linux-gnu | FileCheck %s --check-prefix=CODE
5 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <8 x i8> %a to <8 x i16>
6 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = zext <8 x i8> %b to <8 x i16>
8 ; CODE: uaddl v0.8h, v0.8b, v1.8b
9 define <8 x i16> @uaddl_8h(<8 x i8> %a, <8 x i8> %b) {
10 %tmp0 = zext <8 x i8> %a to <8 x i16>
11 %tmp1 = zext <8 x i8> %b to <8 x i16>
12 %tmp2 = add <8 x i16> %tmp0, %tmp1
16 ; COST-LABEL: uaddl_4s
17 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <4 x i16> %a to <4 x i32>
18 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = zext <4 x i16> %b to <4 x i32>
19 ; CODE-LABEL: uaddl_4s
20 ; CODE: uaddl v0.4s, v0.4h, v1.4h
21 define <4 x i32> @uaddl_4s(<4 x i16> %a, <4 x i16> %b) {
22 %tmp0 = zext <4 x i16> %a to <4 x i32>
23 %tmp1 = zext <4 x i16> %b to <4 x i32>
24 %tmp2 = add <4 x i32> %tmp0, %tmp1
28 ; COST-LABEL: uaddl_2d
29 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <2 x i32> %a to <2 x i64>
30 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = zext <2 x i32> %b to <2 x i64>
31 ; CODE-LABEL: uaddl_2d
32 ; CODE: uaddl v0.2d, v0.2s, v1.2s
33 define <2 x i64> @uaddl_2d(<2 x i32> %a, <2 x i32> %b) {
34 %tmp0 = zext <2 x i32> %a to <2 x i64>
35 %tmp1 = zext <2 x i32> %b to <2 x i64>
36 %tmp2 = add <2 x i64> %tmp0, %tmp1
40 ; COST-LABEL: uaddl2_8h
41 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <16 x i8> %a to <16 x i16>
42 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = zext <16 x i8> %b to <16 x i16>
43 ; CODE-LABEL: uaddl2_8h
44 ; CODE: uaddl2 v2.8h, v0.16b, v1.16b
45 ; CODE-NEXT: uaddl v0.8h, v0.8b, v1.8b
46 define <16 x i16> @uaddl2_8h(<16 x i8> %a, <16 x i8> %b) {
47 %tmp0 = zext <16 x i8> %a to <16 x i16>
48 %tmp1 = zext <16 x i8> %b to <16 x i16>
49 %tmp2 = add <16 x i16> %tmp0, %tmp1
53 ; COST-LABEL: uaddl2_4s
54 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <8 x i16> %a to <8 x i32>
55 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = zext <8 x i16> %b to <8 x i32>
56 ; CODE-LABEL: uaddl2_4s
57 ; CODE: uaddl2 v2.4s, v0.8h, v1.8h
58 ; CODE-NEXT: uaddl v0.4s, v0.4h, v1.4h
59 define <8 x i32> @uaddl2_4s(<8 x i16> %a, <8 x i16> %b) {
60 %tmp0 = zext <8 x i16> %a to <8 x i32>
61 %tmp1 = zext <8 x i16> %b to <8 x i32>
62 %tmp2 = add <8 x i32> %tmp0, %tmp1
66 ; COST-LABEL: uaddl2_2d
67 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <4 x i32> %a to <4 x i64>
68 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = zext <4 x i32> %b to <4 x i64>
69 ; CODE-LABEL: uaddl2_2d
70 ; CODE: uaddl2 v2.2d, v0.4s, v1.4s
71 ; CODE-NEXT: uaddl v0.2d, v0.2s, v1.2s
72 define <4 x i64> @uaddl2_2d(<4 x i32> %a, <4 x i32> %b) {
73 %tmp0 = zext <4 x i32> %a to <4 x i64>
74 %tmp1 = zext <4 x i32> %b to <4 x i64>
75 %tmp2 = add <4 x i64> %tmp0, %tmp1
79 ; COST-LABEL: saddl_8h
80 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <8 x i8> %a to <8 x i16>
81 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = sext <8 x i8> %b to <8 x i16>
82 ; CODE-LABEL: saddl_8h
83 ; CODE: saddl v0.8h, v0.8b, v1.8b
84 define <8 x i16> @saddl_8h(<8 x i8> %a, <8 x i8> %b) {
85 %tmp0 = sext <8 x i8> %a to <8 x i16>
86 %tmp1 = sext <8 x i8> %b to <8 x i16>
87 %tmp2 = add <8 x i16> %tmp0, %tmp1
91 ; COST-LABEL: saddl_4s
92 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <4 x i16> %a to <4 x i32>
93 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = sext <4 x i16> %b to <4 x i32>
94 ; CODE-LABEL: saddl_4s
95 ; CODE: saddl v0.4s, v0.4h, v1.4h
96 define <4 x i32> @saddl_4s(<4 x i16> %a, <4 x i16> %b) {
97 %tmp0 = sext <4 x i16> %a to <4 x i32>
98 %tmp1 = sext <4 x i16> %b to <4 x i32>
99 %tmp2 = add <4 x i32> %tmp0, %tmp1
103 ; COST-LABEL: saddl_2d
104 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <2 x i32> %a to <2 x i64>
105 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = sext <2 x i32> %b to <2 x i64>
106 ; CODE-LABEL: saddl_2d
107 ; CODE: saddl v0.2d, v0.2s, v1.2s
108 define <2 x i64> @saddl_2d(<2 x i32> %a, <2 x i32> %b) {
109 %tmp0 = sext <2 x i32> %a to <2 x i64>
110 %tmp1 = sext <2 x i32> %b to <2 x i64>
111 %tmp2 = add <2 x i64> %tmp0, %tmp1
115 ; COST-LABEL: saddl2_8h
116 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <16 x i8> %a to <16 x i16>
117 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = sext <16 x i8> %b to <16 x i16>
118 ; CODE-LABEL: saddl2_8h
119 ; CODE: saddl2 v2.8h, v0.16b, v1.16b
120 ; CODE-NEXT: saddl v0.8h, v0.8b, v1.8b
121 define <16 x i16> @saddl2_8h(<16 x i8> %a, <16 x i8> %b) {
122 %tmp0 = sext <16 x i8> %a to <16 x i16>
123 %tmp1 = sext <16 x i8> %b to <16 x i16>
124 %tmp2 = add <16 x i16> %tmp0, %tmp1
128 ; COST-LABEL: saddl2_4s
129 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <8 x i16> %a to <8 x i32>
130 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = sext <8 x i16> %b to <8 x i32>
131 ; CODE-LABEL: saddl2_4s
132 ; CODE: saddl2 v2.4s, v0.8h, v1.8h
133 ; CODE-NEXT: saddl v0.4s, v0.4h, v1.4h
134 define <8 x i32> @saddl2_4s(<8 x i16> %a, <8 x i16> %b) {
135 %tmp0 = sext <8 x i16> %a to <8 x i32>
136 %tmp1 = sext <8 x i16> %b to <8 x i32>
137 %tmp2 = add <8 x i32> %tmp0, %tmp1
141 ; COST-LABEL: saddl2_2d
142 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <4 x i32> %a to <4 x i64>
143 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = sext <4 x i32> %b to <4 x i64>
144 ; CODE-LABEL: saddl2_2d
145 ; CODE: saddl2 v2.2d, v0.4s, v1.4s
146 ; CODE-NEXT: saddl v0.2d, v0.2s, v1.2s
147 define <4 x i64> @saddl2_2d(<4 x i32> %a, <4 x i32> %b) {
148 %tmp0 = sext <4 x i32> %a to <4 x i64>
149 %tmp1 = sext <4 x i32> %b to <4 x i64>
150 %tmp2 = add <4 x i64> %tmp0, %tmp1
154 ; COST-LABEL: usubl_8h
155 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <8 x i8> %a to <8 x i16>
156 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = zext <8 x i8> %b to <8 x i16>
157 ; CODE-LABEL: usubl_8h
158 ; CODE: usubl v0.8h, v0.8b, v1.8b
159 define <8 x i16> @usubl_8h(<8 x i8> %a, <8 x i8> %b) {
160 %tmp0 = zext <8 x i8> %a to <8 x i16>
161 %tmp1 = zext <8 x i8> %b to <8 x i16>
162 %tmp2 = sub <8 x i16> %tmp0, %tmp1
166 ; COST-LABEL: usubl_4s
167 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <4 x i16> %a to <4 x i32>
168 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = zext <4 x i16> %b to <4 x i32>
169 ; CODE-LABEL: usubl_4s
170 ; CODE: usubl v0.4s, v0.4h, v1.4h
171 define <4 x i32> @usubl_4s(<4 x i16> %a, <4 x i16> %b) {
172 %tmp0 = zext <4 x i16> %a to <4 x i32>
173 %tmp1 = zext <4 x i16> %b to <4 x i32>
174 %tmp2 = sub <4 x i32> %tmp0, %tmp1
178 ; COST-LABEL: usubl_2d
179 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <2 x i32> %a to <2 x i64>
180 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = zext <2 x i32> %b to <2 x i64>
181 ; CODE-LABEL: usubl_2d
182 ; CODE: usubl v0.2d, v0.2s, v1.2s
183 define <2 x i64> @usubl_2d(<2 x i32> %a, <2 x i32> %b) {
184 %tmp0 = zext <2 x i32> %a to <2 x i64>
185 %tmp1 = zext <2 x i32> %b to <2 x i64>
186 %tmp2 = sub <2 x i64> %tmp0, %tmp1
190 ; COST-LABEL: usubl2_8h
191 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <16 x i8> %a to <16 x i16>
192 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = zext <16 x i8> %b to <16 x i16>
193 ; CODE-LABEL: usubl2_8h
194 ; CODE: usubl2 v2.8h, v0.16b, v1.16b
195 ; CODE-NEXT: usubl v0.8h, v0.8b, v1.8b
196 define <16 x i16> @usubl2_8h(<16 x i8> %a, <16 x i8> %b) {
197 %tmp0 = zext <16 x i8> %a to <16 x i16>
198 %tmp1 = zext <16 x i8> %b to <16 x i16>
199 %tmp2 = sub <16 x i16> %tmp0, %tmp1
203 ; COST-LABEL: usubl2_4s
204 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <8 x i16> %a to <8 x i32>
205 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = zext <8 x i16> %b to <8 x i32>
206 ; CODE-LABEL: usubl2_4s
207 ; CODE: usubl2 v2.4s, v0.8h, v1.8h
208 ; CODE-NEXT: usubl v0.4s, v0.4h, v1.4h
209 define <8 x i32> @usubl2_4s(<8 x i16> %a, <8 x i16> %b) {
210 %tmp0 = zext <8 x i16> %a to <8 x i32>
211 %tmp1 = zext <8 x i16> %b to <8 x i32>
212 %tmp2 = sub <8 x i32> %tmp0, %tmp1
216 ; COST-LABEL: usubl2_2d
217 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <4 x i32> %a to <4 x i64>
218 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = zext <4 x i32> %b to <4 x i64>
219 ; CODE-LABEL: usubl2_2d
220 ; CODE: usubl2 v2.2d, v0.4s, v1.4s
221 ; CODE-NEXT: usubl v0.2d, v0.2s, v1.2s
222 define <4 x i64> @usubl2_2d(<4 x i32> %a, <4 x i32> %b) {
223 %tmp0 = zext <4 x i32> %a to <4 x i64>
224 %tmp1 = zext <4 x i32> %b to <4 x i64>
225 %tmp2 = sub <4 x i64> %tmp0, %tmp1
229 ; COST-LABEL: ssubl_8h
230 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <8 x i8> %a to <8 x i16>
231 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = sext <8 x i8> %b to <8 x i16>
232 ; CODE-LABEL: ssubl_8h
233 ; CODE: ssubl v0.8h, v0.8b, v1.8b
234 define <8 x i16> @ssubl_8h(<8 x i8> %a, <8 x i8> %b) {
235 %tmp0 = sext <8 x i8> %a to <8 x i16>
236 %tmp1 = sext <8 x i8> %b to <8 x i16>
237 %tmp2 = sub <8 x i16> %tmp0, %tmp1
241 ; COST-LABEL: ssubl_4s
242 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <4 x i16> %a to <4 x i32>
243 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = sext <4 x i16> %b to <4 x i32>
244 ; CODE-LABEL: ssubl_4s
245 ; CODE: ssubl v0.4s, v0.4h, v1.4h
246 define <4 x i32> @ssubl_4s(<4 x i16> %a, <4 x i16> %b) {
247 %tmp0 = sext <4 x i16> %a to <4 x i32>
248 %tmp1 = sext <4 x i16> %b to <4 x i32>
249 %tmp2 = sub <4 x i32> %tmp0, %tmp1
253 ; COST-LABEL: ssubl_2d
254 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <2 x i32> %a to <2 x i64>
255 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = sext <2 x i32> %b to <2 x i64>
256 ; CODE-LABEL: ssubl_2d
257 ; CODE: ssubl v0.2d, v0.2s, v1.2s
258 define <2 x i64> @ssubl_2d(<2 x i32> %a, <2 x i32> %b) {
259 %tmp0 = sext <2 x i32> %a to <2 x i64>
260 %tmp1 = sext <2 x i32> %b to <2 x i64>
261 %tmp2 = sub <2 x i64> %tmp0, %tmp1
265 ; COST-LABEL: ssubl2_8h
266 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <16 x i8> %a to <16 x i16>
267 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = sext <16 x i8> %b to <16 x i16>
268 ; CODE-LABEL: ssubl2_8h
269 ; CODE: ssubl2 v2.8h, v0.16b, v1.16b
270 ; CODE-NEXT: ssubl v0.8h, v0.8b, v1.8b
271 define <16 x i16> @ssubl2_8h(<16 x i8> %a, <16 x i8> %b) {
272 %tmp0 = sext <16 x i8> %a to <16 x i16>
273 %tmp1 = sext <16 x i8> %b to <16 x i16>
274 %tmp2 = sub <16 x i16> %tmp0, %tmp1
278 ; COST-LABEL: ssubl2_4s
279 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <8 x i16> %a to <8 x i32>
280 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = sext <8 x i16> %b to <8 x i32>
281 ; CODE-LABEL: ssubl2_4s
282 ; CODE: ssubl2 v2.4s, v0.8h, v1.8h
283 ; CODE-NEXT: ssubl v0.4s, v0.4h, v1.4h
284 define <8 x i32> @ssubl2_4s(<8 x i16> %a, <8 x i16> %b) {
285 %tmp0 = sext <8 x i16> %a to <8 x i32>
286 %tmp1 = sext <8 x i16> %b to <8 x i32>
287 %tmp2 = sub <8 x i32> %tmp0, %tmp1
291 ; COST-LABEL: ssubl2_2d
292 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <4 x i32> %a to <4 x i64>
293 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = sext <4 x i32> %b to <4 x i64>
294 ; CODE-LABEL: ssubl2_2d
295 ; CODE: ssubl2 v2.2d, v0.4s, v1.4s
296 ; CODE-NEXT: ssubl v0.2d, v0.2s, v1.2s
297 define <4 x i64> @ssubl2_2d(<4 x i32> %a, <4 x i32> %b) {
298 %tmp0 = sext <4 x i32> %a to <4 x i64>
299 %tmp1 = sext <4 x i32> %b to <4 x i64>
300 %tmp2 = sub <4 x i64> %tmp0, %tmp1
304 ; COST-LABEL: uaddw_8h
305 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <8 x i8> %a to <8 x i16>
306 ; CODE-LABEL: uaddw_8h
307 ; CODE: uaddw v0.8h, v1.8h, v0.8b
308 define <8 x i16> @uaddw_8h(<8 x i8> %a, <8 x i16> %b) {
309 %tmp0 = zext <8 x i8> %a to <8 x i16>
310 %tmp1 = add <8 x i16> %b, %tmp0
314 ; COST-LABEL: uaddw_4s
315 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <4 x i16> %a to <4 x i32>
316 ; CODE-LABEL: uaddw_4s
317 ; CODE: uaddw v0.4s, v1.4s, v0.4h
318 define <4 x i32> @uaddw_4s(<4 x i16> %a, <4 x i32> %b) {
319 %tmp0 = zext <4 x i16> %a to <4 x i32>
320 %tmp1 = add <4 x i32> %b, %tmp0
324 ; COST-LABEL: uaddw_2d
325 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <2 x i32> %a to <2 x i64>
326 ; CODE-LABEL: uaddw_2d
327 ; CODE: uaddw v0.2d, v1.2d, v0.2s
328 define <2 x i64> @uaddw_2d(<2 x i32> %a, <2 x i64> %b) {
329 %tmp0 = zext <2 x i32> %a to <2 x i64>
330 %tmp1 = add <2 x i64> %b, %tmp0
334 ; COST-LABEL: uaddw2_8h
335 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <16 x i8> %a to <16 x i16>
336 ; CODE-LABEL: uaddw2_8h
337 ; CODE: uaddw2 v2.8h, v2.8h, v0.16b
338 ; CODE-NEXT: uaddw v0.8h, v1.8h, v0.8b
339 define <16 x i16> @uaddw2_8h(<16 x i8> %a, <16 x i16> %b) {
340 %tmp0 = zext <16 x i8> %a to <16 x i16>
341 %tmp1 = add <16 x i16> %b, %tmp0
345 ; COST-LABEL: uaddw2_4s
346 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <8 x i16> %a to <8 x i32>
347 ; CODE-LABEL: uaddw2_4s
348 ; CODE: uaddw2 v2.4s, v2.4s, v0.8h
349 ; CODE-NEXT: uaddw v0.4s, v1.4s, v0.4h
350 define <8 x i32> @uaddw2_4s(<8 x i16> %a, <8 x i32> %b) {
351 %tmp0 = zext <8 x i16> %a to <8 x i32>
352 %tmp1 = add <8 x i32> %b, %tmp0
356 ; COST-LABEL: uaddw2_2d
357 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <4 x i32> %a to <4 x i64>
358 ; CODE-LABEL: uaddw2_2d
359 ; CODE: uaddw2 v2.2d, v2.2d, v0.4s
360 ; CODE-NEXT: uaddw v0.2d, v1.2d, v0.2s
361 define <4 x i64> @uaddw2_2d(<4 x i32> %a, <4 x i64> %b) {
362 %tmp0 = zext <4 x i32> %a to <4 x i64>
363 %tmp1 = add <4 x i64> %b, %tmp0
367 ; COST-LABEL: saddw_8h
368 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <8 x i8> %a to <8 x i16>
369 ; CODE-LABEL: saddw_8h
370 ; CODE: saddw v0.8h, v1.8h, v0.8b
371 define <8 x i16> @saddw_8h(<8 x i8> %a, <8 x i16> %b) {
372 %tmp0 = sext <8 x i8> %a to <8 x i16>
373 %tmp1 = add <8 x i16> %b, %tmp0
377 ; COST-LABEL: saddw_4s
378 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <4 x i16> %a to <4 x i32>
379 ; CODE-LABEL: saddw_4s
380 ; CODE: saddw v0.4s, v1.4s, v0.4h
381 define <4 x i32> @saddw_4s(<4 x i16> %a, <4 x i32> %b) {
382 %tmp0 = sext <4 x i16> %a to <4 x i32>
383 %tmp1 = add <4 x i32> %b, %tmp0
387 ; COST-LABEL: saddw_2d
388 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <2 x i32> %a to <2 x i64>
389 ; CODE-LABEL: saddw_2d
390 ; CODE: saddw v0.2d, v1.2d, v0.2s
391 define <2 x i64> @saddw_2d(<2 x i32> %a, <2 x i64> %b) {
392 %tmp0 = sext <2 x i32> %a to <2 x i64>
393 %tmp1 = add <2 x i64> %b, %tmp0
397 ; COST-LABEL: saddw2_8h
398 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <16 x i8> %a to <16 x i16>
399 ; CODE-LABEL: saddw2_8h
400 ; CODE: saddw2 v2.8h, v2.8h, v0.16b
401 ; CODE-NEXT: saddw v0.8h, v1.8h, v0.8b
402 define <16 x i16> @saddw2_8h(<16 x i8> %a, <16 x i16> %b) {
403 %tmp0 = sext <16 x i8> %a to <16 x i16>
404 %tmp1 = add <16 x i16> %b, %tmp0
408 ; COST-LABEL: saddw2_4s
409 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <8 x i16> %a to <8 x i32>
410 ; CODE-LABEL: saddw2_4s
411 ; CODE: saddw2 v2.4s, v2.4s, v0.8h
412 ; CODE-NEXT: saddw v0.4s, v1.4s, v0.4h
413 define <8 x i32> @saddw2_4s(<8 x i16> %a, <8 x i32> %b) {
414 %tmp0 = sext <8 x i16> %a to <8 x i32>
415 %tmp1 = add <8 x i32> %b, %tmp0
419 ; COST-LABEL: saddw2_2d
420 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <4 x i32> %a to <4 x i64>
421 ; CODE-LABEL: saddw2_2d
422 ; CODE: saddw2 v2.2d, v2.2d, v0.4s
423 ; CODE-NEXT: saddw v0.2d, v1.2d, v0.2s
424 define <4 x i64> @saddw2_2d(<4 x i32> %a, <4 x i64> %b) {
425 %tmp0 = sext <4 x i32> %a to <4 x i64>
426 %tmp1 = add <4 x i64> %b, %tmp0
430 ; COST-LABEL: usubw_8h
431 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <8 x i8> %a to <8 x i16>
432 ; CODE-LABEL: usubw_8h
433 ; CODE: usubw v0.8h, v1.8h, v0.8b
434 define <8 x i16> @usubw_8h(<8 x i8> %a, <8 x i16> %b) {
435 %tmp0 = zext <8 x i8> %a to <8 x i16>
436 %tmp1 = sub <8 x i16> %b, %tmp0
440 ; COST-LABEL: usubw_4s
441 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <4 x i16> %a to <4 x i32>
442 ; CODE-LABEL: usubw_4s
443 ; CODE: usubw v0.4s, v1.4s, v0.4h
444 define <4 x i32> @usubw_4s(<4 x i16> %a, <4 x i32> %b) {
445 %tmp0 = zext <4 x i16> %a to <4 x i32>
446 %tmp1 = sub <4 x i32> %b, %tmp0
450 ; COST-LABEL: usubw_2d
451 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <2 x i32> %a to <2 x i64>
452 ; CODE-LABEL: usubw_2d
453 ; CODE: usubw v0.2d, v1.2d, v0.2s
454 define <2 x i64> @usubw_2d(<2 x i32> %a, <2 x i64> %b) {
455 %tmp0 = zext <2 x i32> %a to <2 x i64>
456 %tmp1 = sub <2 x i64> %b, %tmp0
460 ; COST-LABEL: usubw2_8h
461 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <16 x i8> %a to <16 x i16>
462 ; CODE-LABEL: usubw2_8h
463 ; CODE: usubw2 v2.8h, v2.8h, v0.16b
464 ; CODE-NEXT: usubw v0.8h, v1.8h, v0.8b
465 define <16 x i16> @usubw2_8h(<16 x i8> %a, <16 x i16> %b) {
466 %tmp0 = zext <16 x i8> %a to <16 x i16>
467 %tmp1 = sub <16 x i16> %b, %tmp0
471 ; COST-LABEL: usubw2_4s
472 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <8 x i16> %a to <8 x i32>
473 ; CODE-LABEL: usubw2_4s
474 ; CODE: usubw2 v2.4s, v2.4s, v0.8h
475 ; CODE-NEXT: usubw v0.4s, v1.4s, v0.4h
476 define <8 x i32> @usubw2_4s(<8 x i16> %a, <8 x i32> %b) {
477 %tmp0 = zext <8 x i16> %a to <8 x i32>
478 %tmp1 = sub <8 x i32> %b, %tmp0
482 ; COST-LABEL: usubw2_2d
483 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = zext <4 x i32> %a to <4 x i64>
484 ; CODE-LABEL: usubw2_2d
485 ; CODE: usubw2 v2.2d, v2.2d, v0.4s
486 ; CODE-NEXT: usubw v0.2d, v1.2d, v0.2s
487 define <4 x i64> @usubw2_2d(<4 x i32> %a, <4 x i64> %b) {
488 %tmp0 = zext <4 x i32> %a to <4 x i64>
489 %tmp1 = sub <4 x i64> %b, %tmp0
493 ; COST-LABEL: ssubw_8h
494 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <8 x i8> %a to <8 x i16>
495 ; CODE-LABEL: ssubw_8h
496 ; CODE: ssubw v0.8h, v1.8h, v0.8b
497 define <8 x i16> @ssubw_8h(<8 x i8> %a, <8 x i16> %b) {
498 %tmp0 = sext <8 x i8> %a to <8 x i16>
499 %tmp1 = sub <8 x i16> %b, %tmp0
503 ; COST-LABEL: ssubw_4s
504 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <4 x i16> %a to <4 x i32>
505 ; CODE-LABEL: ssubw_4s
506 ; CODE: ssubw v0.4s, v1.4s, v0.4h
507 define <4 x i32> @ssubw_4s(<4 x i16> %a, <4 x i32> %b) {
508 %tmp0 = sext <4 x i16> %a to <4 x i32>
509 %tmp1 = sub <4 x i32> %b, %tmp0
513 ; COST-LABEL: ssubw_2d
514 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <2 x i32> %a to <2 x i64>
515 ; CODE-LABEL: ssubw_2d
516 ; CODE: ssubw v0.2d, v1.2d, v0.2s
517 define <2 x i64> @ssubw_2d(<2 x i32> %a, <2 x i64> %b) {
518 %tmp0 = sext <2 x i32> %a to <2 x i64>
519 %tmp1 = sub <2 x i64> %b, %tmp0
523 ; COST-LABEL: ssubw2_8h
524 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <16 x i8> %a to <16 x i16>
525 ; CODE-LABEL: ssubw2_8h
526 ; CODE: ssubw2 v2.8h, v2.8h, v0.16b
527 ; CODE-NEXT: ssubw v0.8h, v1.8h, v0.8b
528 define <16 x i16> @ssubw2_8h(<16 x i8> %a, <16 x i16> %b) {
529 %tmp0 = sext <16 x i8> %a to <16 x i16>
530 %tmp1 = sub <16 x i16> %b, %tmp0
534 ; COST-LABEL: ssubw2_4s
535 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <8 x i16> %a to <8 x i32>
536 ; CODE-LABEL: ssubw2_4s
537 ; CODE: ssubw2 v2.4s, v2.4s, v0.8h
538 ; CODE-NEXT: ssubw v0.4s, v1.4s, v0.4h
539 define <8 x i32> @ssubw2_4s(<8 x i16> %a, <8 x i32> %b) {
540 %tmp0 = sext <8 x i16> %a to <8 x i32>
541 %tmp1 = sub <8 x i32> %b, %tmp0
545 ; COST-LABEL: ssubw2_2d
546 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp0 = sext <4 x i32> %a to <4 x i64>
547 ; CODE-LABEL: ssubw2_2d
548 ; CODE: ssubw2 v2.2d, v2.2d, v0.4s
549 ; CODE-NEXT: ssubw v0.2d, v1.2d, v0.2s
550 define <4 x i64> @ssubw2_2d(<4 x i32> %a, <4 x i64> %b) {
551 %tmp0 = sext <4 x i32> %a to <4 x i64>
552 %tmp1 = sub <4 x i64> %b, %tmp0
556 ; COST-LABEL: neg_wrong_operand_order
557 ; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %tmp0 = zext <8 x i8> %a to <8 x i16>
558 define <8 x i16> @neg_wrong_operand_order(<8 x i8> %a, <8 x i16> %b) {
559 %tmp0 = zext <8 x i8> %a to <8 x i16>
560 %tmp1 = sub <8 x i16> %tmp0, %b
564 ; COST-LABEL: neg_non_widening_op
565 ; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %tmp0 = zext <8 x i8> %a to <8 x i16>
566 define <8 x i16> @neg_non_widening_op(<8 x i8> %a, <8 x i16> %b) {
567 %tmp0 = zext <8 x i8> %a to <8 x i16>
568 %tmp1 = udiv <8 x i16> %b, %tmp0
572 ; COST-LABEL: neg_dissimilar_operand_kind_0
573 ; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %tmp0 = sext <8 x i8> %a to <8 x i16>
574 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = zext <8 x i8> %b to <8 x i16>
575 define <8 x i16> @neg_dissimilar_operand_kind_0(<8 x i8> %a, <8 x i8> %b) {
576 %tmp0 = sext <8 x i8> %a to <8 x i16>
577 %tmp1 = zext <8 x i8> %b to <8 x i16>
578 %tmp2 = add <8 x i16> %tmp0, %tmp1
582 ; COST-LABEL: neg_dissimilar_operand_kind_1
583 ; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %tmp0 = zext <4 x i8> %a to <4 x i32>
584 ; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %tmp1 = zext <4 x i16> %b to <4 x i32>
585 define <4 x i32> @neg_dissimilar_operand_kind_1(<4 x i8> %a, <4 x i16> %b) {
586 %tmp0 = zext <4 x i8> %a to <4 x i32>
587 %tmp1 = zext <4 x i16> %b to <4 x i32>
588 %tmp2 = add <4 x i32> %tmp0, %tmp1
592 ; COST-LABEL: neg_illegal_vector_type_0
593 ; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %tmp0 = zext <16 x i4> %a to <16 x i8>
594 define <16 x i8> @neg_illegal_vector_type_0(<16 x i4> %a, <16 x i8> %b) {
595 %tmp0 = zext <16 x i4> %a to <16 x i8>
596 %tmp1 = sub <16 x i8> %b, %tmp0
600 ; COST-LABEL: neg_llegal_vector_type_1
601 ; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %tmp0 = zext <1 x i16> %a to <1 x i32>
602 define <1 x i32> @neg_llegal_vector_type_1(<1 x i16> %a, <1 x i32> %b) {
603 %tmp0 = zext <1 x i16> %a to <1 x i32>
604 %tmp1 = add <1 x i32> %b, %tmp0
608 ; COST-LABEL: neg_llegal_vector_type_2
609 ; COST-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %tmp0 = zext <4 x i16> %a to <4 x i64>
610 define <4 x i64> @neg_llegal_vector_type_2(<4 x i16> %a, <4 x i64> %b) {
611 %tmp0 = zext <4 x i16> %a to <4 x i64>
612 %tmp1 = add <4 x i64> %b, %tmp0
616 ; COST-LABEL: neg_llegal_vector_type_3
617 ; COST-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %tmp0 = zext <3 x i34> %a to <3 x i68>
618 define <3 x i68> @neg_llegal_vector_type_3(<3 x i34> %a, <3 x i68> %b) {
619 %tmp0 = zext <3 x i34> %a to <3 x i68>
620 %tmp1 = add <3 x i68> %b, %tmp0