summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2001-09-08 22:52:52 +0000
committerJason Wright <jason@cvs.openbsd.org>2001-09-08 22:52:52 +0000
commitc406e3fa5ecce56b1398b863b1fb0b4239040e8c (patch)
treec904e23948590b797e08dfb3a95dafa177461020 /sys/arch/sparc64
parenta7e6a29d369556fc025b65a733ded532aa2ee8f4 (diff)
From NetBSD: debugging stuff to dump fpn's
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/fpu/fpu.c19
1 files changed, 18 insertions, 1 deletions
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 <sparc64/fpu/fpu_emu.h>
#include <sparc64/fpu/fpu_extern.h>
+#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):
*/