~kris/9p

9hist

f105ca1fc2c882c6fc1ff486a90b00a72e6532f4 — David du Colombier 24 years ago 5881aef
Plan 9 from Bell Labs 2002-09-15
1 files changed, 18 insertions(+), 11 deletions(-)

M pc/main.c
M pc/main.c => pc/main.c +18 -11
@@ 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);
}