1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=armv6-none-eabi %s -o - | FileCheck %s --check-prefixes=CHECK-ARM,CHECK-ARMV6
3 ; RUN: llc -mtriple=armv7a-none-eabi %s -o - | FileCheck %s --check-prefixes=CHECK-ARM,CHECK-ARMV7
4 ; RUN: llc -mtriple=thumbv6m-none-eabi %s -o - | FileCheck %s --check-prefixes=CHECK-THUMB,CHECK-THUMBV6M
5 ; RUN: llc -mtriple=thumbv7m-none-eabi %s -o - | FileCheck %s --check-prefixes=CHECK-THUMB,CHECK-THUMBV7M
7 define i32 @fold_add19_mul11_i32(i32 %a) {
8 ; CHECK-ARM-LABEL: fold_add19_mul11_i32:
10 ; CHECK-ARM-NEXT: mov r1, #11
11 ; CHECK-ARM-NEXT: mul r0, r0, r1
12 ; CHECK-ARM-NEXT: add r0, r0, #209
13 ; CHECK-ARM-NEXT: bx lr
15 ; CHECK-THUMB-LABEL: fold_add19_mul11_i32:
16 ; CHECK-THUMB: @ %bb.0:
17 ; CHECK-THUMB-NEXT: movs r1, #11
18 ; CHECK-THUMB-NEXT: muls r0, r1, r0
19 ; CHECK-THUMB-NEXT: adds r0, #209
20 ; CHECK-THUMB-NEXT: bx lr
26 define i16 @fold_add19_mul11_i16(i16 %a) {
27 ; CHECK-ARM-LABEL: fold_add19_mul11_i16:
29 ; CHECK-ARM-NEXT: mov r1, #11
30 ; CHECK-ARM-NEXT: mul r0, r0, r1
31 ; CHECK-ARM-NEXT: add r0, r0, #209
32 ; CHECK-ARM-NEXT: bx lr
34 ; CHECK-THUMB-LABEL: fold_add19_mul11_i16:
35 ; CHECK-THUMB: @ %bb.0:
36 ; CHECK-THUMB-NEXT: movs r1, #11
37 ; CHECK-THUMB-NEXT: muls r0, r1, r0
38 ; CHECK-THUMB-NEXT: adds r0, #209
39 ; CHECK-THUMB-NEXT: bx lr
45 define i32 @fold_sub19_mul11_i32(i32 %a) {
46 ; CHECK-ARM-LABEL: fold_sub19_mul11_i32:
48 ; CHECK-ARM-NEXT: mov r1, #11
49 ; CHECK-ARM-NEXT: mul r0, r0, r1
50 ; CHECK-ARM-NEXT: sub r0, r0, #209
51 ; CHECK-ARM-NEXT: bx lr
53 ; CHECK-THUMB-LABEL: fold_sub19_mul11_i32:
54 ; CHECK-THUMB: @ %bb.0:
55 ; CHECK-THUMB-NEXT: movs r1, #11
56 ; CHECK-THUMB-NEXT: muls r0, r1, r0
57 ; CHECK-THUMB-NEXT: subs r0, #209
58 ; CHECK-THUMB-NEXT: bx lr
64 define i16 @fold_sub19_mul11_i16(i16 %a) {
65 ; CHECK-ARM-LABEL: fold_sub19_mul11_i16:
67 ; CHECK-ARM-NEXT: mov r1, #11
68 ; CHECK-ARM-NEXT: mul r0, r0, r1
69 ; CHECK-ARM-NEXT: sub r0, r0, #209
70 ; CHECK-ARM-NEXT: bx lr
72 ; CHECK-THUMB-LABEL: fold_sub19_mul11_i16:
73 ; CHECK-THUMB: @ %bb.0:
74 ; CHECK-THUMB-NEXT: movs r1, #11
75 ; CHECK-THUMB-NEXT: muls r0, r1, r0
76 ; CHECK-THUMB-NEXT: subs r0, #209
77 ; CHECK-THUMB-NEXT: bx lr
83 define i32 @fold_add301_mul19_i32(i32 %a) {
84 ; CHECK-ARMV6-LABEL: fold_add301_mul19_i32:
85 ; CHECK-ARMV6: @ %bb.0:
86 ; CHECK-ARMV6-NEXT: mov r1, #87
87 ; CHECK-ARMV6-NEXT: mov r2, #19
88 ; CHECK-ARMV6-NEXT: orr r1, r1, #5632
89 ; CHECK-ARMV6-NEXT: mla r0, r0, r2, r1
90 ; CHECK-ARMV6-NEXT: bx lr
92 ; CHECK-ARMV7-LABEL: fold_add301_mul19_i32:
93 ; CHECK-ARMV7: @ %bb.0:
94 ; CHECK-ARMV7-NEXT: movw r1, #5719
95 ; CHECK-ARMV7-NEXT: mov r2, #19
96 ; CHECK-ARMV7-NEXT: mla r0, r0, r2, r1
97 ; CHECK-ARMV7-NEXT: bx lr
99 ; CHECK-THUMBV6M-LABEL: fold_add301_mul19_i32:
100 ; CHECK-THUMBV6M: @ %bb.0:
101 ; CHECK-THUMBV6M-NEXT: movs r1, #19
102 ; CHECK-THUMBV6M-NEXT: muls r1, r0, r1
103 ; CHECK-THUMBV6M-NEXT: ldr r0, .LCPI4_0
104 ; CHECK-THUMBV6M-NEXT: adds r0, r1, r0
105 ; CHECK-THUMBV6M-NEXT: bx lr
106 ; CHECK-THUMBV6M-NEXT: .p2align 2
107 ; CHECK-THUMBV6M-NEXT: @ %bb.1:
108 ; CHECK-THUMBV6M-NEXT: .LCPI4_0:
109 ; CHECK-THUMBV6M-NEXT: .long 5719 @ 0x1657
111 ; CHECK-THUMBV7M-LABEL: fold_add301_mul19_i32:
112 ; CHECK-THUMBV7M: @ %bb.0:
113 ; CHECK-THUMBV7M-NEXT: movw r1, #5719
114 ; CHECK-THUMBV7M-NEXT: movs r2, #19
115 ; CHECK-THUMBV7M-NEXT: mla r0, r0, r2, r1
116 ; CHECK-THUMBV7M-NEXT: bx lr
122 define i16 @fold_add301_mul19_i16(i16 %a) {
123 ; CHECK-ARMV6-LABEL: fold_add301_mul19_i16:
124 ; CHECK-ARMV6: @ %bb.0:
125 ; CHECK-ARMV6-NEXT: mov r1, #87
126 ; CHECK-ARMV6-NEXT: mov r2, #19
127 ; CHECK-ARMV6-NEXT: orr r1, r1, #5632
128 ; CHECK-ARMV6-NEXT: mla r0, r0, r2, r1
129 ; CHECK-ARMV6-NEXT: bx lr
131 ; CHECK-ARMV7-LABEL: fold_add301_mul19_i16:
132 ; CHECK-ARMV7: @ %bb.0:
133 ; CHECK-ARMV7-NEXT: movw r1, #5719
134 ; CHECK-ARMV7-NEXT: mov r2, #19
135 ; CHECK-ARMV7-NEXT: mla r0, r0, r2, r1
136 ; CHECK-ARMV7-NEXT: bx lr
138 ; CHECK-THUMBV6M-LABEL: fold_add301_mul19_i16:
139 ; CHECK-THUMBV6M: @ %bb.0:
140 ; CHECK-THUMBV6M-NEXT: movs r1, #19
141 ; CHECK-THUMBV6M-NEXT: muls r1, r0, r1
142 ; CHECK-THUMBV6M-NEXT: ldr r0, .LCPI5_0
143 ; CHECK-THUMBV6M-NEXT: adds r0, r1, r0
144 ; CHECK-THUMBV6M-NEXT: bx lr
145 ; CHECK-THUMBV6M-NEXT: .p2align 2
146 ; CHECK-THUMBV6M-NEXT: @ %bb.1:
147 ; CHECK-THUMBV6M-NEXT: .LCPI5_0:
148 ; CHECK-THUMBV6M-NEXT: .long 5719 @ 0x1657
150 ; CHECK-THUMBV7M-LABEL: fold_add301_mul19_i16:
151 ; CHECK-THUMBV7M: @ %bb.0:
152 ; CHECK-THUMBV7M-NEXT: movw r1, #5719
153 ; CHECK-THUMBV7M-NEXT: movs r2, #19
154 ; CHECK-THUMBV7M-NEXT: mla r0, r0, r2, r1
155 ; CHECK-THUMBV7M-NEXT: bx lr
161 define i32 @fold_sub301_mul19_i32(i32 %a) {
162 ; CHECK-ARMV6-LABEL: fold_sub301_mul19_i32:
163 ; CHECK-ARMV6: @ %bb.0:
164 ; CHECK-ARMV6-NEXT: mvn r1, #86
165 ; CHECK-ARMV6-NEXT: mov r2, #19
166 ; CHECK-ARMV6-NEXT: sub r1, r1, #5632
167 ; CHECK-ARMV6-NEXT: mla r0, r0, r2, r1
168 ; CHECK-ARMV6-NEXT: bx lr
170 ; CHECK-ARMV7-LABEL: fold_sub301_mul19_i32:
171 ; CHECK-ARMV7: @ %bb.0:
172 ; CHECK-ARMV7-NEXT: mov r1, #19
173 ; CHECK-ARMV7-NEXT: mul r0, r0, r1
174 ; CHECK-ARMV7-NEXT: movw r1, #5719
175 ; CHECK-ARMV7-NEXT: sub r0, r0, r1
176 ; CHECK-ARMV7-NEXT: bx lr
178 ; CHECK-THUMBV6M-LABEL: fold_sub301_mul19_i32:
179 ; CHECK-THUMBV6M: @ %bb.0:
180 ; CHECK-THUMBV6M-NEXT: movs r1, #19
181 ; CHECK-THUMBV6M-NEXT: muls r1, r0, r1
182 ; CHECK-THUMBV6M-NEXT: ldr r0, .LCPI6_0
183 ; CHECK-THUMBV6M-NEXT: adds r0, r1, r0
184 ; CHECK-THUMBV6M-NEXT: bx lr
185 ; CHECK-THUMBV6M-NEXT: .p2align 2
186 ; CHECK-THUMBV6M-NEXT: @ %bb.1:
187 ; CHECK-THUMBV6M-NEXT: .LCPI6_0:
188 ; CHECK-THUMBV6M-NEXT: .long 4294961577 @ 0xffffe9a9
190 ; CHECK-THUMBV7M-LABEL: fold_sub301_mul19_i32:
191 ; CHECK-THUMBV7M: @ %bb.0:
192 ; CHECK-THUMBV7M-NEXT: movs r1, #19
193 ; CHECK-THUMBV7M-NEXT: muls r0, r1, r0
194 ; CHECK-THUMBV7M-NEXT: movw r1, #5719
195 ; CHECK-THUMBV7M-NEXT: subs r0, r0, r1
196 ; CHECK-THUMBV7M-NEXT: bx lr
197 %b = add i32 %a, -301
202 define i16 @fold_sub301_mul19_i16(i16 %a) {
203 ; CHECK-ARMV6-LABEL: fold_sub301_mul19_i16:
204 ; CHECK-ARMV6: @ %bb.0:
205 ; CHECK-ARMV6-NEXT: mvn r1, #86
206 ; CHECK-ARMV6-NEXT: mov r2, #19
207 ; CHECK-ARMV6-NEXT: sub r1, r1, #5632
208 ; CHECK-ARMV6-NEXT: mla r0, r0, r2, r1
209 ; CHECK-ARMV6-NEXT: bx lr
211 ; CHECK-ARMV7-LABEL: fold_sub301_mul19_i16:
212 ; CHECK-ARMV7: @ %bb.0:
213 ; CHECK-ARMV7-NEXT: mov r1, #19
214 ; CHECK-ARMV7-NEXT: mul r0, r0, r1
215 ; CHECK-ARMV7-NEXT: movw r1, #5719
216 ; CHECK-ARMV7-NEXT: sub r0, r0, r1
217 ; CHECK-ARMV7-NEXT: bx lr
219 ; CHECK-THUMBV6M-LABEL: fold_sub301_mul19_i16:
220 ; CHECK-THUMBV6M: @ %bb.0:
221 ; CHECK-THUMBV6M-NEXT: movs r1, #19
222 ; CHECK-THUMBV6M-NEXT: muls r1, r0, r1
223 ; CHECK-THUMBV6M-NEXT: ldr r0, .LCPI7_0
224 ; CHECK-THUMBV6M-NEXT: adds r0, r1, r0
225 ; CHECK-THUMBV6M-NEXT: bx lr
226 ; CHECK-THUMBV6M-NEXT: .p2align 2
227 ; CHECK-THUMBV6M-NEXT: @ %bb.1:
228 ; CHECK-THUMBV6M-NEXT: .LCPI7_0:
229 ; CHECK-THUMBV6M-NEXT: .long 4294961577 @ 0xffffe9a9
231 ; CHECK-THUMBV7M-LABEL: fold_sub301_mul19_i16:
232 ; CHECK-THUMBV7M: @ %bb.0:
233 ; CHECK-THUMBV7M-NEXT: movs r1, #19
234 ; CHECK-THUMBV7M-NEXT: muls r0, r1, r0
235 ; CHECK-THUMBV7M-NEXT: movw r1, #5719
236 ; CHECK-THUMBV7M-NEXT: subs r0, r0, r1
237 ; CHECK-THUMBV7M-NEXT: bx lr
238 %b = add i16 %a, -301
243 define i32 @fold_add251_mul253_i32(i32 %a) {
244 ; CHECK-ARMV6-LABEL: fold_add251_mul253_i32:
245 ; CHECK-ARMV6: @ %bb.0:
246 ; CHECK-ARMV6-NEXT: add r0, r0, #251
247 ; CHECK-ARMV6-NEXT: mov r1, #253
248 ; CHECK-ARMV6-NEXT: mul r0, r0, r1
249 ; CHECK-ARMV6-NEXT: bx lr
251 ; CHECK-ARMV7-LABEL: fold_add251_mul253_i32:
252 ; CHECK-ARMV7: @ %bb.0:
253 ; CHECK-ARMV7-NEXT: movw r1, #63503
254 ; CHECK-ARMV7-NEXT: mov r2, #253
255 ; CHECK-ARMV7-NEXT: mla r0, r0, r2, r1
256 ; CHECK-ARMV7-NEXT: bx lr
258 ; CHECK-THUMBV6M-LABEL: fold_add251_mul253_i32:
259 ; CHECK-THUMBV6M: @ %bb.0:
260 ; CHECK-THUMBV6M-NEXT: adds r0, #251
261 ; CHECK-THUMBV6M-NEXT: movs r1, #253
262 ; CHECK-THUMBV6M-NEXT: muls r0, r1, r0
263 ; CHECK-THUMBV6M-NEXT: bx lr
265 ; CHECK-THUMBV7M-LABEL: fold_add251_mul253_i32:
266 ; CHECK-THUMBV7M: @ %bb.0:
267 ; CHECK-THUMBV7M-NEXT: movw r1, #63503
268 ; CHECK-THUMBV7M-NEXT: movs r2, #253
269 ; CHECK-THUMBV7M-NEXT: mla r0, r0, r2, r1
270 ; CHECK-THUMBV7M-NEXT: bx lr
276 define i16 @fold_add251_mul253_i16(i16 %a) {
277 ; CHECK-ARMV6-LABEL: fold_add251_mul253_i16:
278 ; CHECK-ARMV6: @ %bb.0:
279 ; CHECK-ARMV6-NEXT: add r0, r0, #251
280 ; CHECK-ARMV6-NEXT: mov r1, #253
281 ; CHECK-ARMV6-NEXT: mul r0, r0, r1
282 ; CHECK-ARMV6-NEXT: bx lr
284 ; CHECK-ARMV7-LABEL: fold_add251_mul253_i16:
285 ; CHECK-ARMV7: @ %bb.0:
286 ; CHECK-ARMV7-NEXT: mov r1, #253
287 ; CHECK-ARMV7-NEXT: mul r0, r0, r1
288 ; CHECK-ARMV7-NEXT: movw r1, #2033
289 ; CHECK-ARMV7-NEXT: sub r0, r0, r1
290 ; CHECK-ARMV7-NEXT: bx lr
292 ; CHECK-THUMBV6M-LABEL: fold_add251_mul253_i16:
293 ; CHECK-THUMBV6M: @ %bb.0:
294 ; CHECK-THUMBV6M-NEXT: adds r0, #251
295 ; CHECK-THUMBV6M-NEXT: movs r1, #253
296 ; CHECK-THUMBV6M-NEXT: muls r0, r1, r0
297 ; CHECK-THUMBV6M-NEXT: bx lr
299 ; CHECK-THUMBV7M-LABEL: fold_add251_mul253_i16:
300 ; CHECK-THUMBV7M: @ %bb.0:
301 ; CHECK-THUMBV7M-NEXT: movs r1, #253
302 ; CHECK-THUMBV7M-NEXT: muls r0, r1, r0
303 ; CHECK-THUMBV7M-NEXT: subw r0, r0, #2033
304 ; CHECK-THUMBV7M-NEXT: bx lr
310 define i32 @fold_sub251_mul253_i32(i32 %a) {
311 ; CHECK-ARM-LABEL: fold_sub251_mul253_i32:
312 ; CHECK-ARM: @ %bb.0:
313 ; CHECK-ARM-NEXT: sub r0, r0, #251
314 ; CHECK-ARM-NEXT: mov r1, #253
315 ; CHECK-ARM-NEXT: mul r0, r0, r1
316 ; CHECK-ARM-NEXT: bx lr
318 ; CHECK-THUMB-LABEL: fold_sub251_mul253_i32:
319 ; CHECK-THUMB: @ %bb.0:
320 ; CHECK-THUMB-NEXT: subs r0, #251
321 ; CHECK-THUMB-NEXT: movs r1, #253
322 ; CHECK-THUMB-NEXT: muls r0, r1, r0
323 ; CHECK-THUMB-NEXT: bx lr
324 %b = add i32 %a, -251
329 define i16 @fold_sub251_mul253_i16(i16 %a) {
330 ; CHECK-ARMV6-LABEL: fold_sub251_mul253_i16:
331 ; CHECK-ARMV6: @ %bb.0:
332 ; CHECK-ARMV6-NEXT: sub r0, r0, #251
333 ; CHECK-ARMV6-NEXT: mov r1, #253
334 ; CHECK-ARMV6-NEXT: mul r0, r0, r1
335 ; CHECK-ARMV6-NEXT: bx lr
337 ; CHECK-ARMV7-LABEL: fold_sub251_mul253_i16:
338 ; CHECK-ARMV7: @ %bb.0:
339 ; CHECK-ARMV7-NEXT: movw r1, #2033
340 ; CHECK-ARMV7-NEXT: mov r2, #253
341 ; CHECK-ARMV7-NEXT: mla r0, r0, r2, r1
342 ; CHECK-ARMV7-NEXT: bx lr
344 ; CHECK-THUMBV6M-LABEL: fold_sub251_mul253_i16:
345 ; CHECK-THUMBV6M: @ %bb.0:
346 ; CHECK-THUMBV6M-NEXT: subs r0, #251
347 ; CHECK-THUMBV6M-NEXT: movs r1, #253
348 ; CHECK-THUMBV6M-NEXT: muls r0, r1, r0
349 ; CHECK-THUMBV6M-NEXT: bx lr
351 ; CHECK-THUMBV7M-LABEL: fold_sub251_mul253_i16:
352 ; CHECK-THUMBV7M: @ %bb.0:
353 ; CHECK-THUMBV7M-NEXT: movs r1, #253
354 ; CHECK-THUMBV7M-NEXT: muls r0, r1, r0
355 ; CHECK-THUMBV7M-NEXT: addw r0, r0, #2033
356 ; CHECK-THUMBV7M-NEXT: bx lr
357 %b = add i16 %a, -251
362 define i32 @fold_add251_mul353_i32(i32 %a) {
363 ; CHECK-ARMV6-LABEL: fold_add251_mul353_i32:
364 ; CHECK-ARMV6: @ %bb.0:
365 ; CHECK-ARMV6-NEXT: mov r1, #97
366 ; CHECK-ARMV6-NEXT: add r0, r0, #251
367 ; CHECK-ARMV6-NEXT: orr r1, r1, #256
368 ; CHECK-ARMV6-NEXT: mul r0, r0, r1
369 ; CHECK-ARMV6-NEXT: bx lr
371 ; CHECK-ARMV7-LABEL: fold_add251_mul353_i32:
372 ; CHECK-ARMV7: @ %bb.0:
373 ; CHECK-ARMV7-NEXT: add r0, r0, #251
374 ; CHECK-ARMV7-NEXT: movw r1, #353
375 ; CHECK-ARMV7-NEXT: mul r0, r0, r1
376 ; CHECK-ARMV7-NEXT: bx lr
378 ; CHECK-THUMBV6M-LABEL: fold_add251_mul353_i32:
379 ; CHECK-THUMBV6M: @ %bb.0:
380 ; CHECK-THUMBV6M-NEXT: movs r1, #255
381 ; CHECK-THUMBV6M-NEXT: adds r1, #98
382 ; CHECK-THUMBV6M-NEXT: adds r0, #251
383 ; CHECK-THUMBV6M-NEXT: muls r0, r1, r0
384 ; CHECK-THUMBV6M-NEXT: bx lr
386 ; CHECK-THUMBV7M-LABEL: fold_add251_mul353_i32:
387 ; CHECK-THUMBV7M: @ %bb.0:
388 ; CHECK-THUMBV7M-NEXT: adds r0, #251
389 ; CHECK-THUMBV7M-NEXT: movw r1, #353
390 ; CHECK-THUMBV7M-NEXT: muls r0, r1, r0
391 ; CHECK-THUMBV7M-NEXT: bx lr
397 define i16 @fold_add251_mul353_i16(i16 %a) {
398 ; CHECK-ARMV6-LABEL: fold_add251_mul353_i16:
399 ; CHECK-ARMV6: @ %bb.0:
400 ; CHECK-ARMV6-NEXT: mov r1, #97
401 ; CHECK-ARMV6-NEXT: add r0, r0, #251
402 ; CHECK-ARMV6-NEXT: orr r1, r1, #256
403 ; CHECK-ARMV6-NEXT: mul r0, r0, r1
404 ; CHECK-ARMV6-NEXT: bx lr
406 ; CHECK-ARMV7-LABEL: fold_add251_mul353_i16:
407 ; CHECK-ARMV7: @ %bb.0:
408 ; CHECK-ARMV7-NEXT: movw r1, #23067
409 ; CHECK-ARMV7-NEXT: movw r2, #353
410 ; CHECK-ARMV7-NEXT: mla r0, r0, r2, r1
411 ; CHECK-ARMV7-NEXT: bx lr
413 ; CHECK-THUMBV6M-LABEL: fold_add251_mul353_i16:
414 ; CHECK-THUMBV6M: @ %bb.0:
415 ; CHECK-THUMBV6M-NEXT: movs r1, #255
416 ; CHECK-THUMBV6M-NEXT: adds r1, #98
417 ; CHECK-THUMBV6M-NEXT: adds r0, #251
418 ; CHECK-THUMBV6M-NEXT: muls r0, r1, r0
419 ; CHECK-THUMBV6M-NEXT: bx lr
421 ; CHECK-THUMBV7M-LABEL: fold_add251_mul353_i16:
422 ; CHECK-THUMBV7M: @ %bb.0:
423 ; CHECK-THUMBV7M-NEXT: movw r1, #23067
424 ; CHECK-THUMBV7M-NEXT: movw r2, #353
425 ; CHECK-THUMBV7M-NEXT: mla r0, r0, r2, r1
426 ; CHECK-THUMBV7M-NEXT: bx lr
432 define i32 @fold_sub251_mul353_i32(i32 %a) {
433 ; CHECK-ARMV6-LABEL: fold_sub251_mul353_i32:
434 ; CHECK-ARMV6: @ %bb.0:
435 ; CHECK-ARMV6-NEXT: mov r1, #97
436 ; CHECK-ARMV6-NEXT: sub r0, r0, #251
437 ; CHECK-ARMV6-NEXT: orr r1, r1, #256
438 ; CHECK-ARMV6-NEXT: mul r0, r0, r1
439 ; CHECK-ARMV6-NEXT: bx lr
441 ; CHECK-ARMV7-LABEL: fold_sub251_mul353_i32:
442 ; CHECK-ARMV7: @ %bb.0:
443 ; CHECK-ARMV7-NEXT: sub r0, r0, #251
444 ; CHECK-ARMV7-NEXT: movw r1, #353
445 ; CHECK-ARMV7-NEXT: mul r0, r0, r1
446 ; CHECK-ARMV7-NEXT: bx lr
448 ; CHECK-THUMBV6M-LABEL: fold_sub251_mul353_i32:
449 ; CHECK-THUMBV6M: @ %bb.0:
450 ; CHECK-THUMBV6M-NEXT: movs r1, #255
451 ; CHECK-THUMBV6M-NEXT: adds r1, #98
452 ; CHECK-THUMBV6M-NEXT: subs r0, #251
453 ; CHECK-THUMBV6M-NEXT: muls r0, r1, r0
454 ; CHECK-THUMBV6M-NEXT: bx lr
456 ; CHECK-THUMBV7M-LABEL: fold_sub251_mul353_i32:
457 ; CHECK-THUMBV7M: @ %bb.0:
458 ; CHECK-THUMBV7M-NEXT: subs r0, #251
459 ; CHECK-THUMBV7M-NEXT: movw r1, #353
460 ; CHECK-THUMBV7M-NEXT: muls r0, r1, r0
461 ; CHECK-THUMBV7M-NEXT: bx lr
462 %b = add i32 %a, -251
467 define i16 @fold_sub251_mul353_i16(i16 %a) {
468 ; CHECK-ARMV6-LABEL: fold_sub251_mul353_i16:
469 ; CHECK-ARMV6: @ %bb.0:
470 ; CHECK-ARMV6-NEXT: mov r1, #97
471 ; CHECK-ARMV6-NEXT: sub r0, r0, #251
472 ; CHECK-ARMV6-NEXT: orr r1, r1, #256
473 ; CHECK-ARMV6-NEXT: mul r0, r0, r1
474 ; CHECK-ARMV6-NEXT: bx lr
476 ; CHECK-ARMV7-LABEL: fold_sub251_mul353_i16:
477 ; CHECK-ARMV7: @ %bb.0:
478 ; CHECK-ARMV7-NEXT: movw r1, #353
479 ; CHECK-ARMV7-NEXT: mul r0, r0, r1
480 ; CHECK-ARMV7-NEXT: movw r1, #23067
481 ; CHECK-ARMV7-NEXT: sub r0, r0, r1
482 ; CHECK-ARMV7-NEXT: bx lr
484 ; CHECK-THUMBV6M-LABEL: fold_sub251_mul353_i16:
485 ; CHECK-THUMBV6M: @ %bb.0:
486 ; CHECK-THUMBV6M-NEXT: movs r1, #255
487 ; CHECK-THUMBV6M-NEXT: adds r1, #98
488 ; CHECK-THUMBV6M-NEXT: subs r0, #251
489 ; CHECK-THUMBV6M-NEXT: muls r0, r1, r0
490 ; CHECK-THUMBV6M-NEXT: bx lr
492 ; CHECK-THUMBV7M-LABEL: fold_sub251_mul353_i16:
493 ; CHECK-THUMBV7M: @ %bb.0:
494 ; CHECK-THUMBV7M-NEXT: movw r1, #353
495 ; CHECK-THUMBV7M-NEXT: muls r0, r1, r0
496 ; CHECK-THUMBV7M-NEXT: movw r1, #23067
497 ; CHECK-THUMBV7M-NEXT: subs r0, r0, r1
498 ; CHECK-THUMBV7M-NEXT: bx lr
499 %b = add i16 %a, -251