summaryrefslogtreecommitdiffstats
path: root/lib/libc/sparc64/gen/fpgetround.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/sparc64/gen/fpgetround.c')
-rw-r--r--lib/libc/sparc64/gen/fpgetround.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/libc/sparc64/gen/fpgetround.c b/lib/libc/sparc64/gen/fpgetround.c
new file mode 100644
index 0000000..dbc90d7
--- /dev/null
+++ b/lib/libc/sparc64/gen/fpgetround.c
@@ -0,0 +1,21 @@
+/* $NetBSD: fpgetround.c,v 1.2 2002/01/13 21:45:50 thorpej Exp $ */
+
+/*
+ * Written by J.T. Conklin, Apr 10, 1995
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <machine/fsr.h>
+#include <ieeefp.h>
+
+fp_rnd_t
+fpgetround()
+{
+ unsigned int x;
+
+ __asm__("st %%fsr,%0" : "=m" (x));
+ return ((fp_rnd_t)FSR_GET_RD(x));
+}
OpenPOWER on IntegriCloud