1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-none-linux-gnu < %s -o -| FileCheck %s
4 define i64 @umull(i64 %x0, i64 %x1) {
6 ; CHECK: // %bb.0: // %entry
7 ; CHECK-NEXT: umull x0, w1, w0
10 %and = and i64 %x0, 4294967295
11 %and1 = and i64 %x1, 4294967295
12 %mul = mul nuw i64 %and1, %and
16 define i64 @umull2(i64 %x, i32 %y) {
17 ; CHECK-LABEL: umull2:
18 ; CHECK: // %bb.0: // %entry
19 ; CHECK-NEXT: umull x0, w0, w1
22 %and = and i64 %x, 4294967295
23 %conv = zext i32 %y to i64
24 %mul = mul nuw nsw i64 %and, %conv
28 define i64 @umull2_commuted(i64 %x, i32 %y) {
29 ; CHECK-LABEL: umull2_commuted:
30 ; CHECK: // %bb.0: // %entry
31 ; CHECK-NEXT: umull x0, w0, w1
34 %and = and i64 %x, 4294967295
35 %conv = zext i32 %y to i64
36 %mul = mul nuw nsw i64 %conv, %and
40 define i64 @smull(i64 %x0, i64 %x1) {
42 ; CHECK: // %bb.0: // %entry
43 ; CHECK-NEXT: smull x0, w1, w0
46 %sext = shl i64 %x0, 32
47 %conv1 = ashr exact i64 %sext, 32
48 %sext4 = shl i64 %x1, 32
49 %conv3 = ashr exact i64 %sext4, 32
50 %mul = mul nsw i64 %conv3, %conv1
54 define i64 @smull2(i64 %x, i32 %y) {
55 ; CHECK-LABEL: smull2:
56 ; CHECK: // %bb.0: // %entry
57 ; CHECK-NEXT: smull x0, w0, w1
61 %shr = ashr exact i64 %shl, 32
62 %conv = sext i32 %y to i64
63 %mul = mul nsw i64 %shr, %conv
67 define i64 @smull2_commuted(i64 %x, i32 %y) {
68 ; CHECK-LABEL: smull2_commuted:
69 ; CHECK: // %bb.0: // %entry
70 ; CHECK-NEXT: smull x0, w0, w1
74 %shr = ashr exact i64 %shl, 32
75 %conv = sext i32 %y to i64
76 %mul = mul nsw i64 %conv, %shr
80 define i64 @smull_ldrsb_b(ptr %x0, i8 %x1) {
81 ; CHECK-LABEL: smull_ldrsb_b:
82 ; CHECK: // %bb.0: // %entry
83 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
84 ; CHECK-NEXT: ldrsb x8, [x0]
85 ; CHECK-NEXT: sxtb x9, w1
86 ; CHECK-NEXT: smull x0, w8, w9
89 %ext64 = load i8, ptr %x0
90 %sext = sext i8 %ext64 to i64
91 %sext4 = sext i8 %x1 to i64
92 %mul = mul i64 %sext, %sext4
96 define i64 @smull_ldrsb_b_commuted(ptr %x0, i8 %x1) {
97 ; CHECK-LABEL: smull_ldrsb_b_commuted:
98 ; CHECK: // %bb.0: // %entry
99 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
100 ; CHECK-NEXT: ldrsb x8, [x0]
101 ; CHECK-NEXT: sxtb x9, w1
102 ; CHECK-NEXT: smull x0, w9, w8
105 %ext64 = load i8, ptr %x0
106 %sext = sext i8 %ext64 to i64
107 %sext4 = sext i8 %x1 to i64
108 %mul = mul i64 %sext4, %sext
112 define i64 @smull_ldrsb_h(ptr %x0, i16 %x1) {
113 ; CHECK-LABEL: smull_ldrsb_h:
114 ; CHECK: // %bb.0: // %entry
115 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
116 ; CHECK-NEXT: ldrsb x8, [x0]
117 ; CHECK-NEXT: sxth x9, w1
118 ; CHECK-NEXT: smull x0, w8, w9
121 %ext64 = load i8, ptr %x0
122 %sext = sext i8 %ext64 to i64
123 %sext4 = sext i16 %x1 to i64
124 %mul = mul i64 %sext, %sext4
128 define i64 @smull_ldrsb_w(ptr %x0, i32 %x1) {
129 ; CHECK-LABEL: smull_ldrsb_w:
130 ; CHECK: // %bb.0: // %entry
131 ; CHECK-NEXT: ldrsb x8, [x0]
132 ; CHECK-NEXT: smull x0, w8, w1
135 %ext64 = load i8, ptr %x0
136 %sext = sext i8 %ext64 to i64
137 %sext4 = sext i32 %x1 to i64
138 %mul = mul i64 %sext, %sext4
142 define i64 @smull_ldrsh_b(ptr %x0, i8 %x1) {
143 ; CHECK-LABEL: smull_ldrsh_b:
144 ; CHECK: // %bb.0: // %entry
145 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
146 ; CHECK-NEXT: ldrsh x8, [x0]
147 ; CHECK-NEXT: sxtb x9, w1
148 ; CHECK-NEXT: smull x0, w8, w9
151 %ext64 = load i16, ptr %x0
152 %sext = sext i16 %ext64 to i64
153 %sext4 = sext i8 %x1 to i64
154 %mul = mul i64 %sext, %sext4
158 define i64 @smull_ldrsh_h(ptr %x0, i16 %x1) {
159 ; CHECK-LABEL: smull_ldrsh_h:
160 ; CHECK: // %bb.0: // %entry
161 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
162 ; CHECK-NEXT: ldrsh x8, [x0]
163 ; CHECK-NEXT: sxth x9, w1
164 ; CHECK-NEXT: smull x0, w8, w9
167 %ext64 = load i16, ptr %x0
168 %sext = sext i16 %ext64 to i64
169 %sext4 = sext i16 %x1 to i64
170 %mul = mul i64 %sext, %sext4
174 define i64 @smull_ldrsh_h_commuted(ptr %x0, i16 %x1) {
175 ; CHECK-LABEL: smull_ldrsh_h_commuted:
176 ; CHECK: // %bb.0: // %entry
177 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
178 ; CHECK-NEXT: ldrsh x8, [x0]
179 ; CHECK-NEXT: sxth x9, w1
180 ; CHECK-NEXT: smull x0, w9, w8
183 %ext64 = load i16, ptr %x0
184 %sext = sext i16 %ext64 to i64
185 %sext4 = sext i16 %x1 to i64
186 %mul = mul i64 %sext4, %sext
190 define i64 @smull_ldrsh_w(ptr %x0, i32 %x1) {
191 ; CHECK-LABEL: smull_ldrsh_w:
192 ; CHECK: // %bb.0: // %entry
193 ; CHECK-NEXT: ldrsh x8, [x0]
194 ; CHECK-NEXT: smull x0, w8, w1
197 %ext64 = load i16, ptr %x0
198 %sext = sext i16 %ext64 to i64
199 %sext4 = sext i32 %x1 to i64
200 %mul = mul i64 %sext, %sext4
204 define i64 @smull_ldrsw_b(ptr %x0, i8 %x1) {
205 ; CHECK-LABEL: smull_ldrsw_b:
206 ; CHECK: // %bb.0: // %entry
207 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
208 ; CHECK-NEXT: ldrsw x8, [x0]
209 ; CHECK-NEXT: sxtb x9, w1
210 ; CHECK-NEXT: smull x0, w8, w9
213 %ext64 = load i32, ptr %x0
214 %sext = sext i32 %ext64 to i64
215 %sext4 = sext i8 %x1 to i64
216 %mul = mul i64 %sext, %sext4
220 define i64 @smull_ldrsw_h(ptr %x0, i16 %x1) {
221 ; CHECK-LABEL: smull_ldrsw_h:
222 ; CHECK: // %bb.0: // %entry
223 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
224 ; CHECK-NEXT: ldrsw x8, [x0]
225 ; CHECK-NEXT: sxth x9, w1
226 ; CHECK-NEXT: smull x0, w8, w9
229 %ext64 = load i32, ptr %x0
230 %sext = sext i32 %ext64 to i64
231 %sext4 = sext i16 %x1 to i64
232 %mul = mul i64 %sext, %sext4
236 define i64 @smull_ldrsw_w(ptr %x0, i32 %x1) {
237 ; CHECK-LABEL: smull_ldrsw_w:
238 ; CHECK: // %bb.0: // %entry
239 ; CHECK-NEXT: ldrsw x8, [x0]
240 ; CHECK-NEXT: smull x0, w8, w1
243 %ext64 = load i32, ptr %x0
244 %sext = sext i32 %ext64 to i64
245 %sext4 = sext i32 %x1 to i64
246 %mul = mul i64 %sext, %sext4
250 define i64 @smull_ldrsw_w_commuted(ptr %x0, i32 %x1) {
251 ; CHECK-LABEL: smull_ldrsw_w_commuted:
252 ; CHECK: // %bb.0: // %entry
253 ; CHECK-NEXT: ldrsw x8, [x0]
254 ; CHECK-NEXT: smull x0, w8, w1
257 %ext64 = load i32, ptr %x0
258 %sext = sext i32 %ext64 to i64
259 %sext4 = sext i32 %x1 to i64
260 %mul = mul i64 %sext4, %sext
264 define i64 @smull_sext_bb(i8 %x0, i8 %x1) {
265 ; CHECK-LABEL: smull_sext_bb:
266 ; CHECK: // %bb.0: // %entry
267 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
268 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
269 ; CHECK-NEXT: sxtb x8, w0
270 ; CHECK-NEXT: sxtb x9, w1
271 ; CHECK-NEXT: smull x0, w8, w9
274 %sext = sext i8 %x0 to i64
275 %sext4 = sext i8 %x1 to i64
276 %mul = mul i64 %sext, %sext4
280 define i64 @smull_ldrsw_shift(ptr %x0, i64 %x1) {
281 ; CHECK-LABEL: smull_ldrsw_shift:
282 ; CHECK: // %bb.0: // %entry
283 ; CHECK-NEXT: ldrsw x8, [x0]
284 ; CHECK-NEXT: sxtw x9, w1
285 ; CHECK-NEXT: smull x0, w8, w9
288 %ext64 = load i32, ptr %x0
289 %sext = sext i32 %ext64 to i64
290 %shl = shl i64 %x1, 32
291 %shr = ashr exact i64 %shl, 32
292 %mul = mul i64 %sext, %shr
296 define i64 @smull_ldrsh_zextw(ptr %x0, i32 %x1) {
297 ; CHECK-LABEL: smull_ldrsh_zextw:
298 ; CHECK: // %bb.0: // %entry
299 ; CHECK-NEXT: ldrsh x8, [x0]
300 ; CHECK-NEXT: mov w9, w1
301 ; CHECK-NEXT: mul x0, x8, x9
304 %ext64 = load i16, ptr %x0
305 %sext = sext i16 %ext64 to i64
306 %zext = zext i32 %x1 to i64
307 %mul = mul i64 %sext, %zext
311 define i64 @smull_ldrsw_zexth(ptr %x0, i16 %x1) {
312 ; CHECK-LABEL: smull_ldrsw_zexth:
313 ; CHECK: // %bb.0: // %entry
314 ; CHECK-NEXT: ldrsw x8, [x0]
315 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
316 ; CHECK-NEXT: and x9, x1, #0xffff
317 ; CHECK-NEXT: smull x0, w8, w9
320 %ext64 = load i32, ptr %x0
321 %sext = sext i32 %ext64 to i64
322 %zext = zext i16 %x1 to i64
323 %mul = mul i64 %sext, %zext
327 define i64 @smull_ldrsw_zextb(ptr %x0, i8 %x1) {
328 ; CHECK-LABEL: smull_ldrsw_zextb:
329 ; CHECK: // %bb.0: // %entry
330 ; CHECK-NEXT: ldrsw x8, [x0]
331 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
332 ; CHECK-NEXT: and x9, x1, #0xff
333 ; CHECK-NEXT: smull x0, w8, w9
336 %ext64 = load i32, ptr %x0
337 %sext = sext i32 %ext64 to i64
338 %zext = zext i8 %x1 to i64
339 %mul = mul i64 %sext, %zext
343 define i64 @smull_ldrsw_zextb_commuted(ptr %x0, i8 %x1) {
344 ; CHECK-LABEL: smull_ldrsw_zextb_commuted:
345 ; CHECK: // %bb.0: // %entry
346 ; CHECK-NEXT: ldrsw x8, [x0]
347 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
348 ; CHECK-NEXT: and x9, x1, #0xff
349 ; CHECK-NEXT: smull x0, w9, w8
352 %ext64 = load i32, ptr %x0
353 %sext = sext i32 %ext64 to i64
354 %zext = zext i8 %x1 to i64
355 %mul = mul i64 %zext, %sext
359 define i64 @smaddl_ldrsb_h(ptr %x0, i16 %x1, i64 %x2) {
360 ; CHECK-LABEL: smaddl_ldrsb_h:
361 ; CHECK: // %bb.0: // %entry
362 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
363 ; CHECK-NEXT: ldrsb x8, [x0]
364 ; CHECK-NEXT: sxth x9, w1
365 ; CHECK-NEXT: smaddl x0, w8, w9, x2
368 %ext64 = load i8, ptr %x0
369 %sext = sext i8 %ext64 to i64
370 %sext4 = sext i16 %x1 to i64
371 %mul = mul i64 %sext, %sext4
372 %add = add i64 %x2, %mul
376 define i64 @smaddl_ldrsb_h_commuted(ptr %x0, i16 %x1, i64 %x2) {
377 ; CHECK-LABEL: smaddl_ldrsb_h_commuted:
378 ; CHECK: // %bb.0: // %entry
379 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
380 ; CHECK-NEXT: ldrsb x8, [x0]
381 ; CHECK-NEXT: sxth x9, w1
382 ; CHECK-NEXT: smaddl x0, w9, w8, x2
385 %ext64 = load i8, ptr %x0
386 %sext = sext i8 %ext64 to i64
387 %sext4 = sext i16 %x1 to i64
388 %mul = mul i64 %sext4, %sext
389 %add = add i64 %x2, %mul
393 define i64 @smaddl_ldrsh_w(ptr %x0, i32 %x1, i64 %x2) {
394 ; CHECK-LABEL: smaddl_ldrsh_w:
395 ; CHECK: // %bb.0: // %entry
396 ; CHECK-NEXT: ldrsh x8, [x0]
397 ; CHECK-NEXT: smaddl x0, w8, w1, x2
400 %ext64 = load i16, ptr %x0
401 %sext = sext i16 %ext64 to i64
402 %sext4 = sext i32 %x1 to i64
403 %mul = mul i64 %sext, %sext4
404 %add = add i64 %x2, %mul
408 define i64 @smaddl_ldrsh_w_commuted(ptr %x0, i32 %x1, i64 %x2) {
409 ; CHECK-LABEL: smaddl_ldrsh_w_commuted:
410 ; CHECK: // %bb.0: // %entry
411 ; CHECK-NEXT: ldrsh x8, [x0]
412 ; CHECK-NEXT: smaddl x0, w8, w1, x2
415 %ext64 = load i16, ptr %x0
416 %sext = sext i16 %ext64 to i64
417 %sext4 = sext i32 %x1 to i64
418 %mul = mul i64 %sext4, %sext
419 %add = add i64 %x2, %mul
423 define i64 @smaddl_ldrsw_b(ptr %x0, i8 %x1, i64 %x2) {
424 ; CHECK-LABEL: smaddl_ldrsw_b:
426 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
427 ; CHECK-NEXT: ldrsw x8, [x0]
428 ; CHECK-NEXT: sxtb x9, w1
429 ; CHECK-NEXT: smaddl x0, w8, w9, x2
431 %ext64 = load i32, ptr %x0
432 %sext = sext i32 %ext64 to i64
433 %sext2 = sext i8 %x1 to i64
434 %mul = mul i64 %sext, %sext2
435 %add = add i64 %x2, %mul
439 define i64 @smaddl_ldrsw_b_commuted(ptr %x0, i8 %x1, i64 %x2) {
440 ; CHECK-LABEL: smaddl_ldrsw_b_commuted:
442 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
443 ; CHECK-NEXT: ldrsw x8, [x0]
444 ; CHECK-NEXT: sxtb x9, w1
445 ; CHECK-NEXT: smaddl x0, w9, w8, x2
447 %ext64 = load i32, ptr %x0
448 %sext = sext i32 %ext64 to i64
449 %sext2 = sext i8 %x1 to i64
450 %mul = mul i64 %sext2, %sext
451 %add = add i64 %x2, %mul
455 define i64 @smaddl_ldrsw_ldrsw(ptr %x0, ptr %x1, i64 %x2) {
456 ; CHECK-LABEL: smaddl_ldrsw_ldrsw:
457 ; CHECK: // %bb.0: // %entry
458 ; CHECK-NEXT: ldrsw x8, [x0]
459 ; CHECK-NEXT: ldrsw x9, [x1]
460 ; CHECK-NEXT: smaddl x0, w8, w9, x2
463 %ext64 = load i32, ptr %x0
464 %ext64_2 = load i32, ptr %x1
465 %sext = sext i32 %ext64 to i64
466 %sext2 = sext i32 %ext64_2 to i64
467 %mul = mul i64 %sext, %sext2
468 %add = add i64 %x2, %mul
472 define i64 @smaddl_sext_hh(i16 %x0, i16 %x1, i64 %x2) {
473 ; CHECK-LABEL: smaddl_sext_hh:
474 ; CHECK: // %bb.0: // %entry
475 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
476 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
477 ; CHECK-NEXT: sxth x8, w0
478 ; CHECK-NEXT: sxth x9, w1
479 ; CHECK-NEXT: smaddl x0, w8, w9, x2
482 %sext = sext i16 %x0 to i64
483 %sext2 = sext i16 %x1 to i64
484 %mul = mul i64 %sext, %sext2
485 %add = add i64 %x2, %mul
489 define i64 @smaddl_ldrsw_shift(ptr %x0, i64 %x1, i64 %x2) {
490 ; CHECK-LABEL: smaddl_ldrsw_shift:
491 ; CHECK: // %bb.0: // %entry
492 ; CHECK-NEXT: ldrsw x8, [x0]
493 ; CHECK-NEXT: sxtw x9, w1
494 ; CHECK-NEXT: smaddl x0, w8, w9, x2
497 %ext64 = load i32, ptr %x0
498 %sext = sext i32 %ext64 to i64
499 %shl = shl i64 %x1, 32
500 %shr = ashr exact i64 %shl, 32
501 %mul = mul i64 %sext, %shr
502 %add = add i64 %x2, %mul
506 define i64 @smaddl_ldrsw_zextb(ptr %x0, i8 %x1, i64 %x2) {
507 ; CHECK-LABEL: smaddl_ldrsw_zextb:
508 ; CHECK: // %bb.0: // %entry
509 ; CHECK-NEXT: ldrsw x8, [x0]
510 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
511 ; CHECK-NEXT: and x9, x1, #0xff
512 ; CHECK-NEXT: smaddl x0, w8, w9, x2
515 %ext64 = load i32, ptr %x0
516 %sext = sext i32 %ext64 to i64
517 %zext = zext i8 %x1 to i64
518 %mul = mul i64 %sext, %zext
519 %add = add i64 %x2, %mul
523 define i64 @smnegl_ldrsb_h(ptr %x0, i16 %x1) {
524 ; CHECK-LABEL: smnegl_ldrsb_h:
525 ; CHECK: // %bb.0: // %entry
526 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
527 ; CHECK-NEXT: ldrsb x8, [x0]
528 ; CHECK-NEXT: sxth x9, w1
529 ; CHECK-NEXT: smnegl x0, w8, w9
532 %ext64 = load i8, ptr %x0
533 %sext = sext i8 %ext64 to i64
534 %sext4 = sext i16 %x1 to i64
535 %mul = mul i64 %sext, %sext4
536 %sub = sub i64 0, %mul
540 define i64 @smnegl_ldrsb_h_commuted(ptr %x0, i16 %x1) {
541 ; CHECK-LABEL: smnegl_ldrsb_h_commuted:
542 ; CHECK: // %bb.0: // %entry
543 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
544 ; CHECK-NEXT: ldrsb x8, [x0]
545 ; CHECK-NEXT: sxth x9, w1
546 ; CHECK-NEXT: smnegl x0, w9, w8
549 %ext64 = load i8, ptr %x0
550 %sext = sext i8 %ext64 to i64
551 %sext4 = sext i16 %x1 to i64
552 %mul = mul i64 %sext4, %sext
553 %sub = sub i64 0, %mul
557 define i64 @smnegl_ldrsh_w(ptr %x0, i32 %x1) {
558 ; CHECK-LABEL: smnegl_ldrsh_w:
559 ; CHECK: // %bb.0: // %entry
560 ; CHECK-NEXT: ldrsh x8, [x0]
561 ; CHECK-NEXT: smnegl x0, w8, w1
564 %ext64 = load i16, ptr %x0
565 %sext = sext i16 %ext64 to i64
566 %sext4 = sext i32 %x1 to i64
567 %mul = mul i64 %sext, %sext4
568 %sub = sub i64 0, %mul
572 define i64 @smnegl_ldrsh_w_commuted(ptr %x0, i32 %x1) {
573 ; CHECK-LABEL: smnegl_ldrsh_w_commuted:
574 ; CHECK: // %bb.0: // %entry
575 ; CHECK-NEXT: ldrsh x8, [x0]
576 ; CHECK-NEXT: smnegl x0, w8, w1
579 %ext64 = load i16, ptr %x0
580 %sext = sext i16 %ext64 to i64
581 %sext4 = sext i32 %x1 to i64
582 %mul = mul i64 %sext4, %sext
583 %sub = sub i64 0, %mul
587 define i64 @smnegl_ldrsw_b(ptr %x0, i8 %x1) {
588 ; CHECK-LABEL: smnegl_ldrsw_b:
590 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
591 ; CHECK-NEXT: ldrsw x8, [x0]
592 ; CHECK-NEXT: sxtb x9, w1
593 ; CHECK-NEXT: smnegl x0, w8, w9
595 %ext64 = load i32, ptr %x0
596 %sext = sext i32 %ext64 to i64
597 %sext2 = sext i8 %x1 to i64
598 %mul = mul i64 %sext, %sext2
599 %sub = sub i64 0, %mul
603 define i64 @smnegl_ldrsw_b_commuted(ptr %x0, i8 %x1) {
604 ; CHECK-LABEL: smnegl_ldrsw_b_commuted:
606 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
607 ; CHECK-NEXT: ldrsw x8, [x0]
608 ; CHECK-NEXT: sxtb x9, w1
609 ; CHECK-NEXT: smnegl x0, w9, w8
611 %ext64 = load i32, ptr %x0
612 %sext = sext i32 %ext64 to i64
613 %sext2 = sext i8 %x1 to i64
614 %mul = mul i64 %sext2, %sext
615 %sub = sub i64 0, %mul
619 define i64 @smnegl_ldrsw_ldrsw(ptr %x0, ptr %x1) {
620 ; CHECK-LABEL: smnegl_ldrsw_ldrsw:
621 ; CHECK: // %bb.0: // %entry
622 ; CHECK-NEXT: ldrsw x8, [x0]
623 ; CHECK-NEXT: ldrsw x9, [x1]
624 ; CHECK-NEXT: smnegl x0, w8, w9
627 %ext64 = load i32, ptr %x0
628 %ext64_2 = load i32, ptr %x1
629 %sext = sext i32 %ext64 to i64
630 %sext2 = sext i32 %ext64_2 to i64
631 %mul = mul i64 %sext, %sext2
632 %sub = sub i64 0, %mul
636 define i64 @smnegl_sext_hh(i16 %x0, i16 %x1) {
637 ; CHECK-LABEL: smnegl_sext_hh:
638 ; CHECK: // %bb.0: // %entry
639 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
640 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
641 ; CHECK-NEXT: sxth x8, w0
642 ; CHECK-NEXT: sxth x9, w1
643 ; CHECK-NEXT: smnegl x0, w8, w9
646 %sext = sext i16 %x0 to i64
647 %sext2 = sext i16 %x1 to i64
648 %mul = mul i64 %sext, %sext2
649 %sub = sub i64 0, %mul
653 define i64 @smnegl_ldrsw_shift(ptr %x0, i64 %x1) {
654 ; CHECK-LABEL: smnegl_ldrsw_shift:
655 ; CHECK: // %bb.0: // %entry
656 ; CHECK-NEXT: ldrsw x8, [x0]
657 ; CHECK-NEXT: sxtw x9, w1
658 ; CHECK-NEXT: smnegl x0, w8, w9
661 %ext64 = load i32, ptr %x0
662 %sext = sext i32 %ext64 to i64
663 %shl = shl i64 %x1, 32
664 %shr = ashr exact i64 %shl, 32
665 %mul = mul i64 %sext, %shr
666 %sub = sub i64 0, %mul
670 define i64 @smnegl_ldrsw_zextb(ptr %x0, i8 %x1) {
671 ; CHECK-LABEL: smnegl_ldrsw_zextb:
672 ; CHECK: // %bb.0: // %entry
673 ; CHECK-NEXT: ldrsw x8, [x0]
674 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
675 ; CHECK-NEXT: and x9, x1, #0xff
676 ; CHECK-NEXT: smnegl x0, w8, w9
679 %ext64 = load i32, ptr %x0
680 %sext = sext i32 %ext64 to i64
681 %zext = zext i8 %x1 to i64
682 %mul = mul i64 %sext, %zext
683 %sub = sub i64 0, %mul
687 define i64 @smsubl_ldrsb_h(ptr %x0, i16 %x1, i64 %x2) {
688 ; CHECK-LABEL: smsubl_ldrsb_h:
689 ; CHECK: // %bb.0: // %entry
690 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
691 ; CHECK-NEXT: ldrsb x8, [x0]
692 ; CHECK-NEXT: sxth x9, w1
693 ; CHECK-NEXT: smsubl x0, w8, w9, x2
696 %ext64 = load i8, ptr %x0
697 %sext = sext i8 %ext64 to i64
698 %sext4 = sext i16 %x1 to i64
699 %mul = mul i64 %sext, %sext4
700 %sub = sub i64 %x2, %mul
704 define i64 @smsubl_ldrsb_h_commuted(ptr %x0, i16 %x1, i64 %x2) {
705 ; CHECK-LABEL: smsubl_ldrsb_h_commuted:
706 ; CHECK: // %bb.0: // %entry
707 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
708 ; CHECK-NEXT: ldrsb x8, [x0]
709 ; CHECK-NEXT: sxth x9, w1
710 ; CHECK-NEXT: smsubl x0, w9, w8, x2
713 %ext64 = load i8, ptr %x0
714 %sext = sext i8 %ext64 to i64
715 %sext4 = sext i16 %x1 to i64
716 %mul = mul i64 %sext4, %sext
717 %sub = sub i64 %x2, %mul
721 define i64 @smsubl_ldrsh_w(ptr %x0, i32 %x1, i64 %x2) {
722 ; CHECK-LABEL: smsubl_ldrsh_w:
723 ; CHECK: // %bb.0: // %entry
724 ; CHECK-NEXT: ldrsh x8, [x0]
725 ; CHECK-NEXT: smsubl x0, w8, w1, x2
728 %ext64 = load i16, ptr %x0
729 %sext = sext i16 %ext64 to i64
730 %sext4 = sext i32 %x1 to i64
731 %mul = mul i64 %sext, %sext4
732 %sub = sub i64 %x2, %mul
736 define i64 @smsubl_ldrsh_w_commuted(ptr %x0, i32 %x1, i64 %x2) {
737 ; CHECK-LABEL: smsubl_ldrsh_w_commuted:
738 ; CHECK: // %bb.0: // %entry
739 ; CHECK-NEXT: ldrsh x8, [x0]
740 ; CHECK-NEXT: smsubl x0, w8, w1, x2
743 %ext64 = load i16, ptr %x0
744 %sext = sext i16 %ext64 to i64
745 %sext4 = sext i32 %x1 to i64
746 %mul = mul i64 %sext4, %sext
747 %sub = sub i64 %x2, %mul
751 define i64 @smsubl_ldrsw_b(ptr %x0, i8 %x1, i64 %x2) {
752 ; CHECK-LABEL: smsubl_ldrsw_b:
754 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
755 ; CHECK-NEXT: ldrsw x8, [x0]
756 ; CHECK-NEXT: sxtb x9, w1
757 ; CHECK-NEXT: smsubl x0, w8, w9, x2
759 %ext64 = load i32, ptr %x0
760 %sext = sext i32 %ext64 to i64
761 %sext2 = sext i8 %x1 to i64
762 %mul = mul i64 %sext, %sext2
763 %sub = sub i64 %x2, %mul
767 define i64 @smsubl_ldrsw_b_commuted(ptr %x0, i8 %x1, i64 %x2) {
768 ; CHECK-LABEL: smsubl_ldrsw_b_commuted:
770 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
771 ; CHECK-NEXT: ldrsw x8, [x0]
772 ; CHECK-NEXT: sxtb x9, w1
773 ; CHECK-NEXT: smsubl x0, w9, w8, x2
775 %ext64 = load i32, ptr %x0
776 %sext = sext i32 %ext64 to i64
777 %sext2 = sext i8 %x1 to i64
778 %mul = mul i64 %sext2, %sext
779 %sub = sub i64 %x2, %mul
783 define i64 @smsubl_ldrsw_ldrsw(ptr %x0, ptr %x1, i64 %x2) {
784 ; CHECK-LABEL: smsubl_ldrsw_ldrsw:
785 ; CHECK: // %bb.0: // %entry
786 ; CHECK-NEXT: ldrsw x8, [x0]
787 ; CHECK-NEXT: ldrsw x9, [x1]
788 ; CHECK-NEXT: smsubl x0, w8, w9, x2
791 %ext64 = load i32, ptr %x0
792 %ext64_2 = load i32, ptr %x1
793 %sext = sext i32 %ext64 to i64
794 %sext2 = sext i32 %ext64_2 to i64
795 %mul = mul i64 %sext, %sext2
796 %sub = sub i64 %x2, %mul
800 define i64 @smsubl_sext_hh(i16 %x0, i16 %x1, i64 %x2) {
801 ; CHECK-LABEL: smsubl_sext_hh:
802 ; CHECK: // %bb.0: // %entry
803 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
804 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
805 ; CHECK-NEXT: sxth x8, w0
806 ; CHECK-NEXT: sxth x9, w1
807 ; CHECK-NEXT: smsubl x0, w8, w9, x2
810 %sext = sext i16 %x0 to i64
811 %sext2 = sext i16 %x1 to i64
812 %mul = mul i64 %sext, %sext2
813 %sub = sub i64 %x2, %mul
817 define i64 @smsubl_ldrsw_shift(ptr %x0, i64 %x1, i64 %x2) {
818 ; CHECK-LABEL: smsubl_ldrsw_shift:
819 ; CHECK: // %bb.0: // %entry
820 ; CHECK-NEXT: ldrsw x8, [x0]
821 ; CHECK-NEXT: sxtw x9, w1
822 ; CHECK-NEXT: smsubl x0, w8, w9, x2
825 %ext64 = load i32, ptr %x0
826 %sext = sext i32 %ext64 to i64
827 %shl = shl i64 %x1, 32
828 %shr = ashr exact i64 %shl, 32
829 %mul = mul i64 %sext, %shr
830 %sub = sub i64 %x2, %mul
834 define i64 @smsubl_ldrsw_zextb(ptr %x0, i8 %x1, i64 %x2) {
835 ; CHECK-LABEL: smsubl_ldrsw_zextb:
836 ; CHECK: // %bb.0: // %entry
837 ; CHECK-NEXT: ldrsw x8, [x0]
838 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
839 ; CHECK-NEXT: and x9, x1, #0xff
840 ; CHECK-NEXT: smsubl x0, w8, w9, x2
843 %ext64 = load i32, ptr %x0
844 %sext = sext i32 %ext64 to i64
845 %zext = zext i8 %x1 to i64
846 %mul = mul i64 %sext, %zext
847 %sub = sub i64 %x2, %mul
851 define i64 @smull_sext_ashr31(i32 %a, i64 %b) nounwind {
852 ; CHECK-LABEL: smull_sext_ashr31:
853 ; CHECK: // %bb.0: // %entry
854 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
855 ; CHECK-NEXT: sxtw x8, w0
856 ; CHECK-NEXT: asr x9, x1, #31
857 ; CHECK-NEXT: mul x0, x8, x9
860 %tmp1 = sext i32 %a to i64
862 %tmp3 = mul i64 %tmp1, %c
866 define i64 @smull_sext_ashr32(i32 %a, i64 %b) nounwind {
867 ; CHECK-LABEL: smull_sext_ashr32:
868 ; CHECK: // %bb.0: // %entry
869 ; CHECK-NEXT: asr x8, x1, #32
870 ; CHECK-NEXT: smull x0, w8, w0
873 %tmp1 = sext i32 %a to i64
875 %tmp3 = mul i64 %tmp1, %c
880 define i64 @smull_ashr31_both(i64 %a, i64 %b) nounwind {
881 ; CHECK-LABEL: smull_ashr31_both:
882 ; CHECK: // %bb.0: // %entry
883 ; CHECK-NEXT: asr x8, x0, #31
884 ; CHECK-NEXT: asr x9, x1, #31
885 ; CHECK-NEXT: mul x0, x8, x9
888 %tmp1 = ashr i64 %a, 31
890 %tmp3 = mul i64 %tmp1, %c
894 define i64 @smull_ashr32_both(i64 %a, i64 %b) nounwind {
895 ; CHECK-LABEL: smull_ashr32_both:
896 ; CHECK: // %bb.0: // %entry
897 ; CHECK-NEXT: asr x8, x0, #32
898 ; CHECK-NEXT: asr x9, x1, #32
899 ; CHECK-NEXT: smull x0, w8, w9
902 %tmp1 = ashr i64 %a, 32
904 %tmp3 = mul i64 %tmp1, %c
908 define i64 @umull_ldrb_h(ptr %x0, i16 %x1) {
909 ; CHECK-LABEL: umull_ldrb_h:
910 ; CHECK: // %bb.0: // %entry
911 ; CHECK-NEXT: ldrb w8, [x0]
912 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
913 ; CHECK-NEXT: and x9, x1, #0xffff
914 ; CHECK-NEXT: umull x0, w8, w9
917 %ext64 = load i8, ptr %x0
918 %zext = zext i8 %ext64 to i64
919 %zext4 = zext i16 %x1 to i64
920 %mul = mul i64 %zext, %zext4
924 define i64 @umull_ldrb_h_commuted(ptr %x0, i16 %x1) {
925 ; CHECK-LABEL: umull_ldrb_h_commuted:
926 ; CHECK: // %bb.0: // %entry
927 ; CHECK-NEXT: ldrb w8, [x0]
928 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
929 ; CHECK-NEXT: and x9, x1, #0xffff
930 ; CHECK-NEXT: umull x0, w9, w8
933 %ext64 = load i8, ptr %x0
934 %zext = zext i8 %ext64 to i64
935 %zext4 = zext i16 %x1 to i64
936 %mul = mul i64 %zext4, %zext
940 define i64 @umull_ldrh_w(ptr %x0, i32 %x1) {
941 ; CHECK-LABEL: umull_ldrh_w:
942 ; CHECK: // %bb.0: // %entry
943 ; CHECK-NEXT: ldrh w8, [x0]
944 ; CHECK-NEXT: umull x0, w8, w1
947 %ext64 = load i16, ptr %x0
948 %zext = zext i16 %ext64 to i64
949 %zext4 = zext i32 %x1 to i64
950 %mul = mul i64 %zext, %zext4
954 define i64 @umull_ldr_b(ptr %x0, i8 %x1) {
955 ; CHECK-LABEL: umull_ldr_b:
956 ; CHECK: // %bb.0: // %entry
957 ; CHECK-NEXT: ldr w8, [x0]
958 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
959 ; CHECK-NEXT: and x9, x1, #0xff
960 ; CHECK-NEXT: umull x0, w8, w9
963 %ext64 = load i32, ptr %x0
964 %zext = zext i32 %ext64 to i64
965 %zext4 = zext i8 %x1 to i64
966 %mul = mul i64 %zext, %zext4
970 define i64 @umull_ldr2_w(ptr %x0, i32 %x1) {
971 ; CHECK-LABEL: umull_ldr2_w:
972 ; CHECK: // %bb.0: // %entry
973 ; CHECK-NEXT: ldr w8, [x0]
974 ; CHECK-NEXT: umull x0, w8, w1
977 %ext64 = load i64, ptr %x0
978 %and = and i64 %ext64, 4294967295
979 %zext4 = zext i32 %x1 to i64
980 %mul = mul i64 %and, %zext4
984 define i64 @umull_ldr2_ldr2(ptr %x0, ptr %x1) {
985 ; CHECK-LABEL: umull_ldr2_ldr2:
986 ; CHECK: // %bb.0: // %entry
987 ; CHECK-NEXT: ldr w8, [x0]
988 ; CHECK-NEXT: ldr w9, [x1]
989 ; CHECK-NEXT: umull x0, w8, w9
992 %ext64 = load i64, ptr %x0
993 %and = and i64 %ext64, 4294967295
994 %ext64_2 = load i64, ptr %x1
995 %and2 = and i64 %ext64_2, 4294967295
996 %mul = mul i64 %and, %and2
1000 define i64 @umull_ldr2_d(ptr %x0, i64 %x1) {
1001 ; CHECK-LABEL: umull_ldr2_d:
1002 ; CHECK: // %bb.0: // %entry
1003 ; CHECK-NEXT: ldr w8, [x0]
1004 ; CHECK-NEXT: and x9, x1, #0xffffffff
1005 ; CHECK-NEXT: umull x0, w8, w9
1008 %ext64 = load i64, ptr %x0
1009 %and = and i64 %ext64, 4294967295
1010 %and2 = and i64 %x1, 4294967295
1011 %mul = mul i64 %and, %and2
1015 define i64 @umaddl_ldrb_h(ptr %x0, i16 %x1, i64 %x2) {
1016 ; CHECK-LABEL: umaddl_ldrb_h:
1017 ; CHECK: // %bb.0: // %entry
1018 ; CHECK-NEXT: ldrb w8, [x0]
1019 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
1020 ; CHECK-NEXT: and x9, x1, #0xffff
1021 ; CHECK-NEXT: umaddl x0, w8, w9, x2
1024 %ext64 = load i8, ptr %x0
1025 %zext = zext i8 %ext64 to i64
1026 %zext4 = zext i16 %x1 to i64
1027 %mul = mul i64 %zext, %zext4
1028 %add = add i64 %mul, %x2
1032 define i64 @umaddl_ldrb_h_commuted(ptr %x0, i16 %x1, i64 %x2) {
1033 ; CHECK-LABEL: umaddl_ldrb_h_commuted:
1034 ; CHECK: // %bb.0: // %entry
1035 ; CHECK-NEXT: ldrb w8, [x0]
1036 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
1037 ; CHECK-NEXT: and x9, x1, #0xffff
1038 ; CHECK-NEXT: umaddl x0, w9, w8, x2
1041 %ext64 = load i8, ptr %x0
1042 %zext = zext i8 %ext64 to i64
1043 %zext4 = zext i16 %x1 to i64
1044 %mul = mul i64 %zext4, %zext
1045 %add = add i64 %mul, %x2
1049 define i64 @umaddl_ldrh_w(ptr %x0, i32 %x1, i64 %x2) {
1050 ; CHECK-LABEL: umaddl_ldrh_w:
1051 ; CHECK: // %bb.0: // %entry
1052 ; CHECK-NEXT: ldrh w8, [x0]
1053 ; CHECK-NEXT: umaddl x0, w8, w1, x2
1056 %ext64 = load i16, ptr %x0
1057 %zext = zext i16 %ext64 to i64
1058 %zext4 = zext i32 %x1 to i64
1059 %mul = mul i64 %zext, %zext4
1060 %add = add i64 %mul, %x2
1064 define i64 @umaddl_ldr_b(ptr %x0, i8 %x1, i64 %x2) {
1065 ; CHECK-LABEL: umaddl_ldr_b:
1066 ; CHECK: // %bb.0: // %entry
1067 ; CHECK-NEXT: ldr w8, [x0]
1068 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
1069 ; CHECK-NEXT: and x9, x1, #0xff
1070 ; CHECK-NEXT: umaddl x0, w8, w9, x2
1073 %ext64 = load i32, ptr %x0
1074 %zext = zext i32 %ext64 to i64
1075 %zext4 = zext i8 %x1 to i64
1076 %mul = mul i64 %zext, %zext4
1077 %add = add i64 %mul, %x2
1081 define i64 @umaddl_ldr2_w(ptr %x0, i32 %x1, i64 %x2) {
1082 ; CHECK-LABEL: umaddl_ldr2_w:
1083 ; CHECK: // %bb.0: // %entry
1084 ; CHECK-NEXT: ldr w8, [x0]
1085 ; CHECK-NEXT: umaddl x0, w8, w1, x2
1088 %ext64 = load i64, ptr %x0
1089 %and = and i64 %ext64, 4294967295
1090 %zext4 = zext i32 %x1 to i64
1091 %mul = mul i64 %and, %zext4
1092 %add = add i64 %mul, %x2
1096 define i64 @umaddl_ldr2_ldr2(ptr %x0, ptr %x1, i64 %x2) {
1097 ; CHECK-LABEL: umaddl_ldr2_ldr2:
1098 ; CHECK: // %bb.0: // %entry
1099 ; CHECK-NEXT: ldr w8, [x0]
1100 ; CHECK-NEXT: ldr w9, [x1]
1101 ; CHECK-NEXT: umaddl x0, w8, w9, x2
1104 %ext64 = load i64, ptr %x0
1105 %and = and i64 %ext64, 4294967295
1106 %ext64_2 = load i64, ptr %x1
1107 %and2 = and i64 %ext64_2, 4294967295
1108 %mul = mul i64 %and, %and2
1109 %add = add i64 %mul, %x2
1113 define i64 @umaddl_ldr2_d(ptr %x0, i64 %x1, i64 %x2) {
1114 ; CHECK-LABEL: umaddl_ldr2_d:
1115 ; CHECK: // %bb.0: // %entry
1116 ; CHECK-NEXT: ldr w8, [x0]
1117 ; CHECK-NEXT: and x9, x1, #0xffffffff
1118 ; CHECK-NEXT: umaddl x0, w8, w9, x2
1121 %ext64 = load i64, ptr %x0
1122 %and = and i64 %ext64, 4294967295
1123 %and2 = and i64 %x1, 4294967295
1124 %mul = mul i64 %and, %and2
1125 %add = add i64 %mul, %x2
1129 define i64 @umnegl_ldrb_h(ptr %x0, i16 %x1) {
1130 ; CHECK-LABEL: umnegl_ldrb_h:
1131 ; CHECK: // %bb.0: // %entry
1132 ; CHECK-NEXT: ldrb w8, [x0]
1133 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
1134 ; CHECK-NEXT: and x9, x1, #0xffff
1135 ; CHECK-NEXT: umnegl x0, w8, w9
1138 %ext64 = load i8, ptr %x0
1139 %zext = zext i8 %ext64 to i64
1140 %zext4 = zext i16 %x1 to i64
1141 %mul = mul i64 %zext, %zext4
1142 %sub = sub i64 0, %mul
1146 define i64 @umnegl_ldrb_h_commuted(ptr %x0, i16 %x1) {
1147 ; CHECK-LABEL: umnegl_ldrb_h_commuted:
1148 ; CHECK: // %bb.0: // %entry
1149 ; CHECK-NEXT: ldrb w8, [x0]
1150 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
1151 ; CHECK-NEXT: and x9, x1, #0xffff
1152 ; CHECK-NEXT: umnegl x0, w9, w8
1155 %ext64 = load i8, ptr %x0
1156 %zext = zext i8 %ext64 to i64
1157 %zext4 = zext i16 %x1 to i64
1158 %mul = mul i64 %zext4, %zext
1159 %sub = sub i64 0, %mul
1163 define i64 @umnegl_ldrh_w(ptr %x0, i32 %x1) {
1164 ; CHECK-LABEL: umnegl_ldrh_w:
1165 ; CHECK: // %bb.0: // %entry
1166 ; CHECK-NEXT: ldrh w8, [x0]
1167 ; CHECK-NEXT: umnegl x0, w8, w1
1170 %ext64 = load i16, ptr %x0
1171 %zext = zext i16 %ext64 to i64
1172 %zext4 = zext i32 %x1 to i64
1173 %mul = mul i64 %zext, %zext4
1174 %sub = sub i64 0, %mul
1178 define i64 @umnegl_ldr_b(ptr %x0, i8 %x1) {
1179 ; CHECK-LABEL: umnegl_ldr_b:
1180 ; CHECK: // %bb.0: // %entry
1181 ; CHECK-NEXT: ldr w8, [x0]
1182 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
1183 ; CHECK-NEXT: and x9, x1, #0xff
1184 ; CHECK-NEXT: umnegl x0, w8, w9
1187 %ext64 = load i32, ptr %x0
1188 %zext = zext i32 %ext64 to i64
1189 %zext4 = zext i8 %x1 to i64
1190 %mul = mul i64 %zext, %zext4
1191 %sub = sub i64 0, %mul
1195 define i64 @umnegl_ldr2_w(ptr %x0, i32 %x1) {
1196 ; CHECK-LABEL: umnegl_ldr2_w:
1197 ; CHECK: // %bb.0: // %entry
1198 ; CHECK-NEXT: ldr w8, [x0]
1199 ; CHECK-NEXT: umnegl x0, w8, w1
1202 %ext64 = load i64, ptr %x0
1203 %and = and i64 %ext64, 4294967295
1204 %zext4 = zext i32 %x1 to i64
1205 %mul = mul i64 %and, %zext4
1206 %sub = sub i64 0, %mul
1210 define i64 @umnegl_ldr2_ldr2(ptr %x0, ptr %x1) {
1211 ; CHECK-LABEL: umnegl_ldr2_ldr2:
1212 ; CHECK: // %bb.0: // %entry
1213 ; CHECK-NEXT: ldr w8, [x0]
1214 ; CHECK-NEXT: ldr w9, [x1]
1215 ; CHECK-NEXT: umnegl x0, w8, w9
1218 %ext64 = load i64, ptr %x0
1219 %and = and i64 %ext64, 4294967295
1220 %ext64_2 = load i64, ptr %x1
1221 %and2 = and i64 %ext64_2, 4294967295
1222 %mul = mul i64 %and, %and2
1223 %sub = sub i64 0, %mul
1227 define i64 @umnegl_ldr2_d(ptr %x0, i64 %x1) {
1228 ; CHECK-LABEL: umnegl_ldr2_d:
1229 ; CHECK: // %bb.0: // %entry
1230 ; CHECK-NEXT: ldr w8, [x0]
1231 ; CHECK-NEXT: and x9, x1, #0xffffffff
1232 ; CHECK-NEXT: umnegl x0, w8, w9
1235 %ext64 = load i64, ptr %x0
1236 %and = and i64 %ext64, 4294967295
1237 %and2 = and i64 %x1, 4294967295
1238 %mul = mul i64 %and, %and2
1239 %sub = sub i64 0, %mul
1243 define i64 @umsubl_ldrb_h(ptr %x0, i16 %x1, i64 %x2) {
1244 ; CHECK-LABEL: umsubl_ldrb_h:
1245 ; CHECK: // %bb.0: // %entry
1246 ; CHECK-NEXT: ldrb w8, [x0]
1247 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
1248 ; CHECK-NEXT: and x9, x1, #0xffff
1249 ; CHECK-NEXT: umsubl x0, w8, w9, x2
1252 %ext64 = load i8, ptr %x0
1253 %zext = zext i8 %ext64 to i64
1254 %zext4 = zext i16 %x1 to i64
1255 %mul = mul i64 %zext, %zext4
1256 %sub = sub i64 %x2, %mul
1260 define i64 @umsubl_ldrb_h_commuted(ptr %x0, i16 %x1, i64 %x2) {
1261 ; CHECK-LABEL: umsubl_ldrb_h_commuted:
1262 ; CHECK: // %bb.0: // %entry
1263 ; CHECK-NEXT: ldrb w8, [x0]
1264 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
1265 ; CHECK-NEXT: and x9, x1, #0xffff
1266 ; CHECK-NEXT: umsubl x0, w9, w8, x2
1269 %ext64 = load i8, ptr %x0
1270 %zext = zext i8 %ext64 to i64
1271 %zext4 = zext i16 %x1 to i64
1272 %mul = mul i64 %zext4, %zext
1273 %sub = sub i64 %x2, %mul
1277 define i64 @umsubl_ldrh_w(ptr %x0, i32 %x1, i64 %x2) {
1278 ; CHECK-LABEL: umsubl_ldrh_w:
1279 ; CHECK: // %bb.0: // %entry
1280 ; CHECK-NEXT: ldrh w8, [x0]
1281 ; CHECK-NEXT: umsubl x0, w8, w1, x2
1284 %ext64 = load i16, ptr %x0
1285 %zext = zext i16 %ext64 to i64
1286 %zext4 = zext i32 %x1 to i64
1287 %mul = mul i64 %zext, %zext4
1288 %sub = sub i64 %x2, %mul
1292 define i64 @umsubl_ldr_b(ptr %x0, i8 %x1, i64 %x2) {
1293 ; CHECK-LABEL: umsubl_ldr_b:
1294 ; CHECK: // %bb.0: // %entry
1295 ; CHECK-NEXT: ldr w8, [x0]
1296 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
1297 ; CHECK-NEXT: and x9, x1, #0xff
1298 ; CHECK-NEXT: umsubl x0, w8, w9, x2
1301 %ext64 = load i32, ptr %x0
1302 %zext = zext i32 %ext64 to i64
1303 %zext4 = zext i8 %x1 to i64
1304 %mul = mul i64 %zext, %zext4
1305 %sub = sub i64 %x2, %mul
1309 define i64 @umsubl_ldr2_w(ptr %x0, i32 %x1, i64 %x2) {
1310 ; CHECK-LABEL: umsubl_ldr2_w:
1311 ; CHECK: // %bb.0: // %entry
1312 ; CHECK-NEXT: ldr w8, [x0]
1313 ; CHECK-NEXT: umsubl x0, w8, w1, x2
1316 %ext64 = load i64, ptr %x0
1317 %and = and i64 %ext64, 4294967295
1318 %zext4 = zext i32 %x1 to i64
1319 %mul = mul i64 %and, %zext4
1320 %sub = sub i64 %x2, %mul
1324 define i64 @umsubl_ldr2_ldr2(ptr %x0, ptr %x1, i64 %x2) {
1325 ; CHECK-LABEL: umsubl_ldr2_ldr2:
1326 ; CHECK: // %bb.0: // %entry
1327 ; CHECK-NEXT: ldr w8, [x0]
1328 ; CHECK-NEXT: ldr w9, [x1]
1329 ; CHECK-NEXT: umsubl x0, w8, w9, x2
1332 %ext64 = load i64, ptr %x0
1333 %and = and i64 %ext64, 4294967295
1334 %ext64_2 = load i64, ptr %x1
1335 %and2 = and i64 %ext64_2, 4294967295
1336 %mul = mul i64 %and, %and2
1337 %sub = sub i64 %x2, %mul
1341 define i64 @umsubl_ldr2_d(ptr %x0, i64 %x1, i64 %x2) {
1342 ; CHECK-LABEL: umsubl_ldr2_d:
1343 ; CHECK: // %bb.0: // %entry
1344 ; CHECK-NEXT: ldr w8, [x0]
1345 ; CHECK-NEXT: and x9, x1, #0xffffffff
1346 ; CHECK-NEXT: umsubl x0, w8, w9, x2
1349 %ext64 = load i64, ptr %x0
1350 %and = and i64 %ext64, 4294967295
1351 %and2 = and i64 %x1, 4294967295
1352 %mul = mul i64 %and, %and2
1353 %sub = sub i64 %x2, %mul
1357 define i64 @umull_ldr2_w_cc1(ptr %x0, i32 %x1) {
1358 ; CHECK-LABEL: umull_ldr2_w_cc1:
1359 ; CHECK: // %bb.0: // %entry
1360 ; CHECK-NEXT: ldr x8, [x0]
1361 ; CHECK-NEXT: and x8, x8, #0x7fffffff
1362 ; CHECK-NEXT: umull x0, w8, w1
1365 %ext64 = load i64, ptr %x0
1366 %and = and i64 %ext64, 2147483647
1367 %zext4 = zext i32 %x1 to i64
1368 %mul = mul i64 %and, %zext4
1372 define i64 @umull_ldr2_w_cc2(ptr %x0, i32 %x1) {
1373 ; CHECK-LABEL: umull_ldr2_w_cc2:
1374 ; CHECK: // %bb.0: // %entry
1375 ; CHECK-NEXT: ldr x8, [x0]
1376 ; CHECK-NEXT: mov w9, w1
1377 ; CHECK-NEXT: and x8, x8, #0x1ffffffff
1378 ; CHECK-NEXT: mul x0, x8, x9
1381 %ext64 = load i64, ptr %x0
1382 %and = and i64 %ext64, 8589934591
1383 %zext4 = zext i32 %x1 to i64
1384 %mul = mul i64 %and, %zext4
1388 define i64 @regression_umsubl(i64 %a, i32 %b, i64 %c) {
1389 ; CHECK-LABEL: regression_umsubl:
1390 ; CHECK: // %bb.0: // %entry
1391 ; CHECK-NEXT: mov w8, w1
1392 ; CHECK-NEXT: udiv x9, x0, x8
1393 ; CHECK-NEXT: msub x0, x9, x8, x2
1396 %zext1 = zext i32 %b to i64
1397 %res = udiv i64 %a, %zext1
1398 %mul = mul i64 %res, %zext1
1399 %sub = sub i64 %c, %mul