From 45f39d458827e07ab3075bed75f2670581a89f33 Mon Sep 17 00:00:00 2001 From: "Paul E. Murphy" Date: Mon, 25 Jul 2016 13:10:00 -0500 Subject: float128: Add strtof128, wcstof128, and related functions. The implementations are contained with sysdeps/ieee754/float128 as they are only built when _Float128 is enabled within libc/m. * include/gmp.h (__mpn_construct_float128): New declaration. * include/stdlib.h: Include bits/floatn.h for _Float128 tests. (__strtof128_l): New declaration. (__strtof128_nan): Likewise. (__wcstof128_nan): Likewise. (__strtof128_internal): Likewise. (____strtof128_l_internal): Likewise. * include/wchar.h: Include bits/floatn.h for _Float128 tests. (__wcstof128_l): New declaration. (__wcstof128_internal): Likewise. * stdlib/Makefile (bug-strtod2): Link libm too. * stdlib/stdlib.h (strtof128): New declaration. (strtof128_l): Likewise. * stdlib/tst-strtod-nan-locale-main.c: Updated to use tst-strtod.h macros to ensure float128 gets tested too. * stdlib/tst-strtod-round-skeleton.c (CHOOSE_f128): New macro. * stdlib/tst-strtod.h: Include bits/floatn.h for _Float128 tests. (IF_FLOAT128): New macro. (GEN_TEST_STRTOD): Update to optionally include _Float128 in the tests. (STRTOD_TEST_FOREACH): Likewise. * sysdeps/ieee754/float128/Makefile: Insert new strtof128 and wcstof128 functions into libc. * sysdeps/ieee754/float128/Versions: Add exports for the above new functions. * sysdeps/ieee754/float128/mpn2float128.c: New file. * sysdeps/ieee754/float128/strtod_nan_float128.h: New file. * sysdeps/ieee754/float128/strtof128.c: New file. * sysdeps/ieee754/float128/strtof128_l.c: New file. * sysdeps/ieee754/float128/strtof128_nan.c: New file. * sysdeps/ieee754/float128/wcstof128.c: New file. * sysdeps/ieee754/float128/wcstof128_l.c: New file. * sysdeps/ieee754/float128/wcstof128_nan.c: New fike. * wcsmbs/Makefile: (CFLAGS-wcstof128.c): Append strtox-CFLAGS. (CFLAGS-wcstof128_l): Likewise. * wcsmbs/wchar.h: Include bits/floatn.h for _Float128 tests. (wcstof128): New declaration. (wcstof128_l): Likewise. --- include/stdlib.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'include/stdlib.h') diff --git a/include/stdlib.h b/include/stdlib.h index 5847445fd3..cae9f2c541 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -219,6 +219,35 @@ libc_hidden_proto (__wcstof_nan) libc_hidden_proto (__wcstod_nan) libc_hidden_proto (__wcstold_nan) +/* Enable _FloatN bits as needed. */ +#include + +#if __HAVE_DISTINCT_FLOAT128 +extern __typeof (strtof128_l) __strtof128_l; + +libc_hidden_proto (__strtof128_l) +libc_hidden_proto (strtof128) + +extern _Float128 __strtof128_nan (const char *, char **, char) + internal_function; +extern _Float128 __wcstof128_nan (const wchar_t *, wchar_t **, wchar_t) + internal_function; + +libc_hidden_proto (__strtof128_nan) +libc_hidden_proto (__wcstof128_nan) + +extern _Float128 __strtof128_internal (const char *__restrict __nptr, + char **__restrict __endptr, + int __group); +libc_hidden_proto (__strtof128_internal) + +extern _Float128 ____strtof128_l_internal (const char *__restrict __nptr, + char **__restrict __endptr, + int __group, __locale_t __loc); + +libc_hidden_proto (____strtof128_l_internal) +#endif + extern char *__ecvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign); extern char *__fcvt (double __value, int __ndigit, int *__restrict __decpt, -- cgit 1.4.1