1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mattr=+m -mtriple=riscv64 -run-pass=legalizer %s -o - \
4 # RUN: llc -mattr=+zmmul -mtriple=riscv64 -run-pass=legalizer %s -o - \
6 # RUN: llc -mtriple=riscv64 -run-pass=legalizer %s -o - \
7 # RUN: | FileCheck %s --check-prefix=LIBCALL
15 ; CHECK-LABEL: name: smulo_i8
16 ; CHECK: liveins: $x10, $x11
18 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
19 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
20 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 56
21 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
22 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
23 ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[COPY1]], [[C]](s64)
24 ; CHECK-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)
25 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[ASHR]], [[ASHR1]]
26 ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s64) = G_SHL [[MUL]], [[C]](s64)
27 ; CHECK-NEXT: [[ASHR2:%[0-9]+]]:_(s64) = G_ASHR [[SHL2]], [[C]](s64)
28 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ne), [[MUL]](s64), [[ASHR2]]
29 ; CHECK-NEXT: $x10 = COPY [[MUL]](s64)
30 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s64)
31 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
33 ; LIBCALL-LABEL: name: smulo_i8
34 ; LIBCALL: liveins: $x10, $x11
35 ; LIBCALL-NEXT: {{ $}}
36 ; LIBCALL-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
37 ; LIBCALL-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
38 ; LIBCALL-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 56
39 ; LIBCALL-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
40 ; LIBCALL-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
41 ; LIBCALL-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[COPY1]], [[C]](s64)
42 ; LIBCALL-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)
43 ; LIBCALL-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
44 ; LIBCALL-NEXT: $x10 = COPY [[ASHR]](s64)
45 ; LIBCALL-NEXT: $x11 = COPY [[ASHR1]](s64)
46 ; LIBCALL-NEXT: PseudoCALL target-flags(riscv-call) &__muldi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
47 ; LIBCALL-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
48 ; LIBCALL-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
49 ; LIBCALL-NEXT: [[SHL2:%[0-9]+]]:_(s64) = G_SHL [[COPY2]], [[C]](s64)
50 ; LIBCALL-NEXT: [[ASHR2:%[0-9]+]]:_(s64) = G_ASHR [[SHL2]], [[C]](s64)
51 ; LIBCALL-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ne), [[COPY2]](s64), [[ASHR2]]
52 ; LIBCALL-NEXT: $x10 = COPY [[COPY2]](s64)
53 ; LIBCALL-NEXT: $x11 = COPY [[ICMP]](s64)
54 ; LIBCALL-NEXT: PseudoRET implicit $x10, implicit $x11
56 %0:_(s8) = G_TRUNC %2(s64)
58 %1:_(s8) = G_TRUNC %3(s64)
59 %4:_(s8), %5:_(s1) = G_SMULO %0, %1
60 %6:_(s64) = G_ANYEXT %4(s8)
61 %7:_(s64) = G_ANYEXT %5(s1)
64 PseudoRET implicit $x10, implicit $x11
73 ; CHECK-LABEL: name: smulo_i16
74 ; CHECK: liveins: $x10, $x11
76 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
77 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
78 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 48
79 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
80 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
81 ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[COPY1]], [[C]](s64)
82 ; CHECK-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)
83 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[ASHR]], [[ASHR1]]
84 ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s64) = G_SHL [[MUL]], [[C]](s64)
85 ; CHECK-NEXT: [[ASHR2:%[0-9]+]]:_(s64) = G_ASHR [[SHL2]], [[C]](s64)
86 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ne), [[MUL]](s64), [[ASHR2]]
87 ; CHECK-NEXT: $x10 = COPY [[MUL]](s64)
88 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s64)
89 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
91 ; LIBCALL-LABEL: name: smulo_i16
92 ; LIBCALL: liveins: $x10, $x11
93 ; LIBCALL-NEXT: {{ $}}
94 ; LIBCALL-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
95 ; LIBCALL-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
96 ; LIBCALL-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 48
97 ; LIBCALL-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
98 ; LIBCALL-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
99 ; LIBCALL-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[COPY1]], [[C]](s64)
100 ; LIBCALL-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)
101 ; LIBCALL-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
102 ; LIBCALL-NEXT: $x10 = COPY [[ASHR]](s64)
103 ; LIBCALL-NEXT: $x11 = COPY [[ASHR1]](s64)
104 ; LIBCALL-NEXT: PseudoCALL target-flags(riscv-call) &__muldi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
105 ; LIBCALL-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
106 ; LIBCALL-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
107 ; LIBCALL-NEXT: [[SHL2:%[0-9]+]]:_(s64) = G_SHL [[COPY2]], [[C]](s64)
108 ; LIBCALL-NEXT: [[ASHR2:%[0-9]+]]:_(s64) = G_ASHR [[SHL2]], [[C]](s64)
109 ; LIBCALL-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ne), [[COPY2]](s64), [[ASHR2]]
110 ; LIBCALL-NEXT: $x10 = COPY [[COPY2]](s64)
111 ; LIBCALL-NEXT: $x11 = COPY [[ICMP]](s64)
112 ; LIBCALL-NEXT: PseudoRET implicit $x10, implicit $x11
113 %2:_(s64) = COPY $x10
114 %0:_(s16) = G_TRUNC %2(s64)
115 %3:_(s64) = COPY $x11
116 %1:_(s16) = G_TRUNC %3(s64)
117 %4:_(s16), %5:_(s1) = G_SMULO %0, %1
118 %6:_(s64) = G_ANYEXT %4(s16)
119 %7:_(s64) = G_ANYEXT %5(s1)
122 PseudoRET implicit $x10, implicit $x11
131 ; CHECK-LABEL: name: smulo_i32
132 ; CHECK: liveins: $x10, $x11
134 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
135 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
136 ; CHECK-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY]], 32
137 ; CHECK-NEXT: [[SEXT_INREG1:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY1]], 32
138 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[SEXT_INREG]], [[SEXT_INREG1]]
139 ; CHECK-NEXT: [[SEXT_INREG2:%[0-9]+]]:_(s64) = G_SEXT_INREG [[MUL]], 32
140 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ne), [[MUL]](s64), [[SEXT_INREG2]]
141 ; CHECK-NEXT: $x10 = COPY [[MUL]](s64)
142 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s64)
143 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
145 ; LIBCALL-LABEL: name: smulo_i32
146 ; LIBCALL: liveins: $x10, $x11
147 ; LIBCALL-NEXT: {{ $}}
148 ; LIBCALL-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
149 ; LIBCALL-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
150 ; LIBCALL-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY]], 32
151 ; LIBCALL-NEXT: [[SEXT_INREG1:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY1]], 32
152 ; LIBCALL-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
153 ; LIBCALL-NEXT: $x10 = COPY [[SEXT_INREG]](s64)
154 ; LIBCALL-NEXT: $x11 = COPY [[SEXT_INREG1]](s64)
155 ; LIBCALL-NEXT: PseudoCALL target-flags(riscv-call) &__muldi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
156 ; LIBCALL-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
157 ; LIBCALL-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
158 ; LIBCALL-NEXT: [[SEXT_INREG2:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY2]], 32
159 ; LIBCALL-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ne), [[COPY2]](s64), [[SEXT_INREG2]]
160 ; LIBCALL-NEXT: $x10 = COPY [[COPY2]](s64)
161 ; LIBCALL-NEXT: $x11 = COPY [[ICMP]](s64)
162 ; LIBCALL-NEXT: PseudoRET implicit $x10, implicit $x11
163 %2:_(s64) = COPY $x10
164 %0:_(s32) = G_TRUNC %2(s64)
165 %3:_(s64) = COPY $x11
166 %1:_(s32) = G_TRUNC %3(s64)
167 %4:_(s32), %5:_(s1) = G_SMULO %0, %1
168 %6:_(s64) = G_ANYEXT %4(s32)
169 %7:_(s64) = G_ANYEXT %5(s1)
172 PseudoRET implicit $x10, implicit $x11
181 ; CHECK-LABEL: name: smulo_i64
182 ; CHECK: liveins: $x10, $x11
184 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
185 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
186 ; CHECK-NEXT: [[SMULH:%[0-9]+]]:_(s64) = G_SMULH [[COPY]], [[COPY1]]
187 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[COPY]], [[COPY1]]
188 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 63
189 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[MUL]], [[C]](s64)
190 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ne), [[SMULH]](s64), [[ASHR]]
191 ; CHECK-NEXT: $x10 = COPY [[MUL]](s64)
192 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s64)
193 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
195 ; LIBCALL-LABEL: name: smulo_i64
196 ; LIBCALL: liveins: $x10, $x11
197 ; LIBCALL-NEXT: {{ $}}
198 ; LIBCALL-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
199 ; LIBCALL-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
200 ; LIBCALL-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 63
201 ; LIBCALL-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[COPY]], [[C]](s64)
202 ; LIBCALL-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[COPY1]], [[C]](s64)
203 ; LIBCALL-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
204 ; LIBCALL-NEXT: $x10 = COPY [[COPY]](s64)
205 ; LIBCALL-NEXT: $x11 = COPY [[ASHR]](s64)
206 ; LIBCALL-NEXT: $x12 = COPY [[COPY1]](s64)
207 ; LIBCALL-NEXT: $x13 = COPY [[ASHR1]](s64)
208 ; LIBCALL-NEXT: PseudoCALL target-flags(riscv-call) &__multi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11
209 ; LIBCALL-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
210 ; LIBCALL-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
211 ; LIBCALL-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x11
212 ; LIBCALL-NEXT: [[ASHR2:%[0-9]+]]:_(s64) = G_ASHR [[COPY2]], [[C]](s64)
213 ; LIBCALL-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
214 ; LIBCALL-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[COPY2]], [[COPY2]]
215 ; LIBCALL-NEXT: [[XOR1:%[0-9]+]]:_(s64) = G_XOR [[COPY3]], [[ASHR2]]
216 ; LIBCALL-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[XOR]], [[XOR1]]
217 ; LIBCALL-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ne), [[OR]](s64), [[C1]]
218 ; LIBCALL-NEXT: $x10 = COPY [[COPY2]](s64)
219 ; LIBCALL-NEXT: $x11 = COPY [[ICMP]](s64)
220 ; LIBCALL-NEXT: PseudoRET implicit $x10, implicit $x11
221 %0:_(s64) = COPY $x10
222 %1:_(s64) = COPY $x11
223 %2:_(s64), %3:_(s1) = G_SMULO %0, %1
224 %4:_(s64) = G_ANYEXT %3(s1)
227 PseudoRET implicit $x10, implicit $x11
236 ; CHECK-LABEL: name: umulo_i8
237 ; CHECK: liveins: $x10, $x11
239 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
240 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
241 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 255
242 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
243 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]
244 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[AND]], [[AND1]]
245 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND [[MUL]], [[C]]
246 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ne), [[MUL]](s64), [[AND2]]
247 ; CHECK-NEXT: $x10 = COPY [[MUL]](s64)
248 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s64)
249 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
251 ; LIBCALL-LABEL: name: umulo_i8
252 ; LIBCALL: liveins: $x10, $x11
253 ; LIBCALL-NEXT: {{ $}}
254 ; LIBCALL-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
255 ; LIBCALL-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
256 ; LIBCALL-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 255
257 ; LIBCALL-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
258 ; LIBCALL-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]
259 ; LIBCALL-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
260 ; LIBCALL-NEXT: $x10 = COPY [[AND]](s64)
261 ; LIBCALL-NEXT: $x11 = COPY [[AND1]](s64)
262 ; LIBCALL-NEXT: PseudoCALL target-flags(riscv-call) &__muldi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
263 ; LIBCALL-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
264 ; LIBCALL-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
265 ; LIBCALL-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND [[COPY2]], [[C]]
266 ; LIBCALL-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ne), [[COPY2]](s64), [[AND2]]
267 ; LIBCALL-NEXT: $x10 = COPY [[COPY2]](s64)
268 ; LIBCALL-NEXT: $x11 = COPY [[ICMP]](s64)
269 ; LIBCALL-NEXT: PseudoRET implicit $x10, implicit $x11
270 %2:_(s64) = COPY $x10
271 %0:_(s8) = G_TRUNC %2(s64)
272 %3:_(s64) = COPY $x11
273 %1:_(s8) = G_TRUNC %3(s64)
274 %4:_(s8), %5:_(s1) = G_UMULO %0, %1
275 %6:_(s64) = G_ANYEXT %4(s8)
276 %7:_(s64) = G_ANYEXT %5(s1)
279 PseudoRET implicit $x10, implicit $x11
288 ; CHECK-LABEL: name: umulo_i16
289 ; CHECK: liveins: $x10, $x11
291 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
292 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
293 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 65535
294 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
295 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]
296 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[AND]], [[AND1]]
297 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND [[MUL]], [[C]]
298 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ne), [[MUL]](s64), [[AND2]]
299 ; CHECK-NEXT: $x10 = COPY [[MUL]](s64)
300 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s64)
301 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
303 ; LIBCALL-LABEL: name: umulo_i16
304 ; LIBCALL: liveins: $x10, $x11
305 ; LIBCALL-NEXT: {{ $}}
306 ; LIBCALL-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
307 ; LIBCALL-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
308 ; LIBCALL-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 65535
309 ; LIBCALL-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
310 ; LIBCALL-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]
311 ; LIBCALL-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
312 ; LIBCALL-NEXT: $x10 = COPY [[AND]](s64)
313 ; LIBCALL-NEXT: $x11 = COPY [[AND1]](s64)
314 ; LIBCALL-NEXT: PseudoCALL target-flags(riscv-call) &__muldi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
315 ; LIBCALL-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
316 ; LIBCALL-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
317 ; LIBCALL-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND [[COPY2]], [[C]]
318 ; LIBCALL-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ne), [[COPY2]](s64), [[AND2]]
319 ; LIBCALL-NEXT: $x10 = COPY [[COPY2]](s64)
320 ; LIBCALL-NEXT: $x11 = COPY [[ICMP]](s64)
321 ; LIBCALL-NEXT: PseudoRET implicit $x10, implicit $x11
322 %2:_(s64) = COPY $x10
323 %0:_(s16) = G_TRUNC %2(s64)
324 %3:_(s64) = COPY $x11
325 %1:_(s16) = G_TRUNC %3(s64)
326 %4:_(s16), %5:_(s1) = G_UMULO %0, %1
327 %6:_(s64) = G_ANYEXT %4(s16)
328 %7:_(s64) = G_ANYEXT %5(s1)
331 PseudoRET implicit $x10, implicit $x11
340 ; CHECK-LABEL: name: umulo_i32
341 ; CHECK: liveins: $x10, $x11
343 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
344 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
345 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967295
346 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
347 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]
348 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[AND]], [[AND1]]
349 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND [[MUL]], [[C]]
350 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ne), [[MUL]](s64), [[AND2]]
351 ; CHECK-NEXT: $x10 = COPY [[MUL]](s64)
352 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s64)
353 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
355 ; LIBCALL-LABEL: name: umulo_i32
356 ; LIBCALL: liveins: $x10, $x11
357 ; LIBCALL-NEXT: {{ $}}
358 ; LIBCALL-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
359 ; LIBCALL-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
360 ; LIBCALL-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967295
361 ; LIBCALL-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
362 ; LIBCALL-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]
363 ; LIBCALL-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
364 ; LIBCALL-NEXT: $x10 = COPY [[AND]](s64)
365 ; LIBCALL-NEXT: $x11 = COPY [[AND1]](s64)
366 ; LIBCALL-NEXT: PseudoCALL target-flags(riscv-call) &__muldi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
367 ; LIBCALL-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
368 ; LIBCALL-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
369 ; LIBCALL-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND [[COPY2]], [[C]]
370 ; LIBCALL-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ne), [[COPY2]](s64), [[AND2]]
371 ; LIBCALL-NEXT: $x10 = COPY [[COPY2]](s64)
372 ; LIBCALL-NEXT: $x11 = COPY [[ICMP]](s64)
373 ; LIBCALL-NEXT: PseudoRET implicit $x10, implicit $x11
374 %2:_(s64) = COPY $x10
375 %0:_(s32) = G_TRUNC %2(s64)
376 %3:_(s64) = COPY $x11
377 %1:_(s32) = G_TRUNC %3(s64)
378 %4:_(s32), %5:_(s1) = G_UMULO %0, %1
379 %6:_(s64) = G_ANYEXT %4(s32)
380 %7:_(s64) = G_ANYEXT %5(s1)
383 PseudoRET implicit $x10, implicit $x11
392 ; CHECK-LABEL: name: umulo_i64
393 ; CHECK: liveins: $x10, $x11
395 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
396 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
397 ; CHECK-NEXT: [[UMULH:%[0-9]+]]:_(s64) = G_UMULH [[COPY]], [[COPY1]]
398 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
399 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[COPY]], [[COPY1]]
400 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ne), [[UMULH]](s64), [[C]]
401 ; CHECK-NEXT: $x10 = COPY [[MUL]](s64)
402 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s64)
403 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
405 ; LIBCALL-LABEL: name: umulo_i64
406 ; LIBCALL: liveins: $x10, $x11
407 ; LIBCALL-NEXT: {{ $}}
408 ; LIBCALL-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
409 ; LIBCALL-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
410 ; LIBCALL-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
411 ; LIBCALL-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
412 ; LIBCALL-NEXT: $x10 = COPY [[COPY]](s64)
413 ; LIBCALL-NEXT: $x11 = COPY [[C]](s64)
414 ; LIBCALL-NEXT: $x12 = COPY [[COPY1]](s64)
415 ; LIBCALL-NEXT: $x13 = COPY [[C]](s64)
416 ; LIBCALL-NEXT: PseudoCALL target-flags(riscv-call) &__multi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11
417 ; LIBCALL-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
418 ; LIBCALL-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
419 ; LIBCALL-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x11
420 ; LIBCALL-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1
421 ; LIBCALL-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY2]], [[C1]]
422 ; LIBCALL-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY3]], [[C]]
423 ; LIBCALL-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[COPY2]], [[AND]]
424 ; LIBCALL-NEXT: [[XOR1:%[0-9]+]]:_(s64) = G_XOR [[COPY3]], [[AND1]]
425 ; LIBCALL-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[XOR]], [[XOR1]]
426 ; LIBCALL-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ne), [[OR]](s64), [[C]]
427 ; LIBCALL-NEXT: $x10 = COPY [[COPY2]](s64)
428 ; LIBCALL-NEXT: $x11 = COPY [[ICMP]](s64)
429 ; LIBCALL-NEXT: PseudoRET implicit $x10, implicit $x11
430 %0:_(s64) = COPY $x10
431 %1:_(s64) = COPY $x11
432 %2:_(s64), %3:_(s1) = G_UMULO %0, %1
433 %4:_(s64) = G_ANYEXT %3(s1)
436 PseudoRET implicit $x10, implicit $x11