1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-linux | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-linux -mcpu=core2 | FileCheck %s --check-prefix=CORE2
4 ; RUN: llc < %s -mtriple=x86_64-unknown-linux -mcpu=nehalem | FileCheck %s --check-prefix=NEHALEM
6 declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) nounwind
8 define void @memset_0(i8* %a) nounwind {
10 ; X86: # %bb.0: # %entry
13 ; CORE2-LABEL: memset_0:
14 ; CORE2: # %bb.0: # %entry
17 ; NEHALEM-LABEL: memset_0:
18 ; NEHALEM: # %bb.0: # %entry
21 call void @llvm.memset.p0i8.i64(i8* %a, i8 0, i64 0, i1 false)
25 define void @memset_4(i8* %a) nounwind {
26 ; X86-LABEL: memset_4:
27 ; X86: # %bb.0: # %entry
28 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
29 ; X86-NEXT: movl $0, (%eax)
32 ; CORE2-LABEL: memset_4:
33 ; CORE2: # %bb.0: # %entry
34 ; CORE2-NEXT: movl $0, (%rdi)
37 ; NEHALEM-LABEL: memset_4:
38 ; NEHALEM: # %bb.0: # %entry
39 ; NEHALEM-NEXT: movl $0, (%rdi)
42 call void @llvm.memset.p0i8.i64(i8* %a, i8 0, i64 4, i1 false)
46 define void @memset_5(i8* %a) nounwind {
47 ; X86-LABEL: memset_5:
48 ; X86: # %bb.0: # %entry
49 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
50 ; X86-NEXT: movb $0, 4(%eax)
51 ; X86-NEXT: movl $0, (%eax)
54 ; CORE2-LABEL: memset_5:
55 ; CORE2: # %bb.0: # %entry
56 ; CORE2-NEXT: movb $0, 4(%rdi)
57 ; CORE2-NEXT: movl $0, (%rdi)
60 ; NEHALEM-LABEL: memset_5:
61 ; NEHALEM: # %bb.0: # %entry
62 ; NEHALEM-NEXT: movb $0, 4(%rdi)
63 ; NEHALEM-NEXT: movl $0, (%rdi)
66 call void @llvm.memset.p0i8.i64(i8* %a, i8 0, i64 5, i1 false)
70 define void @memset_7(i8* %a) nounwind {
71 ; X86-LABEL: memset_7:
72 ; X86: # %bb.0: # %entry
73 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
74 ; X86-NEXT: movl $0, 3(%eax)
75 ; X86-NEXT: movl $0, (%eax)
78 ; CORE2-LABEL: memset_7:
79 ; CORE2: # %bb.0: # %entry
80 ; CORE2-NEXT: movl $0, 3(%rdi)
81 ; CORE2-NEXT: movl $0, (%rdi)
84 ; NEHALEM-LABEL: memset_7:
85 ; NEHALEM: # %bb.0: # %entry
86 ; NEHALEM-NEXT: movl $0, 3(%rdi)
87 ; NEHALEM-NEXT: movl $0, (%rdi)
90 call void @llvm.memset.p0i8.i64(i8* %a, i8 0, i64 7, i1 false)
94 define void @memset_8(i8* %a) nounwind {
95 ; X86-LABEL: memset_8:
96 ; X86: # %bb.0: # %entry
97 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
98 ; X86-NEXT: movl $0, 4(%eax)
99 ; X86-NEXT: movl $0, (%eax)
102 ; CORE2-LABEL: memset_8:
103 ; CORE2: # %bb.0: # %entry
104 ; CORE2-NEXT: movq $0, (%rdi)
107 ; NEHALEM-LABEL: memset_8:
108 ; NEHALEM: # %bb.0: # %entry
109 ; NEHALEM-NEXT: movq $0, (%rdi)
112 call void @llvm.memset.p0i8.i64(i8* %a, i8 0, i64 8, i1 false)
116 define void @memset_11(i8* %a) nounwind {
117 ; X86-LABEL: memset_11:
118 ; X86: # %bb.0: # %entry
119 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
120 ; X86-NEXT: movl $0, 7(%eax)
121 ; X86-NEXT: movl $0, 4(%eax)
122 ; X86-NEXT: movl $0, (%eax)
125 ; CORE2-LABEL: memset_11:
126 ; CORE2: # %bb.0: # %entry
127 ; CORE2-NEXT: movl $0, 7(%rdi)
128 ; CORE2-NEXT: movq $0, (%rdi)
131 ; NEHALEM-LABEL: memset_11:
132 ; NEHALEM: # %bb.0: # %entry
133 ; NEHALEM-NEXT: movl $0, 7(%rdi)
134 ; NEHALEM-NEXT: movq $0, (%rdi)
137 call void @llvm.memset.p0i8.i64(i8* %a, i8 0, i64 11, i1 false)
141 define void @memset_13(i8* %a) nounwind {
142 ; X86-LABEL: memset_13:
143 ; X86: # %bb.0: # %entry
144 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
145 ; X86-NEXT: movb $0, 12(%eax)
146 ; X86-NEXT: movl $0, 8(%eax)
147 ; X86-NEXT: movl $0, 4(%eax)
148 ; X86-NEXT: movl $0, (%eax)
151 ; CORE2-LABEL: memset_13:
152 ; CORE2: # %bb.0: # %entry
153 ; CORE2-NEXT: movq $0, 5(%rdi)
154 ; CORE2-NEXT: movq $0, (%rdi)
157 ; NEHALEM-LABEL: memset_13:
158 ; NEHALEM: # %bb.0: # %entry
159 ; NEHALEM-NEXT: movq $0, 5(%rdi)
160 ; NEHALEM-NEXT: movq $0, (%rdi)
163 call void @llvm.memset.p0i8.i64(i8* %a, i8 0, i64 13, i1 false)
167 define void @memset_15(i8* %a) nounwind {
168 ; X86-LABEL: memset_15:
169 ; X86: # %bb.0: # %entry
170 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
171 ; X86-NEXT: movl $0, 11(%eax)
172 ; X86-NEXT: movl $0, 8(%eax)
173 ; X86-NEXT: movl $0, 4(%eax)
174 ; X86-NEXT: movl $0, (%eax)
177 ; CORE2-LABEL: memset_15:
178 ; CORE2: # %bb.0: # %entry
179 ; CORE2-NEXT: movq $0, 7(%rdi)
180 ; CORE2-NEXT: movq $0, (%rdi)
183 ; NEHALEM-LABEL: memset_15:
184 ; NEHALEM: # %bb.0: # %entry
185 ; NEHALEM-NEXT: movq $0, 7(%rdi)
186 ; NEHALEM-NEXT: movq $0, (%rdi)
189 call void @llvm.memset.p0i8.i64(i8* %a, i8 0, i64 15, i1 false)
193 define void @memset_16(i8* %a) nounwind {
194 ; X86-LABEL: memset_16:
195 ; X86: # %bb.0: # %entry
196 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
197 ; X86-NEXT: movl $0, 12(%eax)
198 ; X86-NEXT: movl $0, 8(%eax)
199 ; X86-NEXT: movl $0, 4(%eax)
200 ; X86-NEXT: movl $0, (%eax)
203 ; CORE2-LABEL: memset_16:
204 ; CORE2: # %bb.0: # %entry
205 ; CORE2-NEXT: movq $0, 8(%rdi)
206 ; CORE2-NEXT: movq $0, (%rdi)
209 ; NEHALEM-LABEL: memset_16:
210 ; NEHALEM: # %bb.0: # %entry
211 ; NEHALEM-NEXT: xorps %xmm0, %xmm0
212 ; NEHALEM-NEXT: movups %xmm0, (%rdi)
215 call void @llvm.memset.p0i8.i64(i8* %a, i8 0, i64 16, i1 false)
219 define void @memset_17(i8* %a) nounwind {
220 ; X86-LABEL: memset_17:
221 ; X86: # %bb.0: # %entry
222 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
223 ; X86-NEXT: movb $0, 16(%eax)
224 ; X86-NEXT: movl $0, 12(%eax)
225 ; X86-NEXT: movl $0, 8(%eax)
226 ; X86-NEXT: movl $0, 4(%eax)
227 ; X86-NEXT: movl $0, (%eax)
230 ; CORE2-LABEL: memset_17:
231 ; CORE2: # %bb.0: # %entry
232 ; CORE2-NEXT: movb $0, 16(%rdi)
233 ; CORE2-NEXT: movq $0, 8(%rdi)
234 ; CORE2-NEXT: movq $0, (%rdi)
237 ; NEHALEM-LABEL: memset_17:
238 ; NEHALEM: # %bb.0: # %entry
239 ; NEHALEM-NEXT: xorps %xmm0, %xmm0
240 ; NEHALEM-NEXT: movups %xmm0, (%rdi)
241 ; NEHALEM-NEXT: movb $0, 16(%rdi)
244 call void @llvm.memset.p0i8.i64(i8* %a, i8 0, i64 17, i1 false)
248 define void @memset_19(i8* %a) nounwind {
249 ; X86-LABEL: memset_19:
250 ; X86: # %bb.0: # %entry
251 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
252 ; X86-NEXT: movl $0, 15(%eax)
253 ; X86-NEXT: movl $0, 12(%eax)
254 ; X86-NEXT: movl $0, 8(%eax)
255 ; X86-NEXT: movl $0, 4(%eax)
256 ; X86-NEXT: movl $0, (%eax)
259 ; CORE2-LABEL: memset_19:
260 ; CORE2: # %bb.0: # %entry
261 ; CORE2-NEXT: movl $0, 15(%rdi)
262 ; CORE2-NEXT: movq $0, 8(%rdi)
263 ; CORE2-NEXT: movq $0, (%rdi)
266 ; NEHALEM-LABEL: memset_19:
267 ; NEHALEM: # %bb.0: # %entry
268 ; NEHALEM-NEXT: xorps %xmm0, %xmm0
269 ; NEHALEM-NEXT: movups %xmm0, (%rdi)
270 ; NEHALEM-NEXT: movl $0, 15(%rdi)
273 call void @llvm.memset.p0i8.i64(i8* %a, i8 0, i64 19, i1 false)
277 define void @memset_31(i8* %a) nounwind {
278 ; X86-LABEL: memset_31:
279 ; X86: # %bb.0: # %entry
280 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
281 ; X86-NEXT: movl $0, 27(%eax)
282 ; X86-NEXT: movl $0, 24(%eax)
283 ; X86-NEXT: movl $0, 20(%eax)
284 ; X86-NEXT: movl $0, 16(%eax)
285 ; X86-NEXT: movl $0, 12(%eax)
286 ; X86-NEXT: movl $0, 8(%eax)
287 ; X86-NEXT: movl $0, 4(%eax)
288 ; X86-NEXT: movl $0, (%eax)
291 ; CORE2-LABEL: memset_31:
292 ; CORE2: # %bb.0: # %entry
293 ; CORE2-NEXT: movq $0, 23(%rdi)
294 ; CORE2-NEXT: movq $0, 16(%rdi)
295 ; CORE2-NEXT: movq $0, 8(%rdi)
296 ; CORE2-NEXT: movq $0, (%rdi)
299 ; NEHALEM-LABEL: memset_31:
300 ; NEHALEM: # %bb.0: # %entry
301 ; NEHALEM-NEXT: xorps %xmm0, %xmm0
302 ; NEHALEM-NEXT: movups %xmm0, 15(%rdi)
303 ; NEHALEM-NEXT: movups %xmm0, (%rdi)
306 call void @llvm.memset.p0i8.i64(i8* %a, i8 0, i64 31, i1 false)
310 define void @memset_35(i8* %a) nounwind {
311 ; X86-LABEL: memset_35:
312 ; X86: # %bb.0: # %entry
313 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
314 ; X86-NEXT: movl $0, 31(%eax)
315 ; X86-NEXT: movl $0, 28(%eax)
316 ; X86-NEXT: movl $0, 24(%eax)
317 ; X86-NEXT: movl $0, 20(%eax)
318 ; X86-NEXT: movl $0, 16(%eax)
319 ; X86-NEXT: movl $0, 12(%eax)
320 ; X86-NEXT: movl $0, 8(%eax)
321 ; X86-NEXT: movl $0, 4(%eax)
322 ; X86-NEXT: movl $0, (%eax)
325 ; CORE2-LABEL: memset_35:
326 ; CORE2: # %bb.0: # %entry
327 ; CORE2-NEXT: movl $0, 31(%rdi)
328 ; CORE2-NEXT: movq $0, 24(%rdi)
329 ; CORE2-NEXT: movq $0, 16(%rdi)
330 ; CORE2-NEXT: movq $0, 8(%rdi)
331 ; CORE2-NEXT: movq $0, (%rdi)
334 ; NEHALEM-LABEL: memset_35:
335 ; NEHALEM: # %bb.0: # %entry
336 ; NEHALEM-NEXT: xorps %xmm0, %xmm0
337 ; NEHALEM-NEXT: movups %xmm0, 16(%rdi)
338 ; NEHALEM-NEXT: movups %xmm0, (%rdi)
339 ; NEHALEM-NEXT: movl $0, 31(%rdi)
342 call void @llvm.memset.p0i8.i64(i8* %a, i8 0, i64 35, i1 false)