@@ 423,14 423,12 @@ confinit(void)
static char* mathmsg[] =
{
- "invalid",
- "denormalized",
- "div-by-zero",
- "overflow",
- "underflow",
- "precision",
- "stack",
- "error",
+ nil, /* handled below */
+ "denormalized operand",
+ "division by zero",
+ "numeric overflow",
+ "numeric underflow",
+ "precision loss",
};
static void
@@ 446,14 444,23 @@ mathnote(void)
* Some attention should probably be paid here to the
* exception masks and error summary.
*/
- msg = "unknown";
- for(i = 0; i < 8; i++){
+ msg = "unknown exception";
+ for(i = 1; i <= 5; i++){
if(!((1<<i) & status))
continue;
msg = mathmsg[i];
break;
}
- sprint(note, "sys: fp: %s fppc=0x%lux", msg, up->fpsave.pc);
+ if(status & 0x01){
+ if(status & 0x30){
+ if(status & 0x200)
+ msg = "stack overflow";
+ else
+ msg = "stack underflow";
+ }else
+ msg = "invalid operation";
+ }
+ sprint(note, "sys: fp: %s fppc=0x%lux status=0x%lux", msg, up->fpsave.pc, status);
postnote(up, 1, note, NDebug);
}