mult-alt-x86.c
9.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
// RUN: %clang_cc1 -triple i686 -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -triple x86_64 -emit-llvm %s -o - | FileCheck %s
int mout0;
int min1;
int marray[2];
double dout0;
double din1;
// CHECK: @single_R
void single_R()
{
// CHECK: asm "foo $1,$0", "=R,R[[CLOBBERS:[a-zA-Z0-9@%{},~_ ]*\"]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=R" (mout0) : "R" (min1));
}
// CHECK: @single_q
void single_q()
{
// CHECK: asm "foo $1,$0", "=q,q[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=q" (mout0) : "q" (min1));
}
// CHECK: @single_Q
void single_Q()
{
// CHECK: asm "foo $1,$0", "=Q,Q[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=Q" (mout0) : "Q" (min1));
}
// CHECK: @single_a
void single_a()
{
// CHECK: asm "foo $1,$0", "={ax},{ax}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=a" (mout0) : "a" (min1));
}
// CHECK: @single_b
void single_b()
{
// CHECK: asm "foo $1,$0", "={bx},{bx}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=b" (mout0) : "b" (min1));
}
// CHECK: @single_c
void single_c()
{
// CHECK: asm "foo $1,$0", "={cx},{cx}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=c" (mout0) : "c" (min1));
}
// CHECK: @single_d
void single_d()
{
// CHECK: asm "foo $1,$0", "={dx},{dx}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=d" (mout0) : "d" (min1));
}
// CHECK: @single_S
void single_S()
{
// CHECK: asm "foo $1,$0", "={si},{si}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=S" (mout0) : "S" (min1));
}
// CHECK: @single_D
void single_D()
{
// CHECK: asm "foo $1,$0", "={di},{di}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=D" (mout0) : "D" (min1));
}
// CHECK: @single_A
void single_A()
{
// CHECK: asm "foo $1,$0", "=A,A[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=A" (mout0) : "A" (min1));
}
// CHECK: @single_f
void single_f()
{
//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
}
// CHECK: @single_t
void single_t()
{
//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
}
// CHECK: @single_u
void single_u()
{
//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
}
// CHECK: @single_y
void single_y()
{
// CHECK: call double asm "foo $1,$0", "=y,y[[CLOBBERS]](double {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=y" (dout0) : "y" (din1));
}
// CHECK: @single_x
void single_x()
{
// CHECK: asm "foo $1,$0", "=x,x[[CLOBBERS]](double {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=x" (dout0) : "x" (din1));
}
// CHECK: @single_Y
void single_Y()
{
// 'Y' constraint currently broken.
//asm("foo %1,%0" : "=Y0" (mout0) : "Y0" (min1));
//asm("foo %1,%0" : "=Yz" (mout0) : "Yz" (min1));
//asm("foo %1,%0" : "=Yt" (mout0) : "Yt" (min1));
//asm("foo %1,%0" : "=Yi" (mout0) : "Yi" (min1));
//asm("foo %1,%0" : "=Ym" (mout0) : "Ym" (min1));
}
// CHECK: @single_I
void single_I()
{
// CHECK: asm "foo $1,$0", "=*m,I[[CLOBBERS]](i32* @mout0, i32 1)
asm("foo %1,%0" : "=m" (mout0) : "I" (1));
}
// CHECK: @single_J
void single_J()
{
// CHECK: asm "foo $1,$0", "=*m,J[[CLOBBERS]](i32* @mout0, i32 1)
asm("foo %1,%0" : "=m" (mout0) : "J" (1));
}
// CHECK: @single_K
void single_K()
{
// CHECK: asm "foo $1,$0", "=*m,K[[CLOBBERS]](i32* @mout0, i32 1)
asm("foo %1,%0" : "=m" (mout0) : "K" (1));
}
// CHECK: @single_L
void single_L()
{
// CHECK: asm "foo $1,$0", "=*m,L[[CLOBBERS]](i32* @mout0, i32 255)
asm("foo %1,%0" : "=m" (mout0) : "L" (0xff));
// CHECK: asm "foo $1,$0", "=*m,L[[CLOBBERS]](i32* @mout0, i32 65535)
asm("foo %1,%0" : "=m" (mout0) : "L" (0xffff));
// CHECK: asm "foo $1,$0", "=*m,L[[CLOBBERS]](i32* @mout0, i32 -1)
asm("foo %1,%0" : "=m" (mout0) : "L" (0xffffffff));
}
// CHECK: @single_M
void single_M()
{
// CHECK: asm "foo $1,$0", "=*m,M[[CLOBBERS]](i32* @mout0, i32 1)
asm("foo %1,%0" : "=m" (mout0) : "M" (1));
}
// CHECK: @single_N
void single_N()
{
// CHECK: asm "foo $1,$0", "=*m,N[[CLOBBERS]](i32* @mout0, i32 1)
asm("foo %1,%0" : "=m" (mout0) : "N" (1));
}
// CHECK: @single_G
void single_G()
{
// CHECK: asm "foo $1,$0", "=*m,G[[CLOBBERS]](i32* @mout0, double {{1.[0]+e[+]*[0]+}})
asm("foo %1,%0" : "=m" (mout0) : "G" (1.0));
}
// CHECK: @single_C
void single_C()
{
// CHECK: asm "foo $1,$0", "=*m,C[[CLOBBERS]](i32* @mout0, double {{1.[0]+e[+]*[0]+}})
asm("foo %1,%0" : "=m" (mout0) : "C" (1.0));
}
// CHECK: @single_e
void single_e()
{
// CHECK: asm "foo $1,$0", "=*m,e[[CLOBBERS]](i32* @mout0, i32 1)
asm("foo %1,%0" : "=m" (mout0) : "e" (1));
}
// CHECK: @single_Z
void single_Z()
{
// CHECK: asm "foo $1,$0", "=*m,Z[[CLOBBERS]](i32* @mout0, i32 1)
asm("foo %1,%0" : "=m" (mout0) : "Z" (1));
}
// CHECK: @multi_R
void multi_R()
{
// CHECK: asm "foo $1,$0", "=*r|R|m,r|R|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,R,m" (mout0) : "r,R,m" (min1));
}
// CHECK: @multi_q
void multi_q()
{
// CHECK: asm "foo $1,$0", "=*r|q|m,r|q|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,q,m" (mout0) : "r,q,m" (min1));
}
// CHECK: @multi_Q
void multi_Q()
{
// CHECK: asm "foo $1,$0", "=*r|Q|m,r|Q|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,Q,m" (mout0) : "r,Q,m" (min1));
}
// CHECK: @multi_a
void multi_a()
{
// CHECK: asm "foo $1,$0", "=*r|{ax}|m,r|{ax}|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,a,m" (mout0) : "r,a,m" (min1));
}
// CHECK: @multi_b
void multi_b()
{
// CHECK: asm "foo $1,$0", "=*r|{bx}|m,r|{bx}|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,b,m" (mout0) : "r,b,m" (min1));
}
// CHECK: @multi_c
void multi_c()
{
// CHECK: asm "foo $1,$0", "=*r|{cx}|m,r|{cx}|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,c,m" (mout0) : "r,c,m" (min1));
}
// CHECK: @multi_d
void multi_d()
{
// CHECK: asm "foo $1,$0", "=*r|{dx}|m,r|{dx}|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,d,m" (mout0) : "r,d,m" (min1));
}
// CHECK: @multi_S
void multi_S()
{
// CHECK: asm "foo $1,$0", "=*r|{si}|m,r|{si}|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,S,m" (mout0) : "r,S,m" (min1));
}
// CHECK: @multi_D
void multi_D()
{
// CHECK: asm "foo $1,$0", "=*r|{di}|m,r|{di}|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,D,m" (mout0) : "r,D,m" (min1));
}
// CHECK: @multi_A
void multi_A()
{
// CHECK: asm "foo $1,$0", "=*r|A|m,r|A|m[[CLOBBERS]](i32* @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,A,m" (mout0) : "r,A,m" (min1));
}
// CHECK: @multi_f
void multi_f()
{
//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
}
// CHECK: @multi_t
void multi_t()
{
//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
}
// CHECK: @multi_u
void multi_u()
{
//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
}
// CHECK: @multi_y
void multi_y()
{
// CHECK: asm "foo $1,$0", "=*r|y|m,r|y|m[[CLOBBERS]](double* @dout0, double {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,y,m" (dout0) : "r,y,m" (din1));
}
// CHECK: @multi_x
void multi_x()
{
// CHECK: asm "foo $1,$0", "=*r|x|m,r|x|m[[CLOBBERS]](double* @dout0, double {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,x,m" (dout0) : "r,x,m" (din1));
}
// CHECK: @multi_Y
void multi_Y0()
{
// Y constraint currently broken.
//asm("foo %1,%0" : "=r,Y0,m" (mout0) : "r,Y0,m" (min1));
//asm("foo %1,%0" : "=r,Yz,m" (mout0) : "r,Yz,m" (min1));
//asm("foo %1,%0" : "=r,Yt,m" (mout0) : "r,Yt,m" (min1));
//asm("foo %1,%0" : "=r,Yi,m" (mout0) : "r,Yi,m" (min1));
//asm("foo %1,%0" : "=r,Ym,m" (mout0) : "r,Ym,m" (min1));
}
// CHECK: @multi_I
void multi_I()
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|I|m[[CLOBBERS]](i32* @mout0, i32 1)
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,I,m" (1));
}
// CHECK: @multi_J
void multi_J()
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|J|m[[CLOBBERS]](i32* @mout0, i32 1)
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,J,m" (1));
}
// CHECK: @multi_K
void multi_K()
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|K|m[[CLOBBERS]](i32* @mout0, i32 1)
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,K,m" (1));
}
// CHECK: @multi_L
void multi_L()
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|L|m[[CLOBBERS]](i32* @mout0, i32 1)
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,L,m" (1));
}
// CHECK: @multi_M
void multi_M()
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|M|m[[CLOBBERS]](i32* @mout0, i32 1)
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,M,m" (1));
}
// CHECK: @multi_N
void multi_N()
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|N|m[[CLOBBERS]](i32* @mout0, i32 1)
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,N,m" (1));
}
// CHECK: @multi_G
void multi_G()
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|G|m[[CLOBBERS]](i32* @mout0, double {{1.[0]+e[+]*[0]+}})
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,G,m" (1.0));
}
// CHECK: @multi_C
void multi_C()
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|C|m[[CLOBBERS]](i32* @mout0, double {{1.[0]+e[+]*[0]+}})
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,C,m" (1.0));
}
// CHECK: @multi_e
void multi_e()
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|e|m[[CLOBBERS]](i32* @mout0, i32 1)
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,e,m" (1));
}
// CHECK: @multi_Z
void multi_Z()
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|Z|m[[CLOBBERS]](i32* @mout0, i32 1)
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,Z,m" (1));
}