aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/sparc/fpu/fenv_private.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/sparc/fpu/fenv_private.h')
-rw-r--r--sysdeps/sparc/fpu/fenv_private.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sysdeps/sparc/fpu/fenv_private.h b/sysdeps/sparc/fpu/fenv_private.h
index dbd1001..da7c7fe 100644
--- a/sysdeps/sparc/fpu/fenv_private.h
+++ b/sysdeps/sparc/fpu/fenv_private.h
@@ -3,6 +3,15 @@
#include <fenv.h>
+/* For internal use only: access the fp state register. */
+#if __WORDSIZE == 64
+# define __fenv_stfsr(X) __asm__ __volatile__ ("stx %%fsr,%0" : "=m" (X))
+# define __fenv_ldfsr(X) __asm__ __volatile__ ("ldx %0,%%fsr" : : "m" (X))
+#else
+# define __fenv_stfsr(X) __asm__ __volatile__ ("st %%fsr,%0" : "=m" (X))
+# define __fenv_ldfsr(X) __asm__ __volatile__ ("ld %0,%%fsr" : : "m" (X))
+#endif
+
static __always_inline void
libc_feholdexcept (fenv_t *e)
{