From c406e3fa5ecce56b1398b863b1fb0b4239040e8c Mon Sep 17 00:00:00 2001 From: Jason Wright Date: Sat, 8 Sep 2001 22:52:52 +0000 Subject: From NetBSD: debugging stuff to dump fpn's --- sys/arch/sparc64/fpu/fpu.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/arch/sparc64/fpu/fpu.c b/sys/arch/sparc64/fpu/fpu.c index 2f4d8137fe9..b691dfc214c 100644 --- a/sys/arch/sparc64/fpu/fpu.c +++ b/sys/arch/sparc64/fpu/fpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fpu.c,v 1.1 2001/09/08 22:33:51 jason Exp $ */ +/* $OpenBSD: fpu.c,v 1.2 2001/09/08 22:52:51 jason Exp $ */ /* $NetBSD: fpu.c,v 1.11 2000/12/06 01:47:50 mrg Exp $ */ /* @@ -58,6 +58,23 @@ #include #include +#ifdef DEBUG +int fpe_debug = 0; + +/* + * Dump a `fpn' structure. + */ +void +fpu_dumpfpn(struct fpn *fp) +{ + static char *class[] = { "SNAN", "QNAN", "ZERO", "NUM", "INF" }; + + printf("%s %c.%x %x %x %xE%d", class[fp->fp_class + 2], + fp->fp_sign ? '-' : ' ', fp->fp_mant[0], fp->fp_mant[1], + fp->fp_mant[2], fp->fp_mant[3], fp->fp_exp); +} +#endif + /* * fpu_execute returns the following error numbers (0 = no error): */ -- cgit v1.2.3