[Mesa-dev] [PATCH 03/13] gallium/auxiliary: Use exp2(x) instead of pow(2.0, x).

Roland Scheidegger sroland at vmware.com
Wed Jul 15 14:29:17 PDT 2015


Am 15.07.2015 um 21:44 schrieb Matt Turner:
> On Mon, Jul 13, 2015 at 5:13 PM, Roland Scheidegger <sroland at vmware.com> wrote:
>> Did you replace 2 of them by exp2f but one by exp2f on purpose?
>>
>> I don't think we can use exp2/exp2f in gallium. This requires msvc 2013
>> (all of exp2, exp2f, powf are c99, powf is supported by older msvc but
>> the others are not). I guess though could throw some wrappers into
>> c99_math.h.
> 
> I think this series adds uses of sinf, cosf, exp2f, logf, and powf.
> 
> I see existing uses of sinf, cosf, logf, and powf in tgsi_exec.c.
> Presumably that means they're safe for me to use elsewhere?
Yes. I think msvc generally has support for these float functions when
there's also double versions of the same function, c99 or not. And the
double version for all of these exist in c89 (in contrast to exp2).

> 
> I also see that lp_test_arit.c uses exp2f. Presumably that means it's
> also safe to use?
Nope. This one is explicitly excluded from being compiled with msvc...
(at least in scons, though I think the exp2f wasn't the only reason)

> 
> I don't see wrappers for any of these.
> 

Maybe we should add one for exp2/exp2f.

Roland



More information about the mesa-dev mailing list