summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/x86_64/abi/test_passing_floats.c
blob: 42fff97b0ef7e1b8474b0ae46a5e9164da89f0b3 (plain)
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
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
/* This is an autogenerated file. Do not edit.  */

#include "defines.h"
#include "macros.h"
#include "args.h"

struct IntegerRegisters iregs;
struct FloatRegisters fregs;
unsigned int num_iregs, num_fregs;

/* This struct holds values for argument checking.  */
struct 
{
  float f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23;
} values_float;

struct 
{
  double f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23;
} values_double;

struct 
{
  ldouble f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23;
} values_ldouble;

void
fun_check_float_passing_float8_values (float f0 ATTRIBUTE_UNUSED, float f1 ATTRIBUTE_UNUSED, float f2 ATTRIBUTE_UNUSED, float f3 ATTRIBUTE_UNUSED, float f4 ATTRIBUTE_UNUSED, float f5 ATTRIBUTE_UNUSED, float f6 ATTRIBUTE_UNUSED, float f7 ATTRIBUTE_UNUSED)
{
  /* Check argument values.  */
  assert (values_float.f0 == f0);
  assert (values_float.f1 == f1);
  assert (values_float.f2 == f2);
  assert (values_float.f3 == f3);
  assert (values_float.f4 == f4);
  assert (values_float.f5 == f5);
  assert (values_float.f6 == f6);
  assert (values_float.f7 == f7);

}

void
fun_check_float_passing_float8_regs (float f0 ATTRIBUTE_UNUSED, float f1 ATTRIBUTE_UNUSED, float f2 ATTRIBUTE_UNUSED, float f3 ATTRIBUTE_UNUSED, float f4 ATTRIBUTE_UNUSED, float f5 ATTRIBUTE_UNUSED, float f6 ATTRIBUTE_UNUSED, float f7 ATTRIBUTE_UNUSED)
{
  /* Check register contents.  */
  check_float_arguments;
}

void
fun_check_float_passing_float16_values (float f0 ATTRIBUTE_UNUSED, float f1 ATTRIBUTE_UNUSED, float f2 ATTRIBUTE_UNUSED, float f3 ATTRIBUTE_UNUSED, float f4 ATTRIBUTE_UNUSED, float f5 ATTRIBUTE_UNUSED, float f6 ATTRIBUTE_UNUSED, float f7 ATTRIBUTE_UNUSED, float f8 ATTRIBUTE_UNUSED, float f9 ATTRIBUTE_UNUSED, float f10 ATTRIBUTE_UNUSED, float f11 ATTRIBUTE_UNUSED, float f12 ATTRIBUTE_UNUSED, float f13 ATTRIBUTE_UNUSED, float f14 ATTRIBUTE_UNUSED, float f15 ATTRIBUTE_UNUSED)
{
  /* Check argument values.  */
  assert (values_float.f0 == f0);
  assert (values_float.f1 == f1);
  assert (values_float.f2 == f2);
  assert (values_float.f3 == f3);
  assert (values_float.f4 == f4);
  assert (values_float.f5 == f5);
  assert (values_float.f6 == f6);
  assert (values_float.f7 == f7);
  assert (values_float.f8 == f8);
  assert (values_float.f9 == f9);
  assert (values_float.f10 == f10);
  assert (values_float.f11 == f11);
  assert (values_float.f12 == f12);
  assert (values_float.f13 == f13);
  assert (values_float.f14 == f14);
  assert (values_float.f15 == f15);

}

void
fun_check_float_passing_float16_regs (float f0 ATTRIBUTE_UNUSED, float f1 ATTRIBUTE_UNUSED, float f2 ATTRIBUTE_UNUSED, float f3 ATTRIBUTE_UNUSED, float f4 ATTRIBUTE_UNUSED, float f5 ATTRIBUTE_UNUSED, float f6 ATTRIBUTE_UNUSED, float f7 ATTRIBUTE_UNUSED, float f8 ATTRIBUTE_UNUSED, float f9 ATTRIBUTE_UNUSED, float f10 ATTRIBUTE_UNUSED, float f11 ATTRIBUTE_UNUSED, float f12 ATTRIBUTE_UNUSED, float f13 ATTRIBUTE_UNUSED, float f14 ATTRIBUTE_UNUSED, float f15 ATTRIBUTE_UNUSED)
{
  /* Check register contents.  */
  check_float_arguments;
}

