Hi, Miller Puckette hat gesagt: // Miller Puckette wrote:
There's another problem that I've been unable to resolve which is why the CPU usage mysteriously goes up on P4s (there have been postings about this but I don't have a P4 handy to try things on...) It has to do with the P4s throwing floating exceptions at rude times.
Richard Dobson once wrote this on csound-list:
This can be handled in the source code either by adding a
similar small value inside the filter loop (bottom of
butter.c):
do {
t = *in++ - a[4] * a[6] - a[5] * a[7];
t += 0.000000001; /* prevent underflow */
y = t * a[1] + a[2] * a[6] + a[3] * a[7];
....
or using the macro widely disseminated via the music-dsp list:
#define IS_DENORMAL(f) (((*(unsigned int*)&f)&0x7f800000)==0)
used:
t = *in++ - a[4] * a[6] - a[5] * a[7];
if (IS_DENORMAL(t))
t = 0.0f;
y = t * a[1] + a[2] * a[6] + a[3] * a[7];
though that assumes 32bit floats, and will presumably need
fiddling for doubles. I get the impression this is
Pentium-specific - it may then also be possible to tell the
FPU not to raise denormal exceptions, or replace the default
handling with something else, or whatever....
Maybe this helps.
Frank Barknecht _ ______footils.org__