* 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.
This commit is contained in:
Daniel Jacobowitz 2007-08-29 20:34:36 +00:00
parent ceb34e81f0
commit ce7a1add4e
5 changed files with 16 additions and 10 deletions

View File

@ -1,3 +1,13 @@
2007-08-29 Daniel Jacobowitz <dan@codesourcery.com>
* 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 <sjmunroe@us.ibm.com>
* sysdeps/powerpc/nofpu/Makefile: Remove fe_nomask from libm-support.

View File

@ -21,12 +21,12 @@
#include "soft-fp.h"
#include "soft-supp.h"
#include <signal.h>
#include <bp-sym.h>
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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);
}