1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-unknown-linux-gnu | FileCheck %s --check-prefixes=AARCH
4 define { i128, i8 } @muloti_test(i128 %l, i128 %r) unnamed_addr #0 {
5 ; AARCH-LABEL: muloti_test:
6 ; AARCH: // %bb.0: // %start
7 ; AARCH-NEXT: mul x8, x3, x0
8 ; AARCH-NEXT: umulh x9, x0, x2
9 ; AARCH-NEXT: madd x11, x1, x2, x8
10 ; AARCH-NEXT: add x8, x9, x11
11 ; AARCH-NEXT: cmp x8, x9
12 ; AARCH-NEXT: cset w9, lo
13 ; AARCH-NEXT: cmp x11, #0 // =0
14 ; AARCH-NEXT: csel w9, wzr, w9, eq
15 ; AARCH-NEXT: cmp x3, #0 // =0
16 ; AARCH-NEXT: umulh x10, x1, x2
17 ; AARCH-NEXT: cset w12, ne
18 ; AARCH-NEXT: cmp x1, #0 // =0
19 ; AARCH-NEXT: umulh x11, x3, x0
20 ; AARCH-NEXT: cset w13, ne
21 ; AARCH-NEXT: cmp xzr, x10
22 ; AARCH-NEXT: and w10, w13, w12
23 ; AARCH-NEXT: cset w12, ne
24 ; AARCH-NEXT: cmp xzr, x11
25 ; AARCH-NEXT: orr w10, w10, w12
26 ; AARCH-NEXT: cset w11, ne
27 ; AARCH-NEXT: orr w10, w10, w11
28 ; AARCH-NEXT: orr w9, w10, w9
29 ; AARCH-NEXT: mul x0, x0, x2
30 ; AARCH-NEXT: mov x1, x8
31 ; AARCH-NEXT: mov w2, w9
34 %0 = tail call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %l, i128 %r) #2
35 %1 = extractvalue { i128, i1 } %0, 0
36 %2 = extractvalue { i128, i1 } %0, 1
38 %4 = insertvalue { i128, i8 } undef, i128 %1, 0
39 %5 = insertvalue { i128, i8 } %4, i8 %3, 1
43 ; Function Attrs: nounwind readnone speculatable
44 declare { i128, i1 } @llvm.umul.with.overflow.i128(i128, i128) #1
46 attributes #0 = { nounwind readnone uwtable }
47 attributes #1 = { nounwind readnone speculatable }
48 attributes #2 = { nounwind }