mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-04 10:50:07 +00:00
01f2881245
Many libm functions define the function as __<func> and then define <func> as a weak alias. This is not at all limited to cases where there is an internal call that has namespace reasons to need to call __<func> instead of <func>. The common macros for creating libm function aliases work on the basis of public function names all being aliases; that is, they define aliases for functions using the above pattern. Thus, where a function just defines the public name <func> directly, changing that to be a weak alias enables a subsequent conversion to the common macros to retain the exact existing symbols (and so be testable by comparison of stripped binaries). This patch converts many existing functions to use the weak alias pattern, as preparation for subsequent conversions to common macros. I do expect that _FloatN/_FloatNx function aliases will end up needing new variants of the common macros that do *not* create the original float / double / long double name of a function - for cases where that name is created specially to give it a particular symbol version, for example - but for functions that can use the most common macros to create all the public names as aliases, it makes sense for them to do so. Regarding the Bessel function wrappers in this patch: only float and double wrappers are changed because the long double wrappers already used the weak alias pattern. Tested for x86_64, and with build-many-glibcs.py. * include/math.h (roundeven): Change hidden_proto call to __roundeven. * math/w_j0_compat.c (j0): Rename to __j0 and define as weak alias. [NO_LONG_DOUBLE] (__j0l): New strong alias. (y0): Rename to __y0 and define as weak alias. [NO_LONG_DOUBLE] (__y0l): New strong alias. * math/w_j0f_compat.c (j0f): Rename to __j0f and define as weak alias. (y0f): Rename to __y0f and define as weak alias. * math/w_j1_compat.c (j1): Rename to __j1 and define as weak alias. [NO_LONG_DOUBLE] (__j1l): New strong alias. (y1): Rename to __y1 and define as weak alias. [NO_LONG_DOUBLE] (__y1l): New strong alias. * math/w_j1f_compat.c (j1f): Rename to __j1f and define as weak alias. (y1f): Rename to __y1f and define as weak alias. * math/w_jn_compat.c (jn): Rename to __jn and define as weak alias. [NO_LONG_DOUBLE] (__jnl): New strong alias. (yn): Rename to __yn and define as weak alias. [NO_LONG_DOUBLE] (__ynl): New strong alias. * math/w_jnf_compat.c (jnf): Rename to __jnf and define as weak alias. (ynf): Rename to __ynf and define as weak alias. * sysdeps/ieee754/dbl-64/s_fromfp.c (FUNC): Define to __fromfp. (fromfp): Define as weak alias. [NO_LONG_DOUBLE] (__fromfpl): New strong alias. * sysdeps/ieee754/dbl-64/s_fromfpx.c (FUNC): Define to __fromfpx. (fromfpx): Define as weak alias. [NO_LONG_DOUBLE] (__fromfpxl): New strong alias. * sysdeps/ieee754/dbl-64/s_getpayload.c (getpayload): Rename to __getpayload and define as weak alias. [NO_LONG_DOUBLE] (__getpayloadl): New strong alias. * sysdeps/ieee754/dbl-64/s_roundeven.c (roundeven): Rename to __roundeven and define as weak alias. [NO_LONG_DOUBLE] (__roundevenl): New strong alias. * sysdeps/ieee754/dbl-64/s_setpayload.c (FUNC): Define to __setpayload. (setpayload): Define as weak alias. [NO_LONG_DOUBLE] (__setpayloadl): New strong alias. * sysdeps/ieee754/dbl-64/s_setpayloadsig.c (FUNC): Define to __setpayloadsig. (setpayloadsig): Define as weak alias. [NO_LONG_DOUBLE] (__setpayloadsigl): New strong alias. * sysdeps/ieee754/dbl-64/s_totalorder.c (totalorder): Rename to __totalorder and define as weak alias. [NO_LONG_DOUBLE] (__totalorderl): New strong alias. * sysdeps/ieee754/dbl-64/s_totalordermag.c (totalordermag): Rename to __totalordermag and define as weak alias. [NO_LONG_DOUBLE] (__totalordermagl): New strong alias. * sysdeps/ieee754/dbl-64/s_ufromfp.c (FUNC): Define to __ufromfp. (ufromfp): Define as weak alias. [NO_LONG_DOUBLE] (__ufromfpl): New strong alias. * sysdeps/ieee754/dbl-64/s_ufromfpx.c (FUNC): Define to __ufromfpx. (ufromfpx): Define as weak alias. [NO_LONG_DOUBLE] (__ufromfpxl): New strong alias. * sysdeps/ieee754/dbl-64/wordsize-64/s_getpayload.c (getpayload): Rename to __getpayload and define as weak alias. [NO_LONG_DOUBLE] (__getpayloadl): New strong alias. * sysdeps/ieee754/dbl-64/wordsize-64/s_roundeven.c (roundeven): Rename to __roundeven and define as weak alias. [NO_LONG_DOUBLE] (__roundevenl): New strong alias. * sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c (totalorder): Rename to __totalorder and define as weak alias. [NO_LONG_DOUBLE] (__totalorderl): New strong alias. * sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c (totalordermag): Rename to __totalordermag and define as weak alias. [NO_LONG_DOUBLE] (__totalordermagl): New strong alias. * sysdeps/ieee754/float128/float128_private.h (__getpayloadl): New macro. (__roundevenl): Likewise. (__totalorderl): Likewise. (__totalordermagl): Likewise * sysdeps/ieee754/float128/s_fromfpf128.c (FUNC): Define to __fromfpf128. (fromfpf128): Define as weak alias. * sysdeps/ieee754/float128/s_fromfpxf128.c (FUNC): Define to __fromfpxf128. (fromfpxf128): Define as weak alias. * sysdeps/ieee754/float128/s_setpayloadf128.c (FUNC): Define to __setpayloadf128. (setpayloadf128): Define as weak alias. * sysdeps/ieee754/float128/s_setpayloadsigf128.c (FUNC): Define to __setpayloadsigf128. (setpayloadsigf128): Define as weak alias. * sysdeps/ieee754/float128/s_ufromfpf128.c (FUNC): Define to __ufromfpf128. (ufromfpf128): Define as weak alias. * sysdeps/ieee754/float128/s_ufromfpxf128.c (FUNC): Define to __ufromfpxf128. (ufromfpxf128): Define as weak alias. * sysdeps/ieee754/flt-32/s_fromfpf.c (FUNC): Define to __fromfpf. (fromfpf): Define as weak alias. * sysdeps/ieee754/flt-32/s_fromfpxf.c (FUNC): Define to __fromfpxf. (fromfpxf): Define as weak alias. * sysdeps/ieee754/flt-32/s_getpayloadf.c (getpayloadf): Rename to __getpayloadf and define as weak alias. * sysdeps/ieee754/flt-32/s_roundevenf.c (roundevenf): Rename to __roundevenf and define as weak alias. * sysdeps/ieee754/flt-32/s_setpayloadf.c (FUNC): Define to __setpayloadf. (setpayloadf): Define as weak alias. * sysdeps/ieee754/flt-32/s_setpayloadsigf.c (FUNC): Define to __setpayloadsigf. (setpayloadsigf): Define as weak alias. * sysdeps/ieee754/flt-32/s_totalorderf.c (totalorderf): Rename to __totalorderf and define as weak alias. * sysdeps/ieee754/flt-32/s_totalordermagf.c (totalordermagf): Rename to __totalordermagf and define as weak alias. * sysdeps/ieee754/flt-32/s_ufromfpf.c (FUNC): Define to __ufromfpf. (ufromfpf): Define as weak alias. * sysdeps/ieee754/flt-32/s_ufromfpxf.c (FUNC): Define to __ufromfpxf. (ufromfpxf): Define as weak alias. * sysdeps/ieee754/ldbl-128/s_fromfpl.c (FUNC): Define to __fromfpl. (fromfpl): Define as weak alias. * sysdeps/ieee754/ldbl-128/s_fromfpxl.c (FUNC): Define to __fromfpxl. (fromfpxl): Define as weak alias. * sysdeps/ieee754/ldbl-128/s_getpayloadl.c (getpayloadl): Rename to __getpayloadl and define as weak alias. * sysdeps/ieee754/ldbl-128/s_roundevenl.c (roundevenl): Rename to __roundevenl and define as weak alias. * sysdeps/ieee754/ldbl-128/s_setpayloadl.c (FUNC): Define to __setpayloadl. (setpayloadl): Define as weak alias. * sysdeps/ieee754/ldbl-128/s_setpayloadsigl.c (FUNC): Define to __setpayloadsigl. (setpayloadsigl): Define as weak alias. * sysdeps/ieee754/ldbl-128/s_totalorderl.c (totalorderl): Rename to __totalorderl and define as weak alias. * sysdeps/ieee754/ldbl-128/s_totalordermagl.c (totalordermagl): Rename to __totalordermagl and define as weak alias. * sysdeps/ieee754/ldbl-128/s_ufromfpl.c (FUNC): Define to __ufromfpl. (ufromfpl): Define as weak alias. * sysdeps/ieee754/ldbl-128/s_ufromfpxl.c (FUNC): Define to __ufromfpxl. (ufromfpxl): Define as weak alias. * sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c (FUNC): Define to __fromfpl. (fromfpl): Define as weak alias. * sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c (FUNC): Define to __fromfpxl. (fromfpxl): Define as weak alias. * sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c (getpayloadl): Rename to __getpayloadl and define as weak alias. * sysdeps/ieee754/ldbl-128ibm/s_roundevenl.c (roundevenl): Rename to __roundevenl and define as weak alias. Call __roundeven instead of roundeven. * sysdeps/ieee754/ldbl-128ibm/s_setpayloadl.c (FUNC): Define to __setpayloadl. (setpayloadl): Define as weak alias. * sysdeps/ieee754/ldbl-128ibm/s_setpayloadsigl.c (FUNC): Define to __setpayloadsigl. (setpayloadsigl): Define as weak alias. * sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c (totalorderl): Rename to __totalorderl and define as weak alias. * sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c (totalordermagl): Rename to __totalordermagl and define as weak alias. * sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c (FUNC): Define to __ufromfpl. (ufromfpl): Define as weak alias. * sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c (FUNC): Define to __ufromfpxl. (ufromfpxl): Define as weak alias. * sysdeps/ieee754/ldbl-96/s_fromfpl.c (FUNC): Define to __fromfpl. (fromfpl): Define as weak alias. * sysdeps/ieee754/ldbl-96/s_fromfpxl.c (FUNC): Define to __fromfpxl. (fromfpxl): Define as weak alias. * sysdeps/ieee754/ldbl-96/s_getpayloadl.c (getpayloadl): Rename to __getpayloadl and define as weak alias. * sysdeps/ieee754/ldbl-96/s_roundevenl.c (roundevenl): Rename to __roundevenl and define as weak alias. * sysdeps/ieee754/ldbl-96/s_setpayloadl.c (FUNC): Define to __setpayloadl. (setpayloadl): Define as weak alias. * sysdeps/ieee754/ldbl-96/s_setpayloadsigl.c (FUNC): Define to __setpayloadsigl. (setpayloadsigl): Define as weak alias. * sysdeps/ieee754/ldbl-96/s_totalorderl.c (totalorderl): Rename to __totalorderl and define as weak alias. * sysdeps/ieee754/ldbl-96/s_totalordermagl.c (totalordermagl): Rename to __totalordermagl and define as weak alias. * sysdeps/ieee754/ldbl-96/s_ufromfpl.c (FUNC): Define to __ufromfpl. (ufromfpl): Define as weak alias. * sysdeps/ieee754/ldbl-96/s_ufromfpxl.c (FUNC): Define to __ufromfpxl. (ufromfpxl): Define as weak alias.
335 lines
10 KiB
C
335 lines
10 KiB
C
/* _Float128 overrides for building ldbl-128 as _Float128.
|
|
Copyright (C) 2017 Free Software Foundation, Inc.
|
|
This file is part of the GNU C Library.
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Lesser General Public
|
|
License as published by the Free Software Foundation; either
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
License along with the GNU C Library; if not, see
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
/* This must be included before the function renames below. */
|
|
#include <gmp.h>
|
|
#include <math.h>
|
|
#undef HUGE_VALL
|
|
#define HUGE_VALL HUGE_VAL_F128
|
|
#include <math/mul_splitl.h>
|
|
|
|
/* This must be included before the renames of types and macros from
|
|
it. */
|
|
#include <ieee754.h>
|
|
|
|
/* Renames derived from math_private.h. */
|
|
#include <math_private.h>
|
|
#include <ieee754_float128.h>
|
|
#define ieee854_long_double_shape_type ieee854_float128_shape_type
|
|
#define ieee854_long_double ieee854_float128
|
|
|
|
#undef GET_LDOUBLE_LSW64
|
|
#undef GET_LDOUBLE_MSW64
|
|
#undef GET_LDOUBLE_WORDS64
|
|
#undef SET_LDOUBLE_LSW64
|
|
#undef SET_LDOUBLE_MSW64
|
|
#undef SET_LDOUBLE_WORDS64
|
|
#define GET_LDOUBLE_LSW64(x,y) GET_FLOAT128_LSW64 (x, y)
|
|
#define GET_LDOUBLE_MSW64(x,y) GET_FLOAT128_MSW64 (x, y)
|
|
#define GET_LDOUBLE_WORDS64(x,y,z) GET_FLOAT128_WORDS64 (x, y, z)
|
|
#define SET_LDOUBLE_LSW64(x,y) SET_FLOAT128_LSW64 (x, y)
|
|
#define SET_LDOUBLE_MSW64(x,y) SET_FLOAT128_MSW64 (x, y)
|
|
#define SET_LDOUBLE_WORDS64(x,y,z) SET_FLOAT128_WORDS64 (x, y, z)
|
|
|
|
#undef IEEE854_LONG_DOUBLE_BIAS
|
|
#define IEEE854_LONG_DOUBLE_BIAS IEEE854_FLOAT128_BIAS
|
|
|
|
#ifdef SET_RESTORE_ROUNDF128
|
|
# undef SET_RESTORE_ROUNDL
|
|
# define SET_RESTORE_ROUNDL(RM) SET_RESTORE_ROUNDF128 (RM)
|
|
#endif
|
|
|
|
|
|
/* misc macros from the header below. */
|
|
#include <fix-fp-int-convert-overflow.h>
|
|
#undef FIX_LDBL_LONG_CONVERT_OVERFLOW
|
|
#undef FIX_LDBL_LLONG_CONVERT_OVERFLOW
|
|
#define FIX_LDBL_LONG_CONVERT_OVERFLOW FIX_FLT128_LONG_CONVERT_OVERFLOW
|
|
#define FIX_LDBL_LLONG_CONVERT_OVERFLOW FIX_FLT128_LLONG_CONVERT_OVERFLOW
|
|
|
|
|
|
/* float.h constants. */
|
|
#include <float.h>
|
|
#undef LDBL_DIG
|
|
#undef LDBL_EPSILON
|
|
#undef LDBL_MANT_DIG
|
|
#undef LDBL_MAX
|
|
#undef LDBL_MAX_10_EXP
|
|
#undef LDBL_MAX_EXP
|
|
#undef LDBL_MIN
|
|
#undef LDBL_MIN_10_EXP
|
|
#undef LDBL_MIN_EXP
|
|
#undef LDBL_TRUE_MIN
|
|
#define LDBL_DIG FLT128_DIG
|
|
#define LDBL_EPSILON FLT128_EPSILON
|
|
#define LDBL_MANT_DIG FLT128_MANT_DIG
|
|
#define LDBL_MAX FLT128_MAX
|
|
#define LDBL_MAX_10_EXP FLT128_MAX_10_EXP
|
|
#define LDBL_MAX_EXP FLT128_MAX_EXP
|
|
#define LDBL_MIN FLT128_MIN
|
|
#define LDBL_MIN_10_EXP FLT128_MIN_10_EXP
|
|
#define LDBL_MIN_EXP FLT128_MIN_EXP
|
|
#define LDBL_TRUE_MIN FLT128_TRUE_MIN
|
|
|
|
|
|
/* math.h GNU constants. */
|
|
#undef M_El
|
|
#undef M_LOG2El
|
|
#undef M_LOG10El
|
|
#undef M_LN2l
|
|
#undef M_LN10l
|
|
#undef M_PIl
|
|
#undef M_PI_2l
|
|
#undef M_PI_4l
|
|
#undef M_1_PIl
|
|
#undef M_2_PIl
|
|
#undef M_2_SQRTPIl
|
|
#undef M_SQRT2l
|
|
#undef M_SQRT1_2l
|
|
#define M_El M_Ef128
|
|
#define M_LOG2El M_LOG2Ef128
|
|
#define M_LOG10El M_LOG10Ef128
|
|
#define M_LN2l M_LN2f128
|
|
#define M_LN10l M_LN10f128
|
|
#define M_PIl M_PIf128
|
|
#define M_PI_2l M_PI_2f128
|
|
#define M_PI_4l M_PI_4f128
|
|
#define M_1_PIl M_1_PIf128
|
|
#define M_2_PIl M_2_PIf128
|
|
#define M_2_SQRTPIl M_2_SQRTPIf128
|
|
#define M_SQRT2l M_SQRT2f128
|
|
#define M_SQRT1_2l M_SQRT1_2f128
|
|
|
|
|
|
/* IEEE function renames. */
|
|
#define __ieee754_acoshl __ieee754_acoshf128
|
|
#define __ieee754_acosl __ieee754_acosf128
|
|
#define __ieee754_asinhl __ieee754_asinhf128
|
|
#define __ieee754_asinl __ieee754_asinf128
|
|
#define __ieee754_atan2l __ieee754_atan2f128
|
|
#define __ieee754_atanhl __ieee754_atanhf128
|
|
#define __ieee754_coshl __ieee754_coshf128
|
|
#define __ieee754_cosl __ieee754_cosf128
|
|
#define __ieee754_exp10l __ieee754_exp10f128
|
|
#define __ieee754_exp2l __ieee754_exp2f128
|
|
#define __ieee754_expl __ieee754_expf128
|
|
#define __ieee754_fmodl __ieee754_fmodf128
|
|
#define __ieee754_gammal_r __ieee754_gammaf128_r
|
|
#define __ieee754_hypotl __ieee754_hypotf128
|
|
#define __ieee754_ilogbl __ieee754_ilogbf128
|
|
#define __ieee754_j0l __ieee754_j0f128
|
|
#define __ieee754_j1l __ieee754_j1f128
|
|
#define __ieee754_jnl __ieee754_jnf128
|
|
#define __ieee754_lgammal_r __ieee754_lgammaf128_r
|
|
#define __ieee754_log10l __ieee754_log10f128
|
|
#define __ieee754_log2l __ieee754_log2f128
|
|
#define __ieee754_logl __ieee754_logf128
|
|
#define __ieee754_powl __ieee754_powf128
|
|
#define __ieee754_rem_pio2l __ieee754_rem_pio2f128
|
|
#define __ieee754_remainderl __ieee754_remainderf128
|
|
#define __ieee754_sinhl __ieee754_sinhf128
|
|
#define __ieee754_sqrtl __ieee754_sqrtf128
|
|
#define __ieee754_y0l __ieee754_y0f128
|
|
#define __ieee754_y1l __ieee754_y1f128
|
|
#define __ieee754_ynl __ieee754_ynf128
|
|
|
|
|
|
/* finite math entry points. */
|
|
#define __acoshl_finite __acoshf128_finite
|
|
#define __acosl_finite __acosf128_finite
|
|
#define __asinl_finite __asinf128_finite
|
|
#define __atan2l_finite __atan2f128_finite
|
|
#define __atanhl_finite __atanhf128_finite
|
|
#define __coshl_finite __coshf128_finite
|
|
#define __cosl_finite __cosf128_finite
|
|
#define __exp10l_finite __exp10f128_finite
|
|
#define __exp2l_finite __exp2f128_finite
|
|
#define __expl_finite __expf128_finite
|
|
#define __fmodl_finite __fmodf128_finite
|
|
#define __hypotl_finite __hypotf128_finite
|
|
#define __ilogbl_finite __ilogbf128_finite
|
|
#define __j0l_finite __j0f128_finite
|
|
#define __j1l_finite __j1f128_finite
|
|
#define __jnl_finite __jnf128_finite
|
|
#define __lgammal_r_finite __lgammaf128_r_finite
|
|
#define __log10l_finite __log10f128_finite
|
|
#define __log2l_finite __log2f128_finite
|
|
#define __logl_finite __logf128_finite
|
|
#define __powl_finite __powf128_finite
|
|
#define __remainderl_finite __remainderf128_finite
|
|
#define __sinhl_finite __sinhf128_finite
|
|
#define __y0l_finite __y0f128_finite
|
|
#define __y1l_finite __y1f128_finite
|
|
#define __ynl_finite __ynf128_finite
|
|
|
|
|
|
/* internal function names. */
|
|
#define __asinhl __asinhf128
|
|
#define __atanl __atanf128
|
|
#define __cbrtl __cbrtf128
|
|
#define __ceill __ceilf128
|
|
#define __copysignl __copysignf128
|
|
#define __cosl __cosf128
|
|
#define __erfcl __erfcf128
|
|
#define __erfl __erff128
|
|
#define __expl __expf128
|
|
#define __expm1l __expm1f128
|
|
#define __fabsl __fabsf128
|
|
#define __fdiml __fdimf128
|
|
#define __finitel __finitef128
|
|
#define __floorl __floorf128
|
|
#define __fmal __fmaf128
|
|
#define __fmaxl __fmaxf128
|
|
#define __fminl __fminf128
|
|
#define __fpclassifyl __fpclassifyf128
|
|
#define __frexpl __frexpf128
|
|
#define __gammal_r_finite __gammaf128_r_finite
|
|
#define __getpayloadl __getpayloadf128
|
|
#define __isinfl __isinff128
|
|
#define __isnanl __isnanf128
|
|
#define __issignalingl __issignalingf128
|
|
#define __ldexpl __ldexpf128
|
|
#define __llrintl __llrintf128
|
|
#define __llroundl __llroundf128
|
|
#define __log1pl __log1pf128
|
|
#define __logbl __logbf128
|
|
#define __logl __logf128
|
|
#define __lrintl __lrintf128
|
|
#define __lroundl __lroundf128
|
|
#define __modfl __modff128
|
|
#define __nearbyintl __nearbyintf128
|
|
#define __nextafterl __nextafterf128
|
|
#define __nextdownl __nextdownf128
|
|
#define __nextupl __nextupf128
|
|
#define __remquol __remquof128
|
|
#define __rintl __rintf128
|
|
#define __roundevenl __roundevenf128
|
|
#define __roundl __roundf128
|
|
#define __scalblnl __scalblnf128
|
|
#define __scalbnl __scalbnf128
|
|
#define __signbitl __signbitf128
|
|
#define __sincosl __sincosf128
|
|
#define __sinl __sinf128
|
|
#define __sqrtl __sqrtf128
|
|
#define __tanhl __tanhf128
|
|
#define __tanl __tanf128
|
|
#define __totalorderl __totalorderf128
|
|
#define __totalordermagl __totalordermagf128
|
|
#define __truncl __truncf128
|
|
#define __x2y2m1l __x2y2m1f128
|
|
|
|
/* __nexttowardf128 is not _Float128 API. */
|
|
#define __nexttowardl __nexttowardf128_do_not_use
|
|
#define nexttowardl nexttowardf128_do_not_use
|
|
|
|
|
|
/* public entry points. */
|
|
#define asinhl asinhf128
|
|
#define atanl atanf128
|
|
#define cbrtl cbrtf128
|
|
#define ceill ceilf128
|
|
#define copysignl copysignf128
|
|
#define cosl cosf128
|
|
#define erfcl erfcf128
|
|
#define erfl erff128
|
|
#define expl expf128
|
|
#define expm1l expm1f128
|
|
#define fabsl fabsf128
|
|
#define fdiml fdimf128
|
|
#define finitel finitef128_do_not_use
|
|
#define floorl floorf128
|
|
#define fmal fmaf128
|
|
#define fmaxl fmaxf128
|
|
#define fminl fminf128
|
|
#define frexpl frexpf128
|
|
#define getpayloadl getpayloadf128
|
|
#define isinfl isinff128_do_not_use
|
|
#define isnanl isnanf128_do_not_use
|
|
#define ldexpl ldexpf128
|
|
#define llrintl llrintf128
|
|
#define llroundl llroundf128
|
|
#define log1pl log1pf128
|
|
#define logbl logbf128
|
|
#define logl logf128
|
|
#define lrintl lrintf128
|
|
#define lroundl lroundf128
|
|
#define modfl modff128
|
|
#define nanl nanf128
|
|
#define nearbyintl nearbyintf128
|
|
#define nextafterl nextafterf128
|
|
#define nextdownl nextdownf128
|
|
#define nextupl nextupf128
|
|
#define remquol remquof128
|
|
#define rintl rintf128
|
|
#define roundevenl roundevenf128
|
|
#define roundl roundf128
|
|
#define scalbnl scalbnf128
|
|
#define sincosl sincosf128
|
|
#define sinl sinf128
|
|
#define sqrtl sqrtf128
|
|
#define tanhl tanhf128
|
|
#define tanl tanf128
|
|
#define totalorderl totalorderf128
|
|
#define totalordermagl totalordermagf128
|
|
#define truncl truncf128
|
|
|
|
|
|
/* misc internal renames. */
|
|
#define __builtin_fmal __builtin_fmaf128
|
|
#define __expl_table __expf128_table
|
|
#define __gamma_productl __gamma_productf128
|
|
#define __kernel_cosl __kernel_cosf128
|
|
#define __kernel_rem_pio2l __kernel_rem_pio2f128
|
|
#define __kernel_sincosl __kernel_sincosf128
|
|
#define __kernel_sinl __kernel_sinf128
|
|
#define __kernel_tanl __kernel_tanf128
|
|
#define __lgamma_negl __lgamma_negf128
|
|
#define __lgamma_productl __lgamma_productf128
|
|
#define __mpn_extract_long_double __mpn_extract_float128
|
|
#define __sincosl_table __sincosf128_table
|
|
#define mul_splitl mul_splitf128
|
|
|
|
/* Builtin renames. */
|
|
#define __builtin_copysignl __builtin_copysignf128
|
|
#define __builtin_signbitl __builtin_signbit
|
|
|
|
/* Get the constant suffix from bits/floatn-compat.h. */
|
|
#define L(x) __f128 (x)
|
|
|
|
static inline void
|
|
mul_splitf128 (_Float128 *hi, _Float128 *lo, _Float128 x, _Float128 y)
|
|
{
|
|
#ifdef __FP_FAST_FMAF128
|
|
/* Fast built-in fused multiply-add. */
|
|
*hi = x * y;
|
|
*lo = __builtin_fmal (x, y, -*hi);
|
|
#else
|
|
/* Apply Dekker's algorithm. */
|
|
*hi = x * y;
|
|
# define C ((1LL << (FLT128_MANT_DIG + 1) / 2) + 1)
|
|
_Float128 x1 = x * C;
|
|
_Float128 y1 = y * C;
|
|
# undef C
|
|
x1 = (x - x1) + x1;
|
|
y1 = (y - y1) + y1;
|
|
_Float128 x2 = x - x1;
|
|
_Float128 y2 = y - y1;
|
|
*lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
|
|
#endif
|
|
}
|