diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-05-10 06:44:30 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2007-05-10 06:44:30 +0000 |
commit | 96bad006f14ac46ca7a59dc4c5ba5ed9ef7a1560 (patch) | |
tree | 9e209798f73466fb9622bf0a9b14f4fabf00eb29 /sysdeps/powerpc/fpu/feholdexcpt.c | |
parent | 2a0a747e57ec96bab9d4a6b7c0b32df82a41316e (diff) | |
download | glibc-96bad006f14ac46ca7a59dc4c5ba5ed9ef7a1560.tar glibc-96bad006f14ac46ca7a59dc4c5ba5ed9ef7a1560.tar.gz glibc-96bad006f14ac46ca7a59dc4c5ba5ed9ef7a1560.tar.bz2 glibc-96bad006f14ac46ca7a59dc4c5ba5ed9ef7a1560.zip |
Updated to fedora-glibc-20070510T0634cvs/fedora-glibc-2_5_90-23
Diffstat (limited to 'sysdeps/powerpc/fpu/feholdexcpt.c')
-rw-r--r-- | sysdeps/powerpc/fpu/feholdexcpt.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/sysdeps/powerpc/fpu/feholdexcpt.c b/sysdeps/powerpc/fpu/feholdexcpt.c index 150becd678..c9432248db 100644 --- a/sysdeps/powerpc/fpu/feholdexcpt.c +++ b/sysdeps/powerpc/fpu/feholdexcpt.c @@ -22,17 +22,24 @@ int feholdexcept (fenv_t *envp) { - fenv_union_t u; + fenv_union_t old, new; - /* Get the current state. */ - u.fenv = *envp = fegetenv_register (); + /* Save the currently set exceptions. */ + old.fenv = *envp = fegetenv_register (); - /* Clear everything except for the rounding mode and non-IEEE arithmetic + /* Clear everything except for the rounding modes and non-IEEE arithmetic flag. */ - u.l[1] = u.l[1] & 7; + new.l[1] = old.l[1] & 7; + new.l[0] = old.l[0]; + + /* If the old env had any eabled 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[1] & 0x000000F8) != 0) + (void)__fe_mask_env (); /* Put the new state in effect. */ - fesetenv_register (u.fenv); + fesetenv_register (new.fenv); return 0; } |