From ce7a1add4e1be2b9e80a95eaa4f3e62e56c24612 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Wed, 29 Aug 2007 20:34:36 +0000 Subject: [PATCH] * sysdeps/powerpc/nofpu/fsetexcptflg.c (__fesetexceptflag): Do not clobber other exceptions. * sysdeps/powerpc/nofpu/feupdateenv.c (__feupdateenv): Raise new exceptions. * sysdeps/powerpc/nofpu/fraiseexcpt.c (__feraiseexcept): Handle multiple new exceptions if some are disabled. * sysdeps/powerpc/nofpu/sim-full.c (__simulate_exceptions): Likewise. --- ChangeLog.powerpc | 10 ++++++++++ sysdeps/powerpc/nofpu/feupdateenv.c | 4 +++- sysdeps/powerpc/nofpu/fraiseexcpt.c | 5 +---- sysdeps/powerpc/nofpu/fsetexcptflg.c | 2 +- sysdeps/powerpc/nofpu/sim-full.c | 5 +---- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ChangeLog.powerpc b/ChangeLog.powerpc index c775ee0..463dd29 100644 --- a/ChangeLog.powerpc +++ b/ChangeLog.powerpc @@ -1,3 +1,13 @@ +2007-08-29 Daniel Jacobowitz + + * sysdeps/powerpc/nofpu/fsetexcptflg.c (__fesetexceptflag): Do not + clobber other exceptions. + * sysdeps/powerpc/nofpu/feupdateenv.c (__feupdateenv): Raise new + exceptions. + * sysdeps/powerpc/nofpu/fraiseexcpt.c (__feraiseexcept): Handle + multiple new exceptions if some are disabled. + * sysdeps/powerpc/nofpu/sim-full.c (__simulate_exceptions): Likewise. + 2007-07-13 Steven Munroe * sysdeps/powerpc/nofpu/Makefile: Remove fe_nomask from libm-support. diff --git a/sysdeps/powerpc/nofpu/feupdateenv.c b/sysdeps/powerpc/nofpu/feupdateenv.c index 5073776..17af8d3 100644 --- a/sysdeps/powerpc/nofpu/feupdateenv.c +++ b/sysdeps/powerpc/nofpu/feupdateenv.c @@ -21,12 +21,12 @@ #include "soft-fp.h" #include "soft-supp.h" +#include #include int __feupdateenv (const fenv_t *envp) { - fenv_union_t u; int saved_exceptions; /* Save currently set exceptions. */ @@ -37,6 +37,8 @@ __feupdateenv (const fenv_t *envp) /* Raise old exceptions. */ __sim_exceptions |= saved_exceptions; + if (saved_exceptions & ~__sim_disabled_exceptions) + raise (SIGFPE); return 0; } diff --git a/sysdeps/powerpc/nofpu/fraiseexcpt.c b/sysdeps/powerpc/nofpu/fraiseexcpt.c index cd91502..5d3a87f 100644 --- a/sysdeps/powerpc/nofpu/fraiseexcpt.c +++ b/sysdeps/powerpc/nofpu/fraiseexcpt.c @@ -28,10 +28,7 @@ int __feraiseexcept (int x) { __sim_exceptions |= x; - if (x == 0 || __sim_disabled_exceptions & x) - /* Ignore exception. */ - ; - else + if (x & ~__sim_disabled_exceptions) raise (SIGFPE); return 0; } diff --git a/sysdeps/powerpc/nofpu/fsetexcptflg.c b/sysdeps/powerpc/nofpu/fsetexcptflg.c index 85fd88f..2faeb1f 100644 --- a/sysdeps/powerpc/nofpu/fsetexcptflg.c +++ b/sysdeps/powerpc/nofpu/fsetexcptflg.c @@ -26,7 +26,7 @@ int __fesetexceptflag(const fexcept_t *flagp, int excepts) { /* Ignore exceptions not listed in 'excepts'. */ - __sim_exceptions = *flagp & excepts; + __sim_exceptions = (__sim_exceptions & ~excepts) | (*flagp & excepts); return 0; } diff --git a/sysdeps/powerpc/nofpu/sim-full.c b/sysdeps/powerpc/nofpu/sim-full.c index d018240..d5ee007 100644 --- a/sysdeps/powerpc/nofpu/sim-full.c +++ b/sysdeps/powerpc/nofpu/sim-full.c @@ -37,9 +37,6 @@ void __simulate_exceptions (int x) { __sim_exceptions |= x; - if (x == 0 || __sim_disabled_exceptions & x) - /* Ignore exception. */ - ; - else + if (x & ~__sim_disabled_exceptions) raise (SIGFPE); } -- 2.7.4