void
fun_check_float_passing_float20_values (float f0 ATTRIBUTE_UNUSED, float f1 ATTRIBUTE_UNUSED, float f2 ATTRIBUTE_UNUSED, float f3 ATTRIBUTE_UNUSED, float f4 ATTRIBUTE_UNUSED, float f5 ATTRIBUTE_UNUSED, float f6 ATTRIBUTE_UNUSED, float f7 ATTRIBUTE_UNUSED, float f8 ATTRIBUTE_UNUSED, float f9 ATTRIBUTE_UNUSED, float f10 ATTRIBUTE_UNUSED, float f11 ATTRIBUTE_UNUSED, float f12 ATTRIBUTE_UNUSED, float f13 ATTRIBUTE_UNUSED, float f14 ATTRIBUTE_UNUSED, float f15 ATTRIBUTE_UNUSED, float f16 ATTRIBUTE_UNUSED, float f17 ATTRIBUTE_UNUSED, float f18 ATTRIBUTE_UNUSED, float f19 ATTRIBUTE_UNUSED)
{
  /* Check argument values.  */
  assert (values_float.f0 == f0);
  assert (values_float.f1 == f1);
  assert (values_float.f2 == f2);
  assert (values_float.f3 == f3);
  assert (values_float.f4 == f4);
  assert (values_float.f5 == f5);
  assert (values_float.f6 == f6);
  assert (values_float.f7 == f7);
  assert (values_float.f8 == f8);
  assert (values_float.f9 == f9);
  assert (values_float.f10 == f10);
  assert (values_float.f11 == f11);
  assert (values_float.f12 == f12);
  assert (values_float.f13 == f13);
  assert (values_float.f14 == f14);
  assert (values_float.f15 == f15);
  assert (values_float.f16 == f16);
  assert (values_float.f17 == f17);
  assert (values_float.f18 == f18);
  assert (values_float.f19 == f19);

}

void
fun_check_float_passing_float20_regs (float f0 ATTRIBUTE_UNUSED, float f1 ATTRIBUTE_UNUSED, float f2 ATTRIBUTE_UNUSED, float f3 ATTRIBUTE_UNUSED, float f4 ATTRIBUTE_UNUSED, float f5 ATTRIBUTE_UNUSED, float f6 ATTRIBUTE_UNUSED, float f7 ATTRIBUTE_UNUSED, float f8 ATTRIBUTE_UNUSED, float f9 ATTRIBUTE_UNUSED, float f10 ATTRIBUTE_UNUSED, float f11 ATTRIBUTE_UNUSED, float f12 ATTRIBUTE_UNUSED, float f13 ATTRIBUTE_UNUSED, float f14 ATTRIBUTE_UNUSED, float f15 ATTRIBUTE_UNUSED, float f16 ATTRIBUTE_UNUSED, float f17 ATTRIBUTE_UNUSED, float f18 ATTRIBUTE_UNUSED, float f19 ATTRIBUTE_UNUSED)
{
  /* Check register contents.  */
  check_float_arguments;
}

void
fun_check_float_passing_double8_values (double f0 ATTRIBUTE_UNUSED, double f1 ATTRIBUTE_UNUSED, double f2 ATTRIBUTE_UNUSED, double f3 ATTRIBUTE_UNUSED, double f4 ATTRIBUTE_UNUSED, double f5 ATTRIBUTE_UNUSED, double f6 ATTRIBUTE_UNUSED, double f7 ATTRIBUTE_UNUSED)
{
  /* Check argument values.  */
  assert (values_double.f0 == f0);
  assert (values_double.f1 == f1);
  assert (values_double.f2 == f2);
  assert (values_double.f3 == f3);
  assert (values_double.f4 == f4);
  assert (values_double.f5 == f5);
  assert (values_double.f6 == f6);
  assert (values_double.f7 == f7);

}

