r1047 - in glibc-package/trunk/debian: . patches
Author: dan
Date: 2005-10-14 18:19:01 +0000 (Fri, 14 Oct 2005)
New Revision: 1047
Added:
glibc-package/trunk/debian/patches/hppa-fenv-align.dpatch
Modified:
glibc-package/trunk/debian/changelog
glibc-package/trunk/debian/patches/00list
Log:
* Use 8-byte-aligned buffers for doubleword FPU transfers on HPPA
(Closes: #333766).
Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog 2005-10-14 17:40:36 UTC (rev 1046)
+++ glibc-package/trunk/debian/changelog 2005-10-14 18:19:01 UTC (rev 1047)
@@ -24,8 +24,10 @@
* Do not complain about incompatible libraries in /etc/ld.so.conf
(Closes: #310047).
* Update hppa assembly for current CVS binutils.
+ * Use 8-byte-aligned buffers for doubleword FPU transfers on HPPA
+ (Closes: #333766).
- -- Daniel Jacobowitz <dan@debian.org> Fri, 14 Oct 2005 13:40:12 -0400
+ -- Daniel Jacobowitz <dan@debian.org> Fri, 14 Oct 2005 14:18:22 -0400
glibc (2.3.5-6) unstable; urgency=low
Modified: glibc-package/trunk/debian/patches/00list
===================================================================
--- glibc-package/trunk/debian/patches/00list 2005-10-14 17:40:36 UTC (rev 1046)
+++ glibc-package/trunk/debian/patches/00list 2005-10-14 18:19:01 UTC (rev 1047)
@@ -87,3 +87,4 @@
i386-amd64-biarch
mips-bits-syscall
hppa-iitlbp
+hppa-fenv-align
Added: glibc-package/trunk/debian/patches/hppa-fenv-align.dpatch
===================================================================
--- glibc-package/trunk/debian/patches/hppa-fenv-align.dpatch 2005-10-14 17:40:36 UTC (rev 1046)
+++ glibc-package/trunk/debian/patches/hppa-fenv-align.dpatch 2005-10-14 18:19:01 UTC (rev 1047)
@@ -0,0 +1,372 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DP:' are a description of the patch.
+# DP: Description: Use temporary, 8-byte-aligned buffers for doubleword transfer.
+# DP: Dpatch author: Daniel Jacobowitz <dan@debian.org>
+# DP: Patch author: Daniel Jacobowitz <dan@debian.org>
+# DP: Upstream status: Not submitted (yet)
+# DP: Date: 2005-10-14
+
+PATCHLEVEL=-p1
+
+if [ $# -ne 2 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -d "$2" -f --no-backup-if-mismatch -p$PATCHLEVEL < $0;;
+ -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p$PATCHLEVEL < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+diff -ur glibc-2.3.5/sysdeps/hppa.bak/fpu/fclrexcpt.c glibc-2.3.5/sysdeps/hppa/fpu/fclrexcpt.c
+--- glibc-2.3.5/sysdeps/hppa.bak/fpu/fclrexcpt.c 2003-12-18 03:56:15.000000000 +0000
++++ glibc-2.3.5/sysdeps/hppa/fpu/fclrexcpt.c 2005-10-14 17:44:33.000000000 +0000
+@@ -23,14 +23,14 @@
+ int
+ feclearexcept (int excepts)
+ {
+- unsigned int sw[2];
++ union { unsigned long long l; unsigned int sw[2]; } s;
+
+ /* Get the current status word. */
+- __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
++ __asm__ ("fstd %%fr0,0(%1)" : "=m" (s.l) : "r" (&s.l));
+
+ /* Clear all the relevant bits. */
+- sw[0] &= ~((excepts & FE_ALL_EXCEPT) << 27);
+- __asm__ ("fldd 0(%0),%%fr0" : : "r" (sw));
++ s.sw[0] &= ~((excepts & FE_ALL_EXCEPT) << 27);
++ __asm__ ("fldd 0(%0),%%fr0" : : "r" (&s.l), "m" (s.l));
+
+ /* Success. */
+ return 0;
+diff -ur glibc-2.3.5/sysdeps/hppa.bak/fpu/fedisblxcpt.c glibc-2.3.5/sysdeps/hppa/fpu/fedisblxcpt.c
+--- glibc-2.3.5/sysdeps/hppa.bak/fpu/fedisblxcpt.c 2001-07-06 04:55:52.000000000 +0000
++++ glibc-2.3.5/sysdeps/hppa/fpu/fedisblxcpt.c 2005-10-14 17:48:10.000000000 +0000
+@@ -23,15 +23,16 @@
+ int
+ fedisableexcept (int excepts)
+ {
+- unsigned int sw[2], old_exc;
++ union { unsigned long long l; unsigned int sw[2]; } s;
++ unsigned int old_exc;
+
+ /* Get the current status word. */
+- __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
++ __asm__ ("fstd %%fr0,0(%1)" : "=m" (s.l) : "r" (&s.l));
+
+- old_exc = sw[0] & FE_ALL_EXCEPT;
++ old_exc = s.sw[0] & FE_ALL_EXCEPT;
+
+- sw[0] &= ~(excepts & FE_ALL_EXCEPT);
+- __asm__ ("fldd 0(%0),%%fr0" : : "r" (sw));
++ s.sw[0] &= ~(excepts & FE_ALL_EXCEPT);
++ __asm__ ("fldd 0(%0),%%fr0" : : "r" (&s.l), "m" (s.l));
+
+ return old_exc;
+ }
+diff -ur glibc-2.3.5/sysdeps/hppa.bak/fpu/feenablxcpt.c glibc-2.3.5/sysdeps/hppa/fpu/feenablxcpt.c
+--- glibc-2.3.5/sysdeps/hppa.bak/fpu/feenablxcpt.c 2001-07-06 04:55:52.000000000 +0000
++++ glibc-2.3.5/sysdeps/hppa/fpu/feenablxcpt.c 2005-10-14 17:48:46.000000000 +0000
+@@ -23,15 +23,16 @@
+ int
+ feenableexcept (int excepts)
+ {
+- unsigned int sw[2], old_exc;
++ union { unsigned long long l; unsigned int sw[2]; } s;
++ unsigned int old_exc;
+
+ /* Get the current status word. */
+- __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
++ __asm__ ("fstd %%fr0,0(%1)" : "=m" (s.l) : "r" (&s.l));
+
+- old_exc = sw[0] & FE_ALL_EXCEPT;
++ old_exc = s.sw[0] & FE_ALL_EXCEPT;
+
+- sw[0] |= (excepts & FE_ALL_EXCEPT);
+- __asm__ ("fldd 0(%0),%%fr0" : : "r" (sw));
++ s.sw[0] |= (excepts & FE_ALL_EXCEPT);
++ __asm__ ("fldd 0(%0),%%fr0" : : "r" (&s.l), "m" (s.l));
+
+ return old_exc;
+ }
+diff -ur glibc-2.3.5/sysdeps/hppa.bak/fpu/fegetenv.c glibc-2.3.5/sysdeps/hppa/fpu/fegetenv.c
+--- glibc-2.3.5/sysdeps/hppa.bak/fpu/fegetenv.c 2003-12-18 03:56:50.000000000 +0000
++++ glibc-2.3.5/sysdeps/hppa/fpu/fegetenv.c 2005-10-14 18:10:42.000000000 +0000
+@@ -19,15 +19,19 @@
+ 02111-1307 USA. */
+
+ #include <fenv.h>
++#include <string.h>
+
+ int
+ fegetenv (fenv_t *envp)
+ {
++ unsigned long long buf[4], *bufptr = buf;
++
+ __asm__ (
+ "fstd,ma %%fr0,8(%1)\n"
+ "fstd,ma %%fr1,8(%1)\n"
+ "fstd,ma %%fr2,8(%1)\n"
+ "fstd %%fr3,0(%1)\n"
+- : "=m" (*envp), "+r" (envp));
++ : "=m" (buf), "+r" (bufptr));
++ memcpy (envp, buf, sizeof (*envp));
+ return 0;
+ }
+diff -ur glibc-2.3.5/sysdeps/hppa.bak/fpu/fegetexcept.c glibc-2.3.5/sysdeps/hppa/fpu/fegetexcept.c
+--- glibc-2.3.5/sysdeps/hppa.bak/fpu/fegetexcept.c 2001-07-06 04:55:52.000000000 +0000
++++ glibc-2.3.5/sysdeps/hppa/fpu/fegetexcept.c 2005-10-14 17:49:08.000000000 +0000
+@@ -23,10 +23,10 @@
+ int
+ fegetexcept (void)
+ {
+- unsigned int sw[2];
++ union { unsigned long long l; unsigned int sw[2]; } s;
+
+ /* Get the current status word. */
+- __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
++ __asm__ ("fstd %%fr0,0(%1)" : "=m" (s.l) : "r" (&s.l));
+
+- return sw[0] & FE_ALL_EXCEPT;
++ return s.sw[0] & FE_ALL_EXCEPT;
+ }
+diff -ur glibc-2.3.5/sysdeps/hppa.bak/fpu/fegetround.c glibc-2.3.5/sysdeps/hppa/fpu/fegetround.c
+--- glibc-2.3.5/sysdeps/hppa.bak/fpu/fegetround.c 2001-07-06 04:55:52.000000000 +0000
++++ glibc-2.3.5/sysdeps/hppa/fpu/fegetround.c 2005-10-14 17:49:28.000000000 +0000
+@@ -23,10 +23,10 @@
+ int
+ fegetround (void)
+ {
+- unsigned int sw[2];
++ union { unsigned long long l; unsigned int sw[2]; } s;
+
+ /* Get the current status word. */
+- __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
++ __asm__ ("fstd %%fr0,0(%1)" : "=m" (s.l) : "r" (&s.l));
+
+- return sw[0] & FE_DOWNWARD;
++ return s.sw[0] & FE_DOWNWARD;
+ }
+diff -ur glibc-2.3.5/sysdeps/hppa.bak/fpu/feholdexcpt.c glibc-2.3.5/sysdeps/hppa/fpu/feholdexcpt.c
+--- glibc-2.3.5/sysdeps/hppa.bak/fpu/feholdexcpt.c 2004-02-21 02:10:01.000000000 +0000
++++ glibc-2.3.5/sysdeps/hppa/fpu/feholdexcpt.c 2005-10-14 18:14:13.000000000 +0000
+@@ -24,33 +24,34 @@
+ int
+ feholdexcept (fenv_t *envp)
+ {
+- fenv_t clear;
+- fenv_t * _regs = envp;
++ union { unsigned long long buf[4]; fenv_t env; } clear;
++ unsigned long long *bufptr;
+
+ /* Store the environment. */
++ bufptr = clear.buf;
+ __asm__ (
+ "fstd,ma %%fr0,8(%1)\n"
+ "fstd,ma %%fr1,8(%1)\n"
+ "fstd,ma %%fr2,8(%1)\n"
+ "fstd %%fr3,0(%1)\n"
+- : "=m" (*_regs), "+r" (_regs));
+- memcpy (&clear, envp, sizeof (clear));
++ : "=m" (clear), "+r" (bufptr));
++ memcpy (envp, &clear.env, sizeof (fenv_t));
+
+ /* Now clear all exceptions. */
+- clear.__status_word &= ~(FE_ALL_EXCEPT << 27);
+- memset (clear.__exception, 0, sizeof (clear.__exception));
++ clear.env.__status_word &= ~(FE_ALL_EXCEPT << 27);
++ memset (clear.env.__exception, 0, sizeof (clear.env.__exception));
+
+ /* And set all exceptions to non-stop. */
+- clear.__status_word &= ~FE_ALL_EXCEPT;
++ clear.env.__status_word &= ~FE_ALL_EXCEPT;
+
+ /* Load the new environment. */
+- _regs = &clear;
++ bufptr = clear.buf;
+ __asm__ (
+ "fldd,ma 8(%0),%%fr0\n"
+ "fldd,ma 8(%0),%%fr1\n"
+ "fldd,ma 8(%0),%%fr2\n"
+ "fldd 0(%0),%%fr3\n"
+- : : "r" (_regs));
++ : : "r" (bufptr), "m" (clear));
+
+ return 0;
+ }
+diff -ur glibc-2.3.5/sysdeps/hppa.bak/fpu/fesetenv.c glibc-2.3.5/sysdeps/hppa/fpu/fesetenv.c
+--- glibc-2.3.5/sysdeps/hppa.bak/fpu/fesetenv.c 2003-12-18 03:57:31.000000000 +0000
++++ glibc-2.3.5/sysdeps/hppa/fpu/fesetenv.c 2005-10-14 18:14:21.000000000 +0000
+@@ -25,40 +25,42 @@
+ int
+ fesetenv (const fenv_t *envp)
+ {
+- fenv_t temp;
+- fenv_t * _regs = &temp;
++ union { unsigned long long buf[4]; fenv_t env; } temp;
++ unsigned long long *bufptr;
+
+ /* Install the environment specified by ENVP. But there are a few
+ values which we do not want to come from the saved environment.
+ Therefore, we get the current environment and replace the values
+ we want to use from the environment specified by the parameter. */
++ bufptr = temp.buf;
+ __asm__ (
+ "fstd,ma %%fr0,8(%1)\n"
+ "fstd,ma %%fr1,8(%1)\n"
+ "fstd,ma %%fr2,8(%1)\n"
+ "fstd %%fr3,0(%1)\n"
+- : "=m" (*_regs), "+r" (_regs));
++ : "=m" (temp), "+r" (bufptr));
+
+- temp.__status_word &= ~(FE_ALL_EXCEPT
+- | (FE_ALL_EXCEPT << 27)
+- | FE_DOWNWARD);
++ temp.env.__status_word &= ~(FE_ALL_EXCEPT
++ | (FE_ALL_EXCEPT << 27)
++ | FE_DOWNWARD);
+ if (envp == FE_DFL_ENV)
+ ;
+ else if (envp == FE_NOMASK_ENV)
+- temp.__status_word |= FE_ALL_EXCEPT;
++ temp.env.__status_word |= FE_ALL_EXCEPT;
+ else
+- temp.__status_word |= (envp->__status_word
+- & (FE_ALL_EXCEPT
+- | FE_DOWNWARD
+- | (FE_ALL_EXCEPT << 27)));
++ temp.env.__status_word |= (envp->__status_word
++ & (FE_ALL_EXCEPT
++ | FE_DOWNWARD
++ | (FE_ALL_EXCEPT << 27)));
+
+ /* Load the new environment. */
++ bufptr = temp.buf;
+ __asm__ (
+ "fldd,ma -8(%1),%%fr3\n"
+ "fldd,ma -8(%1),%%fr2\n"
+ "fldd,ma -8(%1),%%fr1\n"
+ "fldd 0(%1),%%fr0\n"
+- : "=m" (*_regs), "+r" (_regs));
++ : "=m" (temp), "+r" (bufptr));
+
+ /* Success. */
+ return 0;
+diff -ur glibc-2.3.5/sysdeps/hppa.bak/fpu/fesetround.c glibc-2.3.5/sysdeps/hppa/fpu/fesetround.c
+--- glibc-2.3.5/sysdeps/hppa.bak/fpu/fesetround.c 2002-12-03 02:50:52.000000000 +0000
++++ glibc-2.3.5/sysdeps/hppa/fpu/fesetround.c 2005-10-14 17:58:24.000000000 +0000
+@@ -23,17 +23,17 @@
+ int
+ fesetround (int round)
+ {
+- unsigned int sw[2];
++ union { unsigned long long l; unsigned int sw[2]; } s;
+
+ if (round & ~FE_DOWNWARD)
+ /* ROUND is not a valid rounding mode. */
+ return 1;
+
+ /* Get the current status word. */
+- __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
+- sw[0] &= ~FE_DOWNWARD;
+- sw[0] |= round;
+- __asm__ ("fldd 0(%0),%%fr0" : : "r" (sw));
++ __asm__ ("fstd %%fr0,0(%1)" : "=m" (s.l) : "r" (&s.l));
++ s.sw[0] &= ~FE_DOWNWARD;
++ s.sw[0] |= round;
++ __asm__ ("fldd 0(%0),%%fr0" : : "r" (&s.l), "m" (s.l));
+
+ return 0;
+ }
+diff -ur glibc-2.3.5/sysdeps/hppa.bak/fpu/feupdateenv.c glibc-2.3.5/sysdeps/hppa/fpu/feupdateenv.c
+--- glibc-2.3.5/sysdeps/hppa.bak/fpu/feupdateenv.c 2004-04-17 22:51:43.000000000 +0000
++++ glibc-2.3.5/sysdeps/hppa/fpu/feupdateenv.c 2005-10-14 18:10:40.000000000 +0000
+@@ -19,18 +19,19 @@
+ 02111-1307 USA. */
+
+ #include <fenv.h>
++#include <string.h>
+
+ int
+ feupdateenv (const fenv_t *envp)
+ {
+- unsigned int sw[2];
++ union { unsigned long long l; unsigned int sw[2]; } s;
+
+ /* Get the current exception status. */
+- __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
++ __asm__ ("fstd %%fr0,0(%1)" : "=m" (s.l) : "r" (&s.l));
+ /* Install new environment. */
+ fesetenv (envp);
+ /* Raise the saved exceptions */
+- feraiseexcept(sw[0] & FE_ALL_EXCEPT);
++ feraiseexcept(s.sw[0] & FE_ALL_EXCEPT);
+
+ /* Success. */
+ return 0;
+diff -ur glibc-2.3.5/sysdeps/hppa.bak/fpu/fgetexcptflg.c glibc-2.3.5/sysdeps/hppa/fpu/fgetexcptflg.c
+--- glibc-2.3.5/sysdeps/hppa.bak/fpu/fgetexcptflg.c 2001-07-06 04:55:52.000000000 +0000
++++ glibc-2.3.5/sysdeps/hppa/fpu/fgetexcptflg.c 2005-10-14 17:57:37.000000000 +0000
+@@ -23,12 +23,12 @@
+ int
+ fegetexceptflag (fexcept_t *flagp, int excepts)
+ {
+- unsigned int sw[2];
++ union { unsigned long long l; unsigned int sw[2]; } s;
+
+ /* Get the current status word. */
+- __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
++ __asm__ ("fstd %%fr0,0(%1)" : "=m" (s.l) : "r" (&s.l));
+
+- *flagp = (sw[0] >> 27) & excepts & FE_ALL_EXCEPT;
++ *flagp = (s.sw[0] >> 27) & excepts & FE_ALL_EXCEPT;
+
+ /* Success. */
+ return 0;
+diff -ur glibc-2.3.5/sysdeps/hppa.bak/fpu/fsetexcptflg.c glibc-2.3.5/sysdeps/hppa/fpu/fsetexcptflg.c
+--- glibc-2.3.5/sysdeps/hppa.bak/fpu/fsetexcptflg.c 2003-12-18 03:58:26.000000000 +0000
++++ glibc-2.3.5/sysdeps/hppa/fpu/fsetexcptflg.c 2005-10-14 17:57:28.000000000 +0000
+@@ -24,16 +24,16 @@
+ int
+ fesetexceptflag (const fexcept_t *flagp, int excepts)
+ {
+- unsigned int sw[2];
++ union { unsigned long long l; unsigned int sw[2]; } s;
+
+ /* Get the current status word. */
+- __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
++ __asm__ ("fstd %%fr0,0(%1)" : "=m" (s.l) : "r" (&s.l));
+
+ /* Install new enable trap bits */
+- sw[0] |= (*flagp & excepts & FE_ALL_EXCEPT) << 27;
++ s.sw[0] |= (*flagp & excepts & FE_ALL_EXCEPT) << 27;
+
+ /* Store the new status word. */
+- __asm__ ("fldd 0(%0),%%fr0" : : "r" (sw));
++ __asm__ ("fldd 0(%0),%%fr0" : : "r" (&s.l), "m" (s.l));
+
+ /* Success. */
+ return 0;
+diff -ur glibc-2.3.5/sysdeps/hppa.bak/fpu/ftestexcept.c glibc-2.3.5/sysdeps/hppa/fpu/ftestexcept.c
+--- glibc-2.3.5/sysdeps/hppa.bak/fpu/ftestexcept.c 2001-07-06 04:55:52.000000000 +0000
++++ glibc-2.3.5/sysdeps/hppa/fpu/ftestexcept.c 2005-10-14 18:10:05.000000000 +0000
+@@ -23,10 +23,10 @@
+ int
+ fetestexcept (int excepts)
+ {
+- unsigned int sw[2];
++ union { unsigned long long l; unsigned int sw[2]; } s;
+
+ /* Get the current status word. */
+- __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
++ __asm__ ("fstd %%fr0,0(%1)" : "=m" (s.l) : "r" (&s.l));
+
+- return (sw[0] >> 27) & excepts & FE_ALL_EXCEPT;
++ return (s.sw[0] >> 27) & excepts & FE_ALL_EXCEPT;
+ }
Property changes on: glibc-package/trunk/debian/patches/hppa-fenv-align.dpatch
___________________________________________________________________
Name: svn:executable
+ *
Reply to: