Re: [Piglit] [PATCH piglit v2] teximage-color: Fix un_to_float for 32-bit builds

2014-09-18 Thread Neil Roberts
Ilia Mirkin imir...@alum.mit.edu writes: Just bikeshedding here, but isn't the common way of doing this to just have (1ULL bits) - 1 ? Yes, that's probably more clear. One advantage of doing the shift in the other direction is if we ever end up supporting textures with 64-bit ints then we

Re: [Piglit] [PATCH piglit v2] teximage-color: Fix un_to_float for 32-bit builds

2014-09-18 Thread Brian Paul
On 09/18/2014 04:24 AM, Neil Roberts wrote: Ilia Mirkin imir...@alum.mit.edu writes: Just bikeshedding here, but isn't the common way of doing this to just have (1ULL bits) - 1 ? Yes, that's probably more clear. One advantage of doing the shift in the other direction is if we ever end up

[Piglit] [PATCH piglit v2] teximage-color: Fix un_to_float for 32-bit builds

2014-09-17 Thread Neil Roberts
Actually I think this might be a slightly cleaner way to do the shift because it doesn't depend on any particular size of unsigned int and there are fewer ~s. - Neil --- 8 --- (use git am --scissors to automatically chop here) The un_to_float function was trying to get the

Re: [Piglit] [PATCH piglit v2] teximage-color: Fix un_to_float for 32-bit builds

2014-09-17 Thread Ken Phillis Jr
This needs some changes since the code may not work on all platforms. On Wed, Sep 17, 2014 at 10:06 AM, Neil Roberts n...@linux.intel.com wrote: Actually I think this might be a slightly cleaner way to do the shift because it doesn't depend on any particular size of unsigned int and there are

Re: [Piglit] [PATCH piglit v2] teximage-color: Fix un_to_float for 32-bit builds

2014-09-17 Thread Neil Roberts
Hi Ken, Ken Phillis Jr kphilli...@gmail.com writes: - unsigned int max = ~(~0ul bits); + unsigned int max = ~0u (sizeof max * 8 - bits); why not use, sizeof(unsigned int)? the call sizeof max may not always work depending on compiler Could you explain which compilers “sizeof

Re: [Piglit] [PATCH piglit v2] teximage-color: Fix un_to_float for 32-bit builds

2014-09-17 Thread Ilia Mirkin
On Wed, Sep 17, 2014 at 11:06 AM, Neil Roberts n...@linux.intel.com wrote: Actually I think this might be a slightly cleaner way to do the shift because it doesn't depend on any particular size of unsigned int and there are fewer ~s. - Neil --- 8 --- (use git am --scissors