1 ; RUN: llc < %s -march=msp430 -no-integrated-as
2 ; ModuleID = 'mult-alt-generic.c'
3 target datalayout = "e-p:16:16:16-i8:8:8-i16:16:16-i32:16:32-n8:16"
4 target triple = "msp430"
6 @mout0 = common global i16 0, align 2
7 @min1 = common global i16 0, align 2
8 @marray = common global [2 x i16] zeroinitializer, align 2
10 define void @single_m() nounwind {
12 call void asm "foo $1,$0", "=*m,*m"(i16* elementtype(i16) @mout0, i16* elementtype(i16) @min1) nounwind
16 define void @single_o() nounwind {
18 %out0 = alloca i16, align 2
19 %index = alloca i16, align 2
20 store i16 0, i16* %out0, align 2
21 store i16 1, i16* %index, align 2
25 define void @single_V() nounwind {
30 define void @single_lt() nounwind {
32 %out0 = alloca i16, align 2
33 %in1 = alloca i16, align 2
34 store i16 0, i16* %out0, align 2
35 store i16 1, i16* %in1, align 2
36 %tmp = load i16, i16* %in1, align 2
37 %0 = call i16 asm "foo $1,$0", "=r,<r"(i16 %tmp) nounwind
38 store i16 %0, i16* %out0, align 2
39 %tmp1 = load i16, i16* %in1, align 2
40 %1 = call i16 asm "foo $1,$0", "=r,r<"(i16 %tmp1) nounwind
41 store i16 %1, i16* %out0, align 2
45 define void @single_gt() nounwind {
47 %out0 = alloca i16, align 2
48 %in1 = alloca i16, align 2
49 store i16 0, i16* %out0, align 2
50 store i16 1, i16* %in1, align 2
51 %tmp = load i16, i16* %in1, align 2
52 %0 = call i16 asm "foo $1,$0", "=r,>r"(i16 %tmp) nounwind
53 store i16 %0, i16* %out0, align 2
54 %tmp1 = load i16, i16* %in1, align 2
55 %1 = call i16 asm "foo $1,$0", "=r,r>"(i16 %tmp1) nounwind
56 store i16 %1, i16* %out0, align 2
60 define void @single_r() nounwind {
62 %out0 = alloca i16, align 2
63 %in1 = alloca i16, align 2
64 store i16 0, i16* %out0, align 2
65 store i16 1, i16* %in1, align 2
66 %tmp = load i16, i16* %in1, align 2
67 %0 = call i16 asm "foo $1,$0", "=r,r"(i16 %tmp) nounwind
68 store i16 %0, i16* %out0, align 2
72 define void @single_i() nounwind {
74 %out0 = alloca i16, align 2
75 store i16 0, i16* %out0, align 2
76 %0 = call i16 asm "foo $1,$0", "=r,i"(i16 1) nounwind
77 store i16 %0, i16* %out0, align 2
81 define void @single_n() nounwind {
83 %out0 = alloca i16, align 2
84 store i16 0, i16* %out0, align 2
85 %0 = call i16 asm "foo $1,$0", "=r,n"(i16 1) nounwind
86 store i16 %0, i16* %out0, align 2
90 define void @single_E() nounwind {
92 %out0 = alloca double, align 8
93 store double 0.000000e+000, double* %out0, align 8
94 ; No lowering support.
95 ; %0 = call double asm "foo $1,$0", "=r,E"(double 1.000000e+001) nounwind
96 ; store double %0, double* %out0, align 8
100 define void @single_F() nounwind {
102 %out0 = alloca double, align 8
103 store double 0.000000e+000, double* %out0, align 8
104 ; No lowering support.
105 ; %0 = call double asm "foo $1,$0", "=r,F"(double 1.000000e+000) nounwind
106 ; store double %0, double* %out0, align 8
110 define void @single_s() nounwind {
112 %out0 = alloca i16, align 2
113 store i16 0, i16* %out0, align 2
117 define void @single_g() nounwind {
119 %out0 = alloca i16, align 2
120 %in1 = alloca i16, align 2
121 store i16 0, i16* %out0, align 2
122 store i16 1, i16* %in1, align 2
123 %tmp = load i16, i16* %in1, align 2
124 %0 = call i16 asm "foo $1,$0", "=r,imr"(i16 %tmp) nounwind
125 store i16 %0, i16* %out0, align 2
126 %tmp1 = load i16, i16* @min1, align 2
127 %1 = call i16 asm "foo $1,$0", "=r,imr"(i16 %tmp1) nounwind
128 store i16 %1, i16* %out0, align 2
129 %2 = call i16 asm "foo $1,$0", "=r,imr"(i16 1) nounwind
130 store i16 %2, i16* %out0, align 2
134 define void @single_X() nounwind {
136 %out0 = alloca i16, align 2
137 %in1 = alloca i16, align 2
138 store i16 0, i16* %out0, align 2
139 store i16 1, i16* %in1, align 2
140 %tmp = load i16, i16* %in1, align 2
141 %0 = call i16 asm "foo $1,$0", "=r,X"(i16 %tmp) nounwind
142 store i16 %0, i16* %out0, align 2
143 %tmp1 = load i16, i16* @min1, align 2
144 %1 = call i16 asm "foo $1,$0", "=r,X"(i16 %tmp1) nounwind
145 store i16 %1, i16* %out0, align 2
146 %2 = call i16 asm "foo $1,$0", "=r,X"(i16 1) nounwind
147 store i16 %2, i16* %out0, align 2
148 %3 = call i16 asm "foo $1,$0", "=r,X"(i16* getelementptr inbounds ([2 x i16], [2 x i16]* @marray, i32 0, i32 0)) nounwind
149 store i16 %3, i16* %out0, align 2
150 ; No lowering support.
151 ; %4 = call i16 asm "foo $1,$0", "=r,X"(double 1.000000e+001) nounwind
152 ; store i16 %4, i16* %out0, align 2
153 ; %5 = call i16 asm "foo $1,$0", "=r,X"(double 1.000000e+000) nounwind
154 ; store i16 %5, i16* %out0, align 2
158 define void @single_p() nounwind {
160 %out0 = alloca i16, align 2
161 store i16 0, i16* %out0, align 2
162 %0 = call i16 asm "foo $1,$0", "=r,r"(i16* getelementptr inbounds ([2 x i16], [2 x i16]* @marray, i32 0, i32 0)) nounwind
163 store i16 %0, i16* %out0, align 2
167 define void @multi_m() nounwind {
169 %tmp = load i16, i16* @min1, align 2
170 call void asm "foo $1,$0", "=*m|r,m|r"(i16* elementtype(i16) @mout0, i16 %tmp) nounwind
174 define void @multi_o() nounwind {
176 %out0 = alloca i16, align 2
177 %index = alloca i16, align 2
178 store i16 0, i16* %out0, align 2
179 store i16 1, i16* %index, align 2
183 define void @multi_V() nounwind {
188 define void @multi_lt() nounwind {
190 %out0 = alloca i16, align 2
191 %in1 = alloca i16, align 2
192 store i16 0, i16* %out0, align 2
193 store i16 1, i16* %in1, align 2
194 %tmp = load i16, i16* %in1, align 2
195 %0 = call i16 asm "foo $1,$0", "=r|r,r|<r"(i16 %tmp) nounwind
196 store i16 %0, i16* %out0, align 2
197 %tmp1 = load i16, i16* %in1, align 2
198 %1 = call i16 asm "foo $1,$0", "=r|r,r|r<"(i16 %tmp1) nounwind
199 store i16 %1, i16* %out0, align 2
203 define void @multi_gt() nounwind {
205 %out0 = alloca i16, align 2
206 %in1 = alloca i16, align 2
207 store i16 0, i16* %out0, align 2
208 store i16 1, i16* %in1, align 2
209 %tmp = load i16, i16* %in1, align 2
210 %0 = call i16 asm "foo $1,$0", "=r|r,r|>r"(i16 %tmp) nounwind
211 store i16 %0, i16* %out0, align 2
212 %tmp1 = load i16, i16* %in1, align 2
213 %1 = call i16 asm "foo $1,$0", "=r|r,r|r>"(i16 %tmp1) nounwind
214 store i16 %1, i16* %out0, align 2
218 define void @multi_r() nounwind {
220 %out0 = alloca i16, align 2
221 %in1 = alloca i16, align 2
222 store i16 0, i16* %out0, align 2
223 store i16 1, i16* %in1, align 2
224 %tmp = load i16, i16* %in1, align 2
225 %0 = call i16 asm "foo $1,$0", "=r|r,r|m"(i16 %tmp) nounwind
226 store i16 %0, i16* %out0, align 2
230 define void @multi_i() nounwind {
232 %out0 = alloca i16, align 2
233 store i16 0, i16* %out0, align 2
234 %0 = call i16 asm "foo $1,$0", "=r|r,r|i"(i16 1) nounwind
235 store i16 %0, i16* %out0, align 2
239 define void @multi_n() nounwind {
241 %out0 = alloca i16, align 2
242 store i16 0, i16* %out0, align 2
243 %0 = call i16 asm "foo $1,$0", "=r|r,r|n"(i16 1) nounwind
244 store i16 %0, i16* %out0, align 2
248 define void @multi_E() nounwind {
250 %out0 = alloca double, align 8
251 store double 0.000000e+000, double* %out0, align 8
252 ; No lowering support.
253 ; %0 = call double asm "foo $1,$0", "=r|r,r|E"(double 1.000000e+001) nounwind
254 ; store double %0, double* %out0, align 8
258 define void @multi_F() nounwind {
260 %out0 = alloca double, align 8
261 store double 0.000000e+000, double* %out0, align 8
262 ; No lowering support.
263 ; %0 = call double asm "foo $1,$0", "=r|r,r|F"(double 1.000000e+000) nounwind
264 ; store double %0, double* %out0, align 8
268 define void @multi_s() nounwind {
270 %out0 = alloca i16, align 2
271 store i16 0, i16* %out0, align 2
275 define void @multi_g() nounwind {
277 %out0 = alloca i16, align 2
278 %in1 = alloca i16, align 2
279 store i16 0, i16* %out0, align 2
280 store i16 1, i16* %in1, align 2
281 %tmp = load i16, i16* %in1, align 2
282 %0 = call i16 asm "foo $1,$0", "=r|r,r|imr"(i16 %tmp) nounwind
283 store i16 %0, i16* %out0, align 2
284 %tmp1 = load i16, i16* @min1, align 2
285 %1 = call i16 asm "foo $1,$0", "=r|r,r|imr"(i16 %tmp1) nounwind
286 store i16 %1, i16* %out0, align 2
287 %2 = call i16 asm "foo $1,$0", "=r|r,r|imr"(i16 1) nounwind
288 store i16 %2, i16* %out0, align 2
292 define void @multi_X() nounwind {
294 %out0 = alloca i16, align 2
295 %in1 = alloca i16, align 2
296 store i16 0, i16* %out0, align 2
297 store i16 1, i16* %in1, align 2
298 %tmp = load i16, i16* %in1, align 2
299 %0 = call i16 asm "foo $1,$0", "=r|r,r|X"(i16 %tmp) nounwind
300 store i16 %0, i16* %out0, align 2
301 %tmp1 = load i16, i16* @min1, align 2
302 %1 = call i16 asm "foo $1,$0", "=r|r,r|X"(i16 %tmp1) nounwind
303 store i16 %1, i16* %out0, align 2
304 %2 = call i16 asm "foo $1,$0", "=r|r,r|X"(i16 1) nounwind
305 store i16 %2, i16* %out0, align 2
306 %3 = call i16 asm "foo $1,$0", "=r|r,r|X"(i16* getelementptr inbounds ([2 x i16], [2 x i16]* @marray, i32 0, i32 0)) nounwind
307 store i16 %3, i16* %out0, align 2
308 ; No lowering support.
309 ; %4 = call i16 asm "foo $1,$0", "=r|r,r|X"(double 1.000000e+001) nounwind
310 ; store i16 %4, i16* %out0, align 2
311 ; %5 = call i16 asm "foo $1,$0", "=r|r,r|X"(double 1.000000e+000) nounwind
312 ; store i16 %5, i16* %out0, align 2
316 define void @multi_p() nounwind {
318 %out0 = alloca i16, align 2
319 store i16 0, i16* %out0, align 2
320 %0 = call i16 asm "foo $1,$0", "=r|r,r|r"(i16* getelementptr inbounds ([2 x i16], [2 x i16]* @marray, i32 0, i32 0)) nounwind
321 store i16 %0, i16* %out0, align 2