]>
Commit | Line | Data |
---|---|---|
1 | /* Test compilation of tgmath macros. | |
2 | Copyright (C) 2001-2025 Free Software Foundation, Inc. | |
3 | This file is part of the GNU C Library. | |
4 | ||
5 | The GNU C Library is free software; you can redistribute it and/or | |
6 | modify it under the terms of the GNU Lesser General Public | |
7 | License as published by the Free Software Foundation; either | |
8 | version 2.1 of the License, or (at your option) any later version. | |
9 | ||
10 | The GNU C Library is distributed in the hope that it will be useful, | |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | Lesser General Public License for more details. | |
14 | ||
15 | You should have received a copy of the GNU Lesser General Public | |
16 | License along with the GNU C Library; if not, see | |
17 | <https://www.gnu.org/licenses/>. */ | |
18 | ||
19 | #ifndef HAVE_MAIN | |
20 | #include <float.h> | |
21 | #include <math.h> | |
22 | #include <stdint.h> | |
23 | #include <stdio.h> | |
24 | #include <tgmath.h> | |
25 | ||
26 | //#define DEBUG | |
27 | ||
28 | static void compile_test (void); | |
29 | static void compile_testf (void); | |
30 | #if LDBL_MANT_DIG > DBL_MANT_DIG | |
31 | static void compile_testl (void); | |
32 | #endif | |
33 | ||
34 | float fx; | |
35 | double dx; | |
36 | long double lx; | |
37 | const float fy = 1.25; | |
38 | const double dy = 1.25; | |
39 | const long double ly = 1.25; | |
40 | complex float fz; | |
41 | complex double dz; | |
42 | complex long double lz; | |
43 | ||
44 | volatile int count_double; | |
45 | volatile int count_float; | |
46 | volatile int count_ldouble; | |
47 | volatile int count_cdouble; | |
48 | volatile int count_cfloat; | |
49 | volatile int count_cldouble; | |
50 | ||
51 | #define NCALLS 194 | |
52 | #define NCALLS_INT 4 | |
53 | #define NCCALLS 47 | |
54 | ||
55 | static int | |
56 | do_test (void) | |
57 | { | |
58 | int result = 0; | |
59 | ||
60 | count_float = count_double = count_ldouble = 0; | |
61 | count_cfloat = count_cdouble = count_cldouble = 0; | |
62 | compile_test (); | |
63 | if (count_float != 0 || count_cfloat != 0) | |
64 | { | |
65 | puts ("float function called for double test"); | |
66 | result = 1; | |
67 | } | |
68 | if (count_ldouble != 0 || count_cldouble != 0) | |
69 | { | |
70 | puts ("long double function called for double test"); | |
71 | result = 1; | |
72 | } | |
73 | if (count_double < NCALLS + NCALLS_INT) | |
74 | { | |
75 | printf ("double functions not called often enough (%d)\n", | |
76 | count_double); | |
77 | result = 1; | |
78 | } | |
79 | else if (count_double > NCALLS + NCALLS_INT) | |
80 | { | |
81 | printf ("double functions called too often (%d)\n", | |
82 | count_double); | |
83 | result = 1; | |
84 | } | |
85 | if (count_cdouble < NCCALLS) | |
86 | { | |
87 | printf ("double complex functions not called often enough (%d)\n", | |
88 | count_cdouble); | |
89 | result = 1; | |
90 | } | |
91 | else if (count_cdouble > NCCALLS) | |
92 | { | |
93 | printf ("double complex functions called too often (%d)\n", | |
94 | count_cdouble); | |
95 | result = 1; | |
96 | } | |
97 | ||
98 | count_float = count_double = count_ldouble = 0; | |
99 | count_cfloat = count_cdouble = count_cldouble = 0; | |
100 | compile_testf (); | |
101 | if (count_double != 0 || count_cdouble != 0) | |
102 | { | |
103 | puts ("double function called for float test"); | |
104 | result = 1; | |
105 | } | |
106 | if (count_ldouble != 0 || count_cldouble != 0) | |
107 | { | |
108 | puts ("long double function called for float test"); | |
109 | result = 1; | |
110 | } | |
111 | if (count_float < NCALLS) | |
112 | { | |
113 | printf ("float functions not called often enough (%d)\n", count_float); | |
114 | result = 1; | |
115 | } | |
116 | else if (count_float > NCALLS) | |
117 | { | |
118 | printf ("float functions called too often (%d)\n", | |
119 | count_double); | |
120 | result = 1; | |
121 | } | |
122 | if (count_cfloat < NCCALLS) | |
123 | { | |
124 | printf ("float complex functions not called often enough (%d)\n", | |
125 | count_cfloat); | |
126 | result = 1; | |
127 | } | |
128 | else if (count_cfloat > NCCALLS) | |
129 | { | |
130 | printf ("float complex functions called too often (%d)\n", | |
131 | count_cfloat); | |
132 | result = 1; | |
133 | } | |
134 | ||
135 | #if LDBL_MANT_DIG > DBL_MANT_DIG | |
136 | count_float = count_double = count_ldouble = 0; | |
137 | count_cfloat = count_cdouble = count_cldouble = 0; | |
138 | compile_testl (); | |
139 | if (count_float != 0 || count_cfloat != 0) | |
140 | { | |
141 | puts ("float function called for long double test"); | |
142 | result = 1; | |
143 | } | |
144 | if (count_double != 0 || count_cdouble != 0) | |
145 | { | |
146 | puts ("double function called for long double test"); | |
147 | result = 1; | |
148 | } | |
149 | if (count_ldouble < NCALLS) | |
150 | { | |
151 | printf ("long double functions not called often enough (%d)\n", | |
152 | count_ldouble); | |
153 | result = 1; | |
154 | } | |
155 | else if (count_ldouble > NCALLS) | |
156 | { | |
157 | printf ("long double functions called too often (%d)\n", | |
158 | count_double); | |
159 | result = 1; | |
160 | } | |
161 | if (count_cldouble < NCCALLS) | |
162 | { | |
163 | printf ("long double complex functions not called often enough (%d)\n", | |
164 | count_cldouble); | |
165 | result = 1; | |
166 | } | |
167 | else if (count_cldouble > NCCALLS) | |
168 | { | |
169 | printf ("long double complex functions called too often (%d)\n", | |
170 | count_cldouble); | |
171 | result = 1; | |
172 | } | |
173 | #endif | |
174 | ||
175 | return result; | |
176 | } | |
177 | ||
178 | /* Now generate the three functions. */ | |
179 | #define HAVE_MAIN | |
180 | ||
181 | #define F(name) name | |
182 | #define TYPE double | |
183 | #define TEST_INT 1 | |
184 | #define x dx | |
185 | #define y dy | |
186 | #define z dz | |
187 | #define count count_double | |
188 | #define ccount count_cdouble | |
189 | #include "test-tgmath.c" | |
190 | ||
191 | #define F(name) name##f | |
192 | #define TYPE float | |
193 | #define x fx | |
194 | #define y fy | |
195 | #define z fz | |
196 | #define count count_float | |
197 | #define ccount count_cfloat | |
198 | #include "test-tgmath.c" | |
199 | ||
200 | #if LDBL_MANT_DIG > DBL_MANT_DIG | |
201 | #define F(name) name##l | |
202 | #define TYPE long double | |
203 | #define x lx | |
204 | #define y ly | |
205 | #define z lz | |
206 | #define count count_ldouble | |
207 | #define ccount count_cldouble | |
208 | #include "test-tgmath.c" | |
209 | #endif | |
210 | ||
211 | #define TEST_FUNCTION do_test () | |
212 | #include "../test-skeleton.c" | |
213 | ||
214 | #else | |
215 | ||
216 | #ifdef DEBUG | |
217 | #define P() puts (__FUNCTION__) | |
218 | #else | |
219 | #define P() | |
220 | #endif | |
221 | ||
222 | static void | |
223 | F(compile_test) (void) | |
224 | { | |
225 | TYPE a, b, c = 1.0; | |
226 | complex TYPE d; | |
227 | int i = 2; | |
228 | int saved_count; | |
229 | long int j; | |
230 | long long int k = 2; | |
231 | intmax_t m; | |
232 | uintmax_t um; | |
233 | ||
234 | a = cos (cos (x)); | |
235 | a = cospi (cospi (x)); | |
236 | b = acospi (acospi (a)); | |
237 | b = acos (acos (a)); | |
238 | a = sin (sin (x)); | |
239 | b = sinpi (sinpi (x)); | |
240 | b = asinpi (asinpi (a)); | |
241 | b = asin (asin (a)); | |
242 | a = tan (tan (x)); | |
243 | b = tanpi (tanpi (x)); | |
244 | b = atanpi (atanpi (a)); | |
245 | b = atan (atan (a)); | |
246 | c = atan2 (atan2 (a, c), atan2 (b, x)); | |
247 | b = atan2pi (atan2pi (a, c), atan2pi (b, x)); | |
248 | a = cosh (cosh (x)); | |
249 | b = acosh (acosh (a)); | |
250 | a = sinh (sinh (x)); | |
251 | b = asinh (asinh (a)); | |
252 | a = tanh (tanh (x)); | |
253 | b = atanh (atanh (a)); | |
254 | a = exp (exp (x)); | |
255 | b = log (log (a)); | |
256 | a = log10 (log10 (x)); | |
257 | b = ldexp (ldexp (a, 1), 5); | |
258 | a = frexp (frexp (x, &i), &i); | |
259 | b = expm1 (expm1 (a)); | |
260 | a = exp2m1 (exp2m1 (b)); | |
261 | b = exp10m1 (exp10m1 (a)); | |
262 | a = log1p (log1p (x)); | |
263 | b = logb (logb (a)); | |
264 | a = exp2 (exp2 (x)); | |
265 | a = exp10 (exp10 (x)); | |
266 | b = log2 (log2 (a)); | |
267 | a = log2p1 (log2p1 (x)); | |
268 | a = log10p1 (log10p1 (x)); | |
269 | a = logp1 (logp1 (x)); | |
270 | a = pow (pow (x, a), pow (c, b)); | |
271 | b = pown (pown (x, k), k); | |
272 | b = compoundn (compoundn (x, k), k); | |
273 | b = rootn (rootn (x, k), k); | |
274 | a = powr (powr (x, a), powr (c, b)); | |
275 | b = sqrt (sqrt (a)); | |
276 | a = rsqrt (rsqrt (b)); | |
277 | a = hypot (hypot (x, b), hypot (c, a)); | |
278 | b = cbrt (cbrt (a)); | |
279 | a = ceil (ceil (x)); | |
280 | b = fabs (fabs (a)); | |
281 | a = floor (floor (x)); | |
282 | b = fmod (fmod (a, b), fmod (c, x)); | |
283 | a = nearbyint (nearbyint (x)); | |
284 | b = round (round (a)); | |
285 | c = roundeven (roundeven (a)); | |
286 | a = trunc (trunc (x)); | |
287 | b = remquo (remquo (a, b, &i), remquo (c, x, &i), &i); | |
288 | j = lrint (x) + lround (a); | |
289 | k = llrint (b) + llround (c); | |
290 | m = fromfp (a, FP_INT_UPWARD, 2) + fromfpx (b, FP_INT_DOWNWARD, 3); | |
291 | um = ufromfp (c, FP_INT_TONEAREST, 4) + ufromfpx (a, FP_INT_TOWARDZERO, 5); | |
292 | a = erf (erf (x)); | |
293 | b = erfc (erfc (a)); | |
294 | a = tgamma (tgamma (x)); | |
295 | b = lgamma (lgamma (a)); | |
296 | a = rint (rint (x)); | |
297 | b = nextafter (nextafter (a, b), nextafter (c, x)); | |
298 | a = nextdown (nextdown (a)); | |
299 | b = nexttoward (nexttoward (x, a), c); | |
300 | a = nextup (nextup (a)); | |
301 | b = remainder (remainder (a, b), remainder (c, x)); | |
302 | a = scalb (scalb (x, a), (TYPE) (6)); | |
303 | k = scalbn (a, 7) + scalbln (c, 10l); | |
304 | i = ilogb (x); | |
305 | j = llogb (x); | |
306 | a = fdim (fdim (x, a), fdim (c, b)); | |
307 | b = fmax (fmax (a, x), fmax (c, b)); | |
308 | a = fmin (fmin (x, a), fmin (c, b)); | |
309 | b = fmaxmag (fmaxmag (a, x), fmaxmag (c, b)); | |
310 | a = fminmag (fminmag (x, a), fminmag (c, b)); | |
311 | b = fmaximum (fmaximum (a, x), fmaximum (c, b)); | |
312 | a = fminimum (fminimum (x, a), fminimum (c, b)); | |
313 | b = fmaximum_num (fmaximum_num (a, x), fmaximum_num (c, b)); | |
314 | a = fminimum_num (fminimum_num (x, a), fminimum_num (c, b)); | |
315 | b = fmaximum_mag (fmaximum_mag (a, x), fmaximum_mag (c, b)); | |
316 | a = fminimum_mag (fminimum_mag (x, a), fminimum_mag (c, b)); | |
317 | b = fmaximum_mag_num (fmaximum_mag_num (a, x), fmaximum_mag_num (c, b)); | |
318 | a = fminimum_mag_num (fminimum_mag_num (x, a), fminimum_mag_num (c, b)); | |
319 | b = fma (sin (a), sin (x), sin (c)); | |
320 | ||
321 | #ifdef TEST_INT | |
322 | a = atan2 (i, b); | |
323 | b = remquo (i, a, &i); | |
324 | c = fma (i, b, i); | |
325 | a = pow (i, c); | |
326 | #endif | |
327 | x = a + b + c + i + j + k + m + um; | |
328 | ||
329 | saved_count = count; | |
330 | if (ccount != 0) | |
331 | ccount = -10000; | |
332 | ||
333 | d = cos (cos (z)); | |
334 | z = acos (acos (d)); | |
335 | d = sin (sin (z)); | |
336 | z = asin (asin (d)); | |
337 | d = tan (tan (z)); | |
338 | z = atan (atan (d)); | |
339 | d = cosh (cosh (z)); | |
340 | z = acosh (acosh (d)); | |
341 | d = sinh (sinh (z)); | |
342 | z = asinh (asinh (d)); | |
343 | d = tanh (tanh (z)); | |
344 | z = atanh (atanh (d)); | |
345 | d = exp (exp (z)); | |
346 | z = log (log (d)); | |
347 | d = sqrt (sqrt (z)); | |
348 | z = conj (conj (d)); | |
349 | d = fabs (conj (a)); | |
350 | z = pow (pow (a, d), pow (b, z)); | |
351 | d = cproj (cproj (z)); | |
352 | z += fabs (cproj (a)); | |
353 | a = carg (carg (z)); | |
354 | b = creal (creal (d)); | |
355 | c = cimag (cimag (z)); | |
356 | x += a + b + c + i + j + k; | |
357 | z += d; | |
358 | ||
359 | if (saved_count != count) | |
360 | count = -10000; | |
361 | ||
362 | if (0) | |
363 | { | |
364 | a = cos (y); | |
365 | a = cospi (y); | |
366 | a = acos (y); | |
367 | a = acospi (y); | |
368 | a = sin (y); | |
369 | a = sinpi (y); | |
370 | a = asin (y); | |
371 | a = asinpi (y); | |
372 | a = tan (y); | |
373 | a = tanpi (y); | |
374 | a = atan (y); | |
375 | a = atanpi (y); | |
376 | a = atan2 (y, y); | |
377 | a = atan2pi (y, y); | |
378 | a = cosh (y); | |
379 | a = acosh (y); | |
380 | a = sinh (y); | |
381 | a = asinh (y); | |
382 | a = tanh (y); | |
383 | a = atanh (y); | |
384 | a = exp (y); | |
385 | a = log (y); | |
386 | a = log10 (y); | |
387 | a = ldexp (y, 5); | |
388 | a = frexp (y, &i); | |
389 | a = expm1 (y); | |
390 | a = exp2m1 (y); | |
391 | a = exp10m1 (y); | |
392 | a = log1p (y); | |
393 | a = logb (y); | |
394 | a = exp2 (y); | |
395 | a = exp10 (y); | |
396 | a = log2 (y); | |
397 | a = log2p1 (y); | |
398 | a = log10p1 (y); | |
399 | a = logp1 (y); | |
400 | a = pow (y, y); | |
401 | a = pown (y, 12345); | |
402 | a = compoundn (y, 12345); | |
403 | a = rootn (y, 12345); | |
404 | a = powr (y, y); | |
405 | a = sqrt (y); | |
406 | a = rsqrt (y); | |
407 | a = hypot (y, y); | |
408 | a = cbrt (y); | |
409 | a = ceil (y); | |
410 | a = fabs (y); | |
411 | a = floor (y); | |
412 | a = fmod (y, y); | |
413 | a = nearbyint (y); | |
414 | a = round (y); | |
415 | a = roundeven (y); | |
416 | a = trunc (y); | |
417 | a = remquo (y, y, &i); | |
418 | j = lrint (y) + lround (y); | |
419 | k = llrint (y) + llround (y); | |
420 | m = fromfp (y, FP_INT_UPWARD, 6) + fromfpx (y, FP_INT_DOWNWARD, 7); | |
421 | um = (ufromfp (y, FP_INT_TONEAREST, 8) | |
422 | + ufromfpx (y, FP_INT_TOWARDZERO, 9)); | |
423 | a = erf (y); | |
424 | a = erfc (y); | |
425 | a = tgamma (y); | |
426 | a = lgamma (y); | |
427 | a = rint (y); | |
428 | a = nextafter (y, y); | |
429 | a = nexttoward (y, y); | |
430 | a = remainder (y, y); | |
431 | a = scalb (y, (const TYPE) (6)); | |
432 | k = scalbn (y, 7) + scalbln (y, 10l); | |
433 | i = ilogb (y); | |
434 | j = llogb (y); | |
435 | a = fdim (y, y); | |
436 | a = fmax (y, y); | |
437 | a = fmin (y, y); | |
438 | a = fmaxmag (y, y); | |
439 | a = fminmag (y, y); | |
440 | a = fmaximum (y, y); | |
441 | a = fminimum (y, y); | |
442 | a = fmaximum_num (y, y); | |
443 | a = fminimum_num (y, y); | |
444 | a = fmaximum_mag (y, y); | |
445 | a = fminimum_mag (y, y); | |
446 | a = fmaximum_mag_num (y, y); | |
447 | a = fminimum_mag_num (y, y); | |
448 | a = fma (y, y, y); | |
449 | ||
450 | #ifdef TEST_INT | |
451 | a = atan2 (i, y); | |
452 | a = remquo (i, y, &i); | |
453 | a = fma (i, y, i); | |
454 | a = pow (i, y); | |
455 | #endif | |
456 | ||
457 | d = cos ((const complex TYPE) z); | |
458 | d = acos ((const complex TYPE) z); | |
459 | d = sin ((const complex TYPE) z); | |
460 | d = asin ((const complex TYPE) z); | |
461 | d = tan ((const complex TYPE) z); | |
462 | d = atan ((const complex TYPE) z); | |
463 | d = cosh ((const complex TYPE) z); | |
464 | d = acosh ((const complex TYPE) z); | |
465 | d = sinh ((const complex TYPE) z); | |
466 | d = asinh ((const complex TYPE) z); | |
467 | d = tanh ((const complex TYPE) z); | |
468 | d = atanh ((const complex TYPE) z); | |
469 | d = exp ((const complex TYPE) z); | |
470 | d = log ((const complex TYPE) z); | |
471 | d = sqrt ((const complex TYPE) z); | |
472 | d = pow ((const complex TYPE) z, (const complex TYPE) z); | |
473 | d = fabs ((const complex TYPE) z); | |
474 | d = carg ((const complex TYPE) z); | |
475 | d = creal ((const complex TYPE) z); | |
476 | d = cimag ((const complex TYPE) z); | |
477 | d = conj ((const complex TYPE) z); | |
478 | d = cproj ((const complex TYPE) z); | |
479 | } | |
480 | } | |
481 | #undef x | |
482 | #undef y | |
483 | #undef z | |
484 | ||
485 | ||
486 | TYPE | |
487 | (F(cos)) (TYPE x) | |
488 | { | |
489 | ++count; | |
490 | P (); | |
491 | return x; | |
492 | } | |
493 | ||
494 | TYPE | |
495 | (F(cospi)) (TYPE x) | |
496 | { | |
497 | ++count; | |
498 | P (); | |
499 | return x; | |
500 | } | |
501 | ||
502 | TYPE | |
503 | (F(acos)) (TYPE x) | |
504 | { | |
505 | ++count; | |
506 | P (); | |
507 | return x; | |
508 | } | |
509 | ||
510 | TYPE | |
511 | (F(acospi)) (TYPE x) | |
512 | { | |
513 | ++count; | |
514 | P (); | |
515 | return x; | |
516 | } | |
517 | ||
518 | TYPE | |
519 | (F(sin)) (TYPE x) | |
520 | { | |
521 | ++count; | |
522 | P (); | |
523 | return x; | |
524 | } | |
525 | ||
526 | TYPE | |
527 | (F(sinpi)) (TYPE x) | |
528 | { | |
529 | ++count; | |
530 | P (); | |
531 | return x; | |
532 | } | |
533 | ||
534 | TYPE | |
535 | (F(asin)) (TYPE x) | |
536 | { | |
537 | ++count; | |
538 | P (); | |
539 | return x; | |
540 | } | |
541 | ||
542 | TYPE | |
543 | (F(asinpi)) (TYPE x) | |
544 | { | |
545 | ++count; | |
546 | P (); | |
547 | return x; | |
548 | } | |
549 | ||
550 | TYPE | |
551 | (F(tan)) (TYPE x) | |
552 | { | |
553 | ++count; | |
554 | P (); | |
555 | return x; | |
556 | } | |
557 | ||
558 | TYPE | |
559 | (F(tanpi)) (TYPE x) | |
560 | { | |
561 | ++count; | |
562 | P (); | |
563 | return x; | |
564 | } | |
565 | ||
566 | TYPE | |
567 | (F(atan)) (TYPE x) | |
568 | { | |
569 | ++count; | |
570 | P (); | |
571 | return x; | |
572 | } | |
573 | ||
574 | TYPE | |
575 | (F(atan2)) (TYPE x, TYPE y) | |
576 | { | |
577 | ++count; | |
578 | P (); | |
579 | return x + y; | |
580 | } | |
581 | ||
582 | TYPE | |
583 | (F(atanpi)) (TYPE x) | |
584 | { | |
585 | ++count; | |
586 | P (); | |
587 | return x; | |
588 | } | |
589 | ||
590 | TYPE | |
591 | (F(atan2pi)) (TYPE x, TYPE y) | |
592 | { | |
593 | ++count; | |
594 | P (); | |
595 | return x + y; | |
596 | } | |
597 | ||
598 | TYPE | |
599 | (F(cosh)) (TYPE x) | |
600 | { | |
601 | ++count; | |
602 | P (); | |
603 | return x; | |
604 | } | |
605 | ||
606 | TYPE | |
607 | (F(acosh)) (TYPE x) | |
608 | { | |
609 | ++count; | |
610 | P (); | |
611 | return x; | |
612 | } | |
613 | ||
614 | TYPE | |
615 | (F(sinh)) (TYPE x) | |
616 | { | |
617 | ++count; | |
618 | P (); | |
619 | return x; | |
620 | } | |
621 | ||
622 | TYPE | |
623 | (F(asinh)) (TYPE x) | |
624 | { | |
625 | ++count; | |
626 | P (); | |
627 | return x; | |
628 | } | |
629 | ||
630 | TYPE | |
631 | (F(tanh)) (TYPE x) | |
632 | { | |
633 | ++count; | |
634 | P (); | |
635 | return x; | |
636 | } | |
637 | ||
638 | TYPE | |
639 | (F(atanh)) (TYPE x) | |
640 | { | |
641 | ++count; | |
642 | P (); | |
643 | return x; | |
644 | } | |
645 | ||
646 | TYPE | |
647 | (F(exp)) (TYPE x) | |
648 | { | |
649 | ++count; | |
650 | P (); | |
651 | return x; | |
652 | } | |
653 | ||
654 | TYPE | |
655 | (F(log)) (TYPE x) | |
656 | { | |
657 | ++count; | |
658 | P (); | |
659 | return x; | |
660 | } | |
661 | ||
662 | TYPE | |
663 | (F(log10)) (TYPE x) | |
664 | { | |
665 | ++count; | |
666 | P (); | |
667 | return x; | |
668 | } | |
669 | ||
670 | TYPE | |
671 | (F(ldexp)) (TYPE x, int y) | |
672 | { | |
673 | ++count; | |
674 | P (); | |
675 | return x + y; | |
676 | } | |
677 | ||
678 | TYPE | |
679 | (F(frexp)) (TYPE x, int *y) | |
680 | { | |
681 | ++count; | |
682 | P (); | |
683 | return x + *y; | |
684 | } | |
685 | ||
686 | TYPE | |
687 | (F(expm1)) (TYPE x) | |
688 | { | |
689 | ++count; | |
690 | P (); | |
691 | return x; | |
692 | } | |
693 | ||
694 | TYPE | |
695 | (F(exp2m1)) (TYPE x) | |
696 | { | |
697 | ++count; | |
698 | P (); | |
699 | return x; | |
700 | } | |
701 | ||
702 | TYPE | |
703 | (F(exp10m1)) (TYPE x) | |
704 | { | |
705 | ++count; | |
706 | P (); | |
707 | return x; | |
708 | } | |
709 | ||
710 | TYPE | |
711 | (F(log1p)) (TYPE x) | |
712 | { | |
713 | ++count; | |
714 | P (); | |
715 | return x; | |
716 | } | |
717 | ||
718 | TYPE | |
719 | (F(logb)) (TYPE x) | |
720 | { | |
721 | ++count; | |
722 | P (); | |
723 | return x; | |
724 | } | |
725 | ||
726 | TYPE | |
727 | (F(exp10)) (TYPE x) | |
728 | { | |
729 | ++count; | |
730 | P (); | |
731 | return x; | |
732 | } | |
733 | ||
734 | TYPE | |
735 | (F(exp2)) (TYPE x) | |
736 | { | |
737 | ++count; | |
738 | P (); | |
739 | return x; | |
740 | } | |
741 | ||
742 | TYPE | |
743 | (F(log2)) (TYPE x) | |
744 | { | |
745 | ++count; | |
746 | P (); | |
747 | return x; | |
748 | } | |
749 | ||
750 | TYPE | |
751 | (F(log2p1)) (TYPE x) | |
752 | { | |
753 | ++count; | |
754 | P (); | |
755 | return x; | |
756 | } | |
757 | ||
758 | TYPE | |
759 | (F(log10p1)) (TYPE x) | |
760 | { | |
761 | ++count; | |
762 | P (); | |
763 | return x; | |
764 | } | |
765 | ||
766 | TYPE | |
767 | (F(logp1)) (TYPE x) | |
768 | { | |
769 | ++count; | |
770 | P (); | |
771 | return x; | |
772 | } | |
773 | ||
774 | TYPE | |
775 | (F(pow)) (TYPE x, TYPE y) | |
776 | { | |
777 | ++count; | |
778 | P (); | |
779 | return x + y; | |
780 | } | |
781 | ||
782 | TYPE | |
783 | (F(pown)) (TYPE x, long long int y) | |
784 | { | |
785 | ++count; | |
786 | P (); | |
787 | return x + y; | |
788 | } | |
789 | ||
790 | TYPE | |
791 | (F(powr)) (TYPE x, TYPE y) | |
792 | { | |
793 | ++count; | |
794 | P (); | |
795 | return x + y; | |
796 | } | |
797 | ||
798 | TYPE | |
799 | (F(compoundn)) (TYPE x, long long int y) | |
800 | { | |
801 | ++count; | |
802 | P (); | |
803 | return x + y; | |
804 | } | |
805 | ||
806 | TYPE | |
807 | (F(rootn)) (TYPE x, long long int y) | |
808 | { | |
809 | ++count; | |
810 | P (); | |
811 | return x + y; | |
812 | } | |
813 | ||
814 | TYPE | |
815 | (F(sqrt)) (TYPE x) | |
816 | { | |
817 | ++count; | |
818 | P (); | |
819 | return x; | |
820 | } | |
821 | ||
822 | TYPE | |
823 | (F(rsqrt)) (TYPE x) | |
824 | { | |
825 | ++count; | |
826 | P (); | |
827 | return x; | |
828 | } | |
829 | ||
830 | TYPE | |
831 | (F(hypot)) (TYPE x, TYPE y) | |
832 | { | |
833 | ++count; | |
834 | P (); | |
835 | return x + y; | |
836 | } | |
837 | ||
838 | TYPE | |
839 | (F(cbrt)) (TYPE x) | |
840 | { | |
841 | ++count; | |
842 | P (); | |
843 | return x; | |
844 | } | |
845 | ||
846 | TYPE | |
847 | (F(ceil)) (TYPE x) | |
848 | { | |
849 | ++count; | |
850 | P (); | |
851 | return x; | |
852 | } | |
853 | ||
854 | TYPE | |
855 | (F(fabs)) (TYPE x) | |
856 | { | |
857 | ++count; | |
858 | P (); | |
859 | return x; | |
860 | } | |
861 | ||
862 | TYPE | |
863 | (F(floor)) (TYPE x) | |
864 | { | |
865 | ++count; | |
866 | P (); | |
867 | return x; | |
868 | } | |
869 | ||
870 | TYPE | |
871 | (F(fmod)) (TYPE x, TYPE y) | |
872 | { | |
873 | ++count; | |
874 | P (); | |
875 | return x + y; | |
876 | } | |
877 | ||
878 | TYPE | |
879 | (F(nearbyint)) (TYPE x) | |
880 | { | |
881 | ++count; | |
882 | P (); | |
883 | return x; | |
884 | } | |
885 | ||
886 | TYPE | |
887 | (F(round)) (TYPE x) | |
888 | { | |
889 | ++count; | |
890 | P (); | |
891 | return x; | |
892 | } | |
893 | ||
894 | TYPE | |
895 | (F(roundeven)) (TYPE x) | |
896 | { | |
897 | ++count; | |
898 | P (); | |
899 | return x; | |
900 | } | |
901 | ||
902 | TYPE | |
903 | (F(trunc)) (TYPE x) | |
904 | { | |
905 | ++count; | |
906 | P (); | |
907 | return x; | |
908 | } | |
909 | ||
910 | TYPE | |
911 | (F(remquo)) (TYPE x, TYPE y, int *i) | |
912 | { | |
913 | ++count; | |
914 | P (); | |
915 | return x + y + *i; | |
916 | } | |
917 | ||
918 | long int | |
919 | (F(lrint)) (TYPE x) | |
920 | { | |
921 | ++count; | |
922 | P (); | |
923 | return x; | |
924 | } | |
925 | ||
926 | long int | |
927 | (F(lround)) (TYPE x) | |
928 | { | |
929 | ++count; | |
930 | P (); | |
931 | return x; | |
932 | } | |
933 | ||
934 | long long int | |
935 | (F(llrint)) (TYPE x) | |
936 | { | |
937 | ++count; | |
938 | P (); | |
939 | return x; | |
940 | } | |
941 | ||
942 | long long int | |
943 | (F(llround)) (TYPE x) | |
944 | { | |
945 | ++count; | |
946 | P (); | |
947 | return x; | |
948 | } | |
949 | ||
950 | intmax_t | |
951 | (F(fromfp)) (TYPE x, int round, unsigned int width) | |
952 | { | |
953 | ++count; | |
954 | P (); | |
955 | return x; | |
956 | } | |
957 | ||
958 | intmax_t | |
959 | (F(fromfpx)) (TYPE x, int round, unsigned int width) | |
960 | { | |
961 | ++count; | |
962 | P (); | |
963 | return x; | |
964 | } | |
965 | ||
966 | uintmax_t | |
967 | (F(ufromfp)) (TYPE x, int round, unsigned int width) | |
968 | { | |
969 | ++count; | |
970 | P (); | |
971 | return x; | |
972 | } | |
973 | ||
974 | uintmax_t | |
975 | (F(ufromfpx)) (TYPE x, int round, unsigned int width) | |
976 | { | |
977 | ++count; | |
978 | P (); | |
979 | return x; | |
980 | } | |
981 | ||
982 | TYPE | |
983 | (F(erf)) (TYPE x) | |
984 | { | |
985 | ++count; | |
986 | P (); | |
987 | return x; | |
988 | } | |
989 | ||
990 | TYPE | |
991 | (F(erfc)) (TYPE x) | |
992 | { | |
993 | ++count; | |
994 | P (); | |
995 | return x; | |
996 | } | |
997 | ||
998 | TYPE | |
999 | (F(tgamma)) (TYPE x) | |
1000 | { | |
1001 | ++count; | |
1002 | P (); | |
1003 | return x; | |
1004 | } | |
1005 | ||
1006 | TYPE | |
1007 | (F(lgamma)) (TYPE x) | |
1008 | { | |
1009 | ++count; | |
1010 | P (); | |
1011 | return x; | |
1012 | } | |
1013 | ||
1014 | TYPE | |
1015 | (F(rint)) (TYPE x) | |
1016 | { | |
1017 | ++count; | |
1018 | P (); | |
1019 | return x; | |
1020 | } | |
1021 | ||
1022 | TYPE | |
1023 | (F(nextafter)) (TYPE x, TYPE y) | |
1024 | { | |
1025 | ++count; | |
1026 | P (); | |
1027 | return x + y; | |
1028 | } | |
1029 | ||
1030 | TYPE | |
1031 | (F(nextdown)) (TYPE x) | |
1032 | { | |
1033 | ++count; | |
1034 | P (); | |
1035 | return x; | |
1036 | } | |
1037 | ||
1038 | TYPE | |
1039 | (F(nexttoward)) (TYPE x, long double y) | |
1040 | { | |
1041 | ++count; | |
1042 | P (); | |
1043 | return x + y; | |
1044 | } | |
1045 | ||
1046 | TYPE | |
1047 | (F(nextup)) (TYPE x) | |
1048 | { | |
1049 | ++count; | |
1050 | P (); | |
1051 | return x; | |
1052 | } | |
1053 | ||
1054 | TYPE | |
1055 | (F(remainder)) (TYPE x, TYPE y) | |
1056 | { | |
1057 | ++count; | |
1058 | P (); | |
1059 | return x + y; | |
1060 | } | |
1061 | ||
1062 | TYPE | |
1063 | (F(scalb)) (TYPE x, TYPE y) | |
1064 | { | |
1065 | ++count; | |
1066 | P (); | |
1067 | return x + y; | |
1068 | } | |
1069 | ||
1070 | TYPE | |
1071 | (F(scalbn)) (TYPE x, int y) | |
1072 | { | |
1073 | ++count; | |
1074 | P (); | |
1075 | return x + y; | |
1076 | } | |
1077 | ||
1078 | TYPE | |
1079 | (F(scalbln)) (TYPE x, long int y) | |
1080 | { | |
1081 | ++count; | |
1082 | P (); | |
1083 | return x + y; | |
1084 | } | |
1085 | ||
1086 | int | |
1087 | (F(ilogb)) (TYPE x) | |
1088 | { | |
1089 | ++count; | |
1090 | P (); | |
1091 | return x; | |
1092 | } | |
1093 | ||
1094 | long int | |
1095 | (F(llogb)) (TYPE x) | |
1096 | { | |
1097 | ++count; | |
1098 | P (); | |
1099 | return x; | |
1100 | } | |
1101 | ||
1102 | TYPE | |
1103 | (F(fdim)) (TYPE x, TYPE y) | |
1104 | { | |
1105 | ++count; | |
1106 | P (); | |
1107 | return x + y; | |
1108 | } | |
1109 | ||
1110 | TYPE | |
1111 | (F(fmin)) (TYPE x, TYPE y) | |
1112 | { | |
1113 | ++count; | |
1114 | P (); | |
1115 | return x + y; | |
1116 | } | |
1117 | ||
1118 | TYPE | |
1119 | (F(fmax)) (TYPE x, TYPE y) | |
1120 | { | |
1121 | ++count; | |
1122 | P (); | |
1123 | return x + y; | |
1124 | } | |
1125 | ||
1126 | TYPE | |
1127 | (F(fminmag)) (TYPE x, TYPE y) | |
1128 | { | |
1129 | ++count; | |
1130 | P (); | |
1131 | return x + y; | |
1132 | } | |
1133 | ||
1134 | TYPE | |
1135 | (F(fmaxmag)) (TYPE x, TYPE y) | |
1136 | { | |
1137 | ++count; | |
1138 | P (); | |
1139 | return x + y; | |
1140 | } | |
1141 | ||
1142 | TYPE | |
1143 | (F(fminimum)) (TYPE x, TYPE y) | |
1144 | { | |
1145 | ++count; | |
1146 | P (); | |
1147 | return x + y; | |
1148 | } | |
1149 | ||
1150 | TYPE | |
1151 | (F(fmaximum)) (TYPE x, TYPE y) | |
1152 | { | |
1153 | ++count; | |
1154 | P (); | |
1155 | return x + y; | |
1156 | } | |
1157 | ||
1158 | TYPE | |
1159 | (F(fminimum_num)) (TYPE x, TYPE y) | |
1160 | { | |
1161 | ++count; | |
1162 | P (); | |
1163 | return x + y; | |
1164 | } | |
1165 | ||
1166 | TYPE | |
1167 | (F(fmaximum_num)) (TYPE x, TYPE y) | |
1168 | { | |
1169 | ++count; | |
1170 | P (); | |
1171 | return x + y; | |
1172 | } | |
1173 | ||
1174 | TYPE | |
1175 | (F(fminimum_mag)) (TYPE x, TYPE y) | |
1176 | { | |
1177 | ++count; | |
1178 | P (); | |
1179 | return x + y; | |
1180 | } | |
1181 | ||
1182 | TYPE | |
1183 | (F(fmaximum_mag)) (TYPE x, TYPE y) | |
1184 | { | |
1185 | ++count; | |
1186 | P (); | |
1187 | return x + y; | |
1188 | } | |
1189 | ||
1190 | TYPE | |
1191 | (F(fminimum_mag_num)) (TYPE x, TYPE y) | |
1192 | { | |
1193 | ++count; | |
1194 | P (); | |
1195 | return x + y; | |
1196 | } | |
1197 | ||
1198 | TYPE | |
1199 | (F(fmaximum_mag_num)) (TYPE x, TYPE y) | |
1200 | { | |
1201 | ++count; | |
1202 | P (); | |
1203 | return x + y; | |
1204 | } | |
1205 | ||
1206 | TYPE | |
1207 | (F(fma)) (TYPE x, TYPE y, TYPE z) | |
1208 | { | |
1209 | ++count; | |
1210 | P (); | |
1211 | return x + y + z; | |
1212 | } | |
1213 | ||
1214 | complex TYPE | |
1215 | (F(cacos)) (complex TYPE x) | |
1216 | { | |
1217 | ++ccount; | |
1218 | P (); | |
1219 | return x; | |
1220 | } | |
1221 | ||
1222 | complex TYPE | |
1223 | (F(casin)) (complex TYPE x) | |
1224 | { | |
1225 | ++ccount; | |
1226 | P (); | |
1227 | return x; | |
1228 | } | |
1229 | ||
1230 | complex TYPE | |
1231 | (F(catan)) (complex TYPE x) | |
1232 | { | |
1233 | ++ccount; | |
1234 | P (); | |
1235 | return x; | |
1236 | } | |
1237 | ||
1238 | complex TYPE | |
1239 | (F(ccos)) (complex TYPE x) | |
1240 | { | |
1241 | ++ccount; | |
1242 | P (); | |
1243 | return x; | |
1244 | } | |
1245 | ||
1246 | complex TYPE | |
1247 | (F(csin)) (complex TYPE x) | |
1248 | { | |
1249 | ++ccount; | |
1250 | P (); | |
1251 | return x; | |
1252 | } | |
1253 | ||
1254 | complex TYPE | |
1255 | (F(ctan)) (complex TYPE x) | |
1256 | { | |
1257 | ++ccount; | |
1258 | P (); | |
1259 | return x; | |
1260 | } | |
1261 | ||
1262 | complex TYPE | |
1263 | (F(cacosh)) (complex TYPE x) | |
1264 | { | |
1265 | ++ccount; | |
1266 | P (); | |
1267 | return x; | |
1268 | } | |
1269 | ||
1270 | complex TYPE | |
1271 | (F(casinh)) (complex TYPE x) | |
1272 | { | |
1273 | ++ccount; | |
1274 | P (); | |
1275 | return x; | |
1276 | } | |
1277 | ||
1278 | complex TYPE | |
1279 | (F(catanh)) (complex TYPE x) | |
1280 | { | |
1281 | ++ccount; | |
1282 | P (); | |
1283 | return x; | |
1284 | } | |
1285 | ||
1286 | complex TYPE | |
1287 | (F(ccosh)) (complex TYPE x) | |
1288 | { | |
1289 | ++ccount; | |
1290 | P (); | |
1291 | return x; | |
1292 | } | |
1293 | ||
1294 | complex TYPE | |
1295 | (F(csinh)) (complex TYPE x) | |
1296 | { | |
1297 | ++ccount; | |
1298 | P (); | |
1299 | return x; | |
1300 | } | |
1301 | ||
1302 | complex TYPE | |
1303 | (F(ctanh)) (complex TYPE x) | |
1304 | { | |
1305 | ++ccount; | |
1306 | P (); | |
1307 | return x; | |
1308 | } | |
1309 | ||
1310 | complex TYPE | |
1311 | (F(cexp)) (complex TYPE x) | |
1312 | { | |
1313 | ++ccount; | |
1314 | P (); | |
1315 | return x; | |
1316 | } | |
1317 | ||
1318 | complex TYPE | |
1319 | (F(clog)) (complex TYPE x) | |
1320 | { | |
1321 | ++ccount; | |
1322 | P (); | |
1323 | return x; | |
1324 | } | |
1325 | ||
1326 | complex TYPE | |
1327 | (F(csqrt)) (complex TYPE x) | |
1328 | { | |
1329 | ++ccount; | |
1330 | P (); | |
1331 | return x; | |
1332 | } | |
1333 | ||
1334 | complex TYPE | |
1335 | (F(cpow)) (complex TYPE x, complex TYPE y) | |
1336 | { | |
1337 | ++ccount; | |
1338 | P (); | |
1339 | return x + y; | |
1340 | } | |
1341 | ||
1342 | TYPE | |
1343 | (F(cabs)) (complex TYPE x) | |
1344 | { | |
1345 | ++ccount; | |
1346 | P (); | |
1347 | return x; | |
1348 | } | |
1349 | ||
1350 | TYPE | |
1351 | (F(carg)) (complex TYPE x) | |
1352 | { | |
1353 | ++ccount; | |
1354 | P (); | |
1355 | return x; | |
1356 | } | |
1357 | ||
1358 | TYPE | |
1359 | (F(creal)) (complex TYPE x) | |
1360 | { | |
1361 | ++ccount; | |
1362 | P (); | |
1363 | return __real__ x; | |
1364 | } | |
1365 | ||
1366 | TYPE | |
1367 | (F(cimag)) (complex TYPE x) | |
1368 | { | |
1369 | ++ccount; | |
1370 | P (); | |
1371 | return __imag__ x; | |
1372 | } | |
1373 | ||
1374 | complex TYPE | |
1375 | (F(conj)) (complex TYPE x) | |
1376 | { | |
1377 | ++ccount; | |
1378 | P (); | |
1379 | return x; | |
1380 | } | |
1381 | ||
1382 | complex TYPE | |
1383 | (F(cproj)) (complex TYPE x) | |
1384 | { | |
1385 | ++ccount; | |
1386 | P (); | |
1387 | return x; | |
1388 | } | |
1389 | ||
1390 | #undef F | |
1391 | #undef TYPE | |
1392 | #undef count | |
1393 | #undef ccount | |
1394 | #undef TEST_INT | |
1395 | #endif |