void
fun_check_float_passing_double8_regs (double f0 ATTRIBUTE_UNUSED, double f1 ATTRIBUTE_UNUSED, double f2 ATTRIBUTE_UNUSED, double f3 ATTRIBUTE_UNUSED, double f4 ATTRIBUTE_UNUSED, double f5 ATTRIBUTE_UNUSED, double f6 ATTRIBUTE_UNUSED, double f7 ATTRIBUTE_UNUSED)
{
  /* Check register contents.  */
  check_double_arguments;
}

void
fun_check_float_passing_double16_values (double f0 ATTRIBUTE_UNUSED, double f1 ATTRIBUTE_UNUSED, double f2 ATTRIBUTE_UNUSED, double f3 ATTRIBUTE_UNUSED, double f4 ATTRIBUTE_UNUSED, double f5 ATTRIBUTE_UNUSED, double f6 ATTRIBUTE_UNUSED, double f7 ATTRIBUTE_UNUSED, double f8 ATTRIBUTE_UNUSED, double f9 ATTRIBUTE_UNUSED, double f10 ATTRIBUTE_UNUSED, double f11 ATTRIBUTE_UNUSED, double f12 ATTRIBUTE_UNUSED, double f13 ATTRIBUTE_UNUSED, double f14 ATTRIBUTE_UNUSED, double f15 ATTRIBUTE_UNUSED)
{
  /* Check argument values.  */
  assert (values_double.f0 == f0);
  assert (values_double.f1 == f1);
  assert (values_double.f2 == f2);
  assert (values_double.f3 == f3);
  assert (values_double.f4 == f4);
  assert (values_double.f5 == f5);
  assert (values_double.f6 == f6);
  assert (values_double.f7 == f7);
  assert (values_double.f8 == f8);
  assert (values_double.f9 == f9);
  assert (values_double.f10 == f10);
  assert (values_double.f11 == f11);
  assert (values_double.f12 == f12);
  assert (values_double.f13 == f13);
  assert (values_double.f14 == f14);
  assert (values_double.f15 == f15);

}

void
fun_check_float_passing_double16_regs (double f0 ATTRIBUTE_UNUSED, double f1 ATTRIBUTE_UNUSED, double f2 ATTRIBUTE_UNUSED, double f3 ATTRIBUTE_UNUSED, double f4 ATTRIBUTE_UNUSED, double f5 ATTRIBUTE_UNUSED, double f6 ATTRIBUTE_UNUSED, double f7 ATTRIBUTE_UNUSED, double f8 ATTRIBUTE_UNUSED, double f9 ATTRIBUTE_UNUSED, double f10 ATTRIBUTE_UNUSED, double f11 ATTRIBUTE_UNUSED, double f12 ATTRIBUTE_UNUSED, double f13 ATTRIBUTE_UNUSED, double f14 ATTRIBUTE_UNUSED, double f15 ATTRIBUTE_UNUSED)
{
  /* Check register contents.  */
  check_double_arguments;
}

void
fun_check_float_passing_double20_values (double f0 ATTRIBUTE_UNUSED, double f1 ATTRIBUTE_UNUSED, double f2 ATTRIBUTE_UNUSED, double f3 ATTRIBUTE_UNUSED, double f4 ATTRIBUTE_UNUSED, double f5 ATTRIBUTE_UNUSED, double f6 ATTRIBUTE_UNUSED, double f7 ATTRIBUTE_UNUSED, double f8 ATTRIBUTE_UNUSED, double f9 ATTRIBUTE_UNUSED, double f10 ATTRIBUTE_UNUSED, double f11 ATTRIBUTE_UNUSED, double f12 ATTRIBUTE_UNUSED, double f13 ATTRIBUTE_UNUSED, double f14 ATTRIBUTE_UNUSED, double f15 ATTRIBUTE_UNUSED, double f16 ATTRIBUTE_UNUSED, double f17 ATTRIBUTE_UNUSED, double f18 ATTRIBUTE_UNUSED, double f19 ATTRIBUTE_UNUSED)
{
  /* Check argument values.  */
  assert (values_double.f0 == f0);
  assert (values_double.f1 == f1);
  assert (values_double.f2 == f2);
  assert (values_double.f3 == f3);
  assert (values_double.f4 == f4);
  assert (values_double.f5 == f5);
  assert (values_double.f6 == f6);
  assert (values_double.f7 == f7);
  assert (values_double.f8 == f8);
  assert (values_double.f9 == f9);
  assert (values_double.f10 == f10);
  assert (values_double.f11 == f11);
  assert (values_double.f12 == f12);
  assert (values_double.f13 == f13);
  assert (values_double.f14 == f14);
  assert (values_double.f15 == f15);
  assert (values_double.f16 == f16);
  assert (values_double.f17 == f17);
  assert (values_double.f18 == f18);
  assert (values_double.f19 == f19);

}

