about summary refs log tree commit diff
path: root/sysdeps/ieee754/dbl-64/s_llrint.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright dates with scripts/update-copyrights.Joseph Myers2017-01-011-1/+1
|
* Update copyright dates with scripts/update-copyrights.Joseph Myers2016-01-041-1/+1
|
* Fix lrint, llrint, lround, llround missing exceptions for MIPS (bug 16399).Joseph Myers2015-10-091-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For 32-bit MIPS and some other systems, various of the lrint, llrint, lround, llround functions can be missing exceptions on overflow because casts do not (in current GCC) result in the proper exceptions. In the MIPS case there are two problems here: MIPS I code generation uses an assembler macro that doesn't raise exceptions, while the libgcc conversions of floating-point values to long long also do not raise "invalid" on all overflow cases (and can raise spurious "inexact"). This patch adds support in the generic code (only the functions for which this problem has actually been seen) for forcing the "invalid" exception in the problem cases, and enables that support for the affected MIPS cases. Tested for MIPS; also tested for x86_64 and x86 that installed stripped shared libraries are unchanged by this patch. [BZ #16399] * sysdeps/generic/fix-fp-int-convert-overflow.h: New file. * sysdeps/ieee754/dbl-64/s_llrint.c: Include <fenv.h>, <limits.h> and <fix-fp-int-convert-overflow.h>. (__llrint) [FE_INVALID]: Force FE_INVALID exception as needed if FIX_DBL_LLONG_CONVERT_OVERFLOW. * sysdeps/ieee754/dbl-64/s_llround.c: Include <fenv.h>, <limits.h> and <fix-fp-int-convert-overflow.h>. (__llround) [FE_INVALID]: Force FE_INVALID exception as needed if FIX_DBL_LLONG_CONVERT_OVERFLOW. * sysdeps/ieee754/dbl-64/s_lrint.c: Include <fix-fp-int-convert-overflow.h>. (__lrint) [FE_INVALID]: Force FE_INVALID exception as needed if FIX_DBL_LLONG_CONVERT_OVERFLOW. * sysdeps/ieee754/dbl-64/s_lround.c: Include <fix-fp-int-convert-overflow.h>. (__lround) [FE_INVALID]: Force FE_INVALID exception as needed if FIX_DBL_LLONG_CONVERT_OVERFLOW. * sysdeps/ieee754/flt-32/s_llrintf.c: Include <fenv.h>, <limits.h> and <fix-fp-int-convert-overflow.h>. (__llrintf) [FE_INVALID]: Force FE_INVALID exception as needed if FIX_DBL_LLONG_CONVERT_OVERFLOW. * sysdeps/ieee754/flt-32/s_llroundf.c: Include <fenv.h>, <limits.h> and <fix-fp-int-convert-overflow.h>. (__llroundf) [FE_INVALID]: Force FE_INVALID exception as needed if FIX_DBL_LLONG_CONVERT_OVERFLOW. * sysdeps/ieee754/flt-32/s_lrintf.c: Include <fenv.h>, <limits.h> and <fix-fp-int-convert-overflow.h>. (__lrintf) [FE_INVALID]: Force FE_INVALID exception as needed if FIX_DBL_LLONG_CONVERT_OVERFLOW. * sysdeps/ieee754/flt-32/s_lroundf.c: Include <fenv.h>, <limits.h> and <fix-fp-int-convert-overflow.h>. (__lroundf) [FE_INVALID]: Force FE_INVALID exception as needed if FIX_DBL_LLONG_CONVERT_OVERFLOW. * sysdeps/mips/mips32/fpu/fix-fp-int-convert-overflow.h: New file.
* Use math_narrow_eval more consistently.Joseph Myers2015-09-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Where glibc code needs to avoid excess range and precision in floating-point arithmetic, code variously uses either asms or volatile to force the results of that arithmetic to memory; mostly this is conditional on FLT_EVAL_METHOD, but in the case of lrint / llrint functions some use of volatile is unconditional (and is present unnecessarily in versions for long double). This patch make such code use the recently-added math_narrow_eval macro consistently, removing the unnecessary uses of volatile in long double lrint / llrint implementations completely. Tested for x86_64, x86, mips64 and powerpc. * math/s_nexttowardf.c (__nexttowardf): Use math_narrow_eval. * stdlib/strtod_l.c: Include <math_private.h>. (overflow_value): Use math_narrow_eval. (underflow_value): Likewise. * sysdeps/i386/fpu/s_nexttoward.c (__nexttoward): Likewise. * sysdeps/i386/fpu/s_nexttowardf.c (__nexttowardf): Likewise. * sysdeps/ieee754/dbl-64/e_gamma_r.c (gamma_positive): Likewise. (__ieee754_gamma_r): Likewise. * sysdeps/ieee754/dbl-64/gamma_productf.c (__gamma_productf): Likewise. * sysdeps/ieee754/dbl-64/k_rem_pio2.c (__kernel_rem_pio2): Likewise. * sysdeps/ieee754/dbl-64/lgamma_neg.c (__lgamma_neg): Likewise. * sysdeps/ieee754/dbl-64/s_erf.c (__erfc): Likewise. * sysdeps/ieee754/dbl-64/s_llrint.c (__llrint): Likewise. * sysdeps/ieee754/dbl-64/s_lrint.c (__lrint): Likewise. * sysdeps/ieee754/flt-32/e_gammaf_r.c (gammaf_positive): Likewise. (__ieee754_gammaf_r): Likewise. * sysdeps/ieee754/flt-32/k_rem_pio2f.c (__kernel_rem_pio2f): Likewise. * sysdeps/ieee754/flt-32/lgamma_negf.c (__lgamma_negf): Likewise. * sysdeps/ieee754/flt-32/s_erff.c (__erfcf): Likewise. * sysdeps/ieee754/flt-32/s_llrintf.c (__llrintf): Likewise. * sysdeps/ieee754/flt-32/s_lrintf.c (__lrintf): Likewise. * sysdeps/ieee754/ldbl-128/s_llrintl.c (__llrintl): Do not use volatile. * sysdeps/ieee754/ldbl-128/s_lrintl.c (__lrintl): Likewise. * sysdeps/ieee754/ldbl-128/s_nexttoward.c (__nexttoward): Use math_narrow_eval. * sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c (__nexttoward): Likewise. * sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c (__nexttowardf): Likewise. * sysdeps/ieee754/ldbl-96/gamma_product.c (__gamma_product): Likewise. * sysdeps/ieee754/ldbl-96/s_llrintl.c (__llrintl): Do not use volatile. * sysdeps/ieee754/ldbl-96/s_lrintl.c (__lrintl): Likewise. * sysdeps/ieee754/ldbl-96/s_nexttoward.c (__nexttoward): Use math_narrow_eval. * sysdeps/ieee754/ldbl-96/s_nexttowardf.c (__nexttowardf): Likewise. * sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c (__nldbl_nexttowardf): Likewise.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2015-01-021-1/+1
|
* Update copyright notices with scripts/update-copyrightsAllan McRae2014-01-011-1/+1
|
* Update copyright notices with scripts/update-copyrights.Joseph Myers2013-01-021-1/+1
|
* Use <> for math.h and math_private.h everywhere.Richard Henderson2012-03-091-1/+1
| | | | Entire tree edited via find | grep | sed.
* Replace FSF snail mail address with URLs.Paul Eggert2012-02-091-3/+2
|
* [BZ #2592]Ulrich Drepper2006-09-201-14/+9
| | | | | | | | | | | | | | | | | | | | | | 2006-06-17 Joseph S. Myers <joseph@codesourcery.com> [BZ #2592] * math/libm-test.inc (lrint_test_tonearest): New function. (lrint_test_towardzero): New function. (lrint_test_downward): New function. (lrint_test_upward): New function. (main): Run these new tests. * sysdeps/ieee754/dbl-64/s_llrint.c (__llrint): Correct rounding of values near to 0. (two52): Use double not long double. * sysdeps/ieee754/dbl-64/s_lrint.c (__lrint): Likewise. * sysdeps/ieee754/flt-32/s_llrintf.c (__llrintf): Likewise. (two23): Use float not double. * sysdeps/ieee754/flt-32/s_lrintf.c (__lrintf): Likewise. (two23): Use float not double. * sysdeps/ieee754/ldbl-128/s_llrintl.c (__llrintl): Likewise. * sysdeps/ieee754/ldbl-128/s_lrintl.c (__lrintl): Likewise. * sysdeps/ieee754/ldbl-96/s_llrintl.c (__llrintl): Likewise. * sysdeps/ieee754/ldbl-96/s_lrintl.c (__lrintl): Likewise.
* (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.Ulrich Drepper2004-12-221-9/+14
|
* 2.5-18.1Jakub Jelinek2007-07-121-14/+9
|
* Update.Ulrich Drepper2004-02-011-2/+5
| | | | | | | | | | | | | | * math/libm-test.inc (lround_test): Add new test. (llround_test): Likewise. (lrint_test): Likewise. (llrint_test): Likewise. * sysdeps/ieee754/dbl-64/s_lround.c (__lround): Fix special case with result taking up 20 bits. * sysdeps/ieee754/dbl-64/s_lrint.c (__lrint): Likewise. * sysdeps/ieee754/dbl-64/s_llrint.c (__llrint): Likewise.. * sysdeps/ieee754/ldbl-96/s_lroundl.c (__lroundl): Fix special case with result taking up 31 bits. * sysdeps/ieee754/ldbl-96/s_lrintl.c (__lrintl): Likewise.
* Update to LGPL v2.1.Andreas Jaeger2001-07-061-8/+8
| | | | | | | | | | | | | | 2001-07-06 Paul Eggert <eggert@twinsun.com> * manual/argp.texi: Remove ignored LGPL copyright notice; it's not appropriate for documentation anyway. * manual/libc-texinfo.sh: "Library General Public License" -> "Lesser General Public License". 2001-07-06 Andreas Jaeger <aj@suse.de> * All files under GPL/LGPL version 2: Place under LGPL version 2.1.
* Update.Ulrich Drepper1999-07-141-0/+95