Is the use of such tricks discouraged for GEGL (because gfloats could
be doubles at some point?)
We can take the absolute value by setting the sign bit to zero:
// Example 13.24
float f;
*(int*)f = 0x7FFF; // set sign bit to zero
(From http://www.agner.org/optimize/optimizing_cpp.pdf)
On 08/06/2009 10:02 PM, Nicolas Robidoux wrote:
Michael:
I doubt that the gained speed in execution performance outweights
the messier code.
The bit twiddling absolute value was just an example. It's a
branch-free float minmod we're actually after.
Do I gather that it may be OK to use
Ralf Meyer (another Laurentian prof) did some quick and dirty
experimentation with preliminary versions of bit-twiddling minmods and
found that on PowerPC chips it made a big difference. Not on Intel.
Not really surprising: Avoiding branches like the plague is more
relevant to PowerPC/cell than
3 matches
Mail list logo