[Heikki Kultala] This patch contains the ABI changes for the TCE target.
[clang.git] / test / CodeGen / mult-alt-x86.c
blob84011f2d5303cc30cc1d14ad62692bfc3aab99fb
1 // RUN: %clang_cc1 -triple i686 -emit-llvm %s -o - | FileCheck %s
2 // RUN: %clang_cc1 -triple x86_64 -emit-llvm %s -o - | FileCheck %s
4 int mout0;
5 int min1;
6 int marray[2];
7 double dout0;
8 double din1;
10 // CHECK: @single_R
11 void single_R()
13 // CHECK: asm "foo $1,$0", "=R,R[[CLOBBERS:[a-zA-Z0-9@%{},~_ ]*\"]](i32 {{[a-zA-Z0-9@%]+}})
14 asm("foo %1,%0" : "=R" (mout0) : "R" (min1));
17 // CHECK: @single_q
18 void single_q()
20 // CHECK: asm "foo $1,$0", "=q,q[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
21 asm("foo %1,%0" : "=q" (mout0) : "q" (min1));
24 // CHECK: @single_Q
25 void single_Q()
27 // CHECK: asm "foo $1,$0", "=Q,Q[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
28 asm("foo %1,%0" : "=Q" (mout0) : "Q" (min1));
31 // CHECK: @single_a
32 void single_a()
34 // CHECK: asm "foo $1,$0", "={ax},{ax}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
35 asm("foo %1,%0" : "=a" (mout0) : "a" (min1));
38 // CHECK: @single_b
39 void single_b()
41 // CHECK: asm "foo $1,$0", "={bx},{bx}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
42 asm("foo %1,%0" : "=b" (mout0) : "b" (min1));
45 // CHECK: @single_c
46 void single_c()
48 // CHECK: asm "foo $1,$0", "={cx},{cx}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
49 asm("foo %1,%0" : "=c" (mout0) : "c" (min1));
52 // CHECK: @single_d
53 void single_d()
55 // CHECK: asm "foo $1,$0", "={dx},{dx}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
56 asm("foo %1,%0" : "=d" (mout0) : "d" (min1));
59 // CHECK: @single_S
60 void single_S()
62 // CHECK: asm "foo $1,$0", "={si},{si}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
63 asm("foo %1,%0" : "=S" (mout0) : "S" (min1));
66 // CHECK: @single_D
67 void single_D()
69 // CHECK: asm "foo $1,$0", "={di},{di}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
70 asm("foo %1,%0" : "=D" (mout0) : "D" (min1));
73 // CHECK: @single_A
74 void single_A()
76 // CHECK: asm "foo $1,$0", "=A,A[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
77 asm("foo %1,%0" : "=A" (mout0) : "A" (min1));
80 // CHECK: @single_f
81 void single_f()
83 //FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
86 // CHECK: @single_t
87 void single_t()
89 //FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
92 // CHECK: @single_u
93 void single_u()
95 //FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
98 // CHECK: @single_y
99 void single_y()
101 // CHECK: call double asm "foo $1,$0", "=y,y[[CLOBBERS]](double {{[a-zA-Z0-9@%]+}})
102 asm("foo %1,%0" : "=y" (dout0) : "y" (din1));
105 // CHECK: @single_x
106 void single_x()
108 // CHECK: asm "foo $1,$0", "=x,x[[CLOBBERS]](double {{[a-zA-Z0-9@%]+}})
109 asm("foo %1,%0" : "=x" (dout0) : "x" (din1));
112 // CHECK: @single_Y
113 void single_Y0()
115 // Y constraint currently broken.
116 //asm("foo %1,%0" : "=Y0" (mout0) : "Y0" (min1));
117 //asm("foo %1,%0" : "=Yz" (mout0) : "Yz" (min1));
118 //asm("foo %1,%0" : "=Yt" (mout0) : "Yt" (min1));
119 //asm("foo %1,%0" : "=Yi" (mout0) : "Yi" (min1));
120 //asm("foo %1,%0" : "=Ym" (mout0) : "Ym" (min1));
123 // CHECK: @single_I
124 void single_I()
126 // CHECK: asm "foo $1,$0", "=*m,I[[CLOBBERS]](i32* @mout0, i32 1)
127 asm("foo %1,%0" : "=m" (mout0) : "I" (1));
130 // CHECK: @single_J
131 void single_J()
133 // CHECK: asm "foo $1,$0", "=*m,J[[CLOBBERS]](i32* @mout0, i32 1)
134 asm("foo %1,%0" : "=m" (mout0) : "J" (1));
137 // CHECK: @single_K
138 void single_K()
140 // CHECK: asm "foo $1,$0", "=*m,K[[CLOBBERS]](i32* @mout0, i32 1)
141 asm("foo %1,%0" : "=m" (mout0) : "K" (1));
144 // CHECK: @single_L
145 void single_L()
147 // CHECK: asm "foo $1,$0", "=*m,L[[CLOBBERS]](i32* @mout0, i32 1)
148 asm("foo %1,%0" : "=m" (mout0) : "L" (1));
151 // CHECK: @single_M
152 void single_M()
154 // CHECK: asm "foo $1,$0", "=*m,M[[CLOBBERS]](i32* @mout0, i32 1)
155 asm("foo %1,%0" : "=m" (mout0) : "M" (1));
158 // CHECK: @single_N
159 void single_N()
161 // CHECK: asm "foo $1,$0", "=*m,N[[CLOBBERS]](i32* @mout0, i32 1)
162 asm("foo %1,%0" : "=m" (mout0) : "N" (1));
165 // CHECK: @single_G
166 void single_G()
168 // CHECK: asm "foo $1,$0", "=*m,G[[CLOBBERS]](i32* @mout0, double {{1.[0]+e[+]*[0]+}})
169 asm("foo %1,%0" : "=m" (mout0) : "G" (1.0));
172 // CHECK: @single_C
173 void single_C()
175 // CHECK: asm "foo $1,$0", "=*m,C[[CLOBBERS]](i32* @mout0, double {{1.[0]+e[+]*[0]+}})
176 asm("foo %1,%0" : "=m" (mout0) : "C" (1.0));
179 // CHECK: @single_e
180 void single_e()
182 // CHECK: asm "foo $1,$0", "=*m,e[[CLOBBERS]](i32* @mout0, i32 1)
183 asm("foo %1,%0" : "=m" (mout0) : "e" (1));
186 // CHECK: @single_Z
187 void single_Z()
189 // CHECK: asm "foo $1,$0", "=*m,Z[[CLOBBERS]](i32* @mout0, i32 1)
190 asm("foo %1,%0" : "=m" (mout0) : "Z" (1));
193 // CHECK: @multi_R
194 void multi_R()
196 // CHECK: asm "foo $1,$0", "=*r|R|m,r|R|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
197 asm("foo %1,%0" : "=r,=R,=m" (mout0) : "r,R,m" (min1));
200 // CHECK: @multi_q
201 void multi_q()
203 // CHECK: asm "foo $1,$0", "=*r|q|m,r|q|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
204 asm("foo %1,%0" : "=r,=q,=m" (mout0) : "r,q,m" (min1));
207 // CHECK: @multi_Q
208 void multi_Q()
210 // CHECK: asm "foo $1,$0", "=*r|Q|m,r|Q|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
211 asm("foo %1,%0" : "=r,=Q,=m" (mout0) : "r,Q,m" (min1));
214 // CHECK: @multi_a
215 void multi_a()
217 // CHECK: asm "foo $1,$0", "=*r|{ax}|m,r|{ax}|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
218 asm("foo %1,%0" : "=r,=a,=m" (mout0) : "r,a,m" (min1));
221 // CHECK: @multi_b
222 void multi_b()
224 // CHECK: asm "foo $1,$0", "=*r|{bx}|m,r|{bx}|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
225 asm("foo %1,%0" : "=r,=b,=m" (mout0) : "r,b,m" (min1));
228 // CHECK: @multi_c
229 void multi_c()
231 // CHECK: asm "foo $1,$0", "=*r|{cx}|m,r|{cx}|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
232 asm("foo %1,%0" : "=r,=c,=m" (mout0) : "r,c,m" (min1));
235 // CHECK: @multi_d
236 void multi_d()
238 // CHECK: asm "foo $1,$0", "=*r|{dx}|m,r|{dx}[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
239 asm("foo %1,%0" : "=r,=d,=m" (mout0) : "r,d" (min1));
242 // CHECK: @multi_S
243 void multi_S()
245 // CHECK: asm "foo $1,$0", "=*r|{si}|m,r|{si}|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
246 asm("foo %1,%0" : "=r,=S,=m" (mout0) : "r,S,m" (min1));
249 // CHECK: @multi_D
250 void multi_D()
252 // CHECK: asm "foo $1,$0", "=*r|{di}|m,r|{di}|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
253 asm("foo %1,%0" : "=r,=D,=m" (mout0) : "r,D,m" (min1));
256 // CHECK: @multi_A
257 void multi_A()
259 // CHECK: asm "foo $1,$0", "=*r|A|m,r|A|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
260 asm("foo %1,%0" : "=r,=A,=m" (mout0) : "r,A,m" (min1));
263 // CHECK: @multi_f
264 void multi_f()
266 //FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
269 // CHECK: @multi_t
270 void multi_t()
272 //FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
275 // CHECK: @multi_u
276 void multi_u()
278 //FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
281 // CHECK: @multi_y
282 void multi_y()
284 // CHECK: asm "foo $1,$0", "=*r|y|m,r|y|m[[CLOBBERS]](double* @dout0, double {{[a-zA-Z0-9@%]+}})
285 asm("foo %1,%0" : "=r,=y,=m" (dout0) : "r,y,m" (din1));
288 // CHECK: @multi_x
289 void multi_x()
291 // CHECK: asm "foo $1,$0", "=*r|x|m,r|x|m[[CLOBBERS]](double* @dout0, double {{[a-zA-Z0-9@%]+}})
292 asm("foo %1,%0" : "=r,=x,=m" (dout0) : "r,x,m" (din1));
295 // CHECK: @multi_Y
296 void multi_Y0()
298 // Y constraint currently broken.
299 //asm("foo %1,%0" : "=r,=Y0,=m" (mout0) : "r,Y0,m" (min1));
300 //asm("foo %1,%0" : "=r,=Yz,=m" (mout0) : "r,Yz,m" (min1));
301 //asm("foo %1,%0" : "=r,=Yt,=m" (mout0) : "r,Yt,m" (min1));
302 //asm("foo %1,%0" : "=r,=Yi,=m" (mout0) : "r,Yi,m" (min1));
303 //asm("foo %1,%0" : "=r,=Ym,=m" (mout0) : "r,Ym,m" (min1));
306 // CHECK: @multi_I
307 void multi_I()
309 // CHECK: asm "foo $1,$0", "=*r|m|m,r|I|m[[CLOBBERS]](i32* @mout0, i32 1)
310 asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,I,m" (1));
313 // CHECK: @multi_J
314 void multi_J()
316 // CHECK: asm "foo $1,$0", "=*r|m|m,r|J|m[[CLOBBERS]](i32* @mout0, i32 1)
317 asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,J,m" (1));
320 // CHECK: @multi_K
321 void multi_K()
323 // CHECK: asm "foo $1,$0", "=*r|m|m,r|K|m[[CLOBBERS]](i32* @mout0, i32 1)
324 asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,K,m" (1));
327 // CHECK: @multi_L
328 void multi_L()
330 // CHECK: asm "foo $1,$0", "=*r|m|m,r|L|m[[CLOBBERS]](i32* @mout0, i32 1)
331 asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,L,m" (1));
334 // CHECK: @multi_M
335 void multi_M()
337 // CHECK: asm "foo $1,$0", "=*r|m|m,r|M|m[[CLOBBERS]](i32* @mout0, i32 1)
338 asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,M,m" (1));
341 // CHECK: @multi_N
342 void multi_N()
344 // CHECK: asm "foo $1,$0", "=*r|m|m,r|N|m[[CLOBBERS]](i32* @mout0, i32 1)
345 asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,N,m" (1));
348 // CHECK: @multi_G
349 void multi_G()
351 // CHECK: asm "foo $1,$0", "=*r|m|m,r|G|m[[CLOBBERS]](i32* @mout0, double {{1.[0]+e[+]*[0]+}})
352 asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,G,m" (1.0));
355 // CHECK: @multi_C
356 void multi_C()
358 // CHECK: asm "foo $1,$0", "=*r|m|m,r|C|m[[CLOBBERS]](i32* @mout0, double {{1.[0]+e[+]*[0]+}})
359 asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,C,m" (1.0));
362 // CHECK: @multi_e
363 void multi_e()
365 // CHECK: asm "foo $1,$0", "=*r|m|m,r|e|m[[CLOBBERS]](i32* @mout0, i32 1)
366 asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,e,m" (1));
369 // CHECK: @multi_Z
370 void multi_Z()
372 // CHECK: asm "foo $1,$0", "=*r|m|m,r|Z|m[[CLOBBERS]](i32* @mout0, i32 1)
373 asm("foo %1,%0" : "=r,=m,=m" (mout0) : "r,Z,m" (1));