void
fun_check_float_passing_double20_regs (double f0 ATTRIBUTE_UNUSED, double f1 ATTRIBUTE_UNUSED, double f2 ATTRIBUTE_UNUSED, double f3 ATTRIBUTE_UNUSED, double f4 ATTRIBUTE_UNUSED, double f5 ATTRIBUTE_UNUSED, double f6 ATTRIBUTE_UNUSED, double f7 ATTRIBUTE_UNUSED, double f8 ATTRIBUTE_UNUSED, double f9 ATTRIBUTE_UNUSED, double f10 ATTRIBUTE_UNUSED, double f11 ATTRIBUTE_UNUSED, double f12 ATTRIBUTE_UNUSED, double f13 ATTRIBUTE_UNUSED, double f14 ATTRIBUTE_UNUSED, double f15 ATTRIBUTE_UNUSED, double f16 ATTRIBUTE_UNUSED, double f17 ATTRIBUTE_UNUSED, double f18 ATTRIBUTE_UNUSED, double f19 ATTRIBUTE_UNUSED)
{
  /* Check register contents.  */
  check_double_arguments;
}

void
fun_check_x87_passing_ldouble8_values (ldouble f0 ATTRIBUTE_UNUSED, ldouble f1 ATTRIBUTE_UNUSED, ldouble f2 ATTRIBUTE_UNUSED, ldouble f3 ATTRIBUTE_UNUSED, ldouble f4 ATTRIBUTE_UNUSED, ldouble f5 ATTRIBUTE_UNUSED, ldouble f6 ATTRIBUTE_UNUSED, ldouble f7 ATTRIBUTE_UNUSED)
{
  /* Check argument values.  */
  assert (values_ldouble.f0 == f0);
  assert (values_ldouble.f1 == f1);
  assert (values_ldouble.f2 == f2);
  assert (values_ldouble.f3 == f3);
  assert (values_ldouble.f4 == f4);
  assert (values_ldouble.f5 == f5);
  assert (values_ldouble.f6 == f6);
  assert (values_ldouble.f7 == f7);

}

void
fun_check_x87_passing_ldouble8_regs (ldouble f0 ATTRIBUTE_UNUSED, ldouble f1 ATTRIBUTE_UNUSED, ldouble f2 ATTRIBUTE_UNUSED, ldouble f3 ATTRIBUTE_UNUSED, ldouble f4 ATTRIBUTE_UNUSED, ldouble f5 ATTRIBUTE_UNUSED, ldouble f6 ATTRIBUTE_UNUSED, ldouble f7 ATTRIBUTE_UNUSED)
{
  /* Check register contents.  */
  check_ldouble_arguments;
}

