1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s
4 ; Utilize implicit zero-extension on x86-64 to eliminate explicit
5 ; zero-extensions. Shrink 64-bit adds to 32-bit when the high
6 ; 32-bits will be zeroed.
8 define void @bar(i64 %x, i64 %y, ptr %z) nounwind readnone {
10 ; CHECK: # %bb.0: # %entry
11 ; CHECK-NEXT: addl %esi, %edi
12 ; CHECK-NEXT: movq %rdi, (%rdx)
16 %t1 = and i64 %t0, 4294967295
20 define void @easy(i32 %x, i32 %y, ptr %z) nounwind readnone {
22 ; CHECK: # %bb.0: # %entry
23 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
24 ; CHECK-NEXT: addl %esi, %edi
25 ; CHECK-NEXT: movq %rdi, (%rdx)
29 %tn = zext i32 %t0 to i64
30 %t1 = and i64 %tn, 4294967295
34 define void @cola(ptr%x, i64 %y, ptr %z, i64 %u) nounwind readnone {
36 ; CHECK: # %bb.0: # %entry
37 ; CHECK-NEXT: addl (%rdi), %esi
38 ; CHECK-NEXT: xorq %rcx, %rsi
39 ; CHECK-NEXT: movq %rsi, (%rdx)
44 %t1 = and i64 %t0, 4294967295
49 define void @yaks(ptr%x, i64 %y, ptr %z, i64 %u) nounwind readnone {
51 ; CHECK: # %bb.0: # %entry
52 ; CHECK-NEXT: addl (%rdi), %esi
53 ; CHECK-NEXT: xorl %esi, %ecx
54 ; CHECK-NEXT: movq %rcx, (%rdx)
60 %t2 = and i64 %t1, 4294967295
64 define void @foo(ptr%x, ptr%y, ptr %z) nounwind readnone {
66 ; CHECK: # %bb.0: # %entry
67 ; CHECK-NEXT: movl (%rdi), %eax
68 ; CHECK-NEXT: addl (%rsi), %eax
69 ; CHECK-NEXT: movq %rax, (%rdx)
75 %t1 = and i64 %t0, 4294967295
79 define void @avo(i64 %x, ptr %z, i64 %u) nounwind readnone {
81 ; CHECK: # %bb.0: # %entry
82 ; CHECK-NEXT: addl $734847, %edi # imm = 0xB367F
83 ; CHECK-NEXT: xorq %rdx, %rdi
84 ; CHECK-NEXT: movq %rdi, (%rsi)
87 %t0 = add i64 %x, 734847
88 %t1 = and i64 %t0, 4294967295
93 define void @phe(i64 %x, ptr %z, i64 %u) nounwind readnone {
95 ; CHECK: # %bb.0: # %entry
96 ; CHECK-NEXT: addl $734847, %edi # imm = 0xB367F
97 ; CHECK-NEXT: xorl %edi, %edx
98 ; CHECK-NEXT: movq %rdx, (%rsi)
101 %t0 = add i64 %x, 734847
102 %t1 = xor i64 %t0, %u
103 %t2 = and i64 %t1, 4294967295
104 store i64 %t2, ptr %z
107 define void @oze(i64 %y, ptr %z) nounwind readnone {
109 ; CHECK: # %bb.0: # %entry
110 ; CHECK-NEXT: incl %edi
111 ; CHECK-NEXT: movq %rdi, (%rsi)
115 %t1 = and i64 %t0, 4294967295
116 store i64 %t1, ptr %z
120 define void @sbar(i64 %x, i64 %y, ptr %z) nounwind readnone {
122 ; CHECK: # %bb.0: # %entry
123 ; CHECK-NEXT: subl %esi, %edi
124 ; CHECK-NEXT: movq %rdi, (%rdx)
128 %t1 = and i64 %t0, 4294967295
129 store i64 %t1, ptr %z
132 define void @seasy(i32 %x, i32 %y, ptr %z) nounwind readnone {
133 ; CHECK-LABEL: seasy:
134 ; CHECK: # %bb.0: # %entry
135 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
136 ; CHECK-NEXT: subl %esi, %edi
137 ; CHECK-NEXT: movq %rdi, (%rdx)
141 %tn = zext i32 %t0 to i64
142 %t1 = and i64 %tn, 4294967295
143 store i64 %t1, ptr %z
146 define void @scola(ptr%x, i64 %y, ptr %z, i64 %u) nounwind readnone {
147 ; CHECK-LABEL: scola:
148 ; CHECK: # %bb.0: # %entry
149 ; CHECK-NEXT: movl (%rdi), %eax
150 ; CHECK-NEXT: subl %esi, %eax
151 ; CHECK-NEXT: xorq %rcx, %rax
152 ; CHECK-NEXT: movq %rax, (%rdx)
155 %p = load i64, ptr %x
157 %t1 = and i64 %t0, 4294967295
158 %t2 = xor i64 %t1, %u
159 store i64 %t2, ptr %z
162 define void @syaks(ptr%x, i64 %y, ptr %z, i64 %u) nounwind readnone {
163 ; CHECK-LABEL: syaks:
164 ; CHECK: # %bb.0: # %entry
165 ; CHECK-NEXT: movl (%rdi), %eax
166 ; CHECK-NEXT: subl %esi, %eax
167 ; CHECK-NEXT: xorl %eax, %ecx
168 ; CHECK-NEXT: movq %rcx, (%rdx)
171 %p = load i64, ptr %x
173 %t1 = xor i64 %t0, %u
174 %t2 = and i64 %t1, 4294967295
175 store i64 %t2, ptr %z
178 define void @sfoo(ptr%x, ptr%y, ptr %z) nounwind readnone {
180 ; CHECK: # %bb.0: # %entry
181 ; CHECK-NEXT: movl (%rdi), %eax
182 ; CHECK-NEXT: subl (%rsi), %eax
183 ; CHECK-NEXT: movq %rax, (%rdx)
186 %a = load i64, ptr %x
187 %b = load i64, ptr %y
189 %t1 = and i64 %t0, 4294967295
190 store i64 %t1, ptr %z
193 define void @swya(i64 %y, ptr %z) nounwind readnone {
195 ; CHECK: # %bb.0: # %entry
196 ; CHECK-NEXT: negl %edi
197 ; CHECK-NEXT: movq %rdi, (%rsi)
201 %t1 = and i64 %t0, 4294967295
202 store i64 %t1, ptr %z
205 define void @soze(i64 %y, ptr %z) nounwind readnone {
207 ; CHECK: # %bb.0: # %entry
208 ; CHECK-NEXT: decl %edi
209 ; CHECK-NEXT: movq %rdi, (%rsi)
213 %t1 = and i64 %t0, 4294967295
214 store i64 %t1, ptr %z