This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.18-17-gb72ca61


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  b72ca61b71abd3e2d5b6cdb0680d7179f95be222 (commit)
      from  d1141ff6c875bc53c5ef6cd62b1bbfe91bdccd21 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b72ca61b71abd3e2d5b6cdb0680d7179f95be222

commit b72ca61b71abd3e2d5b6cdb0680d7179f95be222
Author: Maciej W. Rozycki <macro@codesourcery.com>
Date:   Thu Aug 22 17:50:20 2013 +0100

    MIPS: Correct the handling of reserved FCSR bits
    
    Reserved bits in the Floating-Point Control and Status Register (FCSR)
    should not be implicitly cleared by fedisableexcept or feenableexcept,
    there is no reason to.  Among these are the 8 condition codes and one of
    the two bits reserved for architecture implementers (bits #22 & #21).
    
    As to the latter, there is no reason to treat any of them as reserved
    either, they should be user controllable and settable via __fpu_control
    override as the user sees fit.  For example in processors implemented by
    MIPS Technologies, such as the 5Kf or the 24Kf, these bits are used to
    change the treatment of denormalised operands and tiny results: bit #22
    is Flush Override (FO) and bit #21 is Flush to Nearest (FN).  They cause
    non-IEEE-compliant behaviour, but some programs may have a use for such
    modes of operation; the library should not obstruct such use just as it
    does not for the architectural Flush to Zero (FS) bit (bit #24).
    
    Therefore the change adjusts the reserved mask accordingly and also
    documents the distinction between bits 22:21 and 20:18.

diff --git a/ports/ChangeLog.mips b/ports/ChangeLog.mips
index 6e42b77..9b952c6 100644
--- a/ports/ChangeLog.mips
+++ b/ports/ChangeLog.mips
@@ -1,3 +1,12 @@
+2013-08-22  Maciej W. Rozycki  <macro@codesourcery.com>
+
+	* sysdeps/mips/fpu_control.h: Document bits reserved for
+	architecture implementers.
+	(_FPU_RESERVED): Clear bit #21.
+	* sysdeps/mips/fpu/fedisblxcpt.c (fedisableexcept): Don't clear
+	reserved bits.
+	* sysdeps/mips/fpu/feenablxcpt.c (feenableexcept): Likewise.
+
 2013-07-02  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/mips/mips32/libm-test-ulps: Regenerated.
diff --git a/ports/sysdeps/mips/fpu/fedisblxcpt.c b/ports/sysdeps/mips/fpu/fedisblxcpt.c
index 1db197f..7498c0c 100644
--- a/ports/sysdeps/mips/fpu/fedisblxcpt.c
+++ b/ports/sysdeps/mips/fpu/fedisblxcpt.c
@@ -34,7 +34,6 @@ fedisableexcept (int excepts)
   excepts &= FE_ALL_EXCEPT;
 
   new_exc &= ~(excepts << ENABLE_SHIFT);
-  new_exc &= ~_FPU_RESERVED;
   _FPU_SETCW (new_exc);
 
   return old_exc;
diff --git a/ports/sysdeps/mips/fpu/feenablxcpt.c b/ports/sysdeps/mips/fpu/feenablxcpt.c
index 2a3a076..bca8e3d 100644
--- a/ports/sysdeps/mips/fpu/feenablxcpt.c
+++ b/ports/sysdeps/mips/fpu/feenablxcpt.c
@@ -34,7 +34,6 @@ feenableexcept (int excepts)
   excepts &= FE_ALL_EXCEPT;
 
   new_exc |= excepts << ENABLE_SHIFT;
-  new_exc &= ~_FPU_RESERVED;
   _FPU_SETCW (new_exc);
 
   return old_exc;
diff --git a/ports/sysdeps/mips/fpu_control.h b/ports/sysdeps/mips/fpu_control.h
index 6aecb3b..770cbb3 100644
--- a/ports/sysdeps/mips/fpu_control.h
+++ b/ports/sysdeps/mips/fpu_control.h
@@ -28,7 +28,8 @@
  *           causing unimplemented operation exception.  This bit is only
  *           available for MIPS III and newer.
  * 23     -> Condition bit
- * 22-18  -> reserved (read as 0, write with 0)
+ * 22-21  -> reserved for architecture implementers
+ * 20-18  -> reserved (read as 0, write with 0)
  * 17     -> cause bit for unimplemented operation
  * 16     -> cause bit for invalid exception
  * 15     -> cause bit for division by zero exception
@@ -84,7 +85,7 @@ extern fpu_control_t __fpu_control;
 #define _FPU_RC_UP      0x2
 #define _FPU_RC_DOWN    0x3
 
-#define _FPU_RESERVED 0xfebc0000  /* Reserved bits in cw */
+#define _FPU_RESERVED 0xfe9c0000  /* Reserved bits in cw */
 
 
 /* The fdlibm code requires strict IEEE double precision arithmetic,

-----------------------------------------------------------------------

Summary of changes:
 ports/ChangeLog.mips                 |    9 +++++++++
 ports/sysdeps/mips/fpu/fedisblxcpt.c |    1 -
 ports/sysdeps/mips/fpu/feenablxcpt.c |    1 -
 ports/sysdeps/mips/fpu_control.h     |    5 +++--
 4 files changed, 12 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]