void
fun_check_x87_passing_ldouble16_values (ldouble f0 ATTRIBUTE_UNUSED, ldouble f1 ATTRIBUTE_UNUSED, ldouble f2 ATTRIBUTE_UNUSED, ldouble f3 ATTRIBUTE_UNUSED, ldouble f4 ATTRIBUTE_UNUSED, ldouble f5 ATTRIBUTE_UNUSED, ldouble f6 ATTRIBUTE_UNUSED, ldouble f7 ATTRIBUTE_UNUSED, ldouble f8 ATTRIBUTE_UNUSED, ldouble f9 ATTRIBUTE_UNUSED, ldouble f10 ATTRIBUTE_UNUSED, ldouble f11 ATTRIBUTE_UNUSED, ldouble f12 ATTRIBUTE_UNUSED, ldouble f13 ATTRIBUTE_UNUSED, ldouble f14 ATTRIBUTE_UNUSED, ldouble f15 ATTRIBUTE_UNUSED)
{
  /* Check argument values.  */
  assert (values_ldouble.f0 == f0);
  assert (values_ldouble.f1 == f1);
  assert (values_ldouble.f2 == f2);
  assert (values_ldouble.f3 == f3);
  assert (values_ldouble.f4 == f4);
  assert (values_ldouble.f5 == f5);
  assert (values_ldouble.f6 == f6);
  assert (values_ldouble.f7 == f7);
  assert (values_ldouble.f8 == f8);
  assert (values_ldouble.f9 == f9);
  assert (values_ldouble.f10 == f10);
  assert (values_ldouble.f11 == f11);
  assert (values_ldouble.f12 == f12);
  assert (values_ldouble.f13 == f13);
  assert (values_ldouble.f14 == f14);
  assert (values_ldouble.f15 == f15);

}

void
fun_check_x87_passing_ldouble16_regs (ldouble f0 ATTRIBUTE_UNUSED, ldouble f1 ATTRIBUTE_UNUSED, ldouble f2 ATTRIBUTE_UNUSED, ldouble f3 ATTRIBUTE_UNUSED, ldouble f4 ATTRIBUTE_UNUSED, ldouble f5 ATTRIBUTE_UNUSED, ldouble f6 ATTRIBUTE_UNUSED, ldouble f7 ATTRIBUTE_UNUSED, ldouble f8 ATTRIBUTE_UNUSED, ldouble f9 ATTRIBUTE_UNUSED, ldouble f10 ATTRIBUTE_UNUSED, ldouble f11 ATTRIBUTE_UNUSED, ldouble f12 ATTRIBUTE_UNUSED, ldouble f13 ATTRIBUTE_UNUSED, ldouble f14 ATTRIBUTE_UNUSED, ldouble f15 ATTRIBUTE_UNUSED)
{
  /* Check register contents.  */
  check_ldouble_arguments;
}

void
fun_check_x87_passing_ldouble20_values (ldouble f0 ATTRIBUTE_UNUSED, ldouble f1 ATTRIBUTE_UNUSED, ldouble f2 ATTRIBUTE_UNUSED, ldouble f3 ATTRIBUTE_UNUSED, ldouble f4 ATTRIBUTE_UNUSED, ldouble f5 ATTRIBUTE_UNUSED, ldouble f6 ATTRIBUTE_UNUSED, ldouble f7 ATTRIBUTE_UNUSED, ldouble f8 ATTRIBUTE_UNUSED, ldouble f9 ATTRIBUTE_UNUSED, ldouble f10 ATTRIBUTE_UNUSED, ldouble f11 ATTRIBUTE_UNUSED, ldouble f12 ATTRIBUTE_UNUSED, ldouble f13 ATTRIBUTE_UNUSED, ldouble f14 ATTRIBUTE_UNUSED, ldouble f15 ATTRIBUTE_UNUSED, ldouble f16 ATTRIBUTE_UNUSED, ldouble f17 ATTRIBUTE_UNUSED, ldouble f18 ATTRIBUTE_UNUSED, ldouble f19 ATTRIBUTE_UNUSED)
{
  /* Check argument values.  */
  assert (values_ldouble.f0 == f0);
  assert (values_ldouble.f1 == f1);
  assert (values_ldouble.f2 == f2);
  assert (values_ldouble.f3 == f3);
  assert (values_ldouble.f4 == f4);
  assert (values_ldouble.f5 == f5);
  assert (values_ldouble.f6 == f6);
  assert (values_ldouble.f7 == f7);
  assert (values_ldouble.f8 == f8);
  assert (values_ldouble.f9 == f9);
  assert (values_ldouble.f10 == f10);
  assert (values_ldouble.f11 == f11);
  assert (values_ldouble.f12 == f12);
  assert (values_ldouble.f13 == f13);
  assert (values_ldouble.f14 == f14);
  assert (values_ldouble.f15 == f15);
  assert (values_ldouble.f16 == f16);
  assert (values_ldouble.f17 == f17);
  assert (values_ldouble.f18 == f18);
  assert (values_ldouble.f19 == f19);

}

