This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PowerPC floating point little-endian [4 of 15]
- From: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Wed, 02 Oct 2013 11:17:13 -0300
- Subject: Re: PowerPC floating point little-endian [4 of 15]
- Authentication-results: sourceware.org; auth=none
- References: <20130710012435 dot GN2602 at bubble dot grove dot modra dot org> <20130710012622 dot GQ2602 at bubble dot grove dot modra dot org> <20130809044210 dot GU3294 at bubble dot grove dot modra dot org>
Hi Alan,
In general the patch is ok, just some points:
On 09-08-2013 01:42, Alan Modra wrote:
> This is a revised version of
> http://sourceware.org/ml/libc-alpha/2013-07/msg00195.html
> containing the followup revised e_fmodl.c patch
> http://sourceware.org/ml/libc-alpha/2013-07/msg00268.html
> with some further e_hypotl.c tidies. The tests there 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.
>
> PR 15734, 15735
As Andreas pointed out use [BZ #15734], [BZ #15735].
> return (x*y)/(x*y);
> if(__builtin_expect(hx<=hy,0)) {
> - if((hx<hy)||(lx<ly)) return x; /* |x|<|y| return x */
> - if(lx==ly)
> - return Zero[(u_int64_t)sx>>63]; /* |x|=|y| return x*0*/
> + if (hx < hy
> + || (((ly ^ sy) & 0x8000000000000000LL) == 0
> + && (int64_t) (lx ^ sx) < (int64_t) (ly ^ sy))
> + || (((lx ^ sx) & 0x8000000000000000LL) != 0
> + && (int64_t) (lx ^ sx) > (int64_t) (ly ^ sy)))
> + return x; /* |x|<|y| return x */
> + if ((lx ^ sx) == (ly ^ sy))
> + return Zero[(uint64_t)sx>>63]; /* |x|=|y| return x*0*/
These bitwise operations are kinda crypt at first sign, care to add a comment
for the need of less than and greater than comparison expressing the need
to check the magnitudes?