diff options
author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2011-01-03 14:37:49 +0100 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2011-01-03 14:44:33 +0100 |
commit | 8100a075b7dd7471562decb1860571a335d68b0d (patch) | |
tree | 331eebca0cbafd27aa691da4bc5fa281abb61d3d /libm/sh/sh4/feholdexcpt.c | |
parent | e018b8ba1a0110120429de34366459af0771abe2 (diff) | |
parent | 4ac7ad3543dd6d7780e71af80fa5c45414451719 (diff) |
Merge commit 'origin/master' into prelink
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libm/sh/sh4/feholdexcpt.c')
-rw-r--r-- | libm/sh/sh4/feholdexcpt.c | 29 |
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; +} |