PowerPC floating point little-endian [4 of 15]
commit650ef4bd7976e36831cba22d838b567d3b5f6e8f
authorAlan Modra <amodra@gmail.com>
Sat, 17 Aug 2013 08:55:51 +0000 (17 18:25 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 4 Oct 2013 01:02:48 +0000 (4 10:32 +0930)
treecf3fc9761840792041ba623b931e925a3833386a
parent765714cafcad7e6168518c61111f07bd955a9fee
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
math/libm-test.inc
sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
sysdeps/ieee754/ldbl-128ibm/s_erfl.c