[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r3313 - in /trunk/ports: ./ sysdeps/powerpc/nofpu/ sysdeps/powerpc/powerpc32/e500/fpu/



Author: dan
Date: Wed Aug 29 13:23:49 2007
New Revision: 3313

Log:
	* sysdeps/powerpc/powerpc32/e500/fpu/fsetexcptflg.c
	(__fesetexceptflag): Do not clobber other exceptions.  Do not raise
	exceptions.

	Backport:
	2007-08-29  Daniel Jacobowitz  <dan@xxxxxxxxxxxxxxxx>
	* 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.

Modified:
    trunk/ports/ChangeLog.eglibc
    trunk/ports/sysdeps/powerpc/nofpu/feupdateenv.c
    trunk/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c
    trunk/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c
    trunk/ports/sysdeps/powerpc/nofpu/sim-full.c
    trunk/ports/sysdeps/powerpc/powerpc32/e500/fpu/fsetexcptflg.c

Modified: trunk/ports/ChangeLog.eglibc
==============================================================================
--- trunk/ports/ChangeLog.eglibc (original)
+++ trunk/ports/ChangeLog.eglibc Wed Aug 29 13:23:49 2007
@@ -1,3 +1,19 @@
+2007-08-29  Daniel Jacobowitz  <dan@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/powerpc/powerpc32/e500/fpu/fsetexcptflg.c
+	(__fesetexceptflag): Do not clobber other exceptions.  Do not raise
+	exceptions.
+
+	Backport:
+	2007-08-29  Daniel Jacobowitz  <dan@xxxxxxxxxxxxxxxx>
+	* 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-08-14  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	Backport:

Modified: trunk/ports/sysdeps/powerpc/nofpu/feupdateenv.c
==============================================================================
--- trunk/ports/sysdeps/powerpc/nofpu/feupdateenv.c (original)
+++ trunk/ports/sysdeps/powerpc/nofpu/feupdateenv.c Wed Aug 29 13:23:49 2007
@@ -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 @@
 
   /* Raise old exceptions.  */
   __sim_exceptions |= saved_exceptions;
+  if (saved_exceptions & ~__sim_disabled_exceptions)
+    raise (SIGFPE);
 
   return 0;
 }

Modified: trunk/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c
==============================================================================
--- trunk/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c (original)
+++ trunk/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c Wed Aug 29 13:23:49 2007
@@ -28,10 +28,7 @@
 __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;
 }

Modified: trunk/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c
==============================================================================
--- trunk/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c (original)
+++ trunk/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c Wed Aug 29 13:23:49 2007
@@ -26,7 +26,7 @@
 __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;
 }

Modified: trunk/ports/sysdeps/powerpc/nofpu/sim-full.c
==============================================================================
--- trunk/ports/sysdeps/powerpc/nofpu/sim-full.c (original)
+++ trunk/ports/sysdeps/powerpc/nofpu/sim-full.c Wed Aug 29 13:23:49 2007
@@ -37,9 +37,6 @@
 __simulate_exceptions (int x)
 {
   __sim_exceptions |= x;
-  if (x == 0 || __sim_disabled_exceptions & x)
-    /* Ignore exception.  */
-    ;
-  else
+  if (x & ~__sim_disabled_exceptions)
     raise (SIGFPE);
 }

Modified: trunk/ports/sysdeps/powerpc/powerpc32/e500/fpu/fsetexcptflg.c
==============================================================================
--- trunk/ports/sysdeps/powerpc/powerpc32/e500/fpu/fsetexcptflg.c (original)
+++ trunk/ports/sysdeps/powerpc/powerpc32/e500/fpu/fsetexcptflg.c Wed Aug 29 13:23:49 2007
@@ -33,13 +33,10 @@
   flag = *flagp & excepts;
 
   /* Replace the exception status */
-  spefscr = (spefscr & ~FE_ALL_EXCEPT) | flag;
+  spefscr = (spefscr & ~(FE_ALL_EXCEPT & excepts)) | flag;
 
-  /* Store the new status word (along with the rest of the environment).
-     This may cause floating-point exceptions if the restored state
-     requests it.  */
+  /* Store the new status word (along with the rest of the environment).  */
   fesetenv_register (spefscr);
-  feraiseexcept (spefscr & FE_ALL_EXCEPT);
 
   /* Success.  */
   return 0;