Phono Phunk

Phono Phunk Version 2. The groove to make yo booty move. Now available in new liquid flavours!

Articles: Pentium 4 Denormalization - CPU Spikes In Audio Applications

Description of the problem and solutions (for developers)

I have gathered a few links below which I thought might help developers who don’t know about this issue.

Threads on music-dsp mailing list

Source: MUSIC-DSP mailing list

A good description of the problem is available in the “Denormalize” thread. Jon Watte sums it up in this post:

“Algorithms with decaying feedback, such as IIR filters and feedback-based reverbs will typically feed data through in an exponentially decreasing series, which will eventually reach the point of tinyness where the numbers are denormal, and your algorithm will suddenly start gobbling up all available CPU.”

Andrew Leary of Korg R&D also follows up with some interesting information about handling P4 denormals with DAZ and FTZ mode (see below for official Intel documentation).

“When this mode is on, and a denormal is encountered or generated in an XMM register, it simply treats it as 0.0. No exception is generated, no denormalization takes place. There is NO hit in execution. It's a beautiful thing. It is certainly something they did right on the P4.”

Information from Intel

Source: Intel

A cubase.net user received this from Intel:

“The P2, P3, and P4 (step c1 and above) processors all are ALL able to handle ‘denormals’ with equal capacity (this being in a similar manner to Athlon as well because Athlon is not impervious to the problem either). P4 processors (including Xeon) stepped earlier than C1 (i.e. C0 and below) are more susceptable to the problem of shrinking number values due to changes made in LATER steppings. Intel also stated that the problem, a product of errant coding for the FPU, is totally preventable when using the SSE or SSE2 (newer) instruction set as opposed to the X87 (older) instruction set. There is no planned ‘fix’ for the hardware at this point because Intel believes that this issue is a manifestation of software architecture, and will be taking steps to educate software developers about the issue.”

The Intel Developer Services web site contains a paper titled “x87 and SSE Floating Point Assists in IA-32: Flush-To-Zero (FTZ) and Denormals-Are-Zero (DAZ)”.

“Since denormals and underflow numbers are an issue with the performance of most processors, instructions have been added to the SSE and SSE2 instruction set to internally fix the numbers in hardware without calling a software exception. SSE/SSE2 and x87 operations are handled differently, so this paper describes them in two separate sections.”

Information on musicdsp.org

Source: www.musicdsp.org

Laurent de Soras of Ohmforce provides a PDF document titled “Denormal numbers in floating point signal processing applications”. It contains details of the problem and possible solutions.

“Nowadays many DSP applications are running on personal computers using general purpose CPUs. However these processors do not have only advantages in the DSP field. This article will discuss the annoying calculation slowness, well known as ‘denormal bug’ that is caused naturally in some circumstances during the processing of very small numbers. Solutions and useful workarounds are also proposed.”

Threads on the K-v-R forum

Source: www.kvr-vst.com

Here is the original thread I started about this issue.

Tobias Fleischer (a.k.a. Tobybear) of  Tobybear Productions and Patrice Tarrabia (a.k.a. Big Tick) of Big Tick Audio Software provide the workaround they used to fix their plugins.

“On every location in the code where denormalization might occur, just add 1.0e-24 to the float value, then subtract it again, that should fix it.”