blob: 8cf83879b090f9eb196680775d05c842f4dbb86c [file] [log] [blame]
John Thompsonbeffa5b2010-11-02 23:01:44 +00001; RUN: llc < %s -march=msp430
2; ModuleID = 'mult-alt-generic.c'
3target datalayout = "e-p:16:16:16-i8:8:8-i16:16:16-i32:16:32-n8:16"
4target triple = "msp430"
5
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
9
10define void @single_m() nounwind {
11entry:
12 call void asm "foo $1,$0", "=*m,*m"(i16* @mout0, i16* @min1) nounwind
13 ret void
14}
15
16define void @single_o() nounwind {
17entry:
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
22 ret void
23}
24
25define void @single_V() nounwind {
26entry:
27 ret void
28}
29
30define void @single_lt() nounwind {
31entry:
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
David Blaikiea79ac142015-02-27 21:17:42 +000036 %tmp = load i16, i16* %in1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +000037 %0 = call i16 asm "foo $1,$0", "=r,<r"(i16 %tmp) nounwind
38 store i16 %0, i16* %out0, align 2
David Blaikiea79ac142015-02-27 21:17:42 +000039 %tmp1 = load i16, i16* %in1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +000040 %1 = call i16 asm "foo $1,$0", "=r,r<"(i16 %tmp1) nounwind
41 store i16 %1, i16* %out0, align 2
42 ret void
43}
44
45define void @single_gt() nounwind {
46entry:
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
David Blaikiea79ac142015-02-27 21:17:42 +000051 %tmp = load i16, i16* %in1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +000052 %0 = call i16 asm "foo $1,$0", "=r,>r"(i16 %tmp) nounwind
53 store i16 %0, i16* %out0, align 2
David Blaikiea79ac142015-02-27 21:17:42 +000054 %tmp1 = load i16, i16* %in1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +000055 %1 = call i16 asm "foo $1,$0", "=r,r>"(i16 %tmp1) nounwind
56 store i16 %1, i16* %out0, align 2
57 ret void
58}
59
60define void @single_r() nounwind {
61entry:
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
David Blaikiea79ac142015-02-27 21:17:42 +000066 %tmp = load i16, i16* %in1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +000067 %0 = call i16 asm "foo $1,$0", "=r,r"(i16 %tmp) nounwind
68 store i16 %0, i16* %out0, align 2
69 ret void
70}
71
72define void @single_i() nounwind {
73entry:
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
78 ret void
79}
80
81define void @single_n() nounwind {
82entry:
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
87 ret void
88}
89
90define void @single_E() nounwind {
91entry:
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
97 ret void
98}
99
100define void @single_F() nounwind {
101entry:
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
107 ret void
108}
109
110define void @single_s() nounwind {
111entry:
112 %out0 = alloca i16, align 2
113 store i16 0, i16* %out0, align 2
114 ret void
115}
116
117define void @single_g() nounwind {
118entry:
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
David Blaikiea79ac142015-02-27 21:17:42 +0000123 %tmp = load i16, i16* %in1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +0000124 %0 = call i16 asm "foo $1,$0", "=r,imr"(i16 %tmp) nounwind
125 store i16 %0, i16* %out0, align 2
David Blaikiea79ac142015-02-27 21:17:42 +0000126 %tmp1 = load i16, i16* @min1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +0000127 %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
131 ret void
132}
133
134define void @single_X() nounwind {
135entry:
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
David Blaikiea79ac142015-02-27 21:17:42 +0000140 %tmp = load i16, i16* %in1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +0000141 %0 = call i16 asm "foo $1,$0", "=r,X"(i16 %tmp) nounwind
142 store i16 %0, i16* %out0, align 2
David Blaikiea79ac142015-02-27 21:17:42 +0000143 %tmp1 = load i16, i16* @min1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +0000144 %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
David Blaikief72d05b2015-03-13 18:20:45 +0000148 %3 = call i16 asm "foo $1,$0", "=r,X"(i16* getelementptr inbounds ([2 x i16], [2 x i16]* @marray, i32 0, i32 0)) nounwind
John Thompsonbeffa5b2010-11-02 23:01:44 +0000149 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
155 ret void
156}
157
158define void @single_p() nounwind {
159entry:
160 %out0 = alloca i16, align 2
161 store i16 0, i16* %out0, align 2
David Blaikief72d05b2015-03-13 18:20:45 +0000162 %0 = call i16 asm "foo $1,$0", "=r,r"(i16* getelementptr inbounds ([2 x i16], [2 x i16]* @marray, i32 0, i32 0)) nounwind
John Thompsonbeffa5b2010-11-02 23:01:44 +0000163 store i16 %0, i16* %out0, align 2
164 ret void
165}
166
167define void @multi_m() nounwind {
168entry:
David Blaikiea79ac142015-02-27 21:17:42 +0000169 %tmp = load i16, i16* @min1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +0000170 call void asm "foo $1,$0", "=*m|r,m|r"(i16* @mout0, i16 %tmp) nounwind
171 ret void
172}
173
174define void @multi_o() nounwind {
175entry:
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
180 ret void
181}
182
183define void @multi_V() nounwind {
184entry:
185 ret void
186}
187
188define void @multi_lt() nounwind {
189entry:
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
David Blaikiea79ac142015-02-27 21:17:42 +0000194 %tmp = load i16, i16* %in1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +0000195 %0 = call i16 asm "foo $1,$0", "=r|r,r|<r"(i16 %tmp) nounwind
196 store i16 %0, i16* %out0, align 2
David Blaikiea79ac142015-02-27 21:17:42 +0000197 %tmp1 = load i16, i16* %in1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +0000198 %1 = call i16 asm "foo $1,$0", "=r|r,r|r<"(i16 %tmp1) nounwind
199 store i16 %1, i16* %out0, align 2
200 ret void
201}
202
203define void @multi_gt() nounwind {
204entry:
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
David Blaikiea79ac142015-02-27 21:17:42 +0000209 %tmp = load i16, i16* %in1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +0000210 %0 = call i16 asm "foo $1,$0", "=r|r,r|>r"(i16 %tmp) nounwind
211 store i16 %0, i16* %out0, align 2
David Blaikiea79ac142015-02-27 21:17:42 +0000212 %tmp1 = load i16, i16* %in1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +0000213 %1 = call i16 asm "foo $1,$0", "=r|r,r|r>"(i16 %tmp1) nounwind
214 store i16 %1, i16* %out0, align 2
215 ret void
216}
217
218define void @multi_r() nounwind {
219entry:
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
David Blaikiea79ac142015-02-27 21:17:42 +0000224 %tmp = load i16, i16* %in1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +0000225 %0 = call i16 asm "foo $1,$0", "=r|r,r|m"(i16 %tmp) nounwind
226 store i16 %0, i16* %out0, align 2
227 ret void
228}
229
230define void @multi_i() nounwind {
231entry:
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
236 ret void
237}
238
239define void @multi_n() nounwind {
240entry:
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
245 ret void
246}
247
248define void @multi_E() nounwind {
249entry:
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
255 ret void
256}
257
258define void @multi_F() nounwind {
259entry:
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
265 ret void
266}
267
268define void @multi_s() nounwind {
269entry:
270 %out0 = alloca i16, align 2
271 store i16 0, i16* %out0, align 2
272 ret void
273}
274
275define void @multi_g() nounwind {
276entry:
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
David Blaikiea79ac142015-02-27 21:17:42 +0000281 %tmp = load i16, i16* %in1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +0000282 %0 = call i16 asm "foo $1,$0", "=r|r,r|imr"(i16 %tmp) nounwind
283 store i16 %0, i16* %out0, align 2
David Blaikiea79ac142015-02-27 21:17:42 +0000284 %tmp1 = load i16, i16* @min1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +0000285 %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
289 ret void
290}
291
292define void @multi_X() nounwind {
293entry:
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
David Blaikiea79ac142015-02-27 21:17:42 +0000298 %tmp = load i16, i16* %in1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +0000299 %0 = call i16 asm "foo $1,$0", "=r|r,r|X"(i16 %tmp) nounwind
300 store i16 %0, i16* %out0, align 2
David Blaikiea79ac142015-02-27 21:17:42 +0000301 %tmp1 = load i16, i16* @min1, align 2
John Thompsonbeffa5b2010-11-02 23:01:44 +0000302 %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
David Blaikief72d05b2015-03-13 18:20:45 +0000306 %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
John Thompsonbeffa5b2010-11-02 23:01:44 +0000307 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
313 ret void
314}
315
316define void @multi_p() nounwind {
317entry:
318 %out0 = alloca i16, align 2
319 store i16 0, i16* %out0, align 2
David Blaikief72d05b2015-03-13 18:20:45 +0000320 %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
John Thompsonbeffa5b2010-11-02 23:01:44 +0000321 store i16 %0, i16* %out0, align 2
322 ret void
323}