1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=X32
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=X64
5 define i128 @mulhioverflow(i64 %a, i64 %b, i64 %c) nounwind {
6 ; X32-LABEL: mulhioverflow:
10 ; X32-NEXT: pushl %edi
11 ; X32-NEXT: pushl %esi
12 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
13 ; X32-NEXT: movl {{[0-9]+}}(%esp), %esi
14 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ebp
15 ; X32-NEXT: movl {{[0-9]+}}(%esp), %edi
16 ; X32-NEXT: movl %ecx, %eax
18 ; X32-NEXT: movl %edx, %ebx
19 ; X32-NEXT: movl %esi, %eax
21 ; X32-NEXT: movl %edx, %ebp
22 ; X32-NEXT: movl %eax, %esi
23 ; X32-NEXT: addl %ebx, %esi
24 ; X32-NEXT: adcl $0, %ebp
25 ; X32-NEXT: movl %ecx, %eax
27 ; X32-NEXT: movl %edx, %ebx
28 ; X32-NEXT: addl %esi, %eax
29 ; X32-NEXT: adcl %ebp, %ebx
31 ; X32-NEXT: movzbl %al, %ecx
32 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
34 ; X32-NEXT: movl %edx, %esi
35 ; X32-NEXT: movl %eax, %ebp
36 ; X32-NEXT: addl %ebx, %ebp
37 ; X32-NEXT: adcl %ecx, %esi
38 ; X32-NEXT: xorl %ecx, %ecx
39 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
41 ; X32-NEXT: movl %edx, %edi
42 ; X32-NEXT: movl %eax, %ebx
43 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
45 ; X32-NEXT: addl %ebx, %eax
46 ; X32-NEXT: adcl %edi, %edx
47 ; X32-NEXT: addl %ebp, %eax
48 ; X32-NEXT: adcl %esi, %edx
49 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
50 ; X32-NEXT: andl $1, %ecx
51 ; X32-NEXT: addl %eax, %ecx
52 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
53 ; X32-NEXT: movl %ecx, (%eax)
54 ; X32-NEXT: adcl $0, %edx
55 ; X32-NEXT: movl %edx, 4(%eax)
57 ; X32-NEXT: movzbl %cl, %ecx
58 ; X32-NEXT: movl %ecx, 8(%eax)
59 ; X32-NEXT: movl $0, 12(%eax)
66 ; X64-LABEL: mulhioverflow:
68 ; X64-NEXT: movq %rdx, %rcx
69 ; X64-NEXT: movq %rdi, %rax
71 ; X64-NEXT: andl $1, %ecx
72 ; X64-NEXT: leaq (%rcx,%rdx), %rax
73 ; X64-NEXT: xorl %edx, %edx
75 %1 = zext i64 %a to i128
76 %2 = zext i64 %b to i128
80 %6 = zext i64 %5 to i128