diff options
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r-- | sysdeps/ieee754/float128/Makefile | 3 | ||||
-rw-r--r-- | sysdeps/ieee754/float128/float1282mpn.c | 20 | ||||
-rw-r--r-- | sysdeps/ieee754/float128/float128_private.h | 2 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/ldbl2mpn.c | 3 |
4 files changed, 27 insertions, 1 deletions
diff --git a/sysdeps/ieee754/float128/Makefile b/sysdeps/ieee754/float128/Makefile new file mode 100644 index 0000000000..6a7b0e0f45 --- /dev/null +++ b/sysdeps/ieee754/float128/Makefile @@ -0,0 +1,3 @@ +ifeq ($(subdir),stdlib) +routines += float1282mpn +endif diff --git a/sysdeps/ieee754/float128/float1282mpn.c b/sysdeps/ieee754/float128/float1282mpn.c new file mode 100644 index 0000000000..f012ccf0a6 --- /dev/null +++ b/sysdeps/ieee754/float128/float1282mpn.c @@ -0,0 +1,20 @@ +/* Convert a _Float128 type to multiprecision. + 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/>. */ + +#include <float128_private.h> +#include "../ldbl-128/ldbl2mpn.c" diff --git a/sysdeps/ieee754/float128/float128_private.h b/sysdeps/ieee754/float128/float128_private.h index 894e6ac8cb..1e00853c83 100644 --- a/sysdeps/ieee754/float128/float128_private.h +++ b/sysdeps/ieee754/float128/float128_private.h @@ -17,6 +17,7 @@ <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 @@ -291,6 +292,7 @@ #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 diff --git a/sysdeps/ieee754/ldbl-128/ldbl2mpn.c b/sysdeps/ieee754/ldbl-128/ldbl2mpn.c index 71a6f043bd..1c79a5dbe5 100644 --- a/sysdeps/ieee754/ldbl-128/ldbl2mpn.c +++ b/sysdeps/ieee754/ldbl-128/ldbl2mpn.c @@ -21,6 +21,7 @@ #include <ieee754.h> #include <float.h> #include <math.h> +#include <math_private.h> #include <stdlib.h> /* Convert a `long double' in IEEE854 quad-precision format to a @@ -31,7 +32,7 @@ mp_size_t __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size, int *expt, int *is_neg, - long double value) + _Float128 value) { union ieee854_long_double u; u.d = value; |