]>
Commit | Line | Data |
---|---|---|
620ff9ee | 1 | /* Define aliases for libm double functions. ldbl-opt version. |
04277e02 | 2 | Copyright (C) 2017-2019 Free Software Foundation, Inc. |
620ff9ee JM |
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 | |
5a82c748 | 17 | <https://www.gnu.org/licenses/>. */ |
620ff9ee JM |
18 | |
19 | #ifndef _LIBM_ALIAS_DOUBLE_H | |
20 | #define _LIBM_ALIAS_DOUBLE_H | |
21 | ||
f2d64d62 | 22 | #include <bits/floatn.h> |
620ff9ee JM |
23 | #include <math_ldbl_opt.h> |
24 | #include <first-versions.h> | |
25 | #include <ldbl-compat-choose.h> | |
26 | ||
f2d64d62 JM |
27 | #if __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64 |
28 | # define libm_alias_double_other_r_f64(from, to, r) \ | |
29 | weak_alias (from ## r, to ## f64 ## r) | |
30 | #else | |
31 | # define libm_alias_double_other_r_f64(from, to, r) | |
32 | #endif | |
33 | ||
34 | #if __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X | |
35 | # define libm_alias_double_other_r_f32x(from, to, r) \ | |
36 | weak_alias (from ## r, to ## f32x ## r) | |
37 | #else | |
38 | # define libm_alias_double_other_r_f32x(from, to, r) | |
39 | #endif | |
40 | ||
24b6515d JM |
41 | /* Define _FloatN / _FloatNx aliases for a double libm function that |
42 | has internal name FROM ## R and public names TO ## suffix ## R for | |
43 | each suffix of a supported _FloatN / _FloatNx floating-point type | |
44 | with the same format as double. */ | |
f2d64d62 JM |
45 | #define libm_alias_double_other_r(from, to, r) \ |
46 | libm_alias_double_other_r_f64 (from, to, r); \ | |
47 | libm_alias_double_other_r_f32x (from, to, r) | |
24b6515d JM |
48 | |
49 | /* Likewise, but without the R suffix. */ | |
50 | #define libm_alias_double_other(from, to) \ | |
51 | libm_alias_double_other_r (from, to, ) | |
52 | ||
620ff9ee JM |
53 | /* Define aliases for a double libm function that has internal name |
54 | FROM ## R and public names TO ## suffix ## R for each suffix of a | |
55 | supported floating-point type with the same format as double. This | |
56 | should only be used for functions where such public names exist for | |
57 | _FloatN types, not for implementation-namespace exported names | |
58 | (where there is one name per format, not per type) or for | |
59 | obsolescent functions not provided for _FloatN types. */ | |
60 | #define libm_alias_double_r(from, to, r) \ | |
d8124864 | 61 | weak_alias (from ## r, to ## r); \ |
620ff9ee JM |
62 | LONG_DOUBLE_COMPAT_CHOOSE_libm_ ## to ## l ## r \ |
63 | (compat_symbol (libm, \ | |
64 | from ## r, \ | |
65 | to ## l ## r, \ | |
24b6515d JM |
66 | FIRST_VERSION_libm_ ## to ## l ## r), ); \ |
67 | libm_alias_double_other_r (from, to, r) | |
620ff9ee JM |
68 | |
69 | /* Likewise, but without the R suffix. */ | |
70 | #define libm_alias_double(from, to) libm_alias_double_r (from, to, ) | |
71 | ||
72 | #endif |