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