[Mesa-dev] [PATCH] faster logbase2() - again

Roland Scheidegger sroland at vmware.com
Wed Jun 8 16:23:00 PDT 2011


Ok I've pushed this.
The mesa part was bogus though (can't use PIPE_CC_GCC there).
Technically, the non-builtin versions are bogus now though if unsigned
isn't 32bit (on ILP64 it is 64bit - I believe some MIPS/ALPHA systems
might use that). But only if the values fed to them are actually larger
than what a 32bit value can be so I'm not too worried.
(I was quickly looking at fixing that but there doesn't seem to be any
easy way to determine the size of an unsigned in a macro, and using c
code for that just seemed backwards.)

Roland

Am 08.06.2011 22:24, schrieb Benjamin Bellec:
> Le 08/06/2011 22:08, Roland Scheidegger a écrit :
>> Looks good to me - but skip the special n <= 1 case that's what the
>> (n|1) input to the __builtin_clz is good for.
> Ok, I'm not familiar with bit manipulation in fact...
> 
>> Oh and I didn't notice before but there's an error in the gcc version
>> check (as that's defined as (__GNUC__ * 100 + __GNUC_MINOR__) - we're
>> ignoring patchlevel). Though as said there's the popcount usage right
>> next to it which doesn't do a version check neither - if that's the only
>> thing requiring gcc 3.4 we should fix that otherwise could just make gcc
>> 3.4 a requirement.
> Ok I did'nt know that.
> 
> Here is my 3 patchs fixed. I hope this are the last of the series :-)
> 
> Benjamin



More information about the mesa-dev mailing list