1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

float128: Extend the power of ten tables

Update the power of ten tables used by the common implementation when long
double is not the most expressive real type.

	* stdlib/fpioconst.h: Include bits/floatn.h.
	(FPIOCONST_HAVE_EXTENDED_RANGE): New macro for testing how big the
	power of ten table should be.
	(FPIOCONST_POW10_ARRAY_SIZE): Use larger table if above is true.
	* stdlib/fpioconst.c (__tens): Use FPIOCONST_HAVE_EXTENDED_RANGE
	to include larger tables when _Float128 support is enabled.
	(_fpioconst_pow10): Likewise.
This commit is contained in:
Paul E. Murphy
2016-11-04 09:57:27 -02:00
committed by Gabriel F. T. Gomes
parent 81df4d253d
commit 82c19bdfe3
3 changed files with 26 additions and 6 deletions

View File

@ -40,9 +40,19 @@
#define DBL_MAX_10_EXP_LOG 8 /* = floor(log_2(DBL_MAX_10_EXP)) */
#define FLT_MAX_10_EXP_LOG 5 /* = floor(log_2(FLT_MAX_10_EXP)) */
/* On some machines, _Float128 may be ABI-distinct from long double (e.g
IBM extended precision). */
#include <bits/floatn.h>
/* For strtold, we need powers of 10 up to floor (log_2 (LDBL_MANT_DIG
- LDBL_MIN_EXP + 2)). */
#if !defined __NO_LONG_DOUBLE_MATH && __LDBL_MAX_EXP__ > 1024
- LDBL_MIN_EXP + 2)). When _Float128 is enabled in libm and it is
ABI-distinct from long double (e.g. on powerpc64le), we also need powers
of 10 up to floor (log_2 (FLT128_MANT_DIG - FLT128_MIN_EXP + 2)). */
#define FPIOCONST_HAVE_EXTENDED_RANGE \
((!defined __NO_LONG_DOUBLE_MATH && __LDBL_MAX_EXP__ > 1024) \
|| __HAVE_DISTINCT_FLOAT128)
#if FPIOCONST_HAVE_EXTENDED_RANGE
# define FPIOCONST_POW10_ARRAY_SIZE 15
#else
# define FPIOCONST_POW10_ARRAY_SIZE 11