[Mesa-dev] [PATCH] glsl: ensure that frexp returns a 0 exponent for zero values

2014-07-18 Thread Ilia Mirkin
The current code appears to work in simple tests, however this will guarantee that the returned exponent is 0 for a 0 value. Signed-off-by: Ilia Mirkin --- I couldn't make a simple test-case that would cause the current logic to fail. However when I did the same thing with doubles, I ran into tr

Re: [Mesa-dev] [PATCH] glsl: ensure that frexp returns a 0 exponent for zero values

2014-07-18 Thread Matt Turner
On Fri, Jul 18, 2014 at 9:19 AM, Ilia Mirkin wrote: > The current code appears to work in simple tests, however this will > guarantee that the returned exponent is 0 for a 0 value. > > Signed-off-by: Ilia Mirkin > --- > > I couldn't make a simple test-case that would cause the current logic to >

Re: [Mesa-dev] [PATCH] glsl: ensure that frexp returns a 0 exponent for zero values

2014-07-18 Thread Ilia Mirkin
On Fri, Jul 18, 2014 at 5:27 PM, Matt Turner wrote: > On Fri, Jul 18, 2014 at 9:19 AM, Ilia Mirkin wrote: >> The current code appears to work in simple tests, however this will >> guarantee that the returned exponent is 0 for a 0 value. >> >> Signed-off-by: Ilia Mirkin >> --- >> >> I couldn't ma

Re: [Mesa-dev] [PATCH] glsl: ensure that frexp returns a 0 exponent for zero values

2014-07-18 Thread Matt Turner
On Fri, Jul 18, 2014 at 2:37 PM, Ilia Mirkin wrote: > On Fri, Jul 18, 2014 at 5:27 PM, Matt Turner wrote: >> For 0.0f, applying the f2i and abs out of order doesn't affect the >> result, but for -0.0f (0x8000, -2147483648) instead of getting 0, >> you'd get abs(-2147483648) (which is likely -