Had the idea that you could kill denormals without branching
if you didn't mind "injuring" nearby numbers that weren't
quite denormal:
/* branch-free denormal killer */
inline float FlushToZero( volatile float f )
{
f += 9.8607615E-32f;
return f - 9.8607615E-32f;
}
/* end */
This function leaves anything higher than 9.8607615E-32
(ie 2 ** -103) completely unchanged. Numbers below this
value lose one bit of precision for each binary order of
magnitude they are below it. This has the effect that
denormal numbers lose *all* their precision, ie they
become zero.
Simon Jenkins
(Bristol, UK)