[Bf-committers] Why not use sqrtf instead of sqrt?

Jean-Luc Peurière bf-committers@blender.org
Wed, 23 Jun 2004 19:31:42 +0200


Le 21 juin 04, à 13:06, Ton Roosendaal a écrit :

> Hi,
>
> Yes anything is possible. This issue requires thorough verification 
> (by the platform maintainers here). For me it's not the issue whether =

> or not to follow a 'standard' since we just depend too much on getting =

> versions compiled for all current platforms. For example gcc didn't 
> follow C99 until recently... and probably MSVC has its own quirks as =

> well.
>
> Our official 'minimum' gcc to support is still 2.95 or so? Do we 
> officially move to 3.3? When? This is all work which might not be 
> easily completed soon...
>
> Most evidently we need proof that such code reshuffle will give actual =

> & relevant benefit! I know Jean-Luc works on getting this done for OSX =

> now... but it seems like only the new G5 processor will bring us true =

> benefit.
>

My results so far are mixed at least. It's faster in texture code, but 
you lost some in render pipeline.
 From what I can gather, it's a gcc issue with stdlibc++ which contains 
slower code.
for pure C linked against only the float math lib, the gain is clear.

this means that if we want to use sqrtf, we will also need to be 
carefull. We imagined at first to simply use defines for platforms who 
have no float support, but if we need to reshuffle the lib building, 
it's less straightforward.

I will continue to get evidences and post results here when I have 
something showable. However it's a boring job so I dont do much at a 
time

-- 
Jean-luc