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