From 32bf1d09dadee5b60df869ed3567a2b12c04e3fc Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Thu, 3 Nov 2016 12:26:52 -0200 Subject: float128: Add conversion from float128 to mpn Reuse the code for __mpn_extract_long_double to implement __mpn_extract_float128. * include/gmp.h: Include bits/floatn.h (__mpn_extract_float128): Declare when __HAVE_DISTINCT_FLOAT128 is 1. * stdlib/gmp-impl.h: Also check if alloca is not defined before including stack-alloc.h. It could have been defined by other header which not necessarily defines HAVE_ALLOCA. * sysdeps/ieee754/float128/Makefile: New file. * sysdeps/ieee754/float128/float1282mpn.c: New file. * sysdeps/ieee754/float128/float128_private.h: Include gmp.h before redefining __mpn_extract_long_double to __mpn_extract_float128, then redefine __mpn_extract_long_double to __mpn_extract_float128. * sysdeps/ieee754/ldbl-128/ldbl2mpn.c: Replace long double with _Float128 to allow float128_private.h overrides. --- stdlib/gmp-impl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'stdlib') diff --git a/stdlib/gmp-impl.h b/stdlib/gmp-impl.h index 89693c4..42d3e4a 100644 --- a/stdlib/gmp-impl.h +++ b/stdlib/gmp-impl.h @@ -47,7 +47,8 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, see #endif #endif -#if ! defined (HAVE_ALLOCA) || defined (USE_STACK_ALLOC) +#if (! defined (alloca) && ! defined (HAVE_ALLOCA)) \ + || defined (USE_STACK_ALLOC) #include "stack-alloc.h" #else #define TMP_DECL(m) -- cgit v1.1