summaryrefslogtreecommitdiff
path: root/libm/sh/sh4/feholdexcpt.c
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2010-12-17 08:11:12 +0100
committerCarmelo Amoroso <carmelo.amoroso@st.com>2010-12-17 08:17:14 +0100
commit5a1453f20c9ba7023f1836bdcd5ab06963f927a1 (patch)
tree4bc922995ebbeb02fa723433416026a6e8207e7a /libm/sh/sh4/feholdexcpt.c
parent6c6720bb831b14c77d3eb8f5f7061e095df6ea47 (diff)
libm_sh: Move fenv functions into sh4 sub-folder
Indeed fenv funxtions are SH4 specific, so move them into an SH4 specific sub-folder. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libm/sh/sh4/feholdexcpt.c')
-rw-r--r--libm/sh/sh4/feholdexcpt.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/libm/sh/sh4/feholdexcpt.c b/libm/sh/sh4/feholdexcpt.c
new file mode 100644
index 000000000..70b51e8dd
--- /dev/null
+++ b/libm/sh/sh4/feholdexcpt.c
@@ -0,0 +1,29 @@
+/*
+ *
+ * Copyright (c) 2007 STMicroelectronics Ltd
+ * Filippo Arcidiacono (filippo.arcidiacono@st.com)
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ *
+ * Taken from glibc 2.6
+ *
+ */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+feholdexcept (fenv_t *envp)
+{
+ unsigned long int temp;
+
+ /* Store the environment. */
+ _FPU_GETCW (temp);
+ envp->__fpscr = temp;
+
+ /* Now set all exceptions to non-stop. */
+ temp &= ~FE_ALL_EXCEPT;
+ _FPU_SETCW (temp);
+
+ return 1;
+}