From 650ef4bd7976e36831cba22d838b567d3b5f6e8f Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 17 Aug 2013 18:25:51 +0930 Subject: PowerPC floating point little-endian [4 of 15] http://sourceware.org/ml/libc-alpha/2013-08/msg00084.html Another batch of ieee854 macros and union replacement. These four files also have bugs fixed with this patch. The fact that the two doubles in an IBM long double may have different signs means that negation and absolute value operations can't just twiddle one sign bit as you can with ieee864 style extended double. fmodl, remainderl, erfl and erfcl all had errors of this type. erfl also returned +1 for large magnitude negative input where it should return -1. The hypotl error is innocuous since the value adjusted twice is only used as a flag. The e_hypotl.c tests for large "a" and small "b" are mutually exclusive because we've already exited when x/y > 2**120. That allows some further small simplifications. [BZ #15734], [BZ #15735] * sysdeps/ieee754/ldbl-128ibm/e_fmodl.c (__ieee754_fmodl): Rewrite all uses of ieee875 long double macros and unions. Simplify test for 0.0L. Correct |x|<|y| and |x|=|y| test. Use ldbl_extract_mantissa value for ix,iy exponents. Properly normalize after ldbl_extract_mantissa, and don't add hidden bit already handled. Don't treat low word of ieee854 mantissa like low word of IBM long double and mask off bit when testing for zero. * sysdeps/ieee754/ldbl-128ibm/e_hypotl.c (__ieee754_hypotl): Rewrite all uses of ieee875 long double macros and unions. Simplify tests for 0.0L and inf. Correct double adjustment of k. Delete dead code adjusting ha,hb. Simplify code setting kld. Delete two600 and two1022, instead use their values. Recognise that tests for large "a" and small "b" are mutually exclusive. Rename vars. Comment. * sysdeps/ieee754/ldbl-128ibm/e_remainderl.c (__ieee754_remainderl): Rewrite all uses of ieee875 long double macros and unions. Simplify test for 0.0L and nan. Correct negation. * sysdeps/ieee754/ldbl-128ibm/s_erfl.c (__erfl): Rewrite all uses of ieee875 long double macros and unions. Correct output for large magnitude x. Correct absolute value calculation. (__erfcl): Likewise. * math/libm-test.inc: Add tests for errors discovered in IBM long double versions of fmodl, remainderl, erfl and erfcl. --- ChangeLog | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 829d4334a8..e3647f33ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +2013-10-04 Alan Modra + + [BZ #15734], [BZ #15735] + * sysdeps/ieee754/ldbl-128ibm/e_fmodl.c (__ieee754_fmodl): Rewrite + all uses of ieee875 long double macros and unions. Simplify test + for 0.0L. Correct |x|<|y| and |x|=|y| test. Use + ldbl_extract_mantissa value for ix,iy exponents. Properly + normalize after ldbl_extract_mantissa, and don't add hidden bit + already handled. Don't treat low word of ieee854 mantissa like + low word of IBM long double and mask off bit when testing for + zero. + * sysdeps/ieee754/ldbl-128ibm/e_hypotl.c (__ieee754_hypotl): Rewrite + all uses of ieee875 long double macros and unions. Simplify tests + for 0.0L and inf. Correct double adjustment of k. Delete dead code + adjusting ha,hb. Simplify code setting kld. Delete two600 and + two1022, instead use their values. Recognise that tests for large + "a" and small "b" are mutually exclusive. Rename vars. Comment. + * sysdeps/ieee754/ldbl-128ibm/e_remainderl.c (__ieee754_remainderl): + Rewrite all uses of ieee875 long double macros and unions. Simplify + test for 0.0L and nan. Correct negation. + * sysdeps/ieee754/ldbl-128ibm/s_erfl.c (__erfl): Rewrite all uses of + ieee875 long double macros and unions. Correct output for large + magnitude x. Correct absolute value calculation. + (__erfcl): Likewise. + * math/libm-test.inc: Add tests for errors discovered in IBM long + double versions of fmodl, remainderl, erfl and erfcl. + 2013-10-04 Alan Modra * sysdeps/ieee754/ldbl-128ibm/e_atan2l.c (__ieee754_atan2l): Rewrite -- cgit 1.4.1