Mail Archives: djgpp-workers/2002/03/03/07:36:17
On Sat, 2 Mar 2002, Martin Str|mberg wrote:
> > > - if((j<<(52-k))==ly) yisint = 2-(j&1);
> > > + if((((__uint32_t)(j))<<(52-k))==ly) yisint = 2-(j&1);
> >
> > This seems okay, but is mighty ugly. Can you find a better way of
> > shutting up GCC in this case?
>
> Perhaps. But I'd really like somebody who understands the code to make
> more extensive changes.
What additional changes would you like to suggest? The code is not
hard to understand, I think.
> > > - if(((t1&sign)==sign)&&(s1&sign)==0) s0 += 1;
> > > + if((t1&sign)&&(s1&sign)==0) s0 += 1;
> > > ix0 -= t;
> > > if (ix1 < t1) ix0 -= 1;
> > > ix1 -= t1;
> > >
> > > __int32_t sign = (int)0x80000000U;
> > > __uint32_t t1,s1;
> > >
> > > (t1&sign)==sign checks if the sign bit is set or not. The comparision
> > > with sign should be uneccessary.
> >
> > I don't understand the original problem here: both t1 and sign are
> > int's, so why does GCC complain? What is the exact language of the
> > warning?
>
> No. t1 is unsigned.
Oops, you are right.
> > > - if(ix>0x80000000U) z = (invsqrtpi*cc)/__ieee754_sqrtf(x);
> > > + if((__uint32_t)ix>0x80000000U) z = (invsqrtpi*cc)/__ieee754_sqrtf(x);
> >
> > I tend to think that this is a bug in the original code, since ix is
> > computed a few lines above this like so:
> >
> > ix = hx&0x7fffffff;
> >
> > So its high bit can never be set, and the comparison should always
> > fail. Am I missing something?
>
> I'm missing which file we're talking about...
It's from ef_j1.c.
- Raw text -