blob: 128799d0f5636d2691c34c868432206ccccd962c [file] [log] [blame]
Benjamin Kramer50dd09b2011-01-07 11:35:21 +00001; RUN: llc -mtriple=i386-apple-darwin -mcpu=yonah < %s | FileCheck %s
Evan Cheng1887c1c2008-08-21 21:00:15 +00002
3declare void @llvm.memset.i32(i8*, i8, i32, i32) nounwind
4
Evan Cheng94107ba2010-04-01 18:19:11 +00005define fastcc void @t1() nounwind {
Evan Cheng1887c1c2008-08-21 21:00:15 +00006entry:
Evan Cheng94107ba2010-04-01 18:19:11 +00007; CHECK: t1:
Evan Cheng461f1fc2011-01-06 07:58:36 +00008; CHECK: pxor %xmm0, %xmm0
9; CHECK: movups %xmm0, 160
10; CHECK: movups %xmm0, 144
11; CHECK: movups %xmm0, 128
12; CHECK: movups %xmm0, 112
13; CHECK: movups %xmm0, 96
14; CHECK: movups %xmm0, 80
15; CHECK: movups %xmm0, 64
16; CHECK: movups %xmm0, 48
17; CHECK: movups %xmm0, 32
18; CHECK: movups %xmm0, 16
19; CHECK: movups %xmm0, 0
20; CHECK: movl $0, 184
21; CHECK: movl $0, 180
22; CHECK: movl $0, 176
Evan Cheng255f20f2010-04-01 06:04:33 +000023 call void @llvm.memset.i32( i8* null, i8 0, i32 188, i32 1 ) nounwind
24 unreachable
Evan Cheng1887c1c2008-08-21 21:00:15 +000025}
Evan Cheng94107ba2010-04-01 18:19:11 +000026
27define fastcc void @t2(i8 signext %c) nounwind {
28entry:
29; CHECK: t2:
Chris Lattner1eb1b682010-09-22 05:49:14 +000030; CHECK: calll _memset
Evan Cheng94107ba2010-04-01 18:19:11 +000031 call void @llvm.memset.i32( i8* undef, i8 %c, i32 76, i32 1 ) nounwind
32 unreachable
33}
Benjamin Kramer8c06aa12011-01-02 19:44:58 +000034
35declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
36
37define void @t3(i8* nocapture %s, i8 %a) nounwind {
38entry:
39 tail call void @llvm.memset.p0i8.i32(i8* %s, i8 %a, i32 8, i32 1, i1 false)
40 ret void
41; CHECK: t3:
42; CHECK: imull $16843009
43}
44
Benjamin Kramer80220362011-01-02 19:57:05 +000045define void @t4(i8* nocapture %s, i8 %a) nounwind {
46entry:
47 tail call void @llvm.memset.p0i8.i32(i8* %s, i8 %a, i32 15, i32 1, i1 false)
48 ret void
49; CHECK: t4:
50; CHECK: imull $16843009
51; CHECK-NOT: imul
52; CHECK: ret
53}