mirror of
https://sourceware.org/git/glibc.git
synced 2026-01-06 11:51:29 +03:00
[powerpc] fenv_private.h clean up
fenv_private.h includes unused functions, magic macro constants, and some replicated common code fragments. Remove unused functions, replace magic constants with constants from fenv_libc.h, and refactor replicated code. Suggested-by: Paul E. Murphy <murphyp@linux.ibm.com> Reviewed-By: Paul E Murphy <murphyp@linux.ibm.com>
This commit is contained in:
@@ -20,8 +20,6 @@
|
||||
#include <fenv_libc.h>
|
||||
#include <fpu_control.h>
|
||||
|
||||
#define _FPU_MASK_ALL (_FPU_MASK_ZM | _FPU_MASK_OM | _FPU_MASK_UM | _FPU_MASK_XM | _FPU_MASK_IM)
|
||||
|
||||
int
|
||||
__feupdateenv (const fenv_t *envp)
|
||||
{
|
||||
@@ -36,19 +34,8 @@ __feupdateenv (const fenv_t *envp)
|
||||
unchanged. */
|
||||
new.l = (old.l & 0xffffffff1fffff00LL) | (new.l & 0x1ff80fff);
|
||||
|
||||
/* If the old env has no enabled exceptions and the new env has any enabled
|
||||
exceptions, then unmask SIGFPE in the MSR FE0/FE1 bits. This will put
|
||||
the hardware into "precise mode" and may cause the FPU to run slower on
|
||||
some hardware. */
|
||||
if ((old.l & _FPU_MASK_ALL) == 0 && (new.l & _FPU_MASK_ALL) != 0)
|
||||
(void) __fe_nomask_env_priv ();
|
||||
|
||||
/* If the old env had any enabled exceptions and the new env has no enabled
|
||||
exceptions, then mask SIGFPE in the MSR FE0/FE1 bits. This may allow the
|
||||
FPU to run faster because it always takes the default action and can not
|
||||
generate SIGFPE. */
|
||||
if ((old.l & _FPU_MASK_ALL) != 0 && (new.l & _FPU_MASK_ALL) == 0)
|
||||
(void)__fe_mask_env ();
|
||||
__TEST_AND_EXIT_NON_STOP (old.l, new.l);
|
||||
__TEST_AND_ENTER_NON_STOP (old.l, new.l);
|
||||
|
||||
/* Atomically enable and raise (if appropriate) exceptions set in `new'. */
|
||||
fesetenv_register (new.fenv);
|
||||
|
||||
Reference in New Issue
Block a user