I'm witing code in C for the SHARC ADSP-21060. After getting slews
of floating point underflow errors (via the STKY reg / interrupt), Analog Device's tech. support tells me the ADSP-21060 generates a floating point underflow (setting the STKY register AUS bit and causing an interrupt, if enabled) when casting a float to an int (in C) for float values between -1.0 and 1.0. This also causes the C math library functions sin and cod (and perhaps others) as well as stdio lib functions (and others?) to generate this error. I initially took the pains to clear STKY bit, mask the interrupt, to the cast / call the lib function, then re-enable the interrupt for each suspect line of code. ADI assured me the resulting calculation would be correct (which it seems to be). However, to save time (both processor time and my own) I'm falling back to ignoring the floating point underflow interrupt (which includes the floating point underflow (AUS) and the multiply underflow (MUS) ), while still keeping the other errors (overflows and floating point invalid) errors enabled). I suppose the underflow errors could be useful to prevent against divide by zero when working with VERY small floats, but other than this, I don't see the use of it. Any words of wisdom on what I am missing or experience here would be greatly appreciated. Much Regards, > Donald M. Waldron > Principal Software Engineer > BAE SYSTEMS - IEWS > Nashua, NH > |
SHARC floating point underflow errors
Started by ●March 24, 2003