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: ldr.w lr, [sp, #88]
12 ; THUMBV7-NEXT: mov r11, r0
13 ; THUMBV7-NEXT: ldr r4, [sp, #96]
14 ; THUMBV7-NEXT: ldr.w r12, [sp, #80]
15 ; THUMBV7-NEXT: umull r1, r5, r2, lr
16 ; THUMBV7-NEXT: umull r7, r6, r3, r4
17 ; THUMBV7-NEXT: str r1, [sp, #40] @ 4-byte Spill
18 ; THUMBV7-NEXT: ldr r1, [sp, #100]
19 ; THUMBV7-NEXT: umull r4, r0, r4, r2
20 ; THUMBV7-NEXT: str r7, [sp, #32] @ 4-byte Spill
21 ; THUMBV7-NEXT: umull r7, r1, r1, r2
22 ; THUMBV7-NEXT: str r4, [sp, #24] @ 4-byte Spill
23 ; THUMBV7-NEXT: str r0, [sp, #12] @ 4-byte Spill
24 ; THUMBV7-NEXT: ldr r0, [sp, #84]
25 ; THUMBV7-NEXT: str r7, [sp, #20] @ 4-byte Spill
26 ; THUMBV7-NEXT: ldr r7, [sp, #92]
27 ; THUMBV7-NEXT: umull r10, r8, r0, lr
28 ; THUMBV7-NEXT: umull r4, r9, r7, r12
29 ; THUMBV7-NEXT: str r4, [sp, #8] @ 4-byte Spill
30 ; THUMBV7-NEXT: umull r4, r0, r12, lr
31 ; THUMBV7-NEXT: mov.w r12, #0
32 ; THUMBV7-NEXT: umlal r5, r12, r3, lr
33 ; THUMBV7-NEXT: str r4, [sp, #16] @ 4-byte Spill
34 ; THUMBV7-NEXT: str r0, [sp, #4] @ 4-byte Spill
35 ; THUMBV7-NEXT: umull r4, r2, r2, r7
36 ; THUMBV7-NEXT: ldr r0, [sp, #40] @ 4-byte Reload
37 ; THUMBV7-NEXT: str r4, [sp, #28] @ 4-byte Spill
38 ; THUMBV7-NEXT: str r2, [sp, #36] @ 4-byte Spill
39 ; THUMBV7-NEXT: str.w r0, [r11]
40 ; THUMBV7-NEXT: ldr r0, [sp, #32] @ 4-byte Reload
41 ; THUMBV7-NEXT: ldr r2, [sp, #20] @ 4-byte Reload
42 ; THUMBV7-NEXT: add r2, r0
43 ; THUMBV7-NEXT: ldr r0, [sp, #12] @ 4-byte Reload
44 ; THUMBV7-NEXT: adds.w lr, r0, r2
45 ; THUMBV7-NEXT: mov.w r2, #0
46 ; THUMBV7-NEXT: adc r0, r2, #0
47 ; THUMBV7-NEXT: str r0, [sp, #32] @ 4-byte Spill
48 ; THUMBV7-NEXT: ldr r0, [sp, #8] @ 4-byte Reload
49 ; THUMBV7-NEXT: add.w r4, r10, r0
50 ; THUMBV7-NEXT: ldr r0, [sp, #4] @ 4-byte Reload
51 ; THUMBV7-NEXT: adds r4, r4, r0
52 ; THUMBV7-NEXT: adc r0, r2, #0
53 ; THUMBV7-NEXT: str r0, [sp, #40] @ 4-byte Spill
54 ; THUMBV7-NEXT: ldr r0, [sp, #24] @ 4-byte Reload
55 ; THUMBV7-NEXT: ldr r2, [sp, #16] @ 4-byte Reload
56 ; THUMBV7-NEXT: adds.w r10, r2, r0
57 ; THUMBV7-NEXT: mov r2, r3
58 ; THUMBV7-NEXT: adc.w r0, r4, lr
59 ; THUMBV7-NEXT: ldr.w lr, [sp, #100]
60 ; THUMBV7-NEXT: cmp r1, #0
61 ; THUMBV7-NEXT: str r0, [sp, #24] @ 4-byte Spill
63 ; THUMBV7-NEXT: movne r1, #1
64 ; THUMBV7-NEXT: cmp r3, #0
65 ; THUMBV7-NEXT: mov r0, lr
67 ; THUMBV7-NEXT: movne r2, #1
68 ; THUMBV7-NEXT: cmp.w lr, #0
70 ; THUMBV7-NEXT: movne r0, #1
71 ; THUMBV7-NEXT: ldr r4, [sp, #28] @ 4-byte Reload
72 ; THUMBV7-NEXT: ands r0, r2
73 ; THUMBV7-NEXT: orrs r1, r0
74 ; THUMBV7-NEXT: adds r5, r5, r4
75 ; THUMBV7-NEXT: str.w r5, [r11, #4]
76 ; THUMBV7-NEXT: ldr r0, [sp, #36] @ 4-byte Reload
77 ; THUMBV7-NEXT: mov.w r5, #0
78 ; THUMBV7-NEXT: adcs.w r0, r0, r12
79 ; THUMBV7-NEXT: adc r2, r5, #0
80 ; THUMBV7-NEXT: cmp r6, #0
82 ; THUMBV7-NEXT: movne r6, #1
83 ; THUMBV7-NEXT: orrs r1, r6
84 ; THUMBV7-NEXT: ldr r6, [sp, #84]
85 ; THUMBV7-NEXT: umlal r0, r2, r3, r7
86 ; THUMBV7-NEXT: ldr r3, [sp, #32] @ 4-byte Reload
87 ; THUMBV7-NEXT: cmp r7, #0
89 ; THUMBV7-NEXT: movne r7, #1
90 ; THUMBV7-NEXT: orrs r1, r3
91 ; THUMBV7-NEXT: mov r3, r6
92 ; THUMBV7-NEXT: cmp r6, #0
94 ; THUMBV7-NEXT: movne r3, #1
95 ; THUMBV7-NEXT: cmp.w r8, #0
96 ; THUMBV7-NEXT: and.w r3, r3, r7
97 ; THUMBV7-NEXT: ldr r7, [sp, #80]
99 ; THUMBV7-NEXT: movne.w r8, #1
100 ; THUMBV7-NEXT: cmp.w r9, #0
101 ; THUMBV7-NEXT: it ne
102 ; THUMBV7-NEXT: movne.w r9, #1
103 ; THUMBV7-NEXT: orrs r7, r6
104 ; THUMBV7-NEXT: ldr r6, [sp, #96]
105 ; THUMBV7-NEXT: it ne
106 ; THUMBV7-NEXT: movne r7, #1
107 ; THUMBV7-NEXT: orr.w r3, r3, r8
108 ; THUMBV7-NEXT: orrs.w r6, r6, lr
109 ; THUMBV7-NEXT: orr.w r3, r3, r9
110 ; THUMBV7-NEXT: it ne
111 ; THUMBV7-NEXT: movne r6, #1
112 ; THUMBV7-NEXT: adds.w r0, r0, r10
113 ; THUMBV7-NEXT: str.w r0, [r11, #8]
114 ; THUMBV7-NEXT: ldr r0, [sp, #24] @ 4-byte Reload
115 ; THUMBV7-NEXT: adcs r0, r2
116 ; THUMBV7-NEXT: str.w r0, [r11, #12]
117 ; THUMBV7-NEXT: ldr r0, [sp, #40] @ 4-byte Reload
118 ; THUMBV7-NEXT: and.w r2, r7, r6
119 ; THUMBV7-NEXT: orr.w r0, r0, r3
120 ; THUMBV7-NEXT: orr.w r0, r0, r2
121 ; THUMBV7-NEXT: orr.w r0, r0, r1
122 ; THUMBV7-NEXT: adc r1, r5, #0
123 ; THUMBV7-NEXT: orrs r0, r1
124 ; THUMBV7-NEXT: and r0, r0, #1
125 ; THUMBV7-NEXT: strb.w r0, [r11, #16]
126 ; THUMBV7-NEXT: add sp, #44
127 ; THUMBV7-NEXT: pop.w {r4, r5, r6, r7, r8, r9, r10, r11, pc}
129 %0 = tail call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %l, i128 %r) #2
130 %1 = extractvalue { i128, i1 } %0, 0
131 %2 = extractvalue { i128, i1 } %0, 1
132 %3 = zext i1 %2 to i8
133 %4 = insertvalue { i128, i8 } undef, i128 %1, 0
134 %5 = insertvalue { i128, i8 } %4, i8 %3, 1
138 ; Function Attrs: nounwind readnone speculatable
139 declare { i128, i1 } @llvm.umul.with.overflow.i128(i128, i128) #1
141 attributes #0 = { nounwind readnone uwtable }
142 attributes #1 = { nounwind readnone speculatable }
143 attributes #2 = { nounwind }