PowerPC floating point little-endian [4 of 15]
Adhemerval Zanella
azanella@linux.vnet.ibm.com
Wed Oct 2 14:17:00 GMT 2013
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?
More information about the Libc-alpha
mailing list