1 /* Define aliases for libm _Float128 functions.
2    Copyright (C) 2018-2021 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 _LIBM_ALIAS_FLOAT128_H
20 #define _LIBM_ALIAS_FLOAT128_H
21 
22 #include <bits/floatn.h>
23 #include <ldbl-128ibm-compat-abi.h>
24 
25 /* This macro should be used on all long double functions that are not part of
26    the _Float128 API in order to provide *ieee128 symbols without exposing
27    internal *f128 symbols.  */
28 #define libm_alias_float128_other_r_ldbl(from, to, r) \
29   strong_alias (from ## f128 ## r, __ ## to ## ieee128 ## r)
30 
31 /* Define _FloatN / _FloatNx aliases (other than that for _Float128)
32    for a _Float128 libm function that has internal name FROM ## f128
33    ## R and public names TO ## suffix ## R for each suffix of a
34    supported _FloatN / _FloatNx floating-point type with the same
35    format as _Float128.  */
36 #if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
37 # define libm_alias_float128_other_r(from, to, r) \
38   weak_alias (from ## f128 ## r, to ## f64x ## r); \
39   libm_alias_float128_other_r_ldbl(from, to, r)
40 #else
41 # define libm_alias_float128_other_r(from, to, r) \
42   libm_alias_float128_other_r_ldbl(from, to, r)
43 #endif
44 
45 /* Likewise, but without the R suffix.  */
46 #define libm_alias_float128_other(from, to)	\
47   libm_alias_float128_other_r (from, to, )
48 
49 /* Define aliases for a _Float128 libm function that has internal name
50    FROM ## f128 ## R and public names TO ## suffix ## R for each
51    suffix of a supported floating-point type with the same format as
52    _Float128.  This should only be used for functions where such
53    public names exist for _FloatN types, not for
54    implementation-namespace exported names (where there is one name
55    per format, not per type) or for obsolescent functions not provided
56    for _FloatN types.  */
57 #define libm_alias_float128_r(from, to, r)		\
58   weak_alias (from ## f128 ## r, to ## f128 ## r);	\
59   libm_alias_float128_other_r (from, to, r)
60 
61 /* Likewise, but without the R suffix.  */
62 #define libm_alias_float128(from, to) libm_alias_float128_r (from, to, )
63 
64 #endif
65