2002-10-19 20:06:29 +00:00
|
|
|
/* Store current floating-point environment and clear exceptions
|
|
|
|
(soft-float edition).
|
2016-01-04 16:05:18 +00:00
|
|
|
Copyright (C) 2002-2016 Free Software Foundation, Inc.
|
2002-10-19 20:06:29 +00:00
|
|
|
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
|
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-03-09 23:56:38 +00:00
|
|
|
License along with the GNU C Library. If not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
2002-10-19 20:06:29 +00:00
|
|
|
|
|
|
|
#include "soft-fp.h"
|
|
|
|
#include "soft-supp.h"
|
|
|
|
|
|
|
|
int
|
2015-01-05 23:06:14 +00:00
|
|
|
__feholdexcept (fenv_t *envp)
|
2002-10-19 20:06:29 +00:00
|
|
|
{
|
|
|
|
fenv_union_t u;
|
|
|
|
|
|
|
|
/* Get the current state. */
|
2008-08-19 16:06:38 +00:00
|
|
|
__fegetenv (envp);
|
2002-10-19 20:06:29 +00:00
|
|
|
|
|
|
|
u.fenv = *envp;
|
|
|
|
/* Clear everything except the rounding mode. */
|
|
|
|
u.l[0] &= 0x3;
|
2007-05-23 17:45:14 +00:00
|
|
|
/* Disable exceptions */
|
|
|
|
u.l[1] = FE_ALL_EXCEPT;
|
2002-10-19 20:06:29 +00:00
|
|
|
|
|
|
|
/* Put the new state in effect. */
|
2015-01-14 21:35:40 +00:00
|
|
|
__fesetenv (&u.fenv);
|
2002-10-19 20:06:29 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2015-01-05 23:06:14 +00:00
|
|
|
libm_hidden_def (__feholdexcept)
|
|
|
|
weak_alias (__feholdexcept, feholdexcept)
|
|
|
|
libm_hidden_weak (feholdexcept)
|