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 --check-prefixes=CHECK,CHECK-SD
3 ; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel < %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-GI
5 define i64 @umull(i64 %x0, i64 %x1) {
6 ; CHECK-SD-LABEL: umull:
7 ; CHECK-SD: // %bb.0: // %entry
8 ; CHECK-SD-NEXT: umull x0, w1, w0
11 ; CHECK-GI-LABEL: umull:
12 ; CHECK-GI: // %bb.0: // %entry
13 ; CHECK-GI-NEXT: mov w8, w0
14 ; CHECK-GI-NEXT: mov w9, w1
15 ; CHECK-GI-NEXT: mul x0, x9, x8
18 %and = and i64 %x0, 4294967295
19 %and1 = and i64 %x1, 4294967295
20 %mul = mul nuw i64 %and1, %and
24 define i64 @umull2(i64 %x, i32 %y) {
25 ; CHECK-SD-LABEL: umull2:
26 ; CHECK-SD: // %bb.0: // %entry
27 ; CHECK-SD-NEXT: umull x0, w0, w1
30 ; CHECK-GI-LABEL: umull2:
31 ; CHECK-GI: // %bb.0: // %entry
32 ; CHECK-GI-NEXT: mov w8, w0
33 ; CHECK-GI-NEXT: mov w9, w1
34 ; CHECK-GI-NEXT: mul x0, x8, x9
37 %and = and i64 %x, 4294967295
38 %conv = zext i32 %y to i64
39 %mul = mul nuw nsw i64 %and, %conv
43 define i64 @umull2_commuted(i64 %x, i32 %y) {
44 ; CHECK-SD-LABEL: umull2_commuted:
45 ; CHECK-SD: // %bb.0: // %entry
46 ; CHECK-SD-NEXT: umull x0, w0, w1
49 ; CHECK-GI-LABEL: umull2_commuted:
50 ; CHECK-GI: // %bb.0: // %entry
51 ; CHECK-GI-NEXT: mov w8, w0
52 ; CHECK-GI-NEXT: mov w9, w1
53 ; CHECK-GI-NEXT: mul x0, x9, x8
56 %and = and i64 %x, 4294967295
57 %conv = zext i32 %y to i64
58 %mul = mul nuw nsw i64 %conv, %and
62 define i64 @smull(i64 %x0, i64 %x1) {
63 ; CHECK-SD-LABEL: smull:
64 ; CHECK-SD: // %bb.0: // %entry
65 ; CHECK-SD-NEXT: smull x0, w1, w0
68 ; CHECK-GI-LABEL: smull:
69 ; CHECK-GI: // %bb.0: // %entry
70 ; CHECK-GI-NEXT: sxtw x8, w0
71 ; CHECK-GI-NEXT: sxtw x9, w1
72 ; CHECK-GI-NEXT: mul x0, x9, x8
75 %sext = shl i64 %x0, 32
76 %conv1 = ashr exact i64 %sext, 32
77 %sext4 = shl i64 %x1, 32
78 %conv3 = ashr exact i64 %sext4, 32
79 %mul = mul nsw i64 %conv3, %conv1
83 define i64 @smull2(i64 %x, i32 %y) {
84 ; CHECK-SD-LABEL: smull2:
85 ; CHECK-SD: // %bb.0: // %entry
86 ; CHECK-SD-NEXT: smull x0, w0, w1
89 ; CHECK-GI-LABEL: smull2:
90 ; CHECK-GI: // %bb.0: // %entry
91 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
92 ; CHECK-GI-NEXT: sxtw x8, w0
93 ; CHECK-GI-NEXT: sxtw x9, w1
94 ; CHECK-GI-NEXT: mul x0, x8, x9
98 %shr = ashr exact i64 %shl, 32
99 %conv = sext i32 %y to i64
100 %mul = mul nsw i64 %shr, %conv
104 define i64 @smull2_commuted(i64 %x, i32 %y) {
105 ; CHECK-SD-LABEL: smull2_commuted:
106 ; CHECK-SD: // %bb.0: // %entry
107 ; CHECK-SD-NEXT: smull x0, w0, w1
110 ; CHECK-GI-LABEL: smull2_commuted:
111 ; CHECK-GI: // %bb.0: // %entry
112 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
113 ; CHECK-GI-NEXT: sxtw x8, w0
114 ; CHECK-GI-NEXT: sxtw x9, w1
115 ; CHECK-GI-NEXT: mul x0, x9, x8
118 %shl = shl i64 %x, 32
119 %shr = ashr exact i64 %shl, 32
120 %conv = sext i32 %y to i64
121 %mul = mul nsw i64 %conv, %shr
125 define i64 @smull_ldrsb_b(ptr %x0, i8 %x1) {
126 ; CHECK-SD-LABEL: smull_ldrsb_b:
127 ; CHECK-SD: // %bb.0: // %entry
128 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
129 ; CHECK-SD-NEXT: ldrsb x8, [x0]
130 ; CHECK-SD-NEXT: sxtb x9, w1
131 ; CHECK-SD-NEXT: smull x0, w8, w9
134 ; CHECK-GI-LABEL: smull_ldrsb_b:
135 ; CHECK-GI: // %bb.0: // %entry
136 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
137 ; CHECK-GI-NEXT: ldrsb x8, [x0]
138 ; CHECK-GI-NEXT: sxtb x9, w1
139 ; CHECK-GI-NEXT: mul x0, x8, x9
142 %ext64 = load i8, ptr %x0
143 %sext = sext i8 %ext64 to i64
144 %sext4 = sext i8 %x1 to i64
145 %mul = mul i64 %sext, %sext4
149 define i64 @smull_ldrsb_b_commuted(ptr %x0, i8 %x1) {
150 ; CHECK-SD-LABEL: smull_ldrsb_b_commuted:
151 ; CHECK-SD: // %bb.0: // %entry
152 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
153 ; CHECK-SD-NEXT: ldrsb x8, [x0]
154 ; CHECK-SD-NEXT: sxtb x9, w1
155 ; CHECK-SD-NEXT: smull x0, w9, w8
158 ; CHECK-GI-LABEL: smull_ldrsb_b_commuted:
159 ; CHECK-GI: // %bb.0: // %entry
160 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
161 ; CHECK-GI-NEXT: ldrsb x8, [x0]
162 ; CHECK-GI-NEXT: sxtb x9, w1
163 ; CHECK-GI-NEXT: mul x0, x9, x8
166 %ext64 = load i8, ptr %x0
167 %sext = sext i8 %ext64 to i64
168 %sext4 = sext i8 %x1 to i64
169 %mul = mul i64 %sext4, %sext
173 define i64 @smull_ldrsb_h(ptr %x0, i16 %x1) {
174 ; CHECK-SD-LABEL: smull_ldrsb_h:
175 ; CHECK-SD: // %bb.0: // %entry
176 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
177 ; CHECK-SD-NEXT: ldrsb x8, [x0]
178 ; CHECK-SD-NEXT: sxth x9, w1
179 ; CHECK-SD-NEXT: smull x0, w8, w9
182 ; CHECK-GI-LABEL: smull_ldrsb_h:
183 ; CHECK-GI: // %bb.0: // %entry
184 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
185 ; CHECK-GI-NEXT: ldrsb x8, [x0]
186 ; CHECK-GI-NEXT: sxth x9, w1
187 ; CHECK-GI-NEXT: mul x0, x8, x9
190 %ext64 = load i8, ptr %x0
191 %sext = sext i8 %ext64 to i64
192 %sext4 = sext i16 %x1 to i64
193 %mul = mul i64 %sext, %sext4
197 define i64 @smull_ldrsb_w(ptr %x0, i32 %x1) {
198 ; CHECK-SD-LABEL: smull_ldrsb_w:
199 ; CHECK-SD: // %bb.0: // %entry
200 ; CHECK-SD-NEXT: ldrsb x8, [x0]
201 ; CHECK-SD-NEXT: smull x0, w8, w1
204 ; CHECK-GI-LABEL: smull_ldrsb_w:
205 ; CHECK-GI: // %bb.0: // %entry
206 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
207 ; CHECK-GI-NEXT: ldrsb x8, [x0]
208 ; CHECK-GI-NEXT: sxtw x9, w1
209 ; CHECK-GI-NEXT: mul x0, x8, x9
212 %ext64 = load i8, ptr %x0
213 %sext = sext i8 %ext64 to i64
214 %sext4 = sext i32 %x1 to i64
215 %mul = mul i64 %sext, %sext4
219 define i64 @smull_ldrsh_b(ptr %x0, i8 %x1) {
220 ; CHECK-SD-LABEL: smull_ldrsh_b:
221 ; CHECK-SD: // %bb.0: // %entry
222 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
223 ; CHECK-SD-NEXT: ldrsh x8, [x0]
224 ; CHECK-SD-NEXT: sxtb x9, w1
225 ; CHECK-SD-NEXT: smull x0, w8, w9
228 ; CHECK-GI-LABEL: smull_ldrsh_b:
229 ; CHECK-GI: // %bb.0: // %entry
230 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
231 ; CHECK-GI-NEXT: ldrsh x8, [x0]
232 ; CHECK-GI-NEXT: sxtb x9, w1
233 ; CHECK-GI-NEXT: mul x0, x8, x9
236 %ext64 = load i16, ptr %x0
237 %sext = sext i16 %ext64 to i64
238 %sext4 = sext i8 %x1 to i64
239 %mul = mul i64 %sext, %sext4
243 define i64 @smull_ldrsh_h(ptr %x0, i16 %x1) {
244 ; CHECK-SD-LABEL: smull_ldrsh_h:
245 ; CHECK-SD: // %bb.0: // %entry
246 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
247 ; CHECK-SD-NEXT: ldrsh x8, [x0]
248 ; CHECK-SD-NEXT: sxth x9, w1
249 ; CHECK-SD-NEXT: smull x0, w8, w9
252 ; CHECK-GI-LABEL: smull_ldrsh_h:
253 ; CHECK-GI: // %bb.0: // %entry
254 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
255 ; CHECK-GI-NEXT: ldrsh x8, [x0]
256 ; CHECK-GI-NEXT: sxth x9, w1
257 ; CHECK-GI-NEXT: mul x0, x8, x9
260 %ext64 = load i16, ptr %x0
261 %sext = sext i16 %ext64 to i64
262 %sext4 = sext i16 %x1 to i64
263 %mul = mul i64 %sext, %sext4
267 define i64 @smull_ldrsh_h_commuted(ptr %x0, i16 %x1) {
268 ; CHECK-SD-LABEL: smull_ldrsh_h_commuted:
269 ; CHECK-SD: // %bb.0: // %entry
270 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
271 ; CHECK-SD-NEXT: ldrsh x8, [x0]
272 ; CHECK-SD-NEXT: sxth x9, w1
273 ; CHECK-SD-NEXT: smull x0, w9, w8
276 ; CHECK-GI-LABEL: smull_ldrsh_h_commuted:
277 ; CHECK-GI: // %bb.0: // %entry
278 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
279 ; CHECK-GI-NEXT: ldrsh x8, [x0]
280 ; CHECK-GI-NEXT: sxth x9, w1
281 ; CHECK-GI-NEXT: mul x0, x9, x8
284 %ext64 = load i16, ptr %x0
285 %sext = sext i16 %ext64 to i64
286 %sext4 = sext i16 %x1 to i64
287 %mul = mul i64 %sext4, %sext
291 define i64 @smull_ldrsh_w(ptr %x0, i32 %x1) {
292 ; CHECK-SD-LABEL: smull_ldrsh_w:
293 ; CHECK-SD: // %bb.0: // %entry
294 ; CHECK-SD-NEXT: ldrsh x8, [x0]
295 ; CHECK-SD-NEXT: smull x0, w8, w1
298 ; CHECK-GI-LABEL: smull_ldrsh_w:
299 ; CHECK-GI: // %bb.0: // %entry
300 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
301 ; CHECK-GI-NEXT: ldrsh x8, [x0]
302 ; CHECK-GI-NEXT: sxtw x9, w1
303 ; CHECK-GI-NEXT: mul x0, x8, x9
306 %ext64 = load i16, ptr %x0
307 %sext = sext i16 %ext64 to i64
308 %sext4 = sext i32 %x1 to i64
309 %mul = mul i64 %sext, %sext4
313 define i64 @smull_ldrsw_b(ptr %x0, i8 %x1) {
314 ; CHECK-SD-LABEL: smull_ldrsw_b:
315 ; CHECK-SD: // %bb.0: // %entry
316 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
317 ; CHECK-SD-NEXT: ldrsw x8, [x0]
318 ; CHECK-SD-NEXT: sxtb x9, w1
319 ; CHECK-SD-NEXT: smull x0, w8, w9
322 ; CHECK-GI-LABEL: smull_ldrsw_b:
323 ; CHECK-GI: // %bb.0: // %entry
324 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
325 ; CHECK-GI-NEXT: ldrsw x8, [x0]
326 ; CHECK-GI-NEXT: sxtb x9, w1
327 ; CHECK-GI-NEXT: mul x0, x8, x9
330 %ext64 = load i32, ptr %x0
331 %sext = sext i32 %ext64 to i64
332 %sext4 = sext i8 %x1 to i64
333 %mul = mul i64 %sext, %sext4
337 define i64 @smull_ldrsw_h(ptr %x0, i16 %x1) {
338 ; CHECK-SD-LABEL: smull_ldrsw_h:
339 ; CHECK-SD: // %bb.0: // %entry
340 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
341 ; CHECK-SD-NEXT: ldrsw x8, [x0]
342 ; CHECK-SD-NEXT: sxth x9, w1
343 ; CHECK-SD-NEXT: smull x0, w8, w9
346 ; CHECK-GI-LABEL: smull_ldrsw_h:
347 ; CHECK-GI: // %bb.0: // %entry
348 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
349 ; CHECK-GI-NEXT: ldrsw x8, [x0]
350 ; CHECK-GI-NEXT: sxth x9, w1
351 ; CHECK-GI-NEXT: mul x0, x8, x9
354 %ext64 = load i32, ptr %x0
355 %sext = sext i32 %ext64 to i64
356 %sext4 = sext i16 %x1 to i64
357 %mul = mul i64 %sext, %sext4
361 define i64 @smull_ldrsw_w(ptr %x0, i32 %x1) {
362 ; CHECK-SD-LABEL: smull_ldrsw_w:
363 ; CHECK-SD: // %bb.0: // %entry
364 ; CHECK-SD-NEXT: ldrsw x8, [x0]
365 ; CHECK-SD-NEXT: smull x0, w8, w1
368 ; CHECK-GI-LABEL: smull_ldrsw_w:
369 ; CHECK-GI: // %bb.0: // %entry
370 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
371 ; CHECK-GI-NEXT: ldrsw x8, [x0]
372 ; CHECK-GI-NEXT: sxtw x9, w1
373 ; CHECK-GI-NEXT: mul x0, x8, x9
376 %ext64 = load i32, ptr %x0
377 %sext = sext i32 %ext64 to i64
378 %sext4 = sext i32 %x1 to i64
379 %mul = mul i64 %sext, %sext4
383 define i64 @smull_ldrsw_w_commuted(ptr %x0, i32 %x1) {
384 ; CHECK-SD-LABEL: smull_ldrsw_w_commuted:
385 ; CHECK-SD: // %bb.0: // %entry
386 ; CHECK-SD-NEXT: ldrsw x8, [x0]
387 ; CHECK-SD-NEXT: smull x0, w8, w1
390 ; CHECK-GI-LABEL: smull_ldrsw_w_commuted:
391 ; CHECK-GI: // %bb.0: // %entry
392 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
393 ; CHECK-GI-NEXT: ldrsw x8, [x0]
394 ; CHECK-GI-NEXT: sxtw x9, w1
395 ; CHECK-GI-NEXT: mul x0, x9, x8
398 %ext64 = load i32, ptr %x0
399 %sext = sext i32 %ext64 to i64
400 %sext4 = sext i32 %x1 to i64
401 %mul = mul i64 %sext4, %sext
405 define i64 @smull_sext_bb(i8 %x0, i8 %x1) {
406 ; CHECK-SD-LABEL: smull_sext_bb:
407 ; CHECK-SD: // %bb.0: // %entry
408 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
409 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
410 ; CHECK-SD-NEXT: sxtb x8, w0
411 ; CHECK-SD-NEXT: sxtb x9, w1
412 ; CHECK-SD-NEXT: smull x0, w8, w9
415 ; CHECK-GI-LABEL: smull_sext_bb:
416 ; CHECK-GI: // %bb.0: // %entry
417 ; CHECK-GI-NEXT: // kill: def $w0 killed $w0 def $x0
418 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
419 ; CHECK-GI-NEXT: sxtb x8, w0
420 ; CHECK-GI-NEXT: sxtb x9, w1
421 ; CHECK-GI-NEXT: mul x0, x8, x9
424 %sext = sext i8 %x0 to i64
425 %sext4 = sext i8 %x1 to i64
426 %mul = mul i64 %sext, %sext4
430 define i64 @smull_ldrsw_shift(ptr %x0, i64 %x1) {
431 ; CHECK-SD-LABEL: smull_ldrsw_shift:
432 ; CHECK-SD: // %bb.0: // %entry
433 ; CHECK-SD-NEXT: ldrsw x8, [x0]
434 ; CHECK-SD-NEXT: smull x0, w8, w1
437 ; CHECK-GI-LABEL: smull_ldrsw_shift:
438 ; CHECK-GI: // %bb.0: // %entry
439 ; CHECK-GI-NEXT: ldrsw x8, [x0]
440 ; CHECK-GI-NEXT: sxtw x9, w1
441 ; CHECK-GI-NEXT: mul x0, x8, x9
444 %ext64 = load i32, ptr %x0
445 %sext = sext i32 %ext64 to i64
446 %shl = shl i64 %x1, 32
447 %shr = ashr exact i64 %shl, 32
448 %mul = mul i64 %sext, %shr
452 define i64 @smull_ldrsh_zextw(ptr %x0, i32 %x1) {
453 ; CHECK-LABEL: smull_ldrsh_zextw:
454 ; CHECK: // %bb.0: // %entry
455 ; CHECK-NEXT: ldrsh x8, [x0]
456 ; CHECK-NEXT: mov w9, w1
457 ; CHECK-NEXT: mul x0, x8, x9
460 %ext64 = load i16, ptr %x0
461 %sext = sext i16 %ext64 to i64
462 %zext = zext i32 %x1 to i64
463 %mul = mul i64 %sext, %zext
467 define i64 @smull_ldrsw_zexth(ptr %x0, i16 %x1) {
468 ; CHECK-SD-LABEL: smull_ldrsw_zexth:
469 ; CHECK-SD: // %bb.0: // %entry
470 ; CHECK-SD-NEXT: ldrsw x8, [x0]
471 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
472 ; CHECK-SD-NEXT: and x9, x1, #0xffff
473 ; CHECK-SD-NEXT: smull x0, w8, w9
476 ; CHECK-GI-LABEL: smull_ldrsw_zexth:
477 ; CHECK-GI: // %bb.0: // %entry
478 ; CHECK-GI-NEXT: ldrsw x8, [x0]
479 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
480 ; CHECK-GI-NEXT: and x9, x1, #0xffff
481 ; CHECK-GI-NEXT: mul x0, x8, x9
484 %ext64 = load i32, ptr %x0
485 %sext = sext i32 %ext64 to i64
486 %zext = zext i16 %x1 to i64
487 %mul = mul i64 %sext, %zext
491 define i64 @smull_ldrsw_zextb(ptr %x0, i8 %x1) {
492 ; CHECK-SD-LABEL: smull_ldrsw_zextb:
493 ; CHECK-SD: // %bb.0: // %entry
494 ; CHECK-SD-NEXT: ldrsw x8, [x0]
495 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
496 ; CHECK-SD-NEXT: and x9, x1, #0xff
497 ; CHECK-SD-NEXT: smull x0, w8, w9
500 ; CHECK-GI-LABEL: smull_ldrsw_zextb:
501 ; CHECK-GI: // %bb.0: // %entry
502 ; CHECK-GI-NEXT: ldrsw x8, [x0]
503 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
504 ; CHECK-GI-NEXT: and x9, x1, #0xff
505 ; CHECK-GI-NEXT: mul x0, x8, x9
508 %ext64 = load i32, ptr %x0
509 %sext = sext i32 %ext64 to i64
510 %zext = zext i8 %x1 to i64
511 %mul = mul i64 %sext, %zext
515 define i64 @smull_ldrsw_zextb_commuted(ptr %x0, i8 %x1) {
516 ; CHECK-SD-LABEL: smull_ldrsw_zextb_commuted:
517 ; CHECK-SD: // %bb.0: // %entry
518 ; CHECK-SD-NEXT: ldrsw x8, [x0]
519 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
520 ; CHECK-SD-NEXT: and x9, x1, #0xff
521 ; CHECK-SD-NEXT: smull x0, w9, w8
524 ; CHECK-GI-LABEL: smull_ldrsw_zextb_commuted:
525 ; CHECK-GI: // %bb.0: // %entry
526 ; CHECK-GI-NEXT: ldrsw x8, [x0]
527 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
528 ; CHECK-GI-NEXT: and x9, x1, #0xff
529 ; CHECK-GI-NEXT: mul x0, x9, x8
532 %ext64 = load i32, ptr %x0
533 %sext = sext i32 %ext64 to i64
534 %zext = zext i8 %x1 to i64
535 %mul = mul i64 %zext, %sext
539 define i64 @smaddl_ldrsb_h(ptr %x0, i16 %x1, i64 %x2) {
540 ; CHECK-SD-LABEL: smaddl_ldrsb_h:
541 ; CHECK-SD: // %bb.0: // %entry
542 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
543 ; CHECK-SD-NEXT: ldrsb x8, [x0]
544 ; CHECK-SD-NEXT: sxth x9, w1
545 ; CHECK-SD-NEXT: smaddl x0, w8, w9, x2
548 ; CHECK-GI-LABEL: smaddl_ldrsb_h:
549 ; CHECK-GI: // %bb.0: // %entry
550 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
551 ; CHECK-GI-NEXT: ldrsb x8, [x0]
552 ; CHECK-GI-NEXT: sxth x9, w1
553 ; CHECK-GI-NEXT: madd x0, x8, x9, x2
556 %ext64 = load i8, ptr %x0
557 %sext = sext i8 %ext64 to i64
558 %sext4 = sext i16 %x1 to i64
559 %mul = mul i64 %sext, %sext4
560 %add = add i64 %x2, %mul
564 define i64 @smaddl_ldrsb_h_commuted(ptr %x0, i16 %x1, i64 %x2) {
565 ; CHECK-SD-LABEL: smaddl_ldrsb_h_commuted:
566 ; CHECK-SD: // %bb.0: // %entry
567 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
568 ; CHECK-SD-NEXT: ldrsb x8, [x0]
569 ; CHECK-SD-NEXT: sxth x9, w1
570 ; CHECK-SD-NEXT: smaddl x0, w9, w8, x2
573 ; CHECK-GI-LABEL: smaddl_ldrsb_h_commuted:
574 ; CHECK-GI: // %bb.0: // %entry
575 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
576 ; CHECK-GI-NEXT: ldrsb x8, [x0]
577 ; CHECK-GI-NEXT: sxth x9, w1
578 ; CHECK-GI-NEXT: madd x0, x9, x8, x2
581 %ext64 = load i8, ptr %x0
582 %sext = sext i8 %ext64 to i64
583 %sext4 = sext i16 %x1 to i64
584 %mul = mul i64 %sext4, %sext
585 %add = add i64 %x2, %mul
589 define i64 @smaddl_ldrsh_w(ptr %x0, i32 %x1, i64 %x2) {
590 ; CHECK-SD-LABEL: smaddl_ldrsh_w:
591 ; CHECK-SD: // %bb.0: // %entry
592 ; CHECK-SD-NEXT: ldrsh x8, [x0]
593 ; CHECK-SD-NEXT: smaddl x0, w8, w1, x2
596 ; CHECK-GI-LABEL: smaddl_ldrsh_w:
597 ; CHECK-GI: // %bb.0: // %entry
598 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
599 ; CHECK-GI-NEXT: ldrsh x8, [x0]
600 ; CHECK-GI-NEXT: sxtw x9, w1
601 ; CHECK-GI-NEXT: madd x0, x8, x9, x2
604 %ext64 = load i16, ptr %x0
605 %sext = sext i16 %ext64 to i64
606 %sext4 = sext i32 %x1 to i64
607 %mul = mul i64 %sext, %sext4
608 %add = add i64 %x2, %mul
612 define i64 @smaddl_ldrsh_w_commuted(ptr %x0, i32 %x1, i64 %x2) {
613 ; CHECK-SD-LABEL: smaddl_ldrsh_w_commuted:
614 ; CHECK-SD: // %bb.0: // %entry
615 ; CHECK-SD-NEXT: ldrsh x8, [x0]
616 ; CHECK-SD-NEXT: smaddl x0, w8, w1, x2
619 ; CHECK-GI-LABEL: smaddl_ldrsh_w_commuted:
620 ; CHECK-GI: // %bb.0: // %entry
621 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
622 ; CHECK-GI-NEXT: ldrsh x8, [x0]
623 ; CHECK-GI-NEXT: sxtw x9, w1
624 ; CHECK-GI-NEXT: madd x0, x9, x8, x2
627 %ext64 = load i16, ptr %x0
628 %sext = sext i16 %ext64 to i64
629 %sext4 = sext i32 %x1 to i64
630 %mul = mul i64 %sext4, %sext
631 %add = add i64 %x2, %mul
635 define i64 @smaddl_ldrsw_b(ptr %x0, i8 %x1, i64 %x2) {
636 ; CHECK-SD-LABEL: smaddl_ldrsw_b:
637 ; CHECK-SD: // %bb.0:
638 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
639 ; CHECK-SD-NEXT: ldrsw x8, [x0]
640 ; CHECK-SD-NEXT: sxtb x9, w1
641 ; CHECK-SD-NEXT: smaddl x0, w8, w9, x2
644 ; CHECK-GI-LABEL: smaddl_ldrsw_b:
645 ; CHECK-GI: // %bb.0:
646 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
647 ; CHECK-GI-NEXT: ldrsw x8, [x0]
648 ; CHECK-GI-NEXT: sxtb x9, w1
649 ; CHECK-GI-NEXT: madd x0, x8, x9, x2
651 %ext64 = load i32, ptr %x0
652 %sext = sext i32 %ext64 to i64
653 %sext2 = sext i8 %x1 to i64
654 %mul = mul i64 %sext, %sext2
655 %add = add i64 %x2, %mul
659 define i64 @smaddl_ldrsw_b_commuted(ptr %x0, i8 %x1, i64 %x2) {
660 ; CHECK-SD-LABEL: smaddl_ldrsw_b_commuted:
661 ; CHECK-SD: // %bb.0:
662 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
663 ; CHECK-SD-NEXT: ldrsw x8, [x0]
664 ; CHECK-SD-NEXT: sxtb x9, w1
665 ; CHECK-SD-NEXT: smaddl x0, w9, w8, x2
668 ; CHECK-GI-LABEL: smaddl_ldrsw_b_commuted:
669 ; CHECK-GI: // %bb.0:
670 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
671 ; CHECK-GI-NEXT: ldrsw x8, [x0]
672 ; CHECK-GI-NEXT: sxtb x9, w1
673 ; CHECK-GI-NEXT: madd x0, x9, x8, x2
675 %ext64 = load i32, ptr %x0
676 %sext = sext i32 %ext64 to i64
677 %sext2 = sext i8 %x1 to i64
678 %mul = mul i64 %sext2, %sext
679 %add = add i64 %x2, %mul
683 define i64 @smaddl_ldrsw_ldrsw(ptr %x0, ptr %x1, i64 %x2) {
684 ; CHECK-SD-LABEL: smaddl_ldrsw_ldrsw:
685 ; CHECK-SD: // %bb.0: // %entry
686 ; CHECK-SD-NEXT: ldrsw x8, [x0]
687 ; CHECK-SD-NEXT: ldrsw x9, [x1]
688 ; CHECK-SD-NEXT: smaddl x0, w8, w9, x2
691 ; CHECK-GI-LABEL: smaddl_ldrsw_ldrsw:
692 ; CHECK-GI: // %bb.0: // %entry
693 ; CHECK-GI-NEXT: ldrsw x8, [x0]
694 ; CHECK-GI-NEXT: ldrsw x9, [x1]
695 ; CHECK-GI-NEXT: madd x0, x8, x9, x2
698 %ext64 = load i32, ptr %x0
699 %ext64_2 = load i32, ptr %x1
700 %sext = sext i32 %ext64 to i64
701 %sext2 = sext i32 %ext64_2 to i64
702 %mul = mul i64 %sext, %sext2
703 %add = add i64 %x2, %mul
707 define i64 @smaddl_sext_hh(i16 %x0, i16 %x1, i64 %x2) {
708 ; CHECK-SD-LABEL: smaddl_sext_hh:
709 ; CHECK-SD: // %bb.0: // %entry
710 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
711 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
712 ; CHECK-SD-NEXT: sxth x8, w0
713 ; CHECK-SD-NEXT: sxth x9, w1
714 ; CHECK-SD-NEXT: smaddl x0, w8, w9, x2
717 ; CHECK-GI-LABEL: smaddl_sext_hh:
718 ; CHECK-GI: // %bb.0: // %entry
719 ; CHECK-GI-NEXT: // kill: def $w0 killed $w0 def $x0
720 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
721 ; CHECK-GI-NEXT: sxth x8, w0
722 ; CHECK-GI-NEXT: sxth x9, w1
723 ; CHECK-GI-NEXT: madd x0, x8, x9, x2
726 %sext = sext i16 %x0 to i64
727 %sext2 = sext i16 %x1 to i64
728 %mul = mul i64 %sext, %sext2
729 %add = add i64 %x2, %mul
733 define i64 @smaddl_ldrsw_shift(ptr %x0, i64 %x1, i64 %x2) {
734 ; CHECK-SD-LABEL: smaddl_ldrsw_shift:
735 ; CHECK-SD: // %bb.0: // %entry
736 ; CHECK-SD-NEXT: ldrsw x8, [x0]
737 ; CHECK-SD-NEXT: smaddl x0, w8, w1, x2
740 ; CHECK-GI-LABEL: smaddl_ldrsw_shift:
741 ; CHECK-GI: // %bb.0: // %entry
742 ; CHECK-GI-NEXT: ldrsw x8, [x0]
743 ; CHECK-GI-NEXT: sxtw x9, w1
744 ; CHECK-GI-NEXT: madd x0, x8, x9, x2
747 %ext64 = load i32, ptr %x0
748 %sext = sext i32 %ext64 to i64
749 %shl = shl i64 %x1, 32
750 %shr = ashr exact i64 %shl, 32
751 %mul = mul i64 %sext, %shr
752 %add = add i64 %x2, %mul
756 define i64 @smaddl_ldrsw_zextb(ptr %x0, i8 %x1, i64 %x2) {
757 ; CHECK-SD-LABEL: smaddl_ldrsw_zextb:
758 ; CHECK-SD: // %bb.0: // %entry
759 ; CHECK-SD-NEXT: ldrsw x8, [x0]
760 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
761 ; CHECK-SD-NEXT: and x9, x1, #0xff
762 ; CHECK-SD-NEXT: smaddl x0, w8, w9, x2
765 ; CHECK-GI-LABEL: smaddl_ldrsw_zextb:
766 ; CHECK-GI: // %bb.0: // %entry
767 ; CHECK-GI-NEXT: ldrsw x8, [x0]
768 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
769 ; CHECK-GI-NEXT: and x9, x1, #0xff
770 ; CHECK-GI-NEXT: madd x0, x8, x9, x2
773 %ext64 = load i32, ptr %x0
774 %sext = sext i32 %ext64 to i64
775 %zext = zext i8 %x1 to i64
776 %mul = mul i64 %sext, %zext
777 %add = add i64 %x2, %mul
781 define i64 @smnegl_ldrsb_h(ptr %x0, i16 %x1) {
782 ; CHECK-SD-LABEL: smnegl_ldrsb_h:
783 ; CHECK-SD: // %bb.0: // %entry
784 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
785 ; CHECK-SD-NEXT: ldrsb x8, [x0]
786 ; CHECK-SD-NEXT: sxth x9, w1
787 ; CHECK-SD-NEXT: smnegl x0, w8, w9
790 ; CHECK-GI-LABEL: smnegl_ldrsb_h:
791 ; CHECK-GI: // %bb.0: // %entry
792 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
793 ; CHECK-GI-NEXT: ldrsb x8, [x0]
794 ; CHECK-GI-NEXT: sxth x9, w1
795 ; CHECK-GI-NEXT: mneg x0, x8, x9
798 %ext64 = load i8, ptr %x0
799 %sext = sext i8 %ext64 to i64
800 %sext4 = sext i16 %x1 to i64
801 %mul = mul i64 %sext, %sext4
802 %sub = sub i64 0, %mul
806 define i64 @smnegl_ldrsb_h_commuted(ptr %x0, i16 %x1) {
807 ; CHECK-SD-LABEL: smnegl_ldrsb_h_commuted:
808 ; CHECK-SD: // %bb.0: // %entry
809 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
810 ; CHECK-SD-NEXT: ldrsb x8, [x0]
811 ; CHECK-SD-NEXT: sxth x9, w1
812 ; CHECK-SD-NEXT: smnegl x0, w9, w8
815 ; CHECK-GI-LABEL: smnegl_ldrsb_h_commuted:
816 ; CHECK-GI: // %bb.0: // %entry
817 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
818 ; CHECK-GI-NEXT: ldrsb x8, [x0]
819 ; CHECK-GI-NEXT: sxth x9, w1
820 ; CHECK-GI-NEXT: mneg x0, x9, x8
823 %ext64 = load i8, ptr %x0
824 %sext = sext i8 %ext64 to i64
825 %sext4 = sext i16 %x1 to i64
826 %mul = mul i64 %sext4, %sext
827 %sub = sub i64 0, %mul
831 define i64 @smnegl_ldrsh_w(ptr %x0, i32 %x1) {
832 ; CHECK-SD-LABEL: smnegl_ldrsh_w:
833 ; CHECK-SD: // %bb.0: // %entry
834 ; CHECK-SD-NEXT: ldrsh x8, [x0]
835 ; CHECK-SD-NEXT: smnegl x0, w8, w1
838 ; CHECK-GI-LABEL: smnegl_ldrsh_w:
839 ; CHECK-GI: // %bb.0: // %entry
840 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
841 ; CHECK-GI-NEXT: ldrsh x8, [x0]
842 ; CHECK-GI-NEXT: sxtw x9, w1
843 ; CHECK-GI-NEXT: mneg x0, x8, x9
846 %ext64 = load i16, ptr %x0
847 %sext = sext i16 %ext64 to i64
848 %sext4 = sext i32 %x1 to i64
849 %mul = mul i64 %sext, %sext4
850 %sub = sub i64 0, %mul
854 define i64 @smnegl_ldrsh_w_commuted(ptr %x0, i32 %x1) {
855 ; CHECK-SD-LABEL: smnegl_ldrsh_w_commuted:
856 ; CHECK-SD: // %bb.0: // %entry
857 ; CHECK-SD-NEXT: ldrsh x8, [x0]
858 ; CHECK-SD-NEXT: smnegl x0, w8, w1
861 ; CHECK-GI-LABEL: smnegl_ldrsh_w_commuted:
862 ; CHECK-GI: // %bb.0: // %entry
863 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
864 ; CHECK-GI-NEXT: ldrsh x8, [x0]
865 ; CHECK-GI-NEXT: sxtw x9, w1
866 ; CHECK-GI-NEXT: mneg x0, x9, x8
869 %ext64 = load i16, ptr %x0
870 %sext = sext i16 %ext64 to i64
871 %sext4 = sext i32 %x1 to i64
872 %mul = mul i64 %sext4, %sext
873 %sub = sub i64 0, %mul
877 define i64 @smnegl_ldrsw_b(ptr %x0, i8 %x1) {
878 ; CHECK-SD-LABEL: smnegl_ldrsw_b:
879 ; CHECK-SD: // %bb.0:
880 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
881 ; CHECK-SD-NEXT: ldrsw x8, [x0]
882 ; CHECK-SD-NEXT: sxtb x9, w1
883 ; CHECK-SD-NEXT: smnegl x0, w8, w9
886 ; CHECK-GI-LABEL: smnegl_ldrsw_b:
887 ; CHECK-GI: // %bb.0:
888 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
889 ; CHECK-GI-NEXT: ldrsw x8, [x0]
890 ; CHECK-GI-NEXT: sxtb x9, w1
891 ; CHECK-GI-NEXT: mneg x0, x8, x9
893 %ext64 = load i32, ptr %x0
894 %sext = sext i32 %ext64 to i64
895 %sext2 = sext i8 %x1 to i64
896 %mul = mul i64 %sext, %sext2
897 %sub = sub i64 0, %mul
901 define i64 @smnegl_ldrsw_b_commuted(ptr %x0, i8 %x1) {
902 ; CHECK-SD-LABEL: smnegl_ldrsw_b_commuted:
903 ; CHECK-SD: // %bb.0:
904 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
905 ; CHECK-SD-NEXT: ldrsw x8, [x0]
906 ; CHECK-SD-NEXT: sxtb x9, w1
907 ; CHECK-SD-NEXT: smnegl x0, w9, w8
910 ; CHECK-GI-LABEL: smnegl_ldrsw_b_commuted:
911 ; CHECK-GI: // %bb.0:
912 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
913 ; CHECK-GI-NEXT: ldrsw x8, [x0]
914 ; CHECK-GI-NEXT: sxtb x9, w1
915 ; CHECK-GI-NEXT: mneg x0, x9, x8
917 %ext64 = load i32, ptr %x0
918 %sext = sext i32 %ext64 to i64
919 %sext2 = sext i8 %x1 to i64
920 %mul = mul i64 %sext2, %sext
921 %sub = sub i64 0, %mul
925 define i64 @smnegl_ldrsw_ldrsw(ptr %x0, ptr %x1) {
926 ; CHECK-SD-LABEL: smnegl_ldrsw_ldrsw:
927 ; CHECK-SD: // %bb.0: // %entry
928 ; CHECK-SD-NEXT: ldrsw x8, [x0]
929 ; CHECK-SD-NEXT: ldrsw x9, [x1]
930 ; CHECK-SD-NEXT: smnegl x0, w8, w9
933 ; CHECK-GI-LABEL: smnegl_ldrsw_ldrsw:
934 ; CHECK-GI: // %bb.0: // %entry
935 ; CHECK-GI-NEXT: ldrsw x8, [x0]
936 ; CHECK-GI-NEXT: ldrsw x9, [x1]
937 ; CHECK-GI-NEXT: mneg x0, x8, x9
940 %ext64 = load i32, ptr %x0
941 %ext64_2 = load i32, ptr %x1
942 %sext = sext i32 %ext64 to i64
943 %sext2 = sext i32 %ext64_2 to i64
944 %mul = mul i64 %sext, %sext2
945 %sub = sub i64 0, %mul
949 define i64 @smnegl_sext_hh(i16 %x0, i16 %x1) {
950 ; CHECK-SD-LABEL: smnegl_sext_hh:
951 ; CHECK-SD: // %bb.0: // %entry
952 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
953 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
954 ; CHECK-SD-NEXT: sxth x8, w0
955 ; CHECK-SD-NEXT: sxth x9, w1
956 ; CHECK-SD-NEXT: smnegl x0, w8, w9
959 ; CHECK-GI-LABEL: smnegl_sext_hh:
960 ; CHECK-GI: // %bb.0: // %entry
961 ; CHECK-GI-NEXT: // kill: def $w0 killed $w0 def $x0
962 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
963 ; CHECK-GI-NEXT: sxth x8, w0
964 ; CHECK-GI-NEXT: sxth x9, w1
965 ; CHECK-GI-NEXT: mneg x0, x8, x9
968 %sext = sext i16 %x0 to i64
969 %sext2 = sext i16 %x1 to i64
970 %mul = mul i64 %sext, %sext2
971 %sub = sub i64 0, %mul
975 define i64 @smnegl_ldrsw_shift(ptr %x0, i64 %x1) {
976 ; CHECK-SD-LABEL: smnegl_ldrsw_shift:
977 ; CHECK-SD: // %bb.0: // %entry
978 ; CHECK-SD-NEXT: ldrsw x8, [x0]
979 ; CHECK-SD-NEXT: smnegl x0, w8, w1
982 ; CHECK-GI-LABEL: smnegl_ldrsw_shift:
983 ; CHECK-GI: // %bb.0: // %entry
984 ; CHECK-GI-NEXT: ldrsw x8, [x0]
985 ; CHECK-GI-NEXT: sxtw x9, w1
986 ; CHECK-GI-NEXT: mneg x0, x8, x9
989 %ext64 = load i32, ptr %x0
990 %sext = sext i32 %ext64 to i64
991 %shl = shl i64 %x1, 32
992 %shr = ashr exact i64 %shl, 32
993 %mul = mul i64 %sext, %shr
994 %sub = sub i64 0, %mul
998 define i64 @smnegl_ldrsw_zextb(ptr %x0, i8 %x1) {
999 ; CHECK-SD-LABEL: smnegl_ldrsw_zextb:
1000 ; CHECK-SD: // %bb.0: // %entry
1001 ; CHECK-SD-NEXT: ldrsw x8, [x0]
1002 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1003 ; CHECK-SD-NEXT: and x9, x1, #0xff
1004 ; CHECK-SD-NEXT: smnegl x0, w8, w9
1005 ; CHECK-SD-NEXT: ret
1007 ; CHECK-GI-LABEL: smnegl_ldrsw_zextb:
1008 ; CHECK-GI: // %bb.0: // %entry
1009 ; CHECK-GI-NEXT: ldrsw x8, [x0]
1010 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1011 ; CHECK-GI-NEXT: and x9, x1, #0xff
1012 ; CHECK-GI-NEXT: mneg x0, x8, x9
1013 ; CHECK-GI-NEXT: ret
1015 %ext64 = load i32, ptr %x0
1016 %sext = sext i32 %ext64 to i64
1017 %zext = zext i8 %x1 to i64
1018 %mul = mul i64 %sext, %zext
1019 %sub = sub i64 0, %mul
1023 define i64 @smsubl_ldrsb_h(ptr %x0, i16 %x1, i64 %x2) {
1024 ; CHECK-SD-LABEL: smsubl_ldrsb_h:
1025 ; CHECK-SD: // %bb.0: // %entry
1026 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1027 ; CHECK-SD-NEXT: ldrsb x8, [x0]
1028 ; CHECK-SD-NEXT: sxth x9, w1
1029 ; CHECK-SD-NEXT: smsubl x0, w8, w9, x2
1030 ; CHECK-SD-NEXT: ret
1032 ; CHECK-GI-LABEL: smsubl_ldrsb_h:
1033 ; CHECK-GI: // %bb.0: // %entry
1034 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1035 ; CHECK-GI-NEXT: ldrsb x8, [x0]
1036 ; CHECK-GI-NEXT: sxth x9, w1
1037 ; CHECK-GI-NEXT: msub x0, x8, x9, x2
1038 ; CHECK-GI-NEXT: ret
1040 %ext64 = load i8, ptr %x0
1041 %sext = sext i8 %ext64 to i64
1042 %sext4 = sext i16 %x1 to i64
1043 %mul = mul i64 %sext, %sext4
1044 %sub = sub i64 %x2, %mul
1048 define i64 @smsubl_ldrsb_h_commuted(ptr %x0, i16 %x1, i64 %x2) {
1049 ; CHECK-SD-LABEL: smsubl_ldrsb_h_commuted:
1050 ; CHECK-SD: // %bb.0: // %entry
1051 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1052 ; CHECK-SD-NEXT: ldrsb x8, [x0]
1053 ; CHECK-SD-NEXT: sxth x9, w1
1054 ; CHECK-SD-NEXT: smsubl x0, w9, w8, x2
1055 ; CHECK-SD-NEXT: ret
1057 ; CHECK-GI-LABEL: smsubl_ldrsb_h_commuted:
1058 ; CHECK-GI: // %bb.0: // %entry
1059 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1060 ; CHECK-GI-NEXT: ldrsb x8, [x0]
1061 ; CHECK-GI-NEXT: sxth x9, w1
1062 ; CHECK-GI-NEXT: msub x0, x9, x8, x2
1063 ; CHECK-GI-NEXT: ret
1065 %ext64 = load i8, ptr %x0
1066 %sext = sext i8 %ext64 to i64
1067 %sext4 = sext i16 %x1 to i64
1068 %mul = mul i64 %sext4, %sext
1069 %sub = sub i64 %x2, %mul
1073 define i64 @smsubl_ldrsh_w(ptr %x0, i32 %x1, i64 %x2) {
1074 ; CHECK-SD-LABEL: smsubl_ldrsh_w:
1075 ; CHECK-SD: // %bb.0: // %entry
1076 ; CHECK-SD-NEXT: ldrsh x8, [x0]
1077 ; CHECK-SD-NEXT: smsubl x0, w8, w1, x2
1078 ; CHECK-SD-NEXT: ret
1080 ; CHECK-GI-LABEL: smsubl_ldrsh_w:
1081 ; CHECK-GI: // %bb.0: // %entry
1082 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1083 ; CHECK-GI-NEXT: ldrsh x8, [x0]
1084 ; CHECK-GI-NEXT: sxtw x9, w1
1085 ; CHECK-GI-NEXT: msub x0, x8, x9, x2
1086 ; CHECK-GI-NEXT: ret
1088 %ext64 = load i16, ptr %x0
1089 %sext = sext i16 %ext64 to i64
1090 %sext4 = sext i32 %x1 to i64
1091 %mul = mul i64 %sext, %sext4
1092 %sub = sub i64 %x2, %mul
1096 define i64 @smsubl_ldrsh_w_commuted(ptr %x0, i32 %x1, i64 %x2) {
1097 ; CHECK-SD-LABEL: smsubl_ldrsh_w_commuted:
1098 ; CHECK-SD: // %bb.0: // %entry
1099 ; CHECK-SD-NEXT: ldrsh x8, [x0]
1100 ; CHECK-SD-NEXT: smsubl x0, w8, w1, x2
1101 ; CHECK-SD-NEXT: ret
1103 ; CHECK-GI-LABEL: smsubl_ldrsh_w_commuted:
1104 ; CHECK-GI: // %bb.0: // %entry
1105 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1106 ; CHECK-GI-NEXT: ldrsh x8, [x0]
1107 ; CHECK-GI-NEXT: sxtw x9, w1
1108 ; CHECK-GI-NEXT: msub x0, x9, x8, x2
1109 ; CHECK-GI-NEXT: ret
1111 %ext64 = load i16, ptr %x0
1112 %sext = sext i16 %ext64 to i64
1113 %sext4 = sext i32 %x1 to i64
1114 %mul = mul i64 %sext4, %sext
1115 %sub = sub i64 %x2, %mul
1119 define i64 @smsubl_ldrsw_b(ptr %x0, i8 %x1, i64 %x2) {
1120 ; CHECK-SD-LABEL: smsubl_ldrsw_b:
1121 ; CHECK-SD: // %bb.0:
1122 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1123 ; CHECK-SD-NEXT: ldrsw x8, [x0]
1124 ; CHECK-SD-NEXT: sxtb x9, w1
1125 ; CHECK-SD-NEXT: smsubl x0, w8, w9, x2
1126 ; CHECK-SD-NEXT: ret
1128 ; CHECK-GI-LABEL: smsubl_ldrsw_b:
1129 ; CHECK-GI: // %bb.0:
1130 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1131 ; CHECK-GI-NEXT: ldrsw x8, [x0]
1132 ; CHECK-GI-NEXT: sxtb x9, w1
1133 ; CHECK-GI-NEXT: msub x0, x8, x9, x2
1134 ; CHECK-GI-NEXT: ret
1135 %ext64 = load i32, ptr %x0
1136 %sext = sext i32 %ext64 to i64
1137 %sext2 = sext i8 %x1 to i64
1138 %mul = mul i64 %sext, %sext2
1139 %sub = sub i64 %x2, %mul
1143 define i64 @smsubl_ldrsw_b_commuted(ptr %x0, i8 %x1, i64 %x2) {
1144 ; CHECK-SD-LABEL: smsubl_ldrsw_b_commuted:
1145 ; CHECK-SD: // %bb.0:
1146 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1147 ; CHECK-SD-NEXT: ldrsw x8, [x0]
1148 ; CHECK-SD-NEXT: sxtb x9, w1
1149 ; CHECK-SD-NEXT: smsubl x0, w9, w8, x2
1150 ; CHECK-SD-NEXT: ret
1152 ; CHECK-GI-LABEL: smsubl_ldrsw_b_commuted:
1153 ; CHECK-GI: // %bb.0:
1154 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1155 ; CHECK-GI-NEXT: ldrsw x8, [x0]
1156 ; CHECK-GI-NEXT: sxtb x9, w1
1157 ; CHECK-GI-NEXT: msub x0, x9, x8, x2
1158 ; CHECK-GI-NEXT: ret
1159 %ext64 = load i32, ptr %x0
1160 %sext = sext i32 %ext64 to i64
1161 %sext2 = sext i8 %x1 to i64
1162 %mul = mul i64 %sext2, %sext
1163 %sub = sub i64 %x2, %mul
1167 define i64 @smsubl_ldrsw_ldrsw(ptr %x0, ptr %x1, i64 %x2) {
1168 ; CHECK-SD-LABEL: smsubl_ldrsw_ldrsw:
1169 ; CHECK-SD: // %bb.0: // %entry
1170 ; CHECK-SD-NEXT: ldrsw x8, [x0]
1171 ; CHECK-SD-NEXT: ldrsw x9, [x1]
1172 ; CHECK-SD-NEXT: smsubl x0, w8, w9, x2
1173 ; CHECK-SD-NEXT: ret
1175 ; CHECK-GI-LABEL: smsubl_ldrsw_ldrsw:
1176 ; CHECK-GI: // %bb.0: // %entry
1177 ; CHECK-GI-NEXT: ldrsw x8, [x0]
1178 ; CHECK-GI-NEXT: ldrsw x9, [x1]
1179 ; CHECK-GI-NEXT: msub x0, x8, x9, x2
1180 ; CHECK-GI-NEXT: ret
1182 %ext64 = load i32, ptr %x0
1183 %ext64_2 = load i32, ptr %x1
1184 %sext = sext i32 %ext64 to i64
1185 %sext2 = sext i32 %ext64_2 to i64
1186 %mul = mul i64 %sext, %sext2
1187 %sub = sub i64 %x2, %mul
1191 define i64 @smsubl_sext_hh(i16 %x0, i16 %x1, i64 %x2) {
1192 ; CHECK-SD-LABEL: smsubl_sext_hh:
1193 ; CHECK-SD: // %bb.0: // %entry
1194 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1195 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
1196 ; CHECK-SD-NEXT: sxth x8, w0
1197 ; CHECK-SD-NEXT: sxth x9, w1
1198 ; CHECK-SD-NEXT: smsubl x0, w8, w9, x2
1199 ; CHECK-SD-NEXT: ret
1201 ; CHECK-GI-LABEL: smsubl_sext_hh:
1202 ; CHECK-GI: // %bb.0: // %entry
1203 ; CHECK-GI-NEXT: // kill: def $w0 killed $w0 def $x0
1204 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1205 ; CHECK-GI-NEXT: sxth x8, w0
1206 ; CHECK-GI-NEXT: sxth x9, w1
1207 ; CHECK-GI-NEXT: msub x0, x8, x9, x2
1208 ; CHECK-GI-NEXT: ret
1210 %sext = sext i16 %x0 to i64
1211 %sext2 = sext i16 %x1 to i64
1212 %mul = mul i64 %sext, %sext2
1213 %sub = sub i64 %x2, %mul
1217 define i64 @smsubl_ldrsw_shift(ptr %x0, i64 %x1, i64 %x2) {
1218 ; CHECK-SD-LABEL: smsubl_ldrsw_shift:
1219 ; CHECK-SD: // %bb.0: // %entry
1220 ; CHECK-SD-NEXT: ldrsw x8, [x0]
1221 ; CHECK-SD-NEXT: smsubl x0, w8, w1, x2
1222 ; CHECK-SD-NEXT: ret
1224 ; CHECK-GI-LABEL: smsubl_ldrsw_shift:
1225 ; CHECK-GI: // %bb.0: // %entry
1226 ; CHECK-GI-NEXT: ldrsw x8, [x0]
1227 ; CHECK-GI-NEXT: sxtw x9, w1
1228 ; CHECK-GI-NEXT: msub x0, x8, x9, x2
1229 ; CHECK-GI-NEXT: ret
1231 %ext64 = load i32, ptr %x0
1232 %sext = sext i32 %ext64 to i64
1233 %shl = shl i64 %x1, 32
1234 %shr = ashr exact i64 %shl, 32
1235 %mul = mul i64 %sext, %shr
1236 %sub = sub i64 %x2, %mul
1240 define i64 @smsubl_ldrsw_zextb(ptr %x0, i8 %x1, i64 %x2) {
1241 ; CHECK-SD-LABEL: smsubl_ldrsw_zextb:
1242 ; CHECK-SD: // %bb.0: // %entry
1243 ; CHECK-SD-NEXT: ldrsw x8, [x0]
1244 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1245 ; CHECK-SD-NEXT: and x9, x1, #0xff
1246 ; CHECK-SD-NEXT: smsubl x0, w8, w9, x2
1247 ; CHECK-SD-NEXT: ret
1249 ; CHECK-GI-LABEL: smsubl_ldrsw_zextb:
1250 ; CHECK-GI: // %bb.0: // %entry
1251 ; CHECK-GI-NEXT: ldrsw x8, [x0]
1252 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1253 ; CHECK-GI-NEXT: and x9, x1, #0xff
1254 ; CHECK-GI-NEXT: msub x0, x8, x9, x2
1255 ; CHECK-GI-NEXT: ret
1257 %ext64 = load i32, ptr %x0
1258 %sext = sext i32 %ext64 to i64
1259 %zext = zext i8 %x1 to i64
1260 %mul = mul i64 %sext, %zext
1261 %sub = sub i64 %x2, %mul
1265 define i64 @smull_sext_ashr31(i32 %a, i64 %b) nounwind {
1266 ; CHECK-LABEL: smull_sext_ashr31:
1267 ; CHECK: // %bb.0: // %entry
1268 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
1269 ; CHECK-NEXT: sxtw x8, w0
1270 ; CHECK-NEXT: asr x9, x1, #31
1271 ; CHECK-NEXT: mul x0, x8, x9
1274 %tmp1 = sext i32 %a to i64
1275 %c = ashr i64 %b, 31
1276 %tmp3 = mul i64 %tmp1, %c
1280 define i64 @smull_sext_ashr32(i32 %a, i64 %b) nounwind {
1281 ; CHECK-SD-LABEL: smull_sext_ashr32:
1282 ; CHECK-SD: // %bb.0: // %entry
1283 ; CHECK-SD-NEXT: asr x8, x1, #32
1284 ; CHECK-SD-NEXT: smull x0, w8, w0
1285 ; CHECK-SD-NEXT: ret
1287 ; CHECK-GI-LABEL: smull_sext_ashr32:
1288 ; CHECK-GI: // %bb.0: // %entry
1289 ; CHECK-GI-NEXT: // kill: def $w0 killed $w0 def $x0
1290 ; CHECK-GI-NEXT: sxtw x8, w0
1291 ; CHECK-GI-NEXT: asr x9, x1, #32
1292 ; CHECK-GI-NEXT: mul x0, x8, x9
1293 ; CHECK-GI-NEXT: ret
1295 %tmp1 = sext i32 %a to i64
1296 %c = ashr i64 %b, 32
1297 %tmp3 = mul i64 %tmp1, %c
1302 define i64 @smull_ashr31_both(i64 %a, i64 %b) nounwind {
1303 ; CHECK-LABEL: smull_ashr31_both:
1304 ; CHECK: // %bb.0: // %entry
1305 ; CHECK-NEXT: asr x8, x0, #31
1306 ; CHECK-NEXT: asr x9, x1, #31
1307 ; CHECK-NEXT: mul x0, x8, x9
1310 %tmp1 = ashr i64 %a, 31
1311 %c = ashr i64 %b, 31
1312 %tmp3 = mul i64 %tmp1, %c
1316 define i64 @smull_ashr32_both(i64 %a, i64 %b) nounwind {
1317 ; CHECK-SD-LABEL: smull_ashr32_both:
1318 ; CHECK-SD: // %bb.0: // %entry
1319 ; CHECK-SD-NEXT: asr x8, x0, #32
1320 ; CHECK-SD-NEXT: asr x9, x1, #32
1321 ; CHECK-SD-NEXT: smull x0, w8, w9
1322 ; CHECK-SD-NEXT: ret
1324 ; CHECK-GI-LABEL: smull_ashr32_both:
1325 ; CHECK-GI: // %bb.0: // %entry
1326 ; CHECK-GI-NEXT: asr x8, x0, #32
1327 ; CHECK-GI-NEXT: asr x9, x1, #32
1328 ; CHECK-GI-NEXT: mul x0, x8, x9
1329 ; CHECK-GI-NEXT: ret
1331 %tmp1 = ashr i64 %a, 32
1332 %c = ashr i64 %b, 32
1333 %tmp3 = mul i64 %tmp1, %c
1337 define i64 @umull_ldrb_h(ptr %x0, i16 %x1) {
1338 ; CHECK-SD-LABEL: umull_ldrb_h:
1339 ; CHECK-SD: // %bb.0: // %entry
1340 ; CHECK-SD-NEXT: ldrb w8, [x0]
1341 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1342 ; CHECK-SD-NEXT: and x9, x1, #0xffff
1343 ; CHECK-SD-NEXT: umull x0, w8, w9
1344 ; CHECK-SD-NEXT: ret
1346 ; CHECK-GI-LABEL: umull_ldrb_h:
1347 ; CHECK-GI: // %bb.0: // %entry
1348 ; CHECK-GI-NEXT: ldrb w8, [x0]
1349 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1350 ; CHECK-GI-NEXT: and x9, x1, #0xffff
1351 ; CHECK-GI-NEXT: mul x0, x8, x9
1352 ; CHECK-GI-NEXT: ret
1354 %ext64 = load i8, ptr %x0
1355 %zext = zext i8 %ext64 to i64
1356 %zext4 = zext i16 %x1 to i64
1357 %mul = mul i64 %zext, %zext4
1361 define i64 @umull_ldrb_h_commuted(ptr %x0, i16 %x1) {
1362 ; CHECK-SD-LABEL: umull_ldrb_h_commuted:
1363 ; CHECK-SD: // %bb.0: // %entry
1364 ; CHECK-SD-NEXT: ldrb w8, [x0]
1365 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1366 ; CHECK-SD-NEXT: and x9, x1, #0xffff
1367 ; CHECK-SD-NEXT: umull x0, w9, w8
1368 ; CHECK-SD-NEXT: ret
1370 ; CHECK-GI-LABEL: umull_ldrb_h_commuted:
1371 ; CHECK-GI: // %bb.0: // %entry
1372 ; CHECK-GI-NEXT: ldrb w8, [x0]
1373 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1374 ; CHECK-GI-NEXT: and x9, x1, #0xffff
1375 ; CHECK-GI-NEXT: mul x0, x9, x8
1376 ; CHECK-GI-NEXT: ret
1378 %ext64 = load i8, ptr %x0
1379 %zext = zext i8 %ext64 to i64
1380 %zext4 = zext i16 %x1 to i64
1381 %mul = mul i64 %zext4, %zext
1385 define i64 @umull_ldrh_w(ptr %x0, i32 %x1) {
1386 ; CHECK-SD-LABEL: umull_ldrh_w:
1387 ; CHECK-SD: // %bb.0: // %entry
1388 ; CHECK-SD-NEXT: ldrh w8, [x0]
1389 ; CHECK-SD-NEXT: umull x0, w8, w1
1390 ; CHECK-SD-NEXT: ret
1392 ; CHECK-GI-LABEL: umull_ldrh_w:
1393 ; CHECK-GI: // %bb.0: // %entry
1394 ; CHECK-GI-NEXT: ldrh w8, [x0]
1395 ; CHECK-GI-NEXT: mov w9, w1
1396 ; CHECK-GI-NEXT: mul x0, x8, x9
1397 ; CHECK-GI-NEXT: ret
1399 %ext64 = load i16, ptr %x0
1400 %zext = zext i16 %ext64 to i64
1401 %zext4 = zext i32 %x1 to i64
1402 %mul = mul i64 %zext, %zext4
1406 define i64 @umull_ldr_b(ptr %x0, i8 %x1) {
1407 ; CHECK-SD-LABEL: umull_ldr_b:
1408 ; CHECK-SD: // %bb.0: // %entry
1409 ; CHECK-SD-NEXT: ldr w8, [x0]
1410 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1411 ; CHECK-SD-NEXT: and x9, x1, #0xff
1412 ; CHECK-SD-NEXT: umull x0, w8, w9
1413 ; CHECK-SD-NEXT: ret
1415 ; CHECK-GI-LABEL: umull_ldr_b:
1416 ; CHECK-GI: // %bb.0: // %entry
1417 ; CHECK-GI-NEXT: ldr w8, [x0]
1418 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1419 ; CHECK-GI-NEXT: and x9, x1, #0xff
1420 ; CHECK-GI-NEXT: mul x0, x8, x9
1421 ; CHECK-GI-NEXT: ret
1423 %ext64 = load i32, ptr %x0
1424 %zext = zext i32 %ext64 to i64
1425 %zext4 = zext i8 %x1 to i64
1426 %mul = mul i64 %zext, %zext4
1430 define i64 @umull_ldr2_w(ptr %x0, i32 %x1) {
1431 ; CHECK-SD-LABEL: umull_ldr2_w:
1432 ; CHECK-SD: // %bb.0: // %entry
1433 ; CHECK-SD-NEXT: ldr w8, [x0]
1434 ; CHECK-SD-NEXT: umull x0, w8, w1
1435 ; CHECK-SD-NEXT: ret
1437 ; CHECK-GI-LABEL: umull_ldr2_w:
1438 ; CHECK-GI: // %bb.0: // %entry
1439 ; CHECK-GI-NEXT: ldr w8, [x0]
1440 ; CHECK-GI-NEXT: mov w9, w1
1441 ; CHECK-GI-NEXT: mul x0, x8, x9
1442 ; CHECK-GI-NEXT: ret
1444 %ext64 = load i64, ptr %x0
1445 %and = and i64 %ext64, 4294967295
1446 %zext4 = zext i32 %x1 to i64
1447 %mul = mul i64 %and, %zext4
1451 define i64 @umull_ldr2_ldr2(ptr %x0, ptr %x1) {
1452 ; CHECK-SD-LABEL: umull_ldr2_ldr2:
1453 ; CHECK-SD: // %bb.0: // %entry
1454 ; CHECK-SD-NEXT: ldr w8, [x0]
1455 ; CHECK-SD-NEXT: ldr w9, [x1]
1456 ; CHECK-SD-NEXT: umull x0, w8, w9
1457 ; CHECK-SD-NEXT: ret
1459 ; CHECK-GI-LABEL: umull_ldr2_ldr2:
1460 ; CHECK-GI: // %bb.0: // %entry
1461 ; CHECK-GI-NEXT: ldr w8, [x0]
1462 ; CHECK-GI-NEXT: ldr w9, [x1]
1463 ; CHECK-GI-NEXT: mul x0, x8, x9
1464 ; CHECK-GI-NEXT: ret
1466 %ext64 = load i64, ptr %x0
1467 %and = and i64 %ext64, 4294967295
1468 %ext64_2 = load i64, ptr %x1
1469 %and2 = and i64 %ext64_2, 4294967295
1470 %mul = mul i64 %and, %and2
1474 define i64 @umull_ldr2_d(ptr %x0, i64 %x1) {
1475 ; CHECK-SD-LABEL: umull_ldr2_d:
1476 ; CHECK-SD: // %bb.0: // %entry
1477 ; CHECK-SD-NEXT: ldr w8, [x0]
1478 ; CHECK-SD-NEXT: umull x0, w8, w1
1479 ; CHECK-SD-NEXT: ret
1481 ; CHECK-GI-LABEL: umull_ldr2_d:
1482 ; CHECK-GI: // %bb.0: // %entry
1483 ; CHECK-GI-NEXT: ldr w8, [x0]
1484 ; CHECK-GI-NEXT: mov w9, w1
1485 ; CHECK-GI-NEXT: mul x0, x8, x9
1486 ; CHECK-GI-NEXT: ret
1488 %ext64 = load i64, ptr %x0
1489 %and = and i64 %ext64, 4294967295
1490 %and2 = and i64 %x1, 4294967295
1491 %mul = mul i64 %and, %and2
1495 define i64 @umaddl_ldrb_h(ptr %x0, i16 %x1, i64 %x2) {
1496 ; CHECK-SD-LABEL: umaddl_ldrb_h:
1497 ; CHECK-SD: // %bb.0: // %entry
1498 ; CHECK-SD-NEXT: ldrb w8, [x0]
1499 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1500 ; CHECK-SD-NEXT: and x9, x1, #0xffff
1501 ; CHECK-SD-NEXT: umaddl x0, w8, w9, x2
1502 ; CHECK-SD-NEXT: ret
1504 ; CHECK-GI-LABEL: umaddl_ldrb_h:
1505 ; CHECK-GI: // %bb.0: // %entry
1506 ; CHECK-GI-NEXT: ldrb w8, [x0]
1507 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1508 ; CHECK-GI-NEXT: and x9, x1, #0xffff
1509 ; CHECK-GI-NEXT: madd x0, x8, x9, x2
1510 ; CHECK-GI-NEXT: ret
1512 %ext64 = load i8, ptr %x0
1513 %zext = zext i8 %ext64 to i64
1514 %zext4 = zext i16 %x1 to i64
1515 %mul = mul i64 %zext, %zext4
1516 %add = add i64 %mul, %x2
1520 define i64 @umaddl_ldrb_h_commuted(ptr %x0, i16 %x1, i64 %x2) {
1521 ; CHECK-SD-LABEL: umaddl_ldrb_h_commuted:
1522 ; CHECK-SD: // %bb.0: // %entry
1523 ; CHECK-SD-NEXT: ldrb w8, [x0]
1524 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1525 ; CHECK-SD-NEXT: and x9, x1, #0xffff
1526 ; CHECK-SD-NEXT: umaddl x0, w9, w8, x2
1527 ; CHECK-SD-NEXT: ret
1529 ; CHECK-GI-LABEL: umaddl_ldrb_h_commuted:
1530 ; CHECK-GI: // %bb.0: // %entry
1531 ; CHECK-GI-NEXT: ldrb w8, [x0]
1532 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1533 ; CHECK-GI-NEXT: and x9, x1, #0xffff
1534 ; CHECK-GI-NEXT: madd x0, x9, x8, x2
1535 ; CHECK-GI-NEXT: ret
1537 %ext64 = load i8, ptr %x0
1538 %zext = zext i8 %ext64 to i64
1539 %zext4 = zext i16 %x1 to i64
1540 %mul = mul i64 %zext4, %zext
1541 %add = add i64 %mul, %x2
1545 define i64 @umaddl_ldrh_w(ptr %x0, i32 %x1, i64 %x2) {
1546 ; CHECK-SD-LABEL: umaddl_ldrh_w:
1547 ; CHECK-SD: // %bb.0: // %entry
1548 ; CHECK-SD-NEXT: ldrh w8, [x0]
1549 ; CHECK-SD-NEXT: umaddl x0, w8, w1, x2
1550 ; CHECK-SD-NEXT: ret
1552 ; CHECK-GI-LABEL: umaddl_ldrh_w:
1553 ; CHECK-GI: // %bb.0: // %entry
1554 ; CHECK-GI-NEXT: ldrh w8, [x0]
1555 ; CHECK-GI-NEXT: mov w9, w1
1556 ; CHECK-GI-NEXT: madd x0, x8, x9, x2
1557 ; CHECK-GI-NEXT: ret
1559 %ext64 = load i16, ptr %x0
1560 %zext = zext i16 %ext64 to i64
1561 %zext4 = zext i32 %x1 to i64
1562 %mul = mul i64 %zext, %zext4
1563 %add = add i64 %mul, %x2
1567 define i64 @umaddl_ldr_b(ptr %x0, i8 %x1, i64 %x2) {
1568 ; CHECK-SD-LABEL: umaddl_ldr_b:
1569 ; CHECK-SD: // %bb.0: // %entry
1570 ; CHECK-SD-NEXT: ldr w8, [x0]
1571 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1572 ; CHECK-SD-NEXT: and x9, x1, #0xff
1573 ; CHECK-SD-NEXT: umaddl x0, w8, w9, x2
1574 ; CHECK-SD-NEXT: ret
1576 ; CHECK-GI-LABEL: umaddl_ldr_b:
1577 ; CHECK-GI: // %bb.0: // %entry
1578 ; CHECK-GI-NEXT: ldr w8, [x0]
1579 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1580 ; CHECK-GI-NEXT: and x9, x1, #0xff
1581 ; CHECK-GI-NEXT: madd x0, x8, x9, x2
1582 ; CHECK-GI-NEXT: ret
1584 %ext64 = load i32, ptr %x0
1585 %zext = zext i32 %ext64 to i64
1586 %zext4 = zext i8 %x1 to i64
1587 %mul = mul i64 %zext, %zext4
1588 %add = add i64 %mul, %x2
1592 define i64 @umaddl_ldr2_w(ptr %x0, i32 %x1, i64 %x2) {
1593 ; CHECK-SD-LABEL: umaddl_ldr2_w:
1594 ; CHECK-SD: // %bb.0: // %entry
1595 ; CHECK-SD-NEXT: ldr w8, [x0]
1596 ; CHECK-SD-NEXT: umaddl x0, w8, w1, x2
1597 ; CHECK-SD-NEXT: ret
1599 ; CHECK-GI-LABEL: umaddl_ldr2_w:
1600 ; CHECK-GI: // %bb.0: // %entry
1601 ; CHECK-GI-NEXT: ldr w8, [x0]
1602 ; CHECK-GI-NEXT: mov w9, w1
1603 ; CHECK-GI-NEXT: madd x0, x8, x9, x2
1604 ; CHECK-GI-NEXT: ret
1606 %ext64 = load i64, ptr %x0
1607 %and = and i64 %ext64, 4294967295
1608 %zext4 = zext i32 %x1 to i64
1609 %mul = mul i64 %and, %zext4
1610 %add = add i64 %mul, %x2
1614 define i64 @umaddl_ldr2_ldr2(ptr %x0, ptr %x1, i64 %x2) {
1615 ; CHECK-SD-LABEL: umaddl_ldr2_ldr2:
1616 ; CHECK-SD: // %bb.0: // %entry
1617 ; CHECK-SD-NEXT: ldr w8, [x0]
1618 ; CHECK-SD-NEXT: ldr w9, [x1]
1619 ; CHECK-SD-NEXT: umaddl x0, w8, w9, x2
1620 ; CHECK-SD-NEXT: ret
1622 ; CHECK-GI-LABEL: umaddl_ldr2_ldr2:
1623 ; CHECK-GI: // %bb.0: // %entry
1624 ; CHECK-GI-NEXT: ldr w8, [x0]
1625 ; CHECK-GI-NEXT: ldr w9, [x1]
1626 ; CHECK-GI-NEXT: madd x0, x8, x9, x2
1627 ; CHECK-GI-NEXT: ret
1629 %ext64 = load i64, ptr %x0
1630 %and = and i64 %ext64, 4294967295
1631 %ext64_2 = load i64, ptr %x1
1632 %and2 = and i64 %ext64_2, 4294967295
1633 %mul = mul i64 %and, %and2
1634 %add = add i64 %mul, %x2
1638 define i64 @umaddl_ldr2_d(ptr %x0, i64 %x1, i64 %x2) {
1639 ; CHECK-SD-LABEL: umaddl_ldr2_d:
1640 ; CHECK-SD: // %bb.0: // %entry
1641 ; CHECK-SD-NEXT: ldr w8, [x0]
1642 ; CHECK-SD-NEXT: umaddl x0, w8, w1, x2
1643 ; CHECK-SD-NEXT: ret
1645 ; CHECK-GI-LABEL: umaddl_ldr2_d:
1646 ; CHECK-GI: // %bb.0: // %entry
1647 ; CHECK-GI-NEXT: ldr w8, [x0]
1648 ; CHECK-GI-NEXT: mov w9, w1
1649 ; CHECK-GI-NEXT: madd x0, x8, x9, x2
1650 ; CHECK-GI-NEXT: ret
1652 %ext64 = load i64, ptr %x0
1653 %and = and i64 %ext64, 4294967295
1654 %and2 = and i64 %x1, 4294967295
1655 %mul = mul i64 %and, %and2
1656 %add = add i64 %mul, %x2
1660 define i64 @umnegl_ldrb_h(ptr %x0, i16 %x1) {
1661 ; CHECK-SD-LABEL: umnegl_ldrb_h:
1662 ; CHECK-SD: // %bb.0: // %entry
1663 ; CHECK-SD-NEXT: ldrb w8, [x0]
1664 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1665 ; CHECK-SD-NEXT: and x9, x1, #0xffff
1666 ; CHECK-SD-NEXT: umnegl x0, w8, w9
1667 ; CHECK-SD-NEXT: ret
1669 ; CHECK-GI-LABEL: umnegl_ldrb_h:
1670 ; CHECK-GI: // %bb.0: // %entry
1671 ; CHECK-GI-NEXT: ldrb w8, [x0]
1672 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1673 ; CHECK-GI-NEXT: and x9, x1, #0xffff
1674 ; CHECK-GI-NEXT: mneg x0, x8, x9
1675 ; CHECK-GI-NEXT: ret
1677 %ext64 = load i8, ptr %x0
1678 %zext = zext i8 %ext64 to i64
1679 %zext4 = zext i16 %x1 to i64
1680 %mul = mul i64 %zext, %zext4
1681 %sub = sub i64 0, %mul
1685 define i64 @umnegl_ldrb_h_commuted(ptr %x0, i16 %x1) {
1686 ; CHECK-SD-LABEL: umnegl_ldrb_h_commuted:
1687 ; CHECK-SD: // %bb.0: // %entry
1688 ; CHECK-SD-NEXT: ldrb w8, [x0]
1689 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1690 ; CHECK-SD-NEXT: and x9, x1, #0xffff
1691 ; CHECK-SD-NEXT: umnegl x0, w9, w8
1692 ; CHECK-SD-NEXT: ret
1694 ; CHECK-GI-LABEL: umnegl_ldrb_h_commuted:
1695 ; CHECK-GI: // %bb.0: // %entry
1696 ; CHECK-GI-NEXT: ldrb w8, [x0]
1697 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1698 ; CHECK-GI-NEXT: and x9, x1, #0xffff
1699 ; CHECK-GI-NEXT: mneg x0, x9, x8
1700 ; CHECK-GI-NEXT: ret
1702 %ext64 = load i8, ptr %x0
1703 %zext = zext i8 %ext64 to i64
1704 %zext4 = zext i16 %x1 to i64
1705 %mul = mul i64 %zext4, %zext
1706 %sub = sub i64 0, %mul
1710 define i64 @umnegl_ldrh_w(ptr %x0, i32 %x1) {
1711 ; CHECK-SD-LABEL: umnegl_ldrh_w:
1712 ; CHECK-SD: // %bb.0: // %entry
1713 ; CHECK-SD-NEXT: ldrh w8, [x0]
1714 ; CHECK-SD-NEXT: umnegl x0, w8, w1
1715 ; CHECK-SD-NEXT: ret
1717 ; CHECK-GI-LABEL: umnegl_ldrh_w:
1718 ; CHECK-GI: // %bb.0: // %entry
1719 ; CHECK-GI-NEXT: ldrh w8, [x0]
1720 ; CHECK-GI-NEXT: mov w9, w1
1721 ; CHECK-GI-NEXT: mneg x0, x8, x9
1722 ; CHECK-GI-NEXT: ret
1724 %ext64 = load i16, ptr %x0
1725 %zext = zext i16 %ext64 to i64
1726 %zext4 = zext i32 %x1 to i64
1727 %mul = mul i64 %zext, %zext4
1728 %sub = sub i64 0, %mul
1732 define i64 @umnegl_ldr_b(ptr %x0, i8 %x1) {
1733 ; CHECK-SD-LABEL: umnegl_ldr_b:
1734 ; CHECK-SD: // %bb.0: // %entry
1735 ; CHECK-SD-NEXT: ldr w8, [x0]
1736 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1737 ; CHECK-SD-NEXT: and x9, x1, #0xff
1738 ; CHECK-SD-NEXT: umnegl x0, w8, w9
1739 ; CHECK-SD-NEXT: ret
1741 ; CHECK-GI-LABEL: umnegl_ldr_b:
1742 ; CHECK-GI: // %bb.0: // %entry
1743 ; CHECK-GI-NEXT: ldr w8, [x0]
1744 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1745 ; CHECK-GI-NEXT: and x9, x1, #0xff
1746 ; CHECK-GI-NEXT: mneg x0, x8, x9
1747 ; CHECK-GI-NEXT: ret
1749 %ext64 = load i32, ptr %x0
1750 %zext = zext i32 %ext64 to i64
1751 %zext4 = zext i8 %x1 to i64
1752 %mul = mul i64 %zext, %zext4
1753 %sub = sub i64 0, %mul
1757 define i64 @umnegl_ldr2_w(ptr %x0, i32 %x1) {
1758 ; CHECK-SD-LABEL: umnegl_ldr2_w:
1759 ; CHECK-SD: // %bb.0: // %entry
1760 ; CHECK-SD-NEXT: ldr w8, [x0]
1761 ; CHECK-SD-NEXT: umnegl x0, w8, w1
1762 ; CHECK-SD-NEXT: ret
1764 ; CHECK-GI-LABEL: umnegl_ldr2_w:
1765 ; CHECK-GI: // %bb.0: // %entry
1766 ; CHECK-GI-NEXT: ldr w8, [x0]
1767 ; CHECK-GI-NEXT: mov w9, w1
1768 ; CHECK-GI-NEXT: mneg x0, x8, x9
1769 ; CHECK-GI-NEXT: ret
1771 %ext64 = load i64, ptr %x0
1772 %and = and i64 %ext64, 4294967295
1773 %zext4 = zext i32 %x1 to i64
1774 %mul = mul i64 %and, %zext4
1775 %sub = sub i64 0, %mul
1779 define i64 @umnegl_ldr2_ldr2(ptr %x0, ptr %x1) {
1780 ; CHECK-SD-LABEL: umnegl_ldr2_ldr2:
1781 ; CHECK-SD: // %bb.0: // %entry
1782 ; CHECK-SD-NEXT: ldr w8, [x0]
1783 ; CHECK-SD-NEXT: ldr w9, [x1]
1784 ; CHECK-SD-NEXT: umnegl x0, w8, w9
1785 ; CHECK-SD-NEXT: ret
1787 ; CHECK-GI-LABEL: umnegl_ldr2_ldr2:
1788 ; CHECK-GI: // %bb.0: // %entry
1789 ; CHECK-GI-NEXT: ldr w8, [x0]
1790 ; CHECK-GI-NEXT: ldr w9, [x1]
1791 ; CHECK-GI-NEXT: mneg x0, x8, x9
1792 ; CHECK-GI-NEXT: ret
1794 %ext64 = load i64, ptr %x0
1795 %and = and i64 %ext64, 4294967295
1796 %ext64_2 = load i64, ptr %x1
1797 %and2 = and i64 %ext64_2, 4294967295
1798 %mul = mul i64 %and, %and2
1799 %sub = sub i64 0, %mul
1803 define i64 @umnegl_ldr2_d(ptr %x0, i64 %x1) {
1804 ; CHECK-SD-LABEL: umnegl_ldr2_d:
1805 ; CHECK-SD: // %bb.0: // %entry
1806 ; CHECK-SD-NEXT: ldr w8, [x0]
1807 ; CHECK-SD-NEXT: umnegl x0, w8, w1
1808 ; CHECK-SD-NEXT: ret
1810 ; CHECK-GI-LABEL: umnegl_ldr2_d:
1811 ; CHECK-GI: // %bb.0: // %entry
1812 ; CHECK-GI-NEXT: ldr w8, [x0]
1813 ; CHECK-GI-NEXT: mov w9, w1
1814 ; CHECK-GI-NEXT: mneg x0, x8, x9
1815 ; CHECK-GI-NEXT: ret
1817 %ext64 = load i64, ptr %x0
1818 %and = and i64 %ext64, 4294967295
1819 %and2 = and i64 %x1, 4294967295
1820 %mul = mul i64 %and, %and2
1821 %sub = sub i64 0, %mul
1825 define i64 @umsubl_ldrb_h(ptr %x0, i16 %x1, i64 %x2) {
1826 ; CHECK-SD-LABEL: umsubl_ldrb_h:
1827 ; CHECK-SD: // %bb.0: // %entry
1828 ; CHECK-SD-NEXT: ldrb w8, [x0]
1829 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1830 ; CHECK-SD-NEXT: and x9, x1, #0xffff
1831 ; CHECK-SD-NEXT: umsubl x0, w8, w9, x2
1832 ; CHECK-SD-NEXT: ret
1834 ; CHECK-GI-LABEL: umsubl_ldrb_h:
1835 ; CHECK-GI: // %bb.0: // %entry
1836 ; CHECK-GI-NEXT: ldrb w8, [x0]
1837 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1838 ; CHECK-GI-NEXT: and x9, x1, #0xffff
1839 ; CHECK-GI-NEXT: msub x0, x8, x9, x2
1840 ; CHECK-GI-NEXT: ret
1842 %ext64 = load i8, ptr %x0
1843 %zext = zext i8 %ext64 to i64
1844 %zext4 = zext i16 %x1 to i64
1845 %mul = mul i64 %zext, %zext4
1846 %sub = sub i64 %x2, %mul
1850 define i64 @umsubl_ldrb_h_commuted(ptr %x0, i16 %x1, i64 %x2) {
1851 ; CHECK-SD-LABEL: umsubl_ldrb_h_commuted:
1852 ; CHECK-SD: // %bb.0: // %entry
1853 ; CHECK-SD-NEXT: ldrb w8, [x0]
1854 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1855 ; CHECK-SD-NEXT: and x9, x1, #0xffff
1856 ; CHECK-SD-NEXT: umsubl x0, w9, w8, x2
1857 ; CHECK-SD-NEXT: ret
1859 ; CHECK-GI-LABEL: umsubl_ldrb_h_commuted:
1860 ; CHECK-GI: // %bb.0: // %entry
1861 ; CHECK-GI-NEXT: ldrb w8, [x0]
1862 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1863 ; CHECK-GI-NEXT: and x9, x1, #0xffff
1864 ; CHECK-GI-NEXT: msub x0, x9, x8, x2
1865 ; CHECK-GI-NEXT: ret
1867 %ext64 = load i8, ptr %x0
1868 %zext = zext i8 %ext64 to i64
1869 %zext4 = zext i16 %x1 to i64
1870 %mul = mul i64 %zext4, %zext
1871 %sub = sub i64 %x2, %mul
1875 define i64 @umsubl_ldrh_w(ptr %x0, i32 %x1, i64 %x2) {
1876 ; CHECK-SD-LABEL: umsubl_ldrh_w:
1877 ; CHECK-SD: // %bb.0: // %entry
1878 ; CHECK-SD-NEXT: ldrh w8, [x0]
1879 ; CHECK-SD-NEXT: umsubl x0, w8, w1, x2
1880 ; CHECK-SD-NEXT: ret
1882 ; CHECK-GI-LABEL: umsubl_ldrh_w:
1883 ; CHECK-GI: // %bb.0: // %entry
1884 ; CHECK-GI-NEXT: ldrh w8, [x0]
1885 ; CHECK-GI-NEXT: mov w9, w1
1886 ; CHECK-GI-NEXT: msub x0, x8, x9, x2
1887 ; CHECK-GI-NEXT: ret
1889 %ext64 = load i16, ptr %x0
1890 %zext = zext i16 %ext64 to i64
1891 %zext4 = zext i32 %x1 to i64
1892 %mul = mul i64 %zext, %zext4
1893 %sub = sub i64 %x2, %mul
1897 define i64 @umsubl_ldr_b(ptr %x0, i8 %x1, i64 %x2) {
1898 ; CHECK-SD-LABEL: umsubl_ldr_b:
1899 ; CHECK-SD: // %bb.0: // %entry
1900 ; CHECK-SD-NEXT: ldr w8, [x0]
1901 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1902 ; CHECK-SD-NEXT: and x9, x1, #0xff
1903 ; CHECK-SD-NEXT: umsubl x0, w8, w9, x2
1904 ; CHECK-SD-NEXT: ret
1906 ; CHECK-GI-LABEL: umsubl_ldr_b:
1907 ; CHECK-GI: // %bb.0: // %entry
1908 ; CHECK-GI-NEXT: ldr w8, [x0]
1909 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 def $x1
1910 ; CHECK-GI-NEXT: and x9, x1, #0xff
1911 ; CHECK-GI-NEXT: msub x0, x8, x9, x2
1912 ; CHECK-GI-NEXT: ret
1914 %ext64 = load i32, ptr %x0
1915 %zext = zext i32 %ext64 to i64
1916 %zext4 = zext i8 %x1 to i64
1917 %mul = mul i64 %zext, %zext4
1918 %sub = sub i64 %x2, %mul
1922 define i64 @umsubl_ldr2_w(ptr %x0, i32 %x1, i64 %x2) {
1923 ; CHECK-SD-LABEL: umsubl_ldr2_w:
1924 ; CHECK-SD: // %bb.0: // %entry
1925 ; CHECK-SD-NEXT: ldr w8, [x0]
1926 ; CHECK-SD-NEXT: umsubl x0, w8, w1, x2
1927 ; CHECK-SD-NEXT: ret
1929 ; CHECK-GI-LABEL: umsubl_ldr2_w:
1930 ; CHECK-GI: // %bb.0: // %entry
1931 ; CHECK-GI-NEXT: ldr w8, [x0]
1932 ; CHECK-GI-NEXT: mov w9, w1
1933 ; CHECK-GI-NEXT: msub x0, x8, x9, x2
1934 ; CHECK-GI-NEXT: ret
1936 %ext64 = load i64, ptr %x0
1937 %and = and i64 %ext64, 4294967295
1938 %zext4 = zext i32 %x1 to i64
1939 %mul = mul i64 %and, %zext4
1940 %sub = sub i64 %x2, %mul
1944 define i64 @umsubl_ldr2_ldr2(ptr %x0, ptr %x1, i64 %x2) {
1945 ; CHECK-SD-LABEL: umsubl_ldr2_ldr2:
1946 ; CHECK-SD: // %bb.0: // %entry
1947 ; CHECK-SD-NEXT: ldr w8, [x0]
1948 ; CHECK-SD-NEXT: ldr w9, [x1]
1949 ; CHECK-SD-NEXT: umsubl x0, w8, w9, x2
1950 ; CHECK-SD-NEXT: ret
1952 ; CHECK-GI-LABEL: umsubl_ldr2_ldr2:
1953 ; CHECK-GI: // %bb.0: // %entry
1954 ; CHECK-GI-NEXT: ldr w8, [x0]
1955 ; CHECK-GI-NEXT: ldr w9, [x1]
1956 ; CHECK-GI-NEXT: msub x0, x8, x9, x2
1957 ; CHECK-GI-NEXT: ret
1959 %ext64 = load i64, ptr %x0
1960 %and = and i64 %ext64, 4294967295
1961 %ext64_2 = load i64, ptr %x1
1962 %and2 = and i64 %ext64_2, 4294967295
1963 %mul = mul i64 %and, %and2
1964 %sub = sub i64 %x2, %mul
1968 define i64 @umsubl_ldr2_d(ptr %x0, i64 %x1, i64 %x2) {
1969 ; CHECK-SD-LABEL: umsubl_ldr2_d:
1970 ; CHECK-SD: // %bb.0: // %entry
1971 ; CHECK-SD-NEXT: ldr w8, [x0]
1972 ; CHECK-SD-NEXT: umsubl x0, w8, w1, x2
1973 ; CHECK-SD-NEXT: ret
1975 ; CHECK-GI-LABEL: umsubl_ldr2_d:
1976 ; CHECK-GI: // %bb.0: // %entry
1977 ; CHECK-GI-NEXT: ldr w8, [x0]
1978 ; CHECK-GI-NEXT: mov w9, w1
1979 ; CHECK-GI-NEXT: msub x0, x8, x9, x2
1980 ; CHECK-GI-NEXT: ret
1982 %ext64 = load i64, ptr %x0
1983 %and = and i64 %ext64, 4294967295
1984 %and2 = and i64 %x1, 4294967295
1985 %mul = mul i64 %and, %and2
1986 %sub = sub i64 %x2, %mul
1990 define i64 @umull_ldr2_w_cc1(ptr %x0, i32 %x1) {
1991 ; CHECK-SD-LABEL: umull_ldr2_w_cc1:
1992 ; CHECK-SD: // %bb.0: // %entry
1993 ; CHECK-SD-NEXT: ldr x8, [x0]
1994 ; CHECK-SD-NEXT: and x8, x8, #0x7fffffff
1995 ; CHECK-SD-NEXT: umull x0, w8, w1
1996 ; CHECK-SD-NEXT: ret
1998 ; CHECK-GI-LABEL: umull_ldr2_w_cc1:
1999 ; CHECK-GI: // %bb.0: // %entry
2000 ; CHECK-GI-NEXT: ldr x8, [x0]
2001 ; CHECK-GI-NEXT: mov w9, w1
2002 ; CHECK-GI-NEXT: and x8, x8, #0x7fffffff
2003 ; CHECK-GI-NEXT: mul x0, x8, x9
2004 ; CHECK-GI-NEXT: ret
2006 %ext64 = load i64, ptr %x0
2007 %and = and i64 %ext64, 2147483647
2008 %zext4 = zext i32 %x1 to i64
2009 %mul = mul i64 %and, %zext4
2013 define i64 @umull_ldr2_w_cc2(ptr %x0, i32 %x1) {
2014 ; CHECK-LABEL: umull_ldr2_w_cc2:
2015 ; CHECK: // %bb.0: // %entry
2016 ; CHECK-NEXT: ldr x8, [x0]
2017 ; CHECK-NEXT: mov w9, w1
2018 ; CHECK-NEXT: and x8, x8, #0x1ffffffff
2019 ; CHECK-NEXT: mul x0, x8, x9
2022 %ext64 = load i64, ptr %x0
2023 %and = and i64 %ext64, 8589934591
2024 %zext4 = zext i32 %x1 to i64
2025 %mul = mul i64 %and, %zext4
2029 define i64 @regression_umsubl(i64 %a, i32 %b, i64 %c) {
2030 ; CHECK-LABEL: regression_umsubl:
2031 ; CHECK: // %bb.0: // %entry
2032 ; CHECK-NEXT: mov w8, w1
2033 ; CHECK-NEXT: udiv x9, x0, x8
2034 ; CHECK-NEXT: msub x0, x9, x8, x2
2037 %zext1 = zext i32 %b to i64
2038 %res = udiv i64 %a, %zext1
2039 %mul = mul i64 %res, %zext1
2040 %sub = sub i64 %c, %mul
2044 define i64 @umull_and_lshr(i64 %x) {
2045 ; CHECK-SD-LABEL: umull_and_lshr:
2046 ; CHECK-SD: // %bb.0:
2047 ; CHECK-SD-NEXT: lsr x8, x0, #32
2048 ; CHECK-SD-NEXT: umull x0, w0, w8
2049 ; CHECK-SD-NEXT: ret
2051 ; CHECK-GI-LABEL: umull_and_lshr:
2052 ; CHECK-GI: // %bb.0:
2053 ; CHECK-GI-NEXT: lsr x8, x0, #32
2054 ; CHECK-GI-NEXT: mov w9, w0
2055 ; CHECK-GI-NEXT: mul x0, x9, x8
2056 ; CHECK-GI-NEXT: ret
2057 %lo = and i64 %x, u0xffffffff
2058 %hi = lshr i64 %x, 32
2059 %mul = mul i64 %lo, %hi
2063 define i64 @umull_and_and(i64 %x, i64 %y) {
2064 ; CHECK-SD-LABEL: umull_and_and:
2065 ; CHECK-SD: // %bb.0:
2066 ; CHECK-SD-NEXT: umull x0, w0, w1
2067 ; CHECK-SD-NEXT: ret
2069 ; CHECK-GI-LABEL: umull_and_and:
2070 ; CHECK-GI: // %bb.0:
2071 ; CHECK-GI-NEXT: mov w8, w0
2072 ; CHECK-GI-NEXT: mov w9, w1
2073 ; CHECK-GI-NEXT: mul x0, x8, x9
2074 ; CHECK-GI-NEXT: ret
2075 %lo = and i64 %x, u0xffffffff
2076 %hi = and i64 %y, u0xffffffff
2077 %mul = mul i64 %lo, %hi
2081 define i64 @umaddl_and_lshr(i64 %x, i64 %a) {
2082 ; CHECK-SD-LABEL: umaddl_and_lshr:
2083 ; CHECK-SD: // %bb.0:
2084 ; CHECK-SD-NEXT: lsr x8, x0, #32
2085 ; CHECK-SD-NEXT: umaddl x0, w0, w8, x1
2086 ; CHECK-SD-NEXT: ret
2088 ; CHECK-GI-LABEL: umaddl_and_lshr:
2089 ; CHECK-GI: // %bb.0:
2090 ; CHECK-GI-NEXT: lsr x8, x0, #32
2091 ; CHECK-GI-NEXT: mov w9, w0
2092 ; CHECK-GI-NEXT: madd x0, x9, x8, x1
2093 ; CHECK-GI-NEXT: ret
2094 %lo = and i64 %x, u0xffffffff
2095 %hi = lshr i64 %x, 32
2096 %mul = mul i64 %lo, %hi
2097 %add = add i64 %a, %mul
2101 define i64 @umaddl_and_and(i64 %x, i64 %y, i64 %a) {
2102 ; CHECK-SD-LABEL: umaddl_and_and:
2103 ; CHECK-SD: // %bb.0:
2104 ; CHECK-SD-NEXT: umaddl x0, w0, w1, x2
2105 ; CHECK-SD-NEXT: ret
2107 ; CHECK-GI-LABEL: umaddl_and_and:
2108 ; CHECK-GI: // %bb.0:
2109 ; CHECK-GI-NEXT: mov w8, w0
2110 ; CHECK-GI-NEXT: mov w9, w1
2111 ; CHECK-GI-NEXT: madd x0, x8, x9, x2
2112 ; CHECK-GI-NEXT: ret
2113 %lo = and i64 %x, u0xffffffff
2114 %hi = and i64 %y, u0xffffffff
2115 %mul = mul i64 %lo, %hi
2116 %add = add i64 %a, %mul
2120 ; Check which can contain multiple copies that should all be removed.
2121 define i32 @f(i32 %0) {
2122 ; CHECK-SD-LABEL: f:
2123 ; CHECK-SD: // %bb.0: // %entry
2124 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
2125 ; CHECK-SD-NEXT: neg w8, w0
2126 ; CHECK-SD-NEXT: .LBB93_1: // %B
2127 ; CHECK-SD-NEXT: // =>This Inner Loop Header: Depth=1
2128 ; CHECK-SD-NEXT: cbnz x8, .LBB93_1
2129 ; CHECK-SD-NEXT: b .LBB93_1
2131 ; CHECK-GI-LABEL: f:
2132 ; CHECK-GI: // %bb.0: // %entry
2133 ; CHECK-GI-NEXT: neg w8, w0
2134 ; CHECK-GI-NEXT: .LBB93_1: // %B
2135 ; CHECK-GI-NEXT: // =>This Inner Loop Header: Depth=1
2136 ; CHECK-GI-NEXT: cbnz x8, .LBB93_1
2137 ; CHECK-GI-NEXT: b .LBB93_1
2139 %1 = sext i32 %0 to i64
2143 %2 = trunc i64 %1 to i32
2144 %a69.us = sub i32 0, %2
2145 %a69.us.fr = freeze i32 %a69.us
2146 %3 = zext i32 %a69.us.fr to i64
2150 %t = icmp eq i64 0, %3
2151 br i1 %t, label %A, label %B