For signal processing this has been an issue like forever and right I'm still taking precautions of adding a small constant whenever a denormal can happen, e.g.:
float coef = 0.9f;
for (int i=0; i<cnt; i++) dst[i] = state = state * 0.9f + 1E-15f;
This is obviously hardly ideal, but in the past I had numerous problems that even if I tried to set FTZ, it actually didn't work on some computers apparently. Currently I'm using Intel IPP like this:
ippSetDenormAreZeros(b);
const int success = ippSetFlushToZero(b, NULL) == ippStsNoErr;
So how reliable is this? Is there a better way? A reliable way? Unfortunately I need to support like all ancient CPUs from say Core2duo, Windows and OSX. However I'm generally using SSE2 and newer and CLANG with -mfpmath=sse and -ffast-math.