1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i386-unknown | FileCheck %s --check-prefix=X32
3 ; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s --check-prefix=X64
5 define void @add(ptr %p, ptr %q) nounwind {
10 ; X32-NEXT: pushl %edi
11 ; X32-NEXT: pushl %esi
12 ; X32-NEXT: subl $8, %esp
13 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
14 ; X32-NEXT: movl 28(%ecx), %eax
15 ; X32-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
16 ; X32-NEXT: movl 24(%ecx), %eax
17 ; X32-NEXT: movl %eax, (%esp) # 4-byte Spill
18 ; X32-NEXT: movl 20(%ecx), %esi
19 ; X32-NEXT: movl 16(%ecx), %edi
20 ; X32-NEXT: movl 12(%ecx), %ebx
21 ; X32-NEXT: movl 8(%ecx), %ebp
22 ; X32-NEXT: movl (%ecx), %edx
23 ; X32-NEXT: movl 4(%ecx), %ecx
24 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
25 ; X32-NEXT: addl %edx, (%eax)
26 ; X32-NEXT: adcl %ecx, 4(%eax)
27 ; X32-NEXT: adcl %ebp, 8(%eax)
28 ; X32-NEXT: adcl %ebx, 12(%eax)
29 ; X32-NEXT: adcl %edi, 16(%eax)
30 ; X32-NEXT: adcl %esi, 20(%eax)
31 ; X32-NEXT: movl (%esp), %ecx # 4-byte Reload
32 ; X32-NEXT: adcl %ecx, 24(%eax)
33 ; X32-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
34 ; X32-NEXT: adcl %ecx, 28(%eax)
35 ; X32-NEXT: addl $8, %esp
44 ; X64-NEXT: movq 24(%rsi), %rax
45 ; X64-NEXT: movq 16(%rsi), %rcx
46 ; X64-NEXT: movq (%rsi), %rdx
47 ; X64-NEXT: movq 8(%rsi), %rsi
48 ; X64-NEXT: addq %rdx, (%rdi)
49 ; X64-NEXT: adcq %rsi, 8(%rdi)
50 ; X64-NEXT: adcq %rcx, 16(%rdi)
51 ; X64-NEXT: adcq %rax, 24(%rdi)
53 %a = load i256, ptr %p
54 %b = load i256, ptr %q
59 define void @sub(ptr %p, ptr %q) nounwind {
62 ; X32-NEXT: pushl %ebp
63 ; X32-NEXT: pushl %ebx
64 ; X32-NEXT: pushl %edi
65 ; X32-NEXT: pushl %esi
66 ; X32-NEXT: subl $8, %esp
67 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
68 ; X32-NEXT: movl 28(%ecx), %eax
69 ; X32-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
70 ; X32-NEXT: movl 24(%ecx), %eax
71 ; X32-NEXT: movl %eax, (%esp) # 4-byte Spill
72 ; X32-NEXT: movl 20(%ecx), %esi
73 ; X32-NEXT: movl 16(%ecx), %edi
74 ; X32-NEXT: movl 12(%ecx), %ebx
75 ; X32-NEXT: movl 8(%ecx), %ebp
76 ; X32-NEXT: movl (%ecx), %edx
77 ; X32-NEXT: movl 4(%ecx), %ecx
78 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
79 ; X32-NEXT: subl %edx, (%eax)
80 ; X32-NEXT: sbbl %ecx, 4(%eax)
81 ; X32-NEXT: sbbl %ebp, 8(%eax)
82 ; X32-NEXT: sbbl %ebx, 12(%eax)
83 ; X32-NEXT: sbbl %edi, 16(%eax)
84 ; X32-NEXT: sbbl %esi, 20(%eax)
85 ; X32-NEXT: movl (%esp), %ecx # 4-byte Reload
86 ; X32-NEXT: sbbl %ecx, 24(%eax)
87 ; X32-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
88 ; X32-NEXT: sbbl %ecx, 28(%eax)
89 ; X32-NEXT: addl $8, %esp
98 ; X64-NEXT: movq 24(%rsi), %rax
99 ; X64-NEXT: movq 16(%rsi), %rcx
100 ; X64-NEXT: movq (%rsi), %rdx
101 ; X64-NEXT: movq 8(%rsi), %rsi
102 ; X64-NEXT: subq %rdx, (%rdi)
103 ; X64-NEXT: sbbq %rsi, 8(%rdi)
104 ; X64-NEXT: sbbq %rcx, 16(%rdi)
105 ; X64-NEXT: sbbq %rax, 24(%rdi)
107 %a = load i256, ptr %p
108 %b = load i256, ptr %q
110 store i256 %c, ptr %p