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