void
fun_check_x87_passing_ldouble20_regs (ldouble f0 ATTRIBUTE_UNUSED, ldouble f1 ATTRIBUTE_UNUSED, ldouble f2 ATTRIBUTE_UNUSED, ldouble f3 ATTRIBUTE_UNUSED, ldouble f4 ATTRIBUTE_UNUSED, ldouble f5 ATTRIBUTE_UNUSED, ldouble f6 ATTRIBUTE_UNUSED, ldouble f7 ATTRIBUTE_UNUSED, ldouble f8 ATTRIBUTE_UNUSED, ldouble f9 ATTRIBUTE_UNUSED, ldouble f10 ATTRIBUTE_UNUSED, ldouble f11 ATTRIBUTE_UNUSED, ldouble f12 ATTRIBUTE_UNUSED, ldouble f13 ATTRIBUTE_UNUSED, ldouble f14 ATTRIBUTE_UNUSED, ldouble f15 ATTRIBUTE_UNUSED, ldouble f16 ATTRIBUTE_UNUSED, ldouble f17 ATTRIBUTE_UNUSED, ldouble f18 ATTRIBUTE_UNUSED, ldouble f19 ATTRIBUTE_UNUSED)
{
  /* Check register contents.  */
  check_ldouble_arguments;
}

#define def_check_float_passing8(_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7, _func1, _func2, TYPE) \
  values_ ## TYPE .f0 = _f0; \
  values_ ## TYPE .f1 = _f1; \
  values_ ## TYPE .f2 = _f2; \
  values_ ## TYPE .f3 = _f3; \
  values_ ## TYPE .f4 = _f4; \
  values_ ## TYPE .f5 = _f5; \
  values_ ## TYPE .f6 = _f6; \
  values_ ## TYPE .f7 = _f7; \
  WRAP_CALL(_func1) (_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7); \
  \
  clear_float_registers; \
  fregs.F0._ ## TYPE [0] = _f0; \
  fregs.F1._ ## TYPE [0] = _f1; \
  fregs.F2._ ## TYPE [0] = _f2; \
  fregs.F3._ ## TYPE [0] = _f3; \
  fregs.F4._ ## TYPE [0] = _f4; \
  fregs.F5._ ## TYPE [0] = _f5; \
  fregs.F6._ ## TYPE [0] = _f6; \
  fregs.F7._ ## TYPE [0] = _f7; \
  num_fregs = 8; \
  WRAP_CALL(_func2) (_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7);

#define def_check_float_passing16(_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7, _f8, _f9, _f10, _f11, _f12, _f13, _f14, _f15, _func1, _func2, TYPE) \
  values_ ## TYPE .f0 = _f0; \
  values_ ## TYPE .f1 = _f1; \
  values_ ## TYPE .f2 = _f2; \
  values_ ## TYPE .f3 = _f3; \
  values_ ## TYPE .f4 = _f4; \
  values_ ## TYPE .f5 = _f5; \
  values_ ## TYPE .f6 = _f6; \
  values_ ## TYPE .f7 = _f7; \
  values_ ## TYPE .f8 = _f8; \
  values_ ## TYPE .f9 = _f9; \
  values_ ## TYPE .f10 = _f10; \
  values_ ## TYPE .f11 = _f11; \
  values_ ## TYPE .f12 = _f12; \
  values_ ## TYPE .f13 = _f13; \
  values_ ## TYPE .f14 = _f14; \
  values_ ## TYPE .f15 = _f15; \
  WRAP_CALL(_func1) (_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7, _f8, _f9, _f10, _f11, _f12, _f13, _f14, _f15); \
  \
  clear_float_registers; \
  fregs.F0._ ## TYPE [0] = _f0; \
  fregs.F1._ ## TYPE [0] = _f1; \
  fregs.F2._ ## TYPE [0] = _f2; \
  fregs.F3._ ## TYPE [0] = _f3; \
  fregs.F4._ ## TYPE [0] = _f4; \
  fregs.F5._ ## TYPE [0] = _f5; \
  fregs.F6._ ## TYPE [0] = _f6; \
  fregs.F7._ ## TYPE [0] = _f7; \
  num_fregs = 8; \
  WRAP_CALL(_func2) (_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7, _f8, _f9, _f10, _f11, _f12, _f13, _f14, _f15);

