mirror of https://gitee.com/Nocallback/glibc.git
Browse Source
Add the necessary bits to the private headers to support building the _Float128 libm functions. A local override for float.h is provided to include the missing *FLT128 macros implied by TS 18661-3 for this type when compiling prior to GCC 7. * include/complex.h (__kernel_casinhf128): New declaration. * include/float.h: New file. * include/math.h (__finitef128): Add a hidden def. (__isinff128): Likewise. (__isnanf128): Likewise. (__fpclassify): Likewise. (__issignalling): Likewise. (__expf128): Likewise. (__expm1f128): Likewise. * sysdeps/generic/fix-fp-int-convert-overflow.h: (FIX_FLT128_LONG_CONVERT_OVERFLOW): New macro. (FIX_FLT128_LLONG_CONVERT_OVERFLOW): Likewise. * sysdeps/generic/math-type-macros-float128.h: New file. * sysdeps/generic/math_private.h: Include bits/floatn.h and math_private_calls.h for _Float128. (__isinff128): New inline implementation used when GCC < 7.0, since in this case __builtin_isinf_sign is broken. (fabsf128): New inline implementation that calls the builtin. (__EXPR_FLT128): New macro. (min_of_type): Optionally include _Float128 types too. * sysdeps/generic/math_private_calls.h (__kernel_sincos): Declare for _Float128. (__kernel_rem_pio2): Likewise. * sysdeps/ieee754/ldbl-opt/s_sin.c: (__DECL_SIMD_sincos_disablef128): New macro.hjl/cacheinfo/master
committed by
Gabriel F. T. Gomes
9 changed files with 175 additions and 3 deletions
@ -0,0 +1,31 @@ |
|||
#ifndef _LIBC_FLOAT_H |
|||
#define _LIBC_FLOAT_H |
|||
|
|||
#ifndef _ISOMAC |
|||
# define __STDC_WANT_IEC_60559_TYPES_EXT__ |
|||
#endif |
|||
|
|||
#include_next <float.h> |
|||
|
|||
/* Supplement float.h macros for _Float128 for older compilers
|
|||
which do not yet support the type. These are described in |
|||
TS 18661-3. */ |
|||
#ifndef _ISOMAC |
|||
# include <features.h> |
|||
# include <bits/floatn.h> |
|||
# if !__GNUC_PREREQ (7, 0) && __HAVE_DISTINCT_FLOAT128 |
|||
# define FLT128_MANT_DIG 113 |
|||
# define FLT128_DECIMAL_DIG 36 |
|||
# define FLT128_DIG 33 |
|||
# define FLT128_MIN_EXP (-16381) |
|||
# define FLT128_MIN_10_EXP (-4931) |
|||
# define FLT128_MAX_EXP 16384 |
|||
# define FLT128_MAX_10_EXP 4932 |
|||
# define FLT128_MAX 1.18973149535723176508575932662800702e+4932Q |
|||
# define FLT128_EPSILON 1.92592994438723585305597794258492732e-34Q |
|||
# define FLT128_MIN 3.36210314311209350626267781732175260e-4932Q |
|||
# define FLT128_TRUE_MIN 6.47517511943802511092443895822764655e-4966Q |
|||
# endif |
|||
#endif |
|||
|
|||
#endif /* _LIBC_FLOAT_H */ |
|||
@ -0,0 +1,39 @@ |
|||
/* Helper macros for _Float128 variants of type generic functions of libm.
|
|||
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/>. */
|
|||
|
|||
#ifndef _MATH_TYPE_MACROS_FLOAT128 |
|||
#define _MATH_TYPE_MACROS_FLOAT128 |
|||
|
|||
#include <math.h> |
|||
#include <complex.h> |
|||
|
|||
#define M_LIT(c) __f128 (c) |
|||
#define M_PFX FLT128 |
|||
#define M_SUF(c) c ## f128 |
|||
#define FLOAT _Float128 |
|||
#define M_STRTO_NAN __strtof128_nan |
|||
|
|||
#define CFLOAT __CFLOAT128 |
|||
|
|||
#define M_MLIT(c) c ## f128 |
|||
|
|||
|
|||
/* Supply the generic macros. */ |
|||
#include <math-type-macros.h> |
|||
|
|||
#endif |
|||
Loading…
Reference in new issue