aboutsummaryrefslogtreecommitdiff
path: root/libquadmath/strtod
AgeCommit message (Collapse)AuthorFilesLines
2023-03-03libquadmath: Assorted libquadmath strtoflt128 fixes [PR87204, PR94756]Jakub Jelinek1-12/+26
This patch cherry-pickx 8 commits from glibc which fix various strtod_l bugs. Additionally, it makes mp_limb_t 64-bit on llp64 targets like 64-bit cygwin. 2023-03-03 niXman <i.nixman@autistici.org> Jakub Jelinek <jakub@redhat.com> PR libquadmath/87204 PR libquadmath/94756 * printf/gmp-impl.h (mp_limb_t, mp_limb_signed_t, BITS_PER_MP_LIMB): Use 64-bit limbs on LLP64 targets. * strtod/strtod_l.c (round_and_return): Cherry-pick glibc 9310c284ae9 BZ #16151, 4406c41c1d6 BZ #16965 and fcd6b5ac36a BZ #23279 fixes. (____STRTOF_INTERNAL): Cherry-pick glibc b0debe14fcf BZ #23007, 5556d30caee BZ #18247, 09555b9721d and c6aac3bf366 BZ #26137 and d84f25c7d87 fixes.
2018-11-07Update libquadmath fmaq from glibc, fix nanq issues.Joseph Myers2-14/+19
This patch extends update-quadmath.py to update fmaq from glibc. The issue in that function was that quadmath-imp.h had a struct in a union with mant_high and mant_low fields (up to 64-bit) whereas glibc has mantissa0, mantissa1, mantissa2 and mantissa3 (up to 32-bit). The patch changes those fields to be the same as in glibc, moving printf / strtod code that also uses those fields back to closer to the glibc form. This allows fmaq to be updated automatically from glibc (which brings in at least one bug fix from glibc from 2015). nanq was also using the mant_high field name, and had other issues: it only partly initialized the union from which a value was returned, and setting mant_high to 1 meant a signaling NaN would be returned rather than a quiet NaN. This patch fixes those issues as part of updating it to use the changed interfaces (but does not fix the issue of not using the argument). Bootstrapped with no regressions on x86_64-pc-linux-gnu. * quadmath-imp.h (ieee854_float128): Use mantissa0, mantissa1, mantissa2 and mantissa3 fields instead of mant_high and mant_low. Change nan field to ieee_nan. * update-quadmath.py (update_sources): Also update fmaq.c. * math/nanq.c (nanq): Use ieee_nan field of union. Zero-initialize f. Set quiet_nan field. * printf/flt1282mpn.c, printf/printf_fphex.c, strtod/mpn2flt128.c, strtod/strtoflt128.c: Use mantissa0, mantissa1, mantissa2 and mantissa3 fields. Use ieee_nan and quiet_nan field. * math/fmaq.c: Regenerate from glibc sources with update-quadmath.py. From-SVN: r265874
2013-02-19re PR libquadmath/56379 (libquadmath: Wrong result for strtoflt128.c if ↵Jakub Jelinek1-21/+23
compiled with -O0) PR libquadmath/56379 * strtod/strtod_l.c (mpn_lshift_1): Rewritten as function-like macro. From-SVN: r196155
2013-02-06Revert libquadmath and libssp copyright patches.Richard Sandiford4-4/+5
From-SVN: r195820
2013-02-03Update copyright in libquadmath.Richard Sandiford4-5/+4
From-SVN: r195699
2012-12-03strtod_l.c (___STRTOF_INTERNAL): Fix exponent reading.Tobias Burnus1-0/+3
2012-12-03 Tobias Burnus <burnus@net-b.de> * strtod/strtod_l.c (___STRTOF_INTERNAL): Fix exponent reading. 2012-12-03 Tobias Burnus <burnus@net-b.de> * gfortran.dg/quad_3.f90: New. From-SVN: r194100
2012-11-25re PR libquadmath/55462 (FAIL: gfortran.dg/quad_2.f90 -O* execution test ↵Tobias Burnus1-2/+2
after revision 193770) 2012-11-25 Tobias Burnus <burnus@net-b.de> PR libquadmath/55462 * strtod/strtod_l.c (round_and_return): Use HAVE_FENV_H instead of nonexisting HAVE_GET_ROUNDING_MODE. From-SVN: r193796
2012-11-23quadmath-rounding-mode.h: New.Tobias Burnus1-77/+275
2012-11-23 Tobias Burnus <burnus@net-b.de> Joseph Myers <joseph@codesourcery.com> * quadmath-rounding-mode.h: New. * printf/fpioconst.c: Update from GLIBC. Fix strtod rounding. * printf/fpioconst.h: Ditto. * printf/printf_fp.c (__quadmath_printf_fp): Update from GLIBC. Make printf respect the rounding mode for decimal output. * printf/printf_fphex.c (__quadmath_printf_fphex): Update from GLIBC. Make printf respect the rounding mode for hex output. * strtod/strtod_l.c: Update from GLIBC. Make strtod respect the rounding mode. Fix strtod handling of underflow. Co-Authored-By: Joseph Myers <joseph@codesourcery.com> From-SVN: r193770
2011-02-17libquadmath.texi (FLT128_DIG, [...]): Document.Jakub Jelinek5-0/+1742
* libquadmath.texi (FLT128_DIG, FLT128_MIN_10_EXP, FLT128_MAX_10_EXP): Document. (strtoflt128): Remove obsolete comment. * configure.ac (HAVE_STRTOULL): New check. * printf/gmp-impl.h (mpn_construct_float128): New prototype, define. * printf/mul_n.c: Include <config.h>. * printf/add_n.c: Likewise. * printf/cmp.c: Likewise. * printf/fpioconst.c: Likewise. * printf/mul_1.c: Likewise. * printf/rshift.c: Likewise. * printf/lshift.c: Likewise. * printf/submul_1.c: Likewise. * printf/sub_n.c: Likewise. * printf/divrem.c: Likewise. * printf/addmul_1.c: Likewise. * printf/mul.c: Likewise. * printf/quadmath-printf.h (isupper, isdigit, tolower): Change to avoid evaluating argument multiple times. (isxdigit): Redefine. * strtod/strtoflt128.c: New file. * strtod/strtod_l.c: New file. * strtod/mpn2flt128.c: New file. * strtod/grouping.h: New file. * strtod/tens_in_limb.c: New file. * gdtoa/arith.h: Removed. * gdtoa/gd_qnan.h: Removed. * gdtoa/gdtoa_fltrnds.h: Removed. * gdtoa/gdtoa.h: Removed. * gdtoa/gdtoaimp.h: Removed. * gdtoa/gethex.c: Removed. * gdtoa/gmisc.c: Removed. * gdtoa/hd_init.c: Removed. * gdtoa/hexnan.c: Removed. * gdtoa/makefile: Removed. * gdtoa/misc.c: Removed. * gdtoa/README.gdtoa: Removed. * gdtoa/smisc.c: Removed. * gdtoa/strtodg.c: Removed. * gdtoa/strtopQ.c: Removed. * gdtoa/sum.c: Removed. * quadmath.h (FLT128_DIG, FLT128_MIN_10_EXP, FLT128_MAX_10_EXP): Define. * Makefile.am (libquadmath_la_SOURCES): Remove gdtoa/*, add strtod/strtoflt128.c, strtod/mpn2flt128.c and strtod/tens_in_limb.c. * config.h.in: Regenerated. * configure: Regenerated. * Makefile.in: Regenerated. From-SVN: r170254