This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.21-188-ge4363cf
- From: carlos at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 11 Mar 2015 06:28:54 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.21-188-ge4363cf
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 e4363cfb5760d88a9f353c69383b15d5c2705070 (commit)
via fae1aa8d226ce860124efd67ede03004b19b89e2 (commit)
from 068a6274556f9f362443648f4fd47525c8cf2dba (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=e4363cfb5760d88a9f353c69383b15d5c2705070
commit e4363cfb5760d88a9f353c69383b15d5c2705070
Author: Carlos O'Donell <carlos@systemhalted.org>
Date: Wed Mar 11 02:42:27 2015 -0400
hppa: Fix feupdateenv and fesetexceptflag (Bug 18111).
The function feupdateenv has been fixed to correctly handle FE_DFL_ENV
and FE_NOMASK_ENV.
The fesetexceptflag function has been fixed to correctly handle setting
the new flags instead of just OR-ing the existing flags.
This fixes the test-fenv-return and test-fenvinline failures on hppa.
diff --git a/ChangeLog b/ChangeLog
index 26b6928..2413d24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2015-03-11 Carlos O'Donell <carlos@redhat.com>
+
+ [BZ #18111]
+ * sysdeps/hppa/fpu/fpu_control.h (_FPU_HPPA_SHIFT_FLAGS): Define.
+ (_FPU_SETCW): Initialize cw from fpsr before storing.
+ * sysdeps/hppa/fpu/fsetexcptflg.c: Include fpu_control.h
+ (fesetexceptflag): Rewrite using fpu_control.h.
+ * sysdeps/hppa/fpu/feupdateenv.c: Handle FE_DFL_ENV, and FE_NOMASK_ENV.
+
2015-03-11 John David Anglin <danglin@gcc.gnu.org>
[BZ #18110]
diff --git a/NEWS b/NEWS
index 56405a1..7f22380 100644
--- a/NEWS
+++ b/NEWS
@@ -14,7 +14,7 @@ Version 2.22
17792, 17836, 17912, 17916, 17932, 17944, 17949, 17964, 17965, 17967,
17969, 17978, 17987, 17991, 17996, 17998, 17999, 18019, 18020, 18029,
18030, 18032, 18036, 18038, 18039, 18042, 18043, 18046, 18047, 18104,
- 18110.
+ 18110, 18111.
* Character encoding and ctype tables were updated to Unicode 7.0.0, using
new generator scripts contributed by Pravin Satpute and Mike FABIAN (Red
diff --git a/sysdeps/hppa/fpu/feupdateenv.c b/sysdeps/hppa/fpu/feupdateenv.c
index 931f7e6..345559e 100644
--- a/sysdeps/hppa/fpu/feupdateenv.c
+++ b/sysdeps/hppa/fpu/feupdateenv.c
@@ -29,9 +29,22 @@ __feupdateenv (const fenv_t *envp)
__asm__ ("fstd %%fr0,0(%1) \n\t"
"fldd 0(%1),%%fr0 \n\t"
: "=m" (s.l) : "r" (&s.l));
- memcpy(&temp, envp, sizeof(fenv_t));
- /* Currently raised exceptions not cleared */
- temp.__status_word |= s.sw[0] & (FE_ALL_EXCEPT << 27);
+
+ /* Given environment with exception flags not cleared. */
+ if ((envp != FE_DFL_ENV) && (envp != FE_NOMASK_ENV))
+ {
+ memcpy(&temp, envp, sizeof(fenv_t));
+ temp.__status_word |= s.sw[0] & (FE_ALL_EXCEPT << 27);
+ }
+
+ /* Default environment with exception flags not cleared. */
+ if (envp == FE_DFL_ENV)
+ temp.__status_word = s.sw[0] & (FE_ALL_EXCEPT << 27);
+
+ /* All traps enabled and current exception flags not cleared. */
+ if (envp == FE_NOMASK_ENV)
+ temp.__status_word = (s.sw[0] & (FE_ALL_EXCEPT << 27)) | FE_ALL_EXCEPT;
+
/* Install new environment. */
__fesetenv (&temp);
/* Success. */
diff --git a/sysdeps/hppa/fpu/fpu_control.h b/sysdeps/hppa/fpu/fpu_control.h
index ba9692f..2087928 100644
--- a/sysdeps/hppa/fpu/fpu_control.h
+++ b/sysdeps/hppa/fpu/fpu_control.h
@@ -19,7 +19,7 @@
#ifndef _FPU_CONTROL_H
#define _FPU_CONTROL_H
-/* Masking of interrupts */
+/* Masking of interrupts. */
#define _FPU_MASK_PM 0x00000001 /* Inexact (I) */
#define _FPU_MASK_UM 0x00000002 /* Underflow (U) */
#define _FPU_MASK_OM 0x00000004 /* Overflow (O) */
@@ -30,6 +30,8 @@
#define _FPU_HPPA_MASK_RM 0x00000600 /* Rounding mode mask */
/* Masking of interrupt enable bits. */
#define _FPU_HPPA_MASK_INT 0x0000001f /* Interrupt mask */
+/* Shift by 27 to install flag bits. */
+#define _FPU_HPPA_SHIFT_FLAGS 27
/* There are no reserved bits in the PA fpsr (though some are undefined). */
#define _FPU_RESERVED 0x00000000
@@ -55,6 +57,9 @@ typedef unsigned int fpu_control_t;
#define _FPU_SETCW(cw) \
({ \
union { __extension__ unsigned long long __fpreg; unsigned int __halfreg[2]; } __fullfp; \
+ /* Get the current status word and set the control word. */ \
+ __asm__ ("fstd %%fr0,0(%1)\n\t" \
+ : "=m" (__fullfp.__fpreg) : "r" (&__fullfp.__fpreg) : "%r0"); \
__fullfp.__halfreg[0] = cw; \
__asm__ ("fldd 0(%1),%%fr0\n\t" \
: : "m" (__fullfp.__fpreg), "r" (&__fullfp.__fpreg) : "%r0" ); \
diff --git a/sysdeps/hppa/fpu/fsetexcptflg.c b/sysdeps/hppa/fpu/fsetexcptflg.c
index 2c34a1e..c31de8b 100644
--- a/sysdeps/hppa/fpu/fsetexcptflg.c
+++ b/sysdeps/hppa/fpu/fsetexcptflg.c
@@ -18,19 +18,25 @@
<http://www.gnu.org/licenses/>. */
#include <fenv.h>
-#include <math.h>
+#include <fpu_control.h>
int
fesetexceptflag (const fexcept_t *flagp, int excepts)
{
- union { unsigned long long l; unsigned int sw[2]; } s;
+ fpu_control_t fpsr;
+ fpu_control_t fpsr_new;
/* Get the current status word. */
- __asm__ ("fstd %%fr0,0(%1)" : "=m" (s.l) : "r" (&s.l) : "%r0");
- /* Install new raised trap bits */
- s.sw[0] |= (*flagp & excepts & FE_ALL_EXCEPT) << 27;
+ _FPU_GETCW (fpsr);
+ excepts &= FE_ALL_EXCEPT;
+
+ /* Install new raised flags. */
+ fpsr_new = fpsr & ~(excepts << _FPU_HPPA_SHIFT_FLAGS);
+ fpsr_new |= (*flagp & excepts) << _FPU_HPPA_SHIFT_FLAGS;
+
/* Store the new status word. */
- __asm__ ("fldd 0(%0),%%fr0" : : "r" (&s.l), "m" (s.l) : "%r0");
+ if (fpsr != fpsr_new)
+ _FPU_SETCW (fpsr_new);
/* Success. */
return 0;
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=fae1aa8d226ce860124efd67ede03004b19b89e2
commit fae1aa8d226ce860124efd67ede03004b19b89e2
Author: John David Anglin <danglin@gcc.gnu.org>
Date: Tue Mar 10 23:43:50 2015 -0400
hppa: Fix feholdexcpt and fesetenv (Bug 18110).
The constraints in the inline assembly in feholdexcept and fesetenv
are incorrect. The assembly modifies the buffer pointer, but doesn't
express that in the constraints. The simple fix is to remove the
modification of the buffer pointer which is no longer required by
the existing code, and adjust the one constraint that did express
the modification of bufptr.
The change fixes test-fenv when glibc is compiled with recent gcc.
diff --git a/ChangeLog b/ChangeLog
index cea5b0e..26b6928 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-03-11 John David Anglin <danglin@gcc.gnu.org>
+
+ [BZ #18110]
+ * sysdeps/hppa/fpu/feholdexcpt.c (feholdexcept): Don't modify bufptr in
+ asms.
+ * sysdeps/hppa/fpu/fesetenv.c (fesetenv): Likewise.
+
2015-03-11 Joseph Myers <joseph@codesourcery.com>
* soft-fp/soft-fp.h (_FP_UNREACHABLE): New macro.
diff --git a/NEWS b/NEWS
index 0e224ac..56405a1 100644
--- a/NEWS
+++ b/NEWS
@@ -13,7 +13,8 @@ Version 2.22
16560, 16783, 17269, 17523, 17569, 17588, 17631, 17711, 17776, 17779,
17792, 17836, 17912, 17916, 17932, 17944, 17949, 17964, 17965, 17967,
17969, 17978, 17987, 17991, 17996, 17998, 17999, 18019, 18020, 18029,
- 18030, 18032, 18036, 18038, 18039, 18042, 18043, 18046, 18047, 18104.
+ 18030, 18032, 18036, 18038, 18039, 18042, 18043, 18046, 18047, 18104,
+ 18110.
* Character encoding and ctype tables were updated to Unicode 7.0.0, using
new generator scripts contributed by Pravin Satpute and Mike FABIAN (Red
diff --git a/sysdeps/hppa/fpu/feholdexcpt.c b/sysdeps/hppa/fpu/feholdexcpt.c
index 94eba37..1db2775 100644
--- a/sysdeps/hppa/fpu/feholdexcpt.c
+++ b/sysdeps/hppa/fpu/feholdexcpt.c
@@ -29,8 +29,8 @@ __feholdexcept (fenv_t *envp)
/* Store the environment. */
bufptr = clear.buf;
__asm__ (
- "fstd,ma %%fr0,8(%1)\n"
- : "=m" (clear), "+r" (bufptr) : : "%r0");
+ "fstd %%fr0,0(%1)\n"
+ : "=m" (clear) : "r" (bufptr) : "%r0");
memcpy (envp, &clear.env, sizeof (fenv_t));
/* Clear exception queues */
@@ -40,11 +40,9 @@ __feholdexcept (fenv_t *envp)
/* Now clear all flags */
clear.env.__status_word &= ~(FE_ALL_EXCEPT << 27);
- /* Load the new environment. Note: fr0 must load last to enable T-bit
- Thus we start bufptr at the end and work backwards */
- bufptr = (unsigned long long *)((unsigned int)(clear.buf) + sizeof(unsigned int)*4);
+ /* Load the new environment. Note: fr0 must load last to enable T-bit. */
__asm__ (
- "fldd,mb -8(%0),%%fr0\n"
+ "fldd 0(%0),%%fr0\n"
: : "r" (bufptr), "m" (clear) : "%r0");
return 0;
diff --git a/sysdeps/hppa/fpu/fesetenv.c b/sysdeps/hppa/fpu/fesetenv.c
index 5b33ad6..5de755d 100644
--- a/sysdeps/hppa/fpu/fesetenv.c
+++ b/sysdeps/hppa/fpu/fesetenv.c
@@ -33,7 +33,7 @@ __fesetenv (const fenv_t *envp)
we want to use from the environment specified by the parameter. */
bufptr = temp.buf;
__asm__ (
- "fstd,ma %%fr0,8(%1)\n"
+ "fstd %%fr0,0(%1)\n"
: "=m" (temp) : "r" (bufptr) : "%r0");
temp.env.__status_word &= ~(FE_ALL_EXCEPT
@@ -54,7 +54,7 @@ __fesetenv (const fenv_t *envp)
we take advantage of that to load in reverse order so fr0
is loaded last and T-Bit is enabled. */
__asm__ (
- "fldd,mb -8(%1),%%fr0\n"
+ "fldd 0(%1),%%fr0\n"
: : "m" (temp), "r" (bufptr) : "%r0" );
/* Success. */
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 16 ++++++++++++++++
NEWS | 3 ++-
sysdeps/hppa/fpu/feholdexcpt.c | 10 ++++------
sysdeps/hppa/fpu/fesetenv.c | 4 ++--
sysdeps/hppa/fpu/feupdateenv.c | 19 ++++++++++++++++---
sysdeps/hppa/fpu/fpu_control.h | 7 ++++++-
sysdeps/hppa/fpu/fsetexcptflg.c | 18 ++++++++++++------
7 files changed, 58 insertions(+), 19 deletions(-)
hooks/post-receive
--
GNU C Library master sources