1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s --check-prefix=X64
3 ; RUN: llc < %s -mtriple=i386-unknown | FileCheck %s --check-prefix=X86
5 define i128 @foo(i128 %t, i128 %u) {
8 ; X64-NEXT: movq %rdx, %r8
9 ; X64-NEXT: movq %rdi, %rax
10 ; X64-NEXT: imulq %rdi, %rcx
12 ; X64-NEXT: addq %rcx, %rdx
13 ; X64-NEXT: imulq %rsi, %r8
14 ; X64-NEXT: addq %r8, %rdx
19 ; X86-NEXT: pushl %ebp
20 ; X86-NEXT: .cfi_def_cfa_offset 8
21 ; X86-NEXT: pushl %ebx
22 ; X86-NEXT: .cfi_def_cfa_offset 12
23 ; X86-NEXT: pushl %edi
24 ; X86-NEXT: .cfi_def_cfa_offset 16
25 ; X86-NEXT: pushl %esi
26 ; X86-NEXT: .cfi_def_cfa_offset 20
27 ; X86-NEXT: subl $8, %esp
28 ; X86-NEXT: .cfi_def_cfa_offset 28
29 ; X86-NEXT: .cfi_offset %esi, -20
30 ; X86-NEXT: .cfi_offset %edi, -16
31 ; X86-NEXT: .cfi_offset %ebx, -12
32 ; X86-NEXT: .cfi_offset %ebp, -8
33 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
34 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
35 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
36 ; X86-NEXT: imull %ecx, %ebp
37 ; X86-NEXT: movl %eax, %esi
39 ; X86-NEXT: movl %eax, %edi
40 ; X86-NEXT: movl %edx, %ebx
41 ; X86-NEXT: addl %ebp, %ebx
42 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
43 ; X86-NEXT: imull %esi, %eax
44 ; X86-NEXT: addl %eax, %ebx
45 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
46 ; X86-NEXT: movl %eax, %esi
47 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
48 ; X86-NEXT: imull %ecx, %esi
49 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
51 ; X86-NEXT: addl %esi, %edx
52 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
53 ; X86-NEXT: imull %ebp, %esi
54 ; X86-NEXT: addl %edx, %esi
55 ; X86-NEXT: addl %edi, %eax
56 ; X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
57 ; X86-NEXT: adcl %ebx, %esi
58 ; X86-NEXT: movl %ebp, %eax
59 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
61 ; X86-NEXT: movl %edx, %ebx
62 ; X86-NEXT: movl %eax, (%esp) # 4-byte Spill
63 ; X86-NEXT: movl %ecx, %eax
65 ; X86-NEXT: movl %edx, %edi
66 ; X86-NEXT: movl %eax, %ecx
67 ; X86-NEXT: addl %ebx, %ecx
68 ; X86-NEXT: adcl $0, %edi
69 ; X86-NEXT: movl %ebp, %eax
70 ; X86-NEXT: mull {{[0-9]+}}(%esp)
71 ; X86-NEXT: movl %edx, %ebp
72 ; X86-NEXT: movl %eax, %ebx
73 ; X86-NEXT: addl %ecx, %ebx
74 ; X86-NEXT: adcl %edi, %ebp
76 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
77 ; X86-NEXT: mull {{[0-9]+}}(%esp)
78 ; X86-NEXT: addl %ebp, %eax
79 ; X86-NEXT: movzbl %cl, %ecx
80 ; X86-NEXT: adcl %ecx, %edx
81 ; X86-NEXT: addl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Folded Reload
82 ; X86-NEXT: adcl %esi, %edx
83 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
84 ; X86-NEXT: movl %ebx, 4(%ecx)
85 ; X86-NEXT: movl (%esp), %esi # 4-byte Reload
86 ; X86-NEXT: movl %esi, (%ecx)
87 ; X86-NEXT: movl %eax, 8(%ecx)
88 ; X86-NEXT: movl %edx, 12(%ecx)
89 ; X86-NEXT: movl %ecx, %eax
90 ; X86-NEXT: addl $8, %esp
91 ; X86-NEXT: .cfi_def_cfa_offset 20
93 ; X86-NEXT: .cfi_def_cfa_offset 16
95 ; X86-NEXT: .cfi_def_cfa_offset 12
97 ; X86-NEXT: .cfi_def_cfa_offset 8
99 ; X86-NEXT: .cfi_def_cfa_offset 4
105 @aaa = external dso_local global i128
106 @bbb = external dso_local global i128
108 define void @PR13897() nounwind {
109 ; X64-LABEL: PR13897:
110 ; X64: # %bb.0: # %"0x0"
111 ; X64-NEXT: movq bbb(%rip), %rax
112 ; X64-NEXT: movl %eax, %ecx
113 ; X64-NEXT: shlq $32, %rax
114 ; X64-NEXT: orq %rcx, %rax
115 ; X64-NEXT: movq %rax, aaa+8(%rip)
116 ; X64-NEXT: movq %rax, aaa(%rip)
119 ; X86-LABEL: PR13897:
120 ; X86: # %bb.0: # %"0x0"
121 ; X86-NEXT: movl bbb, %eax
122 ; X86-NEXT: movl %eax, aaa+12
123 ; X86-NEXT: movl %eax, aaa+8
124 ; X86-NEXT: movl %eax, aaa+4
125 ; X86-NEXT: movl %eax, aaa
128 %0 = load i128, ptr @bbb
129 %1 = and i128 %0, 4294967295
131 %3 = mul i128 %1, 18446744078004518913
133 store i128 %4, ptr @aaa