1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=thumbv7-unknown-none-gnueabi | FileCheck %s --check-prefixes=THUMBV7
4 define { i128, i8 } @muloti_test(i128 %l, i128 %r) unnamed_addr #0 {
5 ; THUMBV7-LABEL: muloti_test:
6 ; THUMBV7: @ %bb.0: @ %start
7 ; THUMBV7-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
8 ; THUMBV7-NEXT: push.w {r4, r5, r6, r7, r8, r9, r10, r11, lr}
9 ; THUMBV7-NEXT: .pad #44
10 ; THUMBV7-NEXT: sub sp, #44
11 ; THUMBV7-NEXT: ldrd r4, r7, [sp, #88]
12 ; THUMBV7-NEXT: mov r5, r3
13 ; THUMBV7-NEXT: str r0, [sp, #40] @ 4-byte Spill
14 ; THUMBV7-NEXT: movs r0, #0
15 ; THUMBV7-NEXT: strd r4, r7, [sp]
16 ; THUMBV7-NEXT: mov r1, r3
17 ; THUMBV7-NEXT: strd r0, r0, [sp, #8]
18 ; THUMBV7-NEXT: mov r6, r2
19 ; THUMBV7-NEXT: mov r0, r2
20 ; THUMBV7-NEXT: movs r2, #0
21 ; THUMBV7-NEXT: movs r3, #0
22 ; THUMBV7-NEXT: bl __multi3
23 ; THUMBV7-NEXT: strd r1, r0, [sp, #32] @ 8-byte Folded Spill
24 ; THUMBV7-NEXT: strd r3, r2, [sp, #24] @ 8-byte Folded Spill
25 ; THUMBV7-NEXT: ldrd r2, r0, [sp, #96]
26 ; THUMBV7-NEXT: ldr.w r9, [sp, #80]
27 ; THUMBV7-NEXT: umull lr, r0, r0, r6
28 ; THUMBV7-NEXT: ldr.w r11, [sp, #84]
29 ; THUMBV7-NEXT: umull r3, r1, r5, r2
30 ; THUMBV7-NEXT: umull r2, r12, r2, r6
31 ; THUMBV7-NEXT: add r3, lr
32 ; THUMBV7-NEXT: umull r8, r10, r7, r9
33 ; THUMBV7-NEXT: str r2, [sp, #20] @ 4-byte Spill
34 ; THUMBV7-NEXT: adds.w lr, r12, r3
35 ; THUMBV7-NEXT: umull r6, r9, r9, r4
36 ; THUMBV7-NEXT: mov.w r3, #0
37 ; THUMBV7-NEXT: adc r12, r3, #0
38 ; THUMBV7-NEXT: umull r2, r4, r11, r4
39 ; THUMBV7-NEXT: add r2, r8
40 ; THUMBV7-NEXT: mov.w r8, #0
41 ; THUMBV7-NEXT: adds.w r2, r2, r9
42 ; THUMBV7-NEXT: adc r9, r3, #0
43 ; THUMBV7-NEXT: ldr r3, [sp, #20] @ 4-byte Reload
44 ; THUMBV7-NEXT: adds r3, r3, r6
45 ; THUMBV7-NEXT: ldr r6, [sp, #28] @ 4-byte Reload
46 ; THUMBV7-NEXT: adc.w r2, r2, lr
47 ; THUMBV7-NEXT: adds r3, r3, r6
48 ; THUMBV7-NEXT: ldr r6, [sp, #24] @ 4-byte Reload
49 ; THUMBV7-NEXT: adcs r2, r6
50 ; THUMBV7-NEXT: ldrd r6, lr, [sp, #36] @ 8-byte Folded Reload
51 ; THUMBV7-NEXT: str.w r6, [lr]
52 ; THUMBV7-NEXT: adc r8, r8, #0
53 ; THUMBV7-NEXT: ldr r6, [sp, #32] @ 4-byte Reload
54 ; THUMBV7-NEXT: cmp r5, #0
55 ; THUMBV7-NEXT: strd r6, r3, [lr, #4]
56 ; THUMBV7-NEXT: str.w r2, [lr, #12]
58 ; THUMBV7-NEXT: movne r5, #1
59 ; THUMBV7-NEXT: ldr r2, [sp, #100]
60 ; THUMBV7-NEXT: cmp r2, #0
61 ; THUMBV7-NEXT: mov r3, r2
63 ; THUMBV7-NEXT: movne r3, #1
64 ; THUMBV7-NEXT: cmp r0, #0
66 ; THUMBV7-NEXT: movne r0, #1
67 ; THUMBV7-NEXT: cmp r1, #0
68 ; THUMBV7-NEXT: and.w r3, r3, r5
70 ; THUMBV7-NEXT: movne r1, #1
71 ; THUMBV7-NEXT: orrs r0, r3
72 ; THUMBV7-NEXT: cmp r7, #0
73 ; THUMBV7-NEXT: orr.w r0, r0, r1
75 ; THUMBV7-NEXT: movne r7, #1
76 ; THUMBV7-NEXT: cmp.w r11, #0
77 ; THUMBV7-NEXT: mov r1, r11
79 ; THUMBV7-NEXT: movne r1, #1
80 ; THUMBV7-NEXT: cmp r4, #0
81 ; THUMBV7-NEXT: ldr r3, [sp, #96]
83 ; THUMBV7-NEXT: movne r4, #1
84 ; THUMBV7-NEXT: cmp.w r10, #0
85 ; THUMBV7-NEXT: and.w r1, r1, r7
87 ; THUMBV7-NEXT: movne.w r10, #1
88 ; THUMBV7-NEXT: orrs r3, r2
89 ; THUMBV7-NEXT: ldr r2, [sp, #80]
90 ; THUMBV7-NEXT: orr.w r1, r1, r4
91 ; THUMBV7-NEXT: orr.w r1, r1, r10
93 ; THUMBV7-NEXT: movne r3, #1
94 ; THUMBV7-NEXT: orrs.w r7, r2, r11
95 ; THUMBV7-NEXT: orr.w r1, r1, r9
97 ; THUMBV7-NEXT: movne r7, #1
98 ; THUMBV7-NEXT: ands r3, r7
99 ; THUMBV7-NEXT: orr.w r0, r0, r12
100 ; THUMBV7-NEXT: orrs r1, r3
101 ; THUMBV7-NEXT: orrs r0, r1
102 ; THUMBV7-NEXT: orr.w r0, r0, r8
103 ; THUMBV7-NEXT: and r0, r0, #1
104 ; THUMBV7-NEXT: strb.w r0, [lr, #16]
105 ; THUMBV7-NEXT: add sp, #44
106 ; THUMBV7-NEXT: pop.w {r4, r5, r6, r7, r8, r9, r10, r11, pc}
108 %0 = tail call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %l, i128 %r) #2
109 %1 = extractvalue { i128, i1 } %0, 0
110 %2 = extractvalue { i128, i1 } %0, 1
111 %3 = zext i1 %2 to i8
112 %4 = insertvalue { i128, i8 } undef, i128 %1, 0
113 %5 = insertvalue { i128, i8 } %4, i8 %3, 1
117 ; Function Attrs: nounwind readnone speculatable
118 declare { i128, i1 } @llvm.umul.with.overflow.i128(i128, i128) #1
120 attributes #0 = { nounwind readnone uwtable }
121 attributes #1 = { nounwind readnone speculatable }
122 attributes #2 = { nounwind }