Thresholding Denormal Data

Denormal numbers are the border values in the floating point format and special case values for the processor. Operations on denormal data make processing slow, even if corresponding interrupts are disabled. Denormal data occur, for example, in filtering by Infinite Impulse Response (IIR) and FIR filters of the signal captured in fixed-point format and converted to the floating point format. To avoid the slowdown effect in denormal data processing, the Intel IPP threshold functions can be applied to the input signal before filtering. For example:

if (denormal_data)

ippsThreshold_LT_32f_I( src, len, 1e-6f );

ippsFIR_32f( src, dst, len, st );

The 1e-6 value is the threshold level; the input data below that level are set to zero. Because the Intel IPP threshold function is very fast, the execution of two functions is faster than execution of one, if denormal numbers meet in the source data. Of course, if the denormal data occur while using the filtering procedure, the threshold functions do not help. In this case, for Intel processors beginning with the IntelŪ PentiumŪ 4 processor and including the Itanium® processor and Itanium® 2 processor, it is possible to set a special computation mode - Flush to Zero. You can use the function ippsSetFlushToZero for this purpose. Note that this setting takes effect only when computing is done with the Streaming SIMD Extensions (SSE) and Streaming SIMD Extensions 2 (SSE2) instructions. 

The following table illustrates how denormal data may affect performance and the effect of thresholding denormal data. As you can see, thresholding takes only three clocks more. On the other hand, denormal data can cause the application performance to drop 250 times. 

Data/Method

Normal Denormal Denormal + Threshold
CPU cycles per element (CPE) 46 11467 49