1 ; RUN: llc < %s -mattr=+sse2 -mtriple=i686-apple-darwin -mcpu=core2 | FileCheck %s -check-prefix=SSE2
2 ; RUN: llc < %s -mattr=-sse -mtriple=i686-apple-darwin -mcpu=core2 | FileCheck %s -check-prefix=NOSSE
3 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=core2 | FileCheck %s -check-prefix=X86-64
5 @.str = 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"
6 @.str2 = internal constant [30 x i8] c"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx\00", align 4
8 define void @t1(i32 %argc, i8** %argv) nounwind {
11 ; SSE2: movaps _.str, %xmm0
24 ; NOSSE: movl $1734438249
27 ; X86-64: movaps _.str(%rip), %xmm0
28 ; X86-64: movaps %xmm0
31 %tmp1 = alloca [25 x i8]
32 %tmp2 = bitcast [25 x i8]* %tmp1 to i8*
33 call void @llvm.memcpy.i32( i8* %tmp2, i8* getelementptr ([25 x i8]* @.str, i32 0, i32 0), i32 25, i32 1 ) nounwind
38 %struct.s0 = type { [2 x double] }
40 define void @t2(%struct.s0* nocapture %a, %struct.s0* nocapture %b) nounwind ssp {
43 ; SSE2: movaps (%eax), %xmm0
44 ; SSE2: movaps %xmm0, (%eax)
59 ; X86-64: movaps (%rsi), %xmm0
60 ; X86-64: movaps %xmm0, (%rdi)
61 %tmp2 = bitcast %struct.s0* %a to i8* ; <i8*> [#uses=1]
62 %tmp3 = bitcast %struct.s0* %b to i8* ; <i8*> [#uses=1]
63 tail call void @llvm.memcpy.i32(i8* %tmp2, i8* %tmp3, i32 16, i32 16)
67 define void @t3(%struct.s0* nocapture %a, %struct.s0* nocapture %b) nounwind ssp {
70 ; SSE2: movups (%eax), %xmm0
71 ; SSE2: movups %xmm0, (%eax)
86 ; X86-64: movups (%rsi), %xmm0
87 ; X86-64: movups %xmm0, (%rdi)
88 %tmp2 = bitcast %struct.s0* %a to i8* ; <i8*> [#uses=1]
89 %tmp3 = bitcast %struct.s0* %b to i8* ; <i8*> [#uses=1]
90 tail call void @llvm.memcpy.i32(i8* %tmp2, i8* %tmp3, i32 16, i32 8)
94 define void @t4() nounwind {
97 ; SSE2: movups _.str2, %xmm0
98 ; SSE2: movaps %xmm0, (%esp)
99 ; SSE2: movw $120, 28(%esp)
100 ; SSE2: movl $2021161080
101 ; SSE2: movl $2021161080
102 ; SSE2: movl $2021161080
106 ; NOSSE: movl $2021161080
107 ; NOSSE: movl $2021161080
108 ; NOSSE: movl $2021161080
109 ; NOSSE: movl $2021161080
110 ; NOSSE: movl $2021161080
111 ; NOSSE: movl $2021161080
112 ; NOSSE: movl $2021161080
115 ; X86-64: movabsq $8680820740569200760, %rax
117 ; X86-64: movups _.str2(%rip), %xmm0
118 ; X86-64: movaps %xmm0, -40(%rsp)
120 ; X86-64: movl $2021161080
121 %tmp1 = alloca [30 x i8]
122 %tmp2 = bitcast [30 x i8]* %tmp1 to i8*
123 call void @llvm.memcpy.i32(i8* %tmp2, i8* getelementptr inbounds ([30 x i8]* @.str2, i32 0, i32 0), i32 30, i32 1)
127 declare void @llvm.memcpy.i32(i8* nocapture, i8* nocapture, i32, i32) nounwind