This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH] Remove __isinf_ns



> Ondřej Bílka wrote:
> On Mon, Jun 15, 2015 at 11:44:48AM +0100, Wilco Dijkstra wrote:
> > Remove all uses and definition of the internal function __isinf_ns(l/f) as there is no
> benefit in
> > having it when isinf gets inlined in math.h (I'll post that as a separate patch).
> >
> > GLIBC builds and passes math tests on AArch64. OK for commit?
> >
> Almost ok.
> 
> > diff --git a/math/divtc3.c b/math/divtc3.c
> > index bfd9b3f..c0dee8e 100644
> > --- a/math/divtc3.c
> > +++ b/math/divtc3.c
> > @@ -54,19 +54,19 @@ __divtc3 (long double a, long double b, long double c, long double d)
> >  	  x = __copysignl (INFINITY, c) * a;
> >  	  y = __copysignl (INFINITY, c) * b;
> >  	}
> > -      else if ((__isinf_nsl (a) || __isinf_nsl (b))
> > +      else if ((isinf (a) || isinf (b))
> >  	       && isfinite (c) && isfinite (d))
> >  	{
> > -	  a = __copysignl (__isinf_nsl (a) ? 1 : 0, a);
> > -	  b = __copysignl (__isinf_nsl (b) ? 1 : 0, b);
> > +	  a = __copysignl (isinf (a) ? 1 : 0, a);
> > +	  b = __copysignl (isinf (b) ? 1 : 0, b);
> >  	  x = INFINITY * (a * c + b * d);
> >  	  y = INFINITY * (b * c - a * d);
> >  	}
> > -      else if ((__isinf_nsl (c) || __isinf_nsl (d))
> > +      else if ((isinf (c) || isinf (d))
> >  	       && isfinite (a) && isfinite (b))
> >  	{
> > -	  c = __copysignl (__isinf_nsl (c) ? 1 : 0, c);
> > -	  d = __copysignl (__isinf_nsl (d) ? 1 : 0, d);
> > +	  c = __copysignl (isinf (c) ? 1 : 0, c);
> > +	  d = __copysignl (isinf (d) ? 1 : 0, d);
> >  	  x = 0.0 * (a * c + b * d);
> >  	  y = 0.0 * (b * c - a * d);
> >  	}
> 
> These patterns are unnecessary as with libc they could be written as
> 
> c = isinf (c);
> 
> with libc isinf.

That's not exactly equivalent due to signed zeroes.

Wilco



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]