summaryrefslogtreecommitdiff
path: root/include/gmp.h
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>2016-11-03 12:26:52 -0200
committerGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>2017-06-07 17:03:43 -0300
commit32bf1d09dadee5b60df869ed3567a2b12c04e3fc (patch)
tree35384058bf2d5f1f05b893b418a7f339f704629f /include/gmp.h
parent82c19bdfe39164fda779c79a925c2050b19e421b (diff)
downloadglibc-32bf1d09dadee5b60df869ed3567a2b12c04e3fc.tar.gz
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.
Diffstat (limited to 'include/gmp.h')
-rw-r--r--include/gmp.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/gmp.h b/include/gmp.h
index b74167097d..e6f635e8d5 100644
--- a/include/gmp.h
+++ b/include/gmp.h
@@ -6,6 +6,8 @@
#include <stdlib/gmp.h>
+#include <bits/floatn.h>
+
/* Now define the internal interfaces. */
extern mp_size_t __mpn_extract_double (mp_ptr res_ptr, mp_size_t size,
int *expt, int *is_neg,
@@ -15,6 +17,12 @@ extern mp_size_t __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
int *expt, int *is_neg,
long double value);
+#if __HAVE_DISTINCT_FLOAT128
+extern mp_size_t __mpn_extract_float128 (mp_ptr res_ptr, mp_size_t size,
+ int *expt, int *is_neg,
+ _Float128 value);
+#endif
+
extern float __mpn_construct_float (mp_srcptr frac_ptr, int expt, int sign);
extern double __mpn_construct_double (mp_srcptr frac_ptr, int expt,