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), %ebp
14 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ebx
15 ; X32-NEXT: movl {{[0-9]+}}(%esp), %esi
16 ; X32-NEXT: movl %ecx, %eax
18 ; X32-NEXT: movl %edx, %edi
19 ; X32-NEXT: movl %ebp, %eax
21 ; X32-NEXT: movl %edx, %ebx
22 ; X32-NEXT: movl %eax, %ebp
23 ; X32-NEXT: addl %edi, %ebp
24 ; X32-NEXT: adcl $0, %ebx
25 ; X32-NEXT: movl %ecx, %eax
27 ; X32-NEXT: movl %edx, %ecx
28 ; X32-NEXT: addl %ebp, %eax
29 ; X32-NEXT: adcl %ebx, %ecx
31 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
33 ; X32-NEXT: addl %ecx, %eax
34 ; X32-NEXT: movzbl %bl, %ecx
35 ; X32-NEXT: adcl %ecx, %edx
36 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
37 ; X32-NEXT: andl $1, %ecx
38 ; X32-NEXT: addl %eax, %ecx
39 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
40 ; X32-NEXT: movl %ecx, (%eax)
41 ; X32-NEXT: adcl $0, %edx
42 ; X32-NEXT: movl %edx, 4(%eax)
44 ; X32-NEXT: movzbl %cl, %ecx
45 ; X32-NEXT: movl %ecx, 8(%eax)
46 ; X32-NEXT: movl $0, 12(%eax)
53 ; X64-LABEL: mulhioverflow:
55 ; X64-NEXT: movq %rdx, %rcx
56 ; X64-NEXT: movq %rdi, %rax
58 ; X64-NEXT: andl $1, %ecx
59 ; X64-NEXT: leaq (%rcx,%rdx), %rax
60 ; X64-NEXT: xorl %edx, %edx
62 %1 = zext i64 %a to i128
63 %2 = zext i64 %b to i128
67 %6 = zext i64 %5 to i128