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), %esi
13 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ebx
14 ; X32-NEXT: movl {{[0-9]+}}(%esp), %edi
15 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
16 ; X32-NEXT: movl %esi, %eax
18 ; X32-NEXT: movl %edx, %ebp
19 ; X32-NEXT: movl %ebx, %eax
21 ; X32-NEXT: movl %edx, %edi
22 ; X32-NEXT: movl %eax, %ebx
23 ; X32-NEXT: addl %ebp, %ebx
24 ; X32-NEXT: adcl $0, %edi
25 ; X32-NEXT: movl %esi, %eax
27 ; X32-NEXT: movl %edx, %esi
28 ; X32-NEXT: addl %ebx, %eax
29 ; X32-NEXT: adcl %edi, %esi
31 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
33 ; X32-NEXT: addl %esi, %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: addq %rdx, %rcx
60 ; X64-NEXT: movq %rcx, %rax
61 ; X64-NEXT: xorl %edx, %edx
63 %1 = zext i64 %a to i128
64 %2 = zext i64 %b to i128
68 %6 = zext i64 %5 to i128