#define def_check_float_passing20(_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7, _f8, _f9, _f10, _f11, _f12, _f13, _f14, _f15, _f16, _f17, _f18, _f19, _func1, _func2, TYPE) \
  values_ ## TYPE .f0 = _f0; \
  values_ ## TYPE .f1 = _f1; \
  values_ ## TYPE .f2 = _f2; \
  values_ ## TYPE .f3 = _f3; \
  values_ ## TYPE .f4 = _f4; \
  values_ ## TYPE .f5 = _f5; \
  values_ ## TYPE .f6 = _f6; \
  values_ ## TYPE .f7 = _f7; \
  values_ ## TYPE .f8 = _f8; \
  values_ ## TYPE .f9 = _f9; \
  values_ ## TYPE .f10 = _f10; \
  values_ ## TYPE .f11 = _f11; \
  values_ ## TYPE .f12 = _f12; \
  values_ ## TYPE .f13 = _f13; \
  values_ ## TYPE .f14 = _f14; \
  values_ ## TYPE .f15 = _f15; \
  values_ ## TYPE .f16 = _f16; \
  values_ ## TYPE .f17 = _f17; \
  values_ ## TYPE .f18 = _f18; \
  values_ ## TYPE .f19 = _f19; \
  WRAP_CALL(_func1) (_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7, _f8, _f9, _f10, _f11, _f12, _f13, _f14, _f15, _f16, _f17, _f18, _f19); \
  \
  clear_float_registers; \
  fregs.F0._ ## TYPE [0] = _f0; \
  fregs.F1._ ## TYPE [0] = _f1; \
  fregs.F2._ ## TYPE [0] = _f2; \
  fregs.F3._ ## TYPE [0] = _f3; \
  fregs.F4._ ## TYPE [0] = _f4; \
  fregs.F5._ ## TYPE [0] = _f5; \
  fregs.F6._ ## TYPE [0] = _f6; \
  fregs.F7._ ## TYPE [0] = _f7; \
  num_fregs = 8; \
  WRAP_CALL(_func2) (_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7, _f8, _f9, _f10, _f11, _f12, _f13, _f14, _f15, _f16, _f17, _f18, _f19);

#define def_check_x87_passing8(_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7, _func1, _func2, TYPE) \
  values_ ## TYPE .f0 = _f0; \
  values_ ## TYPE .f1 = _f1; \
  values_ ## TYPE .f2 = _f2; \
  values_ ## TYPE .f3 = _f3; \
  values_ ## TYPE .f4 = _f4; \
  values_ ## TYPE .f5 = _f5; \
  values_ ## TYPE .f6 = _f6; \
  values_ ## TYPE .f7 = _f7; \
  WRAP_CALL(_func1) (_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7); \
  \
  clear_x87_registers; \
  num_fregs = 0; \
  WRAP_CALL(_func2) (_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7);

#define def_check_x87_passing16(_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7, _f8, _f9, _f10, _f11, _f12, _f13, _f14, _f15, _func1, _func2, TYPE) \
  values_ ## TYPE .f0 = _f0; \
  values_ ## TYPE .f1 = _f1; \
  values_ ## TYPE .f2 = _f2; \
  values_ ## TYPE .f3 = _f3; \
  values_ ## TYPE .f4 = _f4; \
  values_ ## TYPE .f5 = _f5; \
  values_ ## TYPE .f6 = _f6; \
  values_ ## TYPE .f7 = _f7; \
  values_ ## TYPE .f8 = _f8; \
  values_ ## TYPE .f9 = _f9; \
  values_ ## TYPE .f10 = _f10; \
  values_ ## TYPE .f11 = _f11; \
  values_ ## TYPE .f12 = _f12; \
  values_ ## TYPE .f13 = _f13; \
  values_ ## TYPE .f14 = _f14; \
  values_ ## TYPE .f15 = _f15; \
  WRAP_CALL(_func1) (_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7, _f8, _f9, _f10, _f11, _f12, _f13, _f14, _f15); \
  \
  clear_x87_registers; \
  num_fregs = 0; \
  WRAP_CALL(_func2) (_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7, _f8, _f9, _f10, _f11, _f12, _f13, _f14, _f15);

