Replace FSF snail mail address with URLs.
[glibc.git] / sysdeps / sh / sh4 / fpu / feholdexcpt.c
blob2b6b9bdc83037af69349bfef0f77c0e5f979f645
1 /* Store current floating-point environment and clear exceptions.
2 Copyright (C) 1997, 1998, 1999, 2000, 2005, 2010
3 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
20 #include <fenv.h>
21 #include <fpu_control.h>
23 int
24 feholdexcept (fenv_t *envp)
26 unsigned long int temp;
28 /* Store the environment. */
29 _FPU_GETCW (temp);
30 envp->__fpscr = temp;
32 /* Clear the status flags. */
33 temp &= ~FE_ALL_EXCEPT;
35 /* Now set all exceptions to non-stop. */
36 temp &= ~(FE_ALL_EXCEPT << 5);
38 _FPU_SETCW (temp);
40 /* Success. */
41 return 0;
43 libm_hidden_def (feholdexcept)