1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-linux-gnu | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s --check-prefix=X64
5 declare {i32, i1} @llvm.umul.with.overflow.i32(i32 %a, i32 %b)
7 define zeroext i1 @a(i32 %x) nounwind {
10 ; X86-NEXT: movl $3, %eax
11 ; X86-NEXT: mull {{[0-9]+}}(%esp)
17 ; X64-NEXT: movl %edi, %eax
18 ; X64-NEXT: movl $3, %ecx
22 %res = call {i32, i1} @llvm.umul.with.overflow.i32(i32 %x, i32 3)
23 %obil = extractvalue {i32, i1} %res, 1
27 define i32 @test2(i32 %a, i32 %b) nounwind readnone {
29 ; X86: # %bb.0: # %entry
30 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
31 ; X86-NEXT: addl {{[0-9]+}}(%esp), %eax
32 ; X86-NEXT: addl %eax, %eax
36 ; X64: # %bb.0: # %entry
37 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
38 ; X64-NEXT: addl %esi, %edi
39 ; X64-NEXT: leal (%rdi,%rdi), %eax
42 %tmp0 = add i32 %b, %a
43 %tmp1 = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %tmp0, i32 2)
44 %tmp2 = extractvalue { i32, i1 } %tmp1, 0
48 define i32 @test3(i32 %a, i32 %b) nounwind readnone {
50 ; X86: # %bb.0: # %entry
51 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
52 ; X86-NEXT: addl {{[0-9]+}}(%esp), %eax
53 ; X86-NEXT: movl $4, %ecx
58 ; X64: # %bb.0: # %entry
59 ; X64-NEXT: # kill: def $esi killed $esi def $rsi
60 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
61 ; X64-NEXT: leal (%rdi,%rsi), %eax
62 ; X64-NEXT: movl $4, %ecx
66 %tmp0 = add i32 %b, %a
67 %tmp1 = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %tmp0, i32 4)
68 %tmp2 = extractvalue { i32, i1 } %tmp1, 0
72 ; Check that shifts larger than the shift amount type are handled.
73 ; Intentionally not testing codegen here, only that this doesn't assert.
74 declare {i300, i1} @llvm.umul.with.overflow.i300(i300 %a, i300 %b)
75 define i300 @test4(i300 %a, i300 %b) nounwind {
78 ; X86-NEXT: pushl %ebp
79 ; X86-NEXT: pushl %ebx
80 ; X86-NEXT: pushl %edi
81 ; X86-NEXT: pushl %esi
82 ; X86-NEXT: subl $76, %esp
83 ; X86-NEXT: movl $4095, %ecx # imm = 0xFFF
84 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
85 ; X86-NEXT: andl %ecx, %eax
86 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
87 ; X86-NEXT: andl {{[0-9]+}}(%esp), %ecx
88 ; X86-NEXT: movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
89 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
90 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
91 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
92 ; X86-NEXT: movl %ebx, %eax
94 ; X86-NEXT: movl %edx, %esi
95 ; X86-NEXT: movl %eax, (%esp) # 4-byte Spill
96 ; X86-NEXT: movl %ecx, %eax
98 ; X86-NEXT: movl %edx, %edi
99 ; X86-NEXT: movl %eax, %ebp
100 ; X86-NEXT: addl %esi, %ebp
101 ; X86-NEXT: adcl $0, %edi
102 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
103 ; X86-NEXT: movl %ebx, %eax
104 ; X86-NEXT: mull %ecx
105 ; X86-NEXT: movl %ecx, %ebx
106 ; X86-NEXT: movl %edx, %esi
107 ; X86-NEXT: addl %ebp, %eax
108 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
109 ; X86-NEXT: adcl %edi, %esi
111 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
112 ; X86-NEXT: mull %ebx
113 ; X86-NEXT: movl %edx, %edi
114 ; X86-NEXT: addl %esi, %eax
115 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
116 ; X86-NEXT: movzbl %cl, %eax
117 ; X86-NEXT: adcl %eax, %edi
118 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
119 ; X86-NEXT: movl %ebx, %eax
120 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
121 ; X86-NEXT: mull %ecx
122 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
123 ; X86-NEXT: movl %edx, %esi
124 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
125 ; X86-NEXT: mull %ecx
126 ; X86-NEXT: movl %edx, %ebp
127 ; X86-NEXT: movl %eax, %ecx
128 ; X86-NEXT: addl %esi, %ecx
129 ; X86-NEXT: adcl $0, %ebp
130 ; X86-NEXT: movl %ebx, %eax
131 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
132 ; X86-NEXT: mull %esi
133 ; X86-NEXT: movl %edx, %ebx
134 ; X86-NEXT: addl %ecx, %eax
135 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
136 ; X86-NEXT: adcl %ebp, %ebx
138 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
139 ; X86-NEXT: mull %esi
140 ; X86-NEXT: movl %eax, %esi
141 ; X86-NEXT: addl %ebx, %esi
142 ; X86-NEXT: movzbl %cl, %eax
143 ; X86-NEXT: adcl %eax, %edx
144 ; X86-NEXT: addl (%esp), %esi # 4-byte Folded Reload
145 ; X86-NEXT: adcl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Folded Reload
146 ; X86-NEXT: movl %edx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
147 ; X86-NEXT: adcl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
148 ; X86-NEXT: adcl $0, %edi
149 ; X86-NEXT: movl %edi, (%esp) # 4-byte Spill
150 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
151 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
152 ; X86-NEXT: movl %ebp, %eax
153 ; X86-NEXT: mull %edi
154 ; X86-NEXT: movl %edx, %ecx
155 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
156 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
157 ; X86-NEXT: mull %edi
158 ; X86-NEXT: movl %edx, %ebx
159 ; X86-NEXT: movl %eax, %edi
160 ; X86-NEXT: addl %ecx, %edi
161 ; X86-NEXT: adcl $0, %ebx
162 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
163 ; X86-NEXT: movl %ebp, %eax
164 ; X86-NEXT: mull %ecx
165 ; X86-NEXT: movl %edx, %ebp
166 ; X86-NEXT: addl %edi, %eax
167 ; X86-NEXT: movl %eax, %edi
168 ; X86-NEXT: adcl %ebx, %ebp
169 ; X86-NEXT: setb {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Spill
170 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
171 ; X86-NEXT: mull %ecx
172 ; X86-NEXT: movl %edx, %ecx
173 ; X86-NEXT: movl %eax, %ebx
174 ; X86-NEXT: addl %ebp, %ebx
175 ; X86-NEXT: movzbl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 1-byte Folded Reload
176 ; X86-NEXT: adcl %eax, %ecx
177 ; X86-NEXT: addl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
178 ; X86-NEXT: adcl {{[-0-9]+}}(%e{{[sb]}}p), %edi # 4-byte Folded Reload
179 ; X86-NEXT: movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
180 ; X86-NEXT: adcl $0, %ebx
181 ; X86-NEXT: adcl $0, %ecx
182 ; X86-NEXT: addl {{[-0-9]+}}(%e{{[sb]}}p), %ebx # 4-byte Folded Reload
183 ; X86-NEXT: adcl (%esp), %ecx # 4-byte Folded Reload
184 ; X86-NEXT: setb (%esp) # 1-byte Folded Spill
185 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
186 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
187 ; X86-NEXT: mull %edi
188 ; X86-NEXT: movl %edx, %esi
189 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
190 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
191 ; X86-NEXT: mull %edi
192 ; X86-NEXT: movl %edx, %edi
193 ; X86-NEXT: movl %eax, %ebp
194 ; X86-NEXT: addl %esi, %ebp
195 ; X86-NEXT: adcl $0, %edi
196 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
197 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
198 ; X86-NEXT: mull %edx
199 ; X86-NEXT: movl %edx, %esi
200 ; X86-NEXT: addl %ebp, %eax
201 ; X86-NEXT: movl %eax, %ebp
202 ; X86-NEXT: adcl %edi, %esi
203 ; X86-NEXT: setb {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Spill
204 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
205 ; X86-NEXT: mull {{[0-9]+}}(%esp)
206 ; X86-NEXT: addl %esi, %eax
207 ; X86-NEXT: movzbl {{[-0-9]+}}(%e{{[sb]}}p), %esi # 1-byte Folded Reload
208 ; X86-NEXT: adcl %esi, %edx
209 ; X86-NEXT: addl %ebx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
210 ; X86-NEXT: adcl %ecx, %ebp
211 ; X86-NEXT: movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
212 ; X86-NEXT: movzbl (%esp), %ecx # 1-byte Folded Reload
213 ; X86-NEXT: adcl %ecx, %eax
214 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
215 ; X86-NEXT: adcl $0, %edx
216 ; X86-NEXT: movl %edx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
217 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
218 ; X86-NEXT: movl %edi, %eax
219 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
220 ; X86-NEXT: mull %esi
221 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
222 ; X86-NEXT: movl %edx, %ecx
223 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
224 ; X86-NEXT: mull %esi
225 ; X86-NEXT: movl %edx, %esi
226 ; X86-NEXT: movl %eax, %ebx
227 ; X86-NEXT: addl %ecx, %ebx
228 ; X86-NEXT: adcl $0, %esi
229 ; X86-NEXT: movl %edi, %eax
230 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
231 ; X86-NEXT: mull %edi
232 ; X86-NEXT: movl %edx, %ebp
233 ; X86-NEXT: addl %ebx, %eax
234 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
235 ; X86-NEXT: adcl %esi, %ebp
237 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
238 ; X86-NEXT: mull %edi
239 ; X86-NEXT: movl %edx, %edi
240 ; X86-NEXT: addl %ebp, %eax
241 ; X86-NEXT: movl %eax, (%esp) # 4-byte Spill
242 ; X86-NEXT: movzbl %cl, %eax
243 ; X86-NEXT: adcl %eax, %edi
244 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
245 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
246 ; X86-NEXT: mull %ecx
247 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
248 ; X86-NEXT: movl %edx, %esi
249 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
250 ; X86-NEXT: mull %ecx
251 ; X86-NEXT: movl %edx, %ebx
252 ; X86-NEXT: movl %eax, %ebp
253 ; X86-NEXT: addl %esi, %ebp
254 ; X86-NEXT: adcl $0, %ebx
255 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
256 ; X86-NEXT: mull {{[0-9]+}}(%esp)
257 ; X86-NEXT: movl %edx, %esi
258 ; X86-NEXT: addl %ebp, %eax
259 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
260 ; X86-NEXT: adcl %ebx, %esi
262 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
263 ; X86-NEXT: movl %eax, %ebx
264 ; X86-NEXT: mull {{[0-9]+}}(%esp)
265 ; X86-NEXT: addl %esi, %eax
266 ; X86-NEXT: movzbl %cl, %ecx
267 ; X86-NEXT: adcl %ecx, %edx
268 ; X86-NEXT: addl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Folded Reload
269 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
270 ; X86-NEXT: adcl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Folded Reload
271 ; X86-NEXT: movl %edx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
272 ; X86-NEXT: adcl $0, (%esp) # 4-byte Folded Spill
273 ; X86-NEXT: adcl $0, %edi
274 ; X86-NEXT: movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
275 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
276 ; X86-NEXT: movl %ebp, %eax
277 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
278 ; X86-NEXT: mull %ecx
279 ; X86-NEXT: movl %edx, %esi
280 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
281 ; X86-NEXT: movl %ebx, %eax
282 ; X86-NEXT: mull %ecx
283 ; X86-NEXT: movl %edx, %ecx
284 ; X86-NEXT: movl %eax, %edi
285 ; X86-NEXT: addl %esi, %edi
286 ; X86-NEXT: adcl $0, %ecx
287 ; X86-NEXT: movl %ebp, %eax
288 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
289 ; X86-NEXT: mull %esi
290 ; X86-NEXT: movl %edx, %ebp
291 ; X86-NEXT: addl %edi, %eax
292 ; X86-NEXT: movl %eax, %edi
293 ; X86-NEXT: adcl %ecx, %ebp
295 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
296 ; X86-NEXT: mull %esi
297 ; X86-NEXT: movl %edx, %ebx
298 ; X86-NEXT: movl %eax, %esi
299 ; X86-NEXT: addl %ebp, %esi
300 ; X86-NEXT: movzbl %cl, %eax
301 ; X86-NEXT: adcl %eax, %ebx
302 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %ebp # 4-byte Reload
303 ; X86-NEXT: addl {{[-0-9]+}}(%e{{[sb]}}p), %ebp # 4-byte Folded Reload
304 ; X86-NEXT: adcl {{[-0-9]+}}(%e{{[sb]}}p), %edi # 4-byte Folded Reload
305 ; X86-NEXT: movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
306 ; X86-NEXT: adcl $0, %esi
307 ; X86-NEXT: adcl $0, %ebx
308 ; X86-NEXT: addl (%esp), %esi # 4-byte Folded Reload
309 ; X86-NEXT: adcl {{[-0-9]+}}(%e{{[sb]}}p), %ebx # 4-byte Folded Reload
310 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
311 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
312 ; X86-NEXT: imull %edx, %ecx
313 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
314 ; X86-NEXT: movl %edi, %eax
315 ; X86-NEXT: mull %edx
316 ; X86-NEXT: addl %edx, %ecx
317 ; X86-NEXT: imull {{[0-9]+}}(%esp), %edi
318 ; X86-NEXT: addl %ecx, %edi
319 ; X86-NEXT: movl %eax, %edx
320 ; X86-NEXT: addl %esi, %edx
321 ; X86-NEXT: adcl %ebx, %edi
322 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
323 ; X86-NEXT: addl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
324 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
325 ; X86-NEXT: adcl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
326 ; X86-NEXT: adcl {{[-0-9]+}}(%e{{[sb]}}p), %ebp # 4-byte Folded Reload
327 ; X86-NEXT: movl %ebp, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
328 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
329 ; X86-NEXT: adcl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Folded Reload
330 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
331 ; X86-NEXT: adcl $0, %edx
332 ; X86-NEXT: movl %edx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
333 ; X86-NEXT: adcl $0, %edi
334 ; X86-NEXT: movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
335 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
336 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
337 ; X86-NEXT: movl %esi, %eax
338 ; X86-NEXT: mull %edi
339 ; X86-NEXT: movl %edx, %ecx
340 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
341 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
342 ; X86-NEXT: mull %edi
343 ; X86-NEXT: movl %edx, %edi
344 ; X86-NEXT: movl %eax, %ebx
345 ; X86-NEXT: addl %ecx, %ebx
346 ; X86-NEXT: adcl $0, %edi
347 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
348 ; X86-NEXT: movl %esi, %eax
349 ; X86-NEXT: mull %ecx
350 ; X86-NEXT: movl %ecx, %esi
351 ; X86-NEXT: movl %edx, %ebp
352 ; X86-NEXT: addl %ebx, %eax
353 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
354 ; X86-NEXT: adcl %edi, %ebp
356 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
357 ; X86-NEXT: mull %esi
358 ; X86-NEXT: addl %ebp, %eax
359 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
360 ; X86-NEXT: movzbl %cl, %eax
361 ; X86-NEXT: adcl %eax, %edx
362 ; X86-NEXT: movl %edx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
363 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
364 ; X86-NEXT: movl %ecx, %eax
365 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
366 ; X86-NEXT: mull %esi
367 ; X86-NEXT: movl %edx, %edi
368 ; X86-NEXT: movl %eax, (%esp) # 4-byte Spill
369 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
370 ; X86-NEXT: mull %esi
371 ; X86-NEXT: movl %edx, %ebx
372 ; X86-NEXT: movl %eax, %ebp
373 ; X86-NEXT: addl %edi, %ebp
374 ; X86-NEXT: adcl $0, %ebx
375 ; X86-NEXT: movl %ecx, %eax
376 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
377 ; X86-NEXT: mull %esi
378 ; X86-NEXT: movl %edx, %edi
379 ; X86-NEXT: addl %ebp, %eax
380 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
381 ; X86-NEXT: adcl %ebx, %edi
383 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
384 ; X86-NEXT: mull %esi
385 ; X86-NEXT: movl %eax, %ebx
386 ; X86-NEXT: addl %edi, %ebx
387 ; X86-NEXT: movzbl %cl, %eax
388 ; X86-NEXT: adcl %eax, %edx
389 ; X86-NEXT: addl {{[-0-9]+}}(%e{{[sb]}}p), %ebx # 4-byte Folded Reload
390 ; X86-NEXT: adcl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Folded Reload
391 ; X86-NEXT: movl %edx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
392 ; X86-NEXT: adcl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
393 ; X86-NEXT: adcl $0, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
394 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
395 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
396 ; X86-NEXT: movl %ebp, %eax
397 ; X86-NEXT: mull %ecx
398 ; X86-NEXT: movl %edx, %esi
399 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
400 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
401 ; X86-NEXT: mull %ecx
402 ; X86-NEXT: movl %edx, %edi
403 ; X86-NEXT: movl %eax, %ecx
404 ; X86-NEXT: addl %esi, %ecx
405 ; X86-NEXT: adcl $0, %edi
406 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
407 ; X86-NEXT: movl %ebp, %eax
408 ; X86-NEXT: mull %esi
409 ; X86-NEXT: movl %esi, %ebp
410 ; X86-NEXT: movl %edx, %esi
411 ; X86-NEXT: addl %ecx, %eax
412 ; X86-NEXT: movl %eax, %ecx
413 ; X86-NEXT: adcl %edi, %esi
414 ; X86-NEXT: setb {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Spill
415 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
416 ; X86-NEXT: mull %ebp
417 ; X86-NEXT: movl %edx, %edi
418 ; X86-NEXT: movl %eax, %ebp
419 ; X86-NEXT: addl %esi, %ebp
420 ; X86-NEXT: movzbl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 1-byte Folded Reload
421 ; X86-NEXT: adcl %eax, %edi
422 ; X86-NEXT: addl %ebx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
423 ; X86-NEXT: adcl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Folded Reload
424 ; X86-NEXT: movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
425 ; X86-NEXT: adcl $0, %ebp
426 ; X86-NEXT: adcl $0, %edi
427 ; X86-NEXT: addl {{[-0-9]+}}(%e{{[sb]}}p), %ebp # 4-byte Folded Reload
428 ; X86-NEXT: adcl {{[-0-9]+}}(%e{{[sb]}}p), %edi # 4-byte Folded Reload
429 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
430 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
431 ; X86-NEXT: imull %ecx, %ebx
432 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
433 ; X86-NEXT: movl %esi, %eax
434 ; X86-NEXT: mull %ecx
435 ; X86-NEXT: movl %eax, %ecx
436 ; X86-NEXT: addl %edx, %ebx
437 ; X86-NEXT: imull {{[0-9]+}}(%esp), %esi
438 ; X86-NEXT: addl %ebx, %esi
439 ; X86-NEXT: addl %ebp, %ecx
440 ; X86-NEXT: adcl %edi, %esi
441 ; X86-NEXT: movl (%esp), %eax # 4-byte Reload
442 ; X86-NEXT: addl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Folded Reload
443 ; X86-NEXT: movl %eax, (%esp) # 4-byte Spill
444 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
445 ; X86-NEXT: adcl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Folded Reload
446 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
447 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
448 ; X86-NEXT: adcl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Folded Reload
449 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
450 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
451 ; X86-NEXT: adcl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Folded Reload
452 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
453 ; X86-NEXT: adcl $0, %ecx
454 ; X86-NEXT: adcl $0, %esi
455 ; X86-NEXT: addl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Folded Reload
456 ; X86-NEXT: adcl {{[-0-9]+}}(%e{{[sb]}}p), %esi # 4-byte Folded Reload
457 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
458 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
459 ; X86-NEXT: imull %edx, %ebp
460 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
461 ; X86-NEXT: movl %ebx, %eax
462 ; X86-NEXT: mull %edx
463 ; X86-NEXT: movl %eax, %edi
464 ; X86-NEXT: addl %edx, %ebp
465 ; X86-NEXT: imull {{[0-9]+}}(%esp), %ebx
466 ; X86-NEXT: addl %ebp, %ebx
467 ; X86-NEXT: addl %ecx, %edi
468 ; X86-NEXT: adcl %esi, %ebx
469 ; X86-NEXT: movl %ebx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
470 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %ebx # 4-byte Reload
471 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
472 ; X86-NEXT: imull %edx, %ebx
473 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
474 ; X86-NEXT: movl %ecx, %eax
475 ; X86-NEXT: mull %edx
476 ; X86-NEXT: movl %eax, %esi
477 ; X86-NEXT: addl %edx, %ebx
478 ; X86-NEXT: imull {{[0-9]+}}(%esp), %ecx
479 ; X86-NEXT: addl %ebx, %ecx
480 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %ebp # 4-byte Reload
481 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
482 ; X86-NEXT: imull %edx, %ebp
483 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
484 ; X86-NEXT: movl %ebx, %eax
485 ; X86-NEXT: mull %edx
486 ; X86-NEXT: addl %edx, %ebp
487 ; X86-NEXT: imull {{[0-9]+}}(%esp), %ebx
488 ; X86-NEXT: addl %ebp, %ebx
489 ; X86-NEXT: addl %esi, %eax
490 ; X86-NEXT: adcl %ecx, %ebx
491 ; X86-NEXT: addl %edi, %eax
492 ; X86-NEXT: adcl {{[-0-9]+}}(%e{{[sb]}}p), %ebx # 4-byte Folded Reload
493 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
494 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
495 ; X86-NEXT: movl %edx, (%ecx)
496 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
497 ; X86-NEXT: movl %edx, 4(%ecx)
498 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
499 ; X86-NEXT: movl %edx, 8(%ecx)
500 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
501 ; X86-NEXT: movl %edx, 12(%ecx)
502 ; X86-NEXT: movl (%esp), %edx # 4-byte Reload
503 ; X86-NEXT: movl %edx, 16(%ecx)
504 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
505 ; X86-NEXT: movl %edx, 20(%ecx)
506 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
507 ; X86-NEXT: movl %edx, 24(%ecx)
508 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %edx # 4-byte Reload
509 ; X86-NEXT: movl %edx, 28(%ecx)
510 ; X86-NEXT: movl %eax, 32(%ecx)
511 ; X86-NEXT: andl $4095, %ebx # imm = 0xFFF
512 ; X86-NEXT: movw %bx, 36(%ecx)
513 ; X86-NEXT: movl %ecx, %eax
514 ; X86-NEXT: addl $76, %esp
515 ; X86-NEXT: popl %esi
516 ; X86-NEXT: popl %edi
517 ; X86-NEXT: popl %ebx
518 ; X86-NEXT: popl %ebp
523 ; X64-NEXT: pushq %rbp
524 ; X64-NEXT: pushq %r15
525 ; X64-NEXT: pushq %r14
526 ; X64-NEXT: pushq %r13
527 ; X64-NEXT: pushq %r12
528 ; X64-NEXT: pushq %rbx
529 ; X64-NEXT: movq %r9, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
530 ; X64-NEXT: movq %r8, %r11
531 ; X64-NEXT: movq %rcx, %r8
532 ; X64-NEXT: movq %rdx, %r13
533 ; X64-NEXT: movq %rdi, %r12
534 ; X64-NEXT: movq {{[0-9]+}}(%rsp), %r10
535 ; X64-NEXT: movq {{[0-9]+}}(%rsp), %rbp
536 ; X64-NEXT: movq %rsi, %rax
537 ; X64-NEXT: mulq %r10
538 ; X64-NEXT: movq %rdx, %r14
539 ; X64-NEXT: movq %rax, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
540 ; X64-NEXT: movq %r13, %rax
541 ; X64-NEXT: mulq %r10
542 ; X64-NEXT: movq %rdx, %rbx
543 ; X64-NEXT: movq %rax, %rdi
544 ; X64-NEXT: addq %r14, %rdi
545 ; X64-NEXT: adcq $0, %rbx
546 ; X64-NEXT: movq %rsi, %rax
547 ; X64-NEXT: mulq %rbp
548 ; X64-NEXT: movq %rdx, %rcx
549 ; X64-NEXT: movq %rax, %r9
550 ; X64-NEXT: addq %rdi, %r9
551 ; X64-NEXT: adcq %rbx, %rcx
553 ; X64-NEXT: movzbl %al, %edi
554 ; X64-NEXT: movq %r13, %rax
555 ; X64-NEXT: mulq %rbp
556 ; X64-NEXT: movq %rdx, %rbx
557 ; X64-NEXT: movq %rax, %rbp
558 ; X64-NEXT: addq %rcx, %rbp
559 ; X64-NEXT: adcq %rdi, %rbx
560 ; X64-NEXT: movq %r8, %rax
561 ; X64-NEXT: mulq %r10
562 ; X64-NEXT: movq %rdx, %rcx
563 ; X64-NEXT: movq %rax, %r15
564 ; X64-NEXT: movq %r11, %rax
565 ; X64-NEXT: mulq %r10
566 ; X64-NEXT: movq %rdx, %r10
567 ; X64-NEXT: movq %rax, %r14
568 ; X64-NEXT: addq %rcx, %r14
569 ; X64-NEXT: adcq $0, %r10
570 ; X64-NEXT: movq %r8, %rax
571 ; X64-NEXT: movq {{[0-9]+}}(%rsp), %rcx
572 ; X64-NEXT: mulq %rcx
573 ; X64-NEXT: movq %rax, %rdi
574 ; X64-NEXT: addq %r14, %rdi
575 ; X64-NEXT: adcq %r10, %rdx
576 ; X64-NEXT: imulq %rcx, %r11
577 ; X64-NEXT: movq {{[0-9]+}}(%rsp), %r14
578 ; X64-NEXT: addq %rbp, %r15
579 ; X64-NEXT: adcq %rbx, %rdi
580 ; X64-NEXT: adcq %rdx, %r11
581 ; X64-NEXT: movq %rsi, %rax
582 ; X64-NEXT: mulq %r14
583 ; X64-NEXT: movq %rdx, %rcx
584 ; X64-NEXT: movq %rax, %r10
585 ; X64-NEXT: movq %r13, %rax
586 ; X64-NEXT: mulq %r14
587 ; X64-NEXT: movq %rdx, %rbp
588 ; X64-NEXT: movq %rax, %rbx
589 ; X64-NEXT: addq %rcx, %rbx
590 ; X64-NEXT: adcq $0, %rbp
591 ; X64-NEXT: movq {{[0-9]+}}(%rsp), %rcx
592 ; X64-NEXT: movq %rsi, %rax
593 ; X64-NEXT: mulq %rcx
594 ; X64-NEXT: addq %rbx, %rax
595 ; X64-NEXT: adcq %rbp, %rdx
596 ; X64-NEXT: imulq %rcx, %r13
597 ; X64-NEXT: addq %rdx, %r13
598 ; X64-NEXT: addq %r15, %r10
599 ; X64-NEXT: adcq %rdi, %rax
600 ; X64-NEXT: adcq %r11, %r13
601 ; X64-NEXT: imulq %r14, %r8
602 ; X64-NEXT: addq %r13, %r8
603 ; X64-NEXT: movq {{[-0-9]+}}(%r{{[sb]}}p), %rcx # 8-byte Reload
604 ; X64-NEXT: imulq {{[0-9]+}}(%rsp), %rcx
605 ; X64-NEXT: imulq {{[0-9]+}}(%rsp), %rsi
606 ; X64-NEXT: addq %rcx, %rsi
607 ; X64-NEXT: addq %r8, %rsi
608 ; X64-NEXT: movq {{[-0-9]+}}(%r{{[sb]}}p), %rcx # 8-byte Reload
609 ; X64-NEXT: movq %rcx, (%r12)
610 ; X64-NEXT: movq %r9, 8(%r12)
611 ; X64-NEXT: movq %r10, 16(%r12)
612 ; X64-NEXT: movq %rax, 24(%r12)
613 ; X64-NEXT: movl %esi, 32(%r12)
614 ; X64-NEXT: shrq $32, %rsi
615 ; X64-NEXT: andl $4095, %esi # imm = 0xFFF
616 ; X64-NEXT: movw %si, 36(%r12)
617 ; X64-NEXT: movq %r12, %rax
618 ; X64-NEXT: popq %rbx
619 ; X64-NEXT: popq %r12
620 ; X64-NEXT: popq %r13
621 ; X64-NEXT: popq %r14
622 ; X64-NEXT: popq %r15
623 ; X64-NEXT: popq %rbp
625 %x = call {i300, i1} @llvm.umul.with.overflow.i300(i300 %a, i300 %b)
626 %y = extractvalue {i300, i1} %x, 0