#define def_check_x87_passing20(_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7, _f8, _f9, _f10, _f11, _f12, _f13, _f14, _f15, _f16, _f17, _f18, _f19, _func1, _func2, TYPE) \
  values_ ## TYPE .f0 = _f0; \
  values_ ## TYPE .f1 = _f1; \
  values_ ## TYPE .f2 = _f2; \
  values_ ## TYPE .f3 = _f3; \
  values_ ## TYPE .f4 = _f4; \
  values_ ## TYPE .f5 = _f5; \
  values_ ## TYPE .f6 = _f6; \
  values_ ## TYPE .f7 = _f7; \
  values_ ## TYPE .f8 = _f8; \
  values_ ## TYPE .f9 = _f9; \
  values_ ## TYPE .f10 = _f10; \
  values_ ## TYPE .f11 = _f11; \
  values_ ## TYPE .f12 = _f12; \
  values_ ## TYPE .f13 = _f13; \
  values_ ## TYPE .f14 = _f14; \
  values_ ## TYPE .f15 = _f15; \
  values_ ## TYPE .f16 = _f16; \
  values_ ## TYPE .f17 = _f17; \
  values_ ## TYPE .f18 = _f18; \
  values_ ## TYPE .f19 = _f19; \
  WRAP_CALL(_func1) (_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7, _f8, _f9, _f10, _f11, _f12, _f13, _f14, _f15, _f16, _f17, _f18, _f19); \
  \
  clear_x87_registers; \
  num_fregs = 0; \
  WRAP_CALL(_func2) (_f0, _f1, _f2, _f3, _f4, _f5, _f6, _f7, _f8, _f9, _f10, _f11, _f12, _f13, _f14, _f15, _f16, _f17, _f18, _f19);

void
test_floats_on_stack ()
{
  def_check_float_passing8(32, 33, 34, 35, 36, 37, 38, 39, fun_check_float_passing_float8_values, fun_check_float_passing_float8_regs, float);

  def_check_float_passing16(32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, fun_check_float_passing_float16_values, fun_check_float_passing_float16_regs, float);
}

void
test_too_many_floats ()
{
  def_check_float_passing20(32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, fun_check_float_passing_float20_values, fun_check_float_passing_float20_regs, float);
}

void
test_doubles_on_stack ()
{
  def_check_float_passing8(32, 33, 34, 35, 36, 37, 38, 39, fun_check_float_passing_double8_values, fun_check_float_passing_double8_regs, double);

  def_check_float_passing16(32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, fun_check_float_passing_double16_values, fun_check_float_passing_double16_regs, double);
}

void
test_too_many_doubles ()
{
  def_check_float_passing20(32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, fun_check_float_passing_double20_values, fun_check_float_passing_double20_regs, double);
}

void
test_long_doubles_on_stack ()
{
  def_check_x87_passing8(32, 33, 34, 35, 36, 37, 38, 39, fun_check_x87_passing_ldouble8_values, fun_check_x87_passing_ldouble8_regs, ldouble);
}

void
test_too_many_long_doubles ()
{
  def_check_x87_passing20(32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, fun_check_x87_passing_ldouble20_values, fun_check_x87_passing_ldouble20_regs, ldouble);
}

void
test_float128s_on_stack ()
{
}

void
test_too_many_float128s ()
{
}


int
main (void)
{
  test_floats_on_stack ();
  test_too_many_floats ();
  test_doubles_on_stack ();
  test_too_many_doubles ();
  test_long_doubles_on_stack ();
  test_too_many_long_doubles ();
  test_float128s_on_stack ();
  test_too_many_float128s ();
  return 0;
}