1 ; RUN: llc < %s -no-integrated-as
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:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
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 void @single_m() nounwind {
12 call void asm "foo $1,$0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(ptr elementtype(i32) @mout0, ptr elementtype(i32) @min1) nounwind
16 define void @single_o() nounwind {
18 %out0 = alloca i32, align 4
19 %index = alloca i32, align 4
20 store i32 0, ptr %out0, align 4
21 store i32 1, ptr %index, align 4
25 define void @single_V() nounwind {
30 define void @single_lt() nounwind {
32 %out0 = alloca i32, align 4
33 %in1 = alloca i32, align 4
34 store i32 0, ptr %out0, align 4
35 store i32 1, ptr %in1, align 4
36 %tmp = load i32, ptr %in1, align 4
37 %0 = call i32 asm "foo $1,$0", "=r,<r,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind
38 store i32 %0, ptr %out0, align 4
39 %tmp1 = load i32, ptr %in1, align 4
40 %1 = call i32 asm "foo $1,$0", "=r,r<,~{dirflag},~{fpsr},~{flags}"(i32 %tmp1) nounwind
41 store i32 %1, ptr %out0, align 4
45 define void @single_gt() nounwind {
47 %out0 = alloca i32, align 4
48 %in1 = alloca i32, align 4
49 store i32 0, ptr %out0, align 4
50 store i32 1, ptr %in1, align 4
51 %tmp = load i32, ptr %in1, align 4
52 %0 = call i32 asm "foo $1,$0", "=r,>r,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind
53 store i32 %0, ptr %out0, align 4
54 %tmp1 = load i32, ptr %in1, align 4
55 %1 = call i32 asm "foo $1,$0", "=r,r>,~{dirflag},~{fpsr},~{flags}"(i32 %tmp1) nounwind
56 store i32 %1, ptr %out0, align 4
60 define void @single_r() nounwind {
62 %out0 = alloca i32, align 4
63 %in1 = alloca i32, align 4
64 store i32 0, ptr %out0, align 4
65 store i32 1, ptr %in1, align 4
66 %tmp = load i32, ptr %in1, align 4
67 %0 = call i32 asm "foo $1,$0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind
68 store i32 %0, ptr %out0, align 4
72 define void @single_i() nounwind {
74 %out0 = alloca i32, align 4
75 store i32 0, ptr %out0, align 4
76 %0 = call i32 asm "foo $1,$0", "=r,i,~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind
77 store i32 %0, ptr %out0, align 4
81 define void @single_n() nounwind {
83 %out0 = alloca i32, align 4
84 store i32 0, ptr %out0, align 4
85 %0 = call i32 asm "foo $1,$0", "=r,n,~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind
86 store i32 %0, ptr %out0, align 4
90 define void @single_E() nounwind {
92 %out0 = alloca double, align 8
93 store double 0.000000e+000, ptr %out0, align 8
94 ; No lowering support.
95 ; %0 = call double asm "foo $1,$0", "=r,E,~{dirflag},~{fpsr},~{flags}"(double 1.000000e+001) nounwind
96 ; store double %0, ptr %out0, align 8
100 define void @single_F() nounwind {
102 %out0 = alloca double, align 8
103 store double 0.000000e+000, ptr %out0, align 8
104 ; No lowering support.
105 ; %0 = call double asm "foo $1,$0", "=r,F,~{dirflag},~{fpsr},~{flags}"(double 1.000000e+000) nounwind
106 ; store double %0, ptr %out0, align 8
110 define void @single_s() nounwind {
112 %out0 = alloca i32, align 4
113 store i32 0, ptr %out0, align 4
117 define void @single_g() nounwind {
119 %out0 = alloca i32, align 4
120 %in1 = alloca i32, align 4
121 store i32 0, ptr %out0, align 4
122 store i32 1, ptr %in1, align 4
123 %tmp = load i32, ptr %in1, align 4
124 %0 = call i32 asm "foo $1,$0", "=r,imr,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind
125 store i32 %0, ptr %out0, align 4
126 %tmp1 = load i32, ptr @min1, align 4
127 %1 = call i32 asm "foo $1,$0", "=r,imr,~{dirflag},~{fpsr},~{flags}"(i32 %tmp1) nounwind
128 store i32 %1, ptr %out0, align 4
129 %2 = call i32 asm "foo $1,$0", "=r,imr,~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind
130 store i32 %2, ptr %out0, align 4
134 define void @single_X() nounwind {
136 %out0 = alloca i32, align 4
137 %in1 = alloca i32, align 4
138 store i32 0, ptr %out0, align 4
139 store i32 1, ptr %in1, align 4
140 %tmp = load i32, ptr %in1, align 4
141 %0 = call i32 asm "foo $1,$0", "=r,X,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind
142 store i32 %0, ptr %out0, align 4
143 %tmp1 = load i32, ptr @min1, align 4
144 %1 = call i32 asm "foo $1,$0", "=r,X,~{dirflag},~{fpsr},~{flags}"(i32 %tmp1) nounwind
145 store i32 %1, ptr %out0, align 4
146 %2 = call i32 asm "foo $1,$0", "=r,X,~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind
147 store i32 %2, ptr %out0, align 4
148 %3 = call i32 asm "foo $1,$0", "=r,X,~{dirflag},~{fpsr},~{flags}"(ptr @marray) nounwind
149 store i32 %3, ptr %out0, align 4
150 %4 = call i32 asm "foo $1,$0", "=r,X,~{dirflag},~{fpsr},~{flags}"(double 1.000000e+001) nounwind
151 store i32 %4, ptr %out0, align 4
152 %5 = call i32 asm "foo $1,$0", "=r,X,~{dirflag},~{fpsr},~{flags}"(double 1.000000e+000) nounwind
153 store i32 %5, ptr %out0, align 4
157 define void @single_p() nounwind {
159 %out0 = alloca i32, align 4
160 store i32 0, ptr %out0, align 4
161 %0 = call i32 asm "foo $1,$0", "=r,im,~{dirflag},~{fpsr},~{flags}"(ptr @marray) nounwind
162 store i32 %0, ptr %out0, align 4
166 define void @multi_m() nounwind {
168 %tmp = load i32, ptr @min1, align 4
169 call void asm "foo $1,$0", "=*m|r,m|r,~{dirflag},~{fpsr},~{flags}"(ptr elementtype(i32) @mout0, i32 %tmp) nounwind
173 define void @multi_o() nounwind {
175 %out0 = alloca i32, align 4
176 %index = alloca i32, align 4
177 store i32 0, ptr %out0, align 4
178 store i32 1, ptr %index, align 4
182 define void @multi_V() nounwind {
187 define void @multi_lt() nounwind {
189 %out0 = alloca i32, align 4
190 %in1 = alloca i32, align 4
191 store i32 0, ptr %out0, align 4
192 store i32 1, ptr %in1, align 4
193 %tmp = load i32, ptr %in1, align 4
194 %0 = call i32 asm "foo $1,$0", "=r|r,r|<r,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind
195 store i32 %0, ptr %out0, align 4
196 %tmp1 = load i32, ptr %in1, align 4
197 %1 = call i32 asm "foo $1,$0", "=r|r,r|r<,~{dirflag},~{fpsr},~{flags}"(i32 %tmp1) nounwind
198 store i32 %1, ptr %out0, align 4
202 define void @multi_gt() nounwind {
204 %out0 = alloca i32, align 4
205 %in1 = alloca i32, align 4
206 store i32 0, ptr %out0, align 4
207 store i32 1, ptr %in1, align 4
208 %tmp = load i32, ptr %in1, align 4
209 %0 = call i32 asm "foo $1,$0", "=r|r,r|>r,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind
210 store i32 %0, ptr %out0, align 4
211 %tmp1 = load i32, ptr %in1, align 4
212 %1 = call i32 asm "foo $1,$0", "=r|r,r|r>,~{dirflag},~{fpsr},~{flags}"(i32 %tmp1) nounwind
213 store i32 %1, ptr %out0, align 4
217 define void @multi_r() nounwind {
219 %out0 = alloca i32, align 4
220 %in1 = alloca i32, align 4
221 store i32 0, ptr %out0, align 4
222 store i32 1, ptr %in1, align 4
223 %tmp = load i32, ptr %in1, align 4
224 %0 = call i32 asm "foo $1,$0", "=r|r,r|m,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind
225 store i32 %0, ptr %out0, align 4
229 define void @multi_i() nounwind {
231 %out0 = alloca i32, align 4
232 store i32 0, ptr %out0, align 4
233 %0 = call i32 asm "foo $1,$0", "=r|r,r|i,~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind
234 store i32 %0, ptr %out0, align 4
238 define void @multi_n() nounwind {
240 %out0 = alloca i32, align 4
241 store i32 0, ptr %out0, align 4
242 %0 = call i32 asm "foo $1,$0", "=r|r,r|n,~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind
243 store i32 %0, ptr %out0, align 4
247 define void @multi_E() nounwind {
249 %out0 = alloca double, align 8
250 store double 0.000000e+000, ptr %out0, align 8
251 ; No lowering support.
252 ; %0 = call double asm "foo $1,$0", "=r|r,r|E,~{dirflag},~{fpsr},~{flags}"(double 1.000000e+001) nounwind
253 ; store double %0, ptr %out0, align 8
257 define void @multi_F() nounwind {
259 %out0 = alloca double, align 8
260 store double 0.000000e+000, ptr %out0, align 8
261 ; No lowering support.
262 ; %0 = call double asm "foo $1,$0", "=r|r,r|F,~{dirflag},~{fpsr},~{flags}"(double 1.000000e+000) nounwind
263 ; store double %0, ptr %out0, align 8
267 define void @multi_s() nounwind {
269 %out0 = alloca i32, align 4
270 store i32 0, ptr %out0, align 4
274 define void @multi_g() nounwind {
276 %out0 = alloca i32, align 4
277 %in1 = alloca i32, align 4
278 store i32 0, ptr %out0, align 4
279 store i32 1, ptr %in1, align 4
280 %tmp = load i32, ptr %in1, align 4
281 %0 = call i32 asm "foo $1,$0", "=r|r,r|imr,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind
282 store i32 %0, ptr %out0, align 4
283 %tmp1 = load i32, ptr @min1, align 4
284 %1 = call i32 asm "foo $1,$0", "=r|r,r|imr,~{dirflag},~{fpsr},~{flags}"(i32 %tmp1) nounwind
285 store i32 %1, ptr %out0, align 4
286 %2 = call i32 asm "foo $1,$0", "=r|r,r|imr,~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind
287 store i32 %2, ptr %out0, align 4
291 define void @multi_X() nounwind {
293 %out0 = alloca i32, align 4
294 %in1 = alloca i32, align 4
295 store i32 0, ptr %out0, align 4
296 store i32 1, ptr %in1, align 4
297 %tmp = load i32, ptr %in1, align 4
298 %0 = call i32 asm "foo $1,$0", "=r|r,r|X,~{dirflag},~{fpsr},~{flags}"(i32 %tmp) nounwind
299 store i32 %0, ptr %out0, align 4
300 %tmp1 = load i32, ptr @min1, align 4
301 %1 = call i32 asm "foo $1,$0", "=r|r,r|X,~{dirflag},~{fpsr},~{flags}"(i32 %tmp1) nounwind
302 store i32 %1, ptr %out0, align 4
303 %2 = call i32 asm "foo $1,$0", "=r|r,r|X,~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind
304 store i32 %2, ptr %out0, align 4
305 %3 = call i32 asm "foo $1,$0", "=r|r,r|X,~{dirflag},~{fpsr},~{flags}"(ptr @marray) nounwind
306 store i32 %3, ptr %out0, align 4
307 %4 = call i32 asm "foo $1,$0", "=r|r,r|X,~{dirflag},~{fpsr},~{flags}"(double 1.000000e+001) nounwind
308 store i32 %4, ptr %out0, align 4
309 %5 = call i32 asm "foo $1,$0", "=r|r,r|X,~{dirflag},~{fpsr},~{flags}"(double 1.000000e+000) nounwind
310 store i32 %5, ptr %out0, align 4
314 define void @multi_p() nounwind {
316 %out0 = alloca i32, align 4
317 store i32 0, ptr %out0, align 4
318 %0 = call i32 asm "foo $1,$0", "=r|r,r|im,~{dirflag},~{fpsr},~{flags}"(ptr @marray) nounwind
319 store i32 %0, ptr %out0, align 4