summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch/sparc/gen/fpgetround.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/arch/sparc/gen/fpgetround.c')
-rw-r--r--lib/libc/arch/sparc/gen/fpgetround.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/libc/arch/sparc/gen/fpgetround.c b/lib/libc/arch/sparc/gen/fpgetround.c
new file mode 100644
index 00000000000..6cd5b4a126c
--- /dev/null
+++ b/lib/libc/arch/sparc/gen/fpgetround.c
@@ -0,0 +1,15 @@
+/*
+ * Written by J.T. Conklin, Apr 10, 1995
+ * Public domain.
+ */
+
+#include <ieeefp.h>
+
+fp_rnd
+fpgetround()
+{
+ int x;
+
+ __asm__("st %%fsr,%0" : "=m" (*&x));
+ return (x >> 30) & 0x03;
+}