079c40252b70aa99943d8ff04de9f6df99752ace
[oota-llvm.git] / test / CodeGen / X86 / memcpy-2.ll
1 ; RUN: llc < %s -mattr=+sse2      -mtriple=i686-apple-darwin | FileCheck %s -check-prefix=SSE2
2 ; RUN: llc < %s -mattr=+sse,-sse2 -mtriple=i686-apple-darwin | FileCheck %s -check-prefix=SSE1
3 ; RUN: llc < %s -mattr=-sse       -mtriple=i686-apple-darwin | FileCheck %s -check-prefix=NOSSE
4
5         %struct.ParmT = type { [25 x i8], i8, i8* }
6 @.str12 = internal constant [25 x i8] c"image\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"              ; <[25 x i8]*> [#uses=1]
7
8 define void @t1(i32 %argc, i8** %argv) nounwind  {
9 entry:
10 ; SSE2: t1:
11 ; SSE2: movaps _.str12, %xmm0
12 ; SSE2: movaps %xmm0
13 ; SSE2: movb $0
14 ; SSE2: movl $0
15 ; SSE2: movl $0
16
17 ; SSE1: t1:
18 ; SSE1: movaps _.str12, %xmm0
19 ; SSE1: movaps %xmm0
20 ; SSE1: movb $0
21 ; SSE1: movl $0
22 ; SSE1: movl $0
23
24 ; NOSSE: t1:
25 ; NOSSE: movb $0
26 ; NOSSE: movl $0
27 ; NOSSE: movl $0
28 ; NOSSE: movl $0
29 ; NOSSE: movl $0
30 ; NOSSE: movl $101
31 ; NOSSE: movl $1734438249
32         %parms.i = alloca [13 x %struct.ParmT]          ; <[13 x %struct.ParmT]*> [#uses=1]
33         %parms1.i = getelementptr [13 x %struct.ParmT]* %parms.i, i32 0, i32 0, i32 0, i32 0            ; <i8*> [#uses=1]
34         call void @llvm.memcpy.i32( i8* %parms1.i, i8* getelementptr ([25 x i8]* @.str12, i32 0, i32 0), i32 25, i32 1 ) nounwind 
35         unreachable
36 }
37
38 ;rdar://7774704
39 %struct.s0 = type { [2 x double] }
40
41 define void @t2(%struct.s0* nocapture %a, %struct.s0* nocapture %b) nounwind ssp {
42 entry:
43 ; SSE2: t2:
44 ; SSE2: movaps (%eax), %xmm0
45 ; SSE2: movaps %xmm0, (%eax)
46
47 ; SSE1: t2:
48 ; SSE1: movaps (%eax), %xmm0
49 ; SSE1: movaps %xmm0, (%eax)
50
51 ; NOSSE: t2:
52 ; NOSSE: movl
53 ; NOSSE: movl
54 ; NOSSE: movl
55 ; NOSSE: movl
56 ; NOSSE: movl
57 ; NOSSE: movl
58 ; NOSSE: movl
59 ; NOSSE: movl
60 ; NOSSE: movl
61 ; NOSSE: movl
62   %tmp2 = bitcast %struct.s0* %a to i8*           ; <i8*> [#uses=1]
63   %tmp3 = bitcast %struct.s0* %b to i8*           ; <i8*> [#uses=1]
64   tail call void @llvm.memcpy.i32(i8* %tmp2, i8* %tmp3, i32 16, i32 16)
65   ret void
66 }
67
68 define void @t3(%struct.s0* nocapture %a, %struct.s0* nocapture %b) nounwind ssp {
69 entry:
70 ; SSE2: t3:
71 ; SSE2: movsd (%eax), %xmm0
72 ; SSE2: movsd 8(%eax), %xmm1
73 ; SSE2: movsd %xmm1, 8(%eax)
74 ; SSE2: movsd %xmm0, (%eax)
75
76 ; SSE1: t3:
77 ; SSE1: movl
78 ; SSE1: movl
79 ; SSE1: movl
80 ; SSE1: movl
81 ; SSE1: movl
82 ; SSE1: movl
83 ; SSE1: movl
84 ; SSE1: movl
85 ; SSE1: movl
86 ; SSE1: movl
87
88 ; NOSSE: t3:
89 ; NOSSE: movl
90 ; NOSSE: movl
91 ; NOSSE: movl
92 ; NOSSE: movl
93 ; NOSSE: movl
94 ; NOSSE: movl
95 ; NOSSE: movl
96 ; NOSSE: movl
97 ; NOSSE: movl
98 ; NOSSE: movl
99   %tmp2 = bitcast %struct.s0* %a to i8*           ; <i8*> [#uses=1]
100   %tmp3 = bitcast %struct.s0* %b to i8*           ; <i8*> [#uses=1]
101   tail call void @llvm.memcpy.i32(i8* %tmp2, i8* %tmp3, i32 16, i32 8)
102   ret void
103 }
104
105 declare void @llvm.memcpy.i32(i8* nocapture, i8* nocapture, i32, i32) nounwind