blob: f2f35ef4dbc45d565eb81fd7434fe63ea1c07eea [file] [log] [blame]
Scott Michel9c0c6b22008-11-21 02:56:16 +00001; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
Scott Michel18fae692008-11-25 17:29:43 +00002; RUN: grep {stqd.*0(\$3)} %t1.s | count 4
3; RUN: grep {stqd.*16(\$3)} %t1.s | count 4
4; RUN: grep 16256 %t1.s | count 2
5; RUN: grep 16384 %t1.s | count 1
Scott Michelf0569be2008-12-27 04:51:36 +00006; RUN: grep 771 %t1.s | count 4
7; RUN: grep 515 %t1.s | count 2
8; RUN: grep 1799 %t1.s | count 2
Evan Cheng3927f432009-03-25 20:20:11 +00009; RUN: grep 1543 %t1.s | count 5
10; RUN: grep 1029 %t1.s | count 3
Scott Michel18fae692008-11-25 17:29:43 +000011; RUN: grep {shli.*, 4} %t1.s | count 4
12; RUN: grep stqx %t1.s | count 4
Evan Cheng3927f432009-03-25 20:20:11 +000013; RUN: grep ilhu %t1.s | count 11
14; RUN: grep iohl %t1.s | count 8
15; RUN: grep shufb %t1.s | count 15
Scott Michelf0569be2008-12-27 04:51:36 +000016; RUN: grep frds %t1.s | count 1
Scott Michel9c0c6b22008-11-21 02:56:16 +000017
18; ModuleID = 'stores.bc'
19target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
20target triple = "spu"
21
Scott Michel18fae692008-11-25 17:29:43 +000022define void @store_v16i8_1(<16 x i8>* %a) nounwind {
23entry:
24 store <16 x i8> < i8 1, i8 2, i8 1, i8 1, i8 1, i8 2, i8 1, i8 1, i8 1, i8 2, i8 1, i8 1, i8 1, i8 2, i8 1, i8 1 >, <16 x i8>* %a
25 ret void
26}
27
28define void @store_v16i8_2(<16 x i8>* %a) nounwind {
29entry:
30 %arrayidx = getelementptr <16 x i8>* %a, i32 1
31 store <16 x i8> < i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2 >, <16 x i8>* %arrayidx
32 ret void
33}
34
35define void @store_v16i8_3(<16 x i8>* %a, i32 %i) nounwind {
36entry:
37 %arrayidx = getelementptr <16 x i8>* %a, i32 %i
38 store <16 x i8> < i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1 >, <16 x i8>* %arrayidx
39 ret void
40}
41
42define void @store_v8i16_1(<8 x i16>* %a) nounwind {
43entry:
44 store <8 x i16> < i16 1, i16 2, i16 1, i16 1, i16 1, i16 2, i16 1, i16 1 >, <8 x i16>* %a
45 ret void
46}
47
48define void @store_v8i16_2(<8 x i16>* %a) nounwind {
49entry:
50 %arrayidx = getelementptr <8 x i16>* %a, i16 1
51 store <8 x i16> < i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2 >, <8 x i16>* %arrayidx
52 ret void
53}
54
55define void @store_v8i16_3(<8 x i16>* %a, i32 %i) nounwind {
56entry:
57 %arrayidx = getelementptr <8 x i16>* %a, i32 %i
58 store <8 x i16> < i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1 >, <8 x i16>* %arrayidx
59 ret void
60}
61
62define void @store_v4i32_1(<4 x i32>* %a) nounwind {
63entry:
64 store <4 x i32> < i32 1, i32 2, i32 1, i32 1 >, <4 x i32>* %a
65 ret void
66}
67
68define void @store_v4i32_2(<4 x i32>* %a) nounwind {
69entry:
70 %arrayidx = getelementptr <4 x i32>* %a, i32 1
71 store <4 x i32> < i32 2, i32 2, i32 2, i32 2 >, <4 x i32>* %arrayidx
72 ret void
73}
74
75define void @store_v4i32_3(<4 x i32>* %a, i32 %i) nounwind {
76entry:
77 %arrayidx = getelementptr <4 x i32>* %a, i32 %i
78 store <4 x i32> < i32 1, i32 1, i32 1, i32 1 >, <4 x i32>* %arrayidx
79 ret void
80}
81
Scott Michel9c0c6b22008-11-21 02:56:16 +000082define void @store_v4f32_1(<4 x float>* %a) nounwind {
83entry:
84 store <4 x float> < float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00 >, <4 x float>* %a
85 ret void
86}
87
88define void @store_v4f32_2(<4 x float>* %a) nounwind {
89entry:
90 %arrayidx = getelementptr <4 x float>* %a, i32 1
91 store <4 x float> < float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00 >, <4 x float>* %arrayidx
92 ret void
93}
Scott Michel18fae692008-11-25 17:29:43 +000094
95define void @store_v4f32_3(<4 x float>* %a, i32 %i) nounwind {
96entry:
97 %arrayidx = getelementptr <4 x float>* %a, i32 %i
98 store <4 x float> < float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00 >, <4 x float>* %arrayidx
99 ret void
100}
Scott Michelf0569be2008-12-27 04:51:36 +0000101
102; Test truncating stores:
103
104define zeroext i8 @tstore_i16_i8(i16 signext %val, i8* %dest) nounwind {
105entry:
106 %conv = trunc i16 %val to i8
107 store i8 %conv, i8* %dest
108 ret i8 %conv
109}
110
111define zeroext i8 @tstore_i32_i8(i32 %val, i8* %dest) nounwind {
112entry:
113 %conv = trunc i32 %val to i8
114 store i8 %conv, i8* %dest
115 ret i8 %conv
116}
117
118define signext i16 @tstore_i32_i16(i32 %val, i16* %dest) nounwind {
119entry:
120 %conv = trunc i32 %val to i16
121 store i16 %conv, i16* %dest
122 ret i16 %conv
123}
124
125define zeroext i8 @tstore_i64_i8(i64 %val, i8* %dest) nounwind {
126entry:
127 %conv = trunc i64 %val to i8
128 store i8 %conv, i8* %dest
129 ret i8 %conv
130}
131
132define signext i16 @tstore_i64_i16(i64 %val, i16* %dest) nounwind {
133entry:
134 %conv = trunc i64 %val to i16
135 store i16 %conv, i16* %dest
136 ret i16 %conv
137}
138
139define i32 @tstore_i64_i32(i64 %val, i32* %dest) nounwind {
140entry:
141 %conv = trunc i64 %val to i32
142 store i32 %conv, i32* %dest
143 ret i32 %conv
144}
145
146define float @tstore_f64_f32(double %val, float* %dest) nounwind {
147entry:
148 %conv = fptrunc double %val to float
149 store float %conv, float* %dest
150 ret float %conv
151}