From c091488e5172025eb4e96fcc1141edb89dbc9afd Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 19 Feb 2016 01:07:40 +0000 Subject: Fix ldbl-128ibm powl overflow handling (bug 19674). The ldbl-128ibm implementation of powl has some problems in the case of overflow or underflow, which are mainly visible in non-default rounding modes. * When overflow or underflow is detected early, the correct sign of an overflowing or underflowing result is not allowed for. This is mostly hidden in the default rounding mode by the errno-setting wrappers recomputing the result (except in non-default error-handling modes such as -lieee), but visible in other rounding modes where a result that is not zero or infinity causes the wrappers not to do the recomputation. * The final scaling is done before the sign is incorporated in the result, but should be done afterwards for correct overflowing and underflowing results in directed rounding modes. This patch fixes those problems. Tested for powerpc. [BZ #19674] * sysdeps/ieee754/ldbl-128ibm/e_powl.c (__ieee754_powl): Include sign in overflowing and underflowing results when overflow or underflow is detected early. Include sign in result before rather than after scaling. --- ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 32fae2de24..ec2b50820a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2016-02-19 Joseph Myers + [BZ #19674] + * sysdeps/ieee754/ldbl-128ibm/e_powl.c (__ieee754_powl): Include + sign in overflowing and underflowing results when overflow or + underflow is detected early. Include sign in result before rather + than after scaling. + [BZ #19603] * sysdeps/ieee754/ldbl-128ibm/e_remainderl.c (__ieee754_remainderl): Adjust sign of integer version of low part -- cgit v1.2.3