glibc/sysdeps
Stefan Liebler c4d17461e0 S/390: Do not raise inexact exception in lrint/lround. [BZ #19486]
I get some math test-failures on s390 for float/double/ldouble for
various lrint/lround functions like:
lrint (0x1p64): Exception "Inexact" set
lrint (-0x1p64): Exception "Inexact" set
lround (0x1p64): Exception "Inexact" set
lround (-0x1p64): Exception "Inexact" set
...

GCC emits "convert to fixed" instructions for casting floating point
values to integer values. These instructions raise invalid and inexact
exceptions if the floating point value exceeds the integer type ranges.

This patch enables the various FIX_DBL_LONG_CONVERT_OVERFLOW macros in
order to avoid a cast from floating point to integer type and raise the
invalid exception with feraiseexcept.
The ldbl-128 rint/round functions are now using the same logic.

ChangeLog:

	[BZ #19486]
	* sysdeps/s390/fix-fp-int-convert-overflow.h: New File.
	* sysdeps/generic/fix-fp-int-convert-overflow.h
	(FIX_LDBL_LONG_CONVERT_OVERFLOW,
	FIX_LDBL_LLONG_CONVERT_OVERFLOW): New define.
	* sysdeps/arm/fix-fp-int-convert-overflow.h: Likewise.
	* sysdeps/mips/mips32/fpu/fix-fp-int-convert-overflow.h:
	Likewise.
	* sysdeps/ieee754/ldbl-128/s_lrintl.c (__lrintl):
	Avoid conversions to long int where inexact exceptions
	could be raised.
	* sysdeps/ieee754/ldbl-128/s_lroundl.c (__lroundl):
	Likewise.
	* sysdeps/ieee754/ldbl-128/s_llrintl.c (__llrintl):
	Avoid conversions to long long int where inexact exceptions
	could be raised.
	* sysdeps/ieee754/ldbl-128/s_llroundl.c (__llroundl):
	Likewise.
2016-01-18 12:48:06 +01:00
..
aarch64 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
alpha Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
arm S/390: Do not raise inexact exception in lrint/lround. [BZ #19486] 2016-01-18 12:48:06 +01:00
generic S/390: Do not raise inexact exception in lrint/lround. [BZ #19486] 2016-01-18 12:48:06 +01:00
gnu Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
hppa hppa: fix dladdr [BZ #19415] 2016-01-08 02:19:26 -05:00
i386 Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
ia64 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ieee754 S/390: Do not raise inexact exception in lrint/lround. [BZ #19486] 2016-01-18 12:48:06 +01:00
init_array Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
m68k Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mach Update copyright dates committed in 2016 2016-01-06 14:03:10 -08:00
microblaze Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mips S/390: Do not raise inexact exception in lrint/lround. [BZ #19486] 2016-01-18 12:48:06 +01:00
nacl Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nios2 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nptl New pthread_barrier algorithm to fulfill barrier destruction requirements. 2016-01-15 21:20:34 +01:00
posix Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
powerpc powerpc: Enforce compiler barriers on hardware transactions 2016-01-08 17:47:33 -02:00
pthread Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s390 S/390: Do not raise inexact exception in lrint/lround. [BZ #19486] 2016-01-18 12:48:06 +01:00
sh Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
sparc New pthread_barrier algorithm to fulfill barrier destruction requirements. 2016-01-15 21:20:34 +01:00
tile Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
unix sparc: mman.h: fix bad comment insertion 2016-01-16 02:34:15 -05:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
x86 Set index_Fast_Unaligned_Load for Excavator family CPUs 2016-01-14 08:14:31 -08:00
x86_64 Fixed typos in __memcpy_chk. 2016-01-16 14:42:26 +03:00