This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PROPOSED PATCH] Transition AltiVec support for setjmp/longjmp
- To: libc-alpha at sourceware dot cygnus dot com
- Subject: [PROPOSED PATCH] Transition AltiVec support for setjmp/longjmp
- From: Daniel Jacobowitz <dmj+ at andrew dot cmu dot edu>
- Date: Sat, 3 Mar 2001 00:04:09 -0500
Well, I got this to work. There's some bits of it I'm not terribly happy
with, and I'm open to suggestions or corrections.
Some comments on the patch:
linuxthreads/ChangeLog:
2001-03-02 Daniel Jacobowitz <djacobowitz@mvista.com>
* ptlongjmp.c: Move from here ...
* sysdeps/pthread/ptlongjmp.c: ... to here.
Necessary to override it with a copy in a sysdep directory.
* sysdeps/unix/sysv/linux/powerpc/altivec/Makefile: New file.
* sysdeps/unix/sysv/linux/powerpc/altivec/Versions: New file.
* sysdeps/unix/sysv/linux/powerpc/altivec/old-ptlongjmp.c: New file.
* sysdeps/unix/sysv/linux/powerpc/altivec/ptlongjmp.c: New file.
sysdeps/powerpc/altivec would actually be more correct, but if I put it
there then there's not really anywhere I can put the original ptlongjmp.c so
that it will get overridden, is there?
The patch doesn't really handle a potential Hurd/PowerPC port anyway; I
would have to have two copies of _longjmp_unwind. I didn't bother because
it is presently a stub.
ChangeLog:
2001-03-02 Daniel Jacobowitz <djacobowitz@mvista.com>
* Versions.def: Add GLIBC_ALTIVEC_2.2 to libc and libpthread.
This is the magic version. It will be used as default for all functions
which expose a jmp_buf if --with-altivec=default is given; otherwise it will
be provided for compatibility if --with-altivec.
* config.h.in: Add ALTIVEC_SUPPORT and ALTIVEC_SUPPORT_DEFAULT.
* config.make.in: Add $(with-altivec).
* configure.in: Add --with-altivec. Include altivec sysdep dirs.
Perhaps a little over-zealous trying to tack /altivec onto things, but
uninteresting otherwise.
* scripts/version.awk: Add support for "local:" and "global:" in
Versions fragments.
This is a hack, I think. The problem is that __sigsetjmp() becomes
versioned; the dynamic linker references this function. Then the clever
linker tries to export it and discovers that ld.so does not have a
GLIBC_ALTIVEC_2.2 version in its map, and chokes. Thus I use this in
sysdeps/powerpc/Versions:
+ld {
+ GLIBC_ALTIVEC_2.2 {
+ local:
+ __sigsetjmp;
+ }
+}
Is this the right approach?
* sysdeps/powerpc/Makefile: Do not force -mppc if $(with-altivec).
Necessary, because -mppc conflicts with -m7400 and prevents altivec from
being recognized. You'd need a binutils/gcc which defaulted to -m7400 or
else you'd need to manually specify -m7400 -Wa,-m7400 to compile this as it
stands; I could add -m7400 conditionally here, I suppose, but I'm not sure
that will always be the right processor option. Especially not if we're
building a libc intended to run on more than just the 74xx.
* sysdeps/powerpc/sysdep.h: Define vector registers and VRSAVE.
Nothing startling about this.
* sysdeps/powerpc/altivec/Makefile: New file.
* sysdeps/powerpc/altivec/Versions: New file.
* sysdeps/powerpc/altivec/__longjmp.S: New file.
* sysdeps/powerpc/altivec/_vec__longjmp.S: New file.
* sysdeps/powerpc/altivec/bits/novec_setjmp.h: New file.
* sysdeps/powerpc/altivec/bits/vec_setjmp.h: New file.
* sysdeps/powerpc/altivec/bsd-_setjmp.S: New file.
* sysdeps/powerpc/altivec/bsd-setjmp.S: New file.
* sysdeps/powerpc/altivec/longjmp.c: New file.
* sysdeps/powerpc/altivec/novec_setjmp.h: New file.
* sysdeps/powerpc/altivec/old-bsd-_setjmp.S: New file.
* sysdeps/powerpc/altivec/old-bsd-setjmp.S: New file.
* sysdeps/powerpc/altivec/old-longjmp.c: New file.
* sysdeps/powerpc/altivec/old-setjmp.S: New file.
* sysdeps/powerpc/altivec/old-sigjmp.c: New file.
* sysdeps/powerpc/altivec/setjmp.S: New file.
* sysdeps/powerpc/altivec/sigjmp.c: New file.
* sysdeps/powerpc/altivec/vec_setjmp.h: New file.
A little more code duplication than I really like, but it works.
* sysdeps/powerpc/altivec-default/bits/setjmp.h: New file.
This was the easiest way to make sure the correct <bits/setjmp.h> got
installed.
--
Daniel Jacobowitz Debian GNU/Linux Developer
Monta Vista Software Debian Security Team
linuxthreads/ChangeLog:
2001-03-02 Daniel Jacobowitz <djacobowitz@mvista.com>
* ptlongjmp.c: Move from here ...
* sysdeps/pthread/ptlongjmp.c: ... to here.
* sysdeps/unix/sysv/linux/powerpc/altivec/Makefile: New file.
* sysdeps/unix/sysv/linux/powerpc/altivec/Versions: New file.
* sysdeps/unix/sysv/linux/powerpc/altivec/old-ptlongjmp.c: New file.
* sysdeps/unix/sysv/linux/powerpc/altivec/ptlongjmp.c: New file.
ChangeLog:
2001-03-02 Daniel Jacobowitz <djacobowitz@mvista.com>
* Versions.def: Add GLIBC_ALTIVEC_2.2 to libc and libpthread.
* config.h.in: Add ALTIVEC_SUPPORT and ALTIVEC_SUPPORT_DEFAULT.
* config.make.in: Add $(with-altivec).
* configure.in: Add --with-altivec. Include altivec sysdep dirs.
* scripts/version.awk: Add support for "local:" and "global:" in
Versions fragments.
* sysdeps/powerpc/Makefile: Do not force -mppc if $(with-altivec).
* sysdeps/powerpc/sysdep.h: Define vector registers and VRSAVE.
* sysdeps/powerpc/altivec/Makefile: New file.
* sysdeps/powerpc/altivec/Versions: New file.
* sysdeps/powerpc/altivec/__longjmp.S: New file.
* sysdeps/powerpc/altivec/_vec__longjmp.S: New file.
* sysdeps/powerpc/altivec/bits/novec_setjmp.h: New file.
* sysdeps/powerpc/altivec/bits/vec_setjmp.h: New file.
* sysdeps/powerpc/altivec/bsd-_setjmp.S: New file.
* sysdeps/powerpc/altivec/bsd-setjmp.S: New file.
* sysdeps/powerpc/altivec/longjmp.c: New file.
* sysdeps/powerpc/altivec/novec_setjmp.h: New file.
* sysdeps/powerpc/altivec/old-bsd-_setjmp.S: New file.
* sysdeps/powerpc/altivec/old-bsd-setjmp.S: New file.
* sysdeps/powerpc/altivec/old-longjmp.c: New file.
* sysdeps/powerpc/altivec/old-setjmp.S: New file.
* sysdeps/powerpc/altivec/old-sigjmp.c: New file.
* sysdeps/powerpc/altivec/setjmp.S: New file.
* sysdeps/powerpc/altivec/sigjmp.c: New file.
* sysdeps/powerpc/altivec/vec_setjmp.h: New file.
* sysdeps/powerpc/altivec-default/bits/setjmp.h: New file.
diff -uNr -x .#* -x CVS libc/Versions.def libc-work/Versions.def
--- libc/Versions.def Fri Mar 2 23:28:54 2001
+++ libc-work/Versions.def Fri Mar 2 23:05:40 2001
@@ -15,6 +15,9 @@
%ifdef USE_IN_LIBIO
HURD_CTHREADS_0.3
%endif
+%ifdef ALTIVEC_SUPPORT
+ GLIBC_ALTIVEC_2.2
+%endif
}
libcrypt {
GLIBC_2.0
@@ -68,6 +71,9 @@
GLIBC_2.1.1
GLIBC_2.1.2
GLIBC_2.2
+%ifdef ALTIVEC_SUPPORT
+ GLIBC_ALTIVEC_2.2
+%endif
}
libresolv {
GLIBC_2.0
diff -uNr -x .#* -x CVS libc/config.h.in libc-work/config.h.in
--- libc/config.h.in Tue Dec 5 02:40:19 2000
+++ libc-work/config.h.in Sun Feb 25 13:00:51 2001
@@ -83,6 +83,13 @@
certain registers (CR0, MQ, CTR, LR) in asm statements. */
#undef BROKEN_PPC_ASM_CR0
+/* Defined on PowerPC if we are providing Altivec support for
+ compatibility. */
+#undef ALTIVEC_SUPPORT
+
+/* Defined on PowerPC if we are providing Altivec support by default. */
+#undef ALTIVEC_SUPPORT_DEFAULT
+
/* Defined to some form of __attribute__ ((...)) if the compiler supports
a different, more efficient calling convention. */
diff -uNr -x .#* -x CVS libc/config.make.in libc-work/config.make.in
--- libc/config.make.in Mon Feb 5 17:58:19 2001
+++ libc-work/config.make.in Mon Feb 26 17:06:27 2001
@@ -70,6 +70,7 @@
add-ons = @subdirs@
cross-compiling = @cross_compiling@
force-install = @force_install@
+with-altivec = @with_altivec@
# Build tools.
CC = @CC@
diff -uNr -x .#* -x CVS libc/configure.in libc-work/configure.in
--- libc/configure.in Thu Feb 22 22:30:29 2001
+++ libc-work/configure.in Mon Feb 26 17:05:26 2001
@@ -59,6 +59,25 @@
AC_ARG_WITH(fp, dnl
[ --with-fp if using floating-point hardware [default=yes]],
with_fp=$withval, with_fp=yes)
+AC_ARG_WITH(altivec, dnl
+[ --with-altivec if altivec hardware is available, or:
+ --with-altivec=default if altivec support should be used for new
+ applications
+ [default=no]],
+ with_altivec=$withval, with_altivec=no)
+if test "$with_altivec" != no; then
+ if test "$with_fpu" = no; then
+ AC_MSG_ERROR(Altivec support requires an FPU)
+ fi
+fi
+if test "$with_altivec" = default; then
+ AC_DEFINE(ALTIVEC_SUPPORT_DEFAULT)
+fi
+if test "$with_altivec" != no; then
+ AC_DEFINE(ALTIVEC_SUPPORT)
+fi
+AC_SUBST(with_altivec)
+
AC_ARG_WITH(binutils, dnl
--with-binutils=PATH specify location of binutils (as and ld),
path_binutils=$withval, path_binutils='')
@@ -391,6 +410,14 @@
tail=$machine
while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do
set $m
+ # Prepend altivec-default if --with-altivec=default
+ if test "$with_altivec" = default; then
+ mach="$mach /$1/altivec-default"
+ fi
+ # Prepend altivec if --with-altivec
+ if test "$with_altivec" != no; then
+ mach="$mach /$1/altivec"
+ fi
# Prepend the machine's FPU directory unless --without-fp.
if test "$with_fp" = yes; then
mach="$mach /$1/fpu"
diff -uNr -x .#* -x CVS libc/linuxthreads/ptlongjmp.c libc-work/linuxthreads/ptlongjmp.c
--- libc/linuxthreads/ptlongjmp.c Tue Oct 27 08:52:00 1998
+++ libc-work/linuxthreads/ptlongjmp.c Wed Dec 31 19:00:00 1969
@@ -1,55 +0,0 @@
-/* Linuxthreads - a simple clone()-based implementation of Posix */
-/* threads for Linux. */
-/* Copyright (C) 1998 Xavier Leroy (Xavier.Leroy@inria.fr) */
-/* */
-/* This program is free software; you can redistribute it and/or */
-/* modify it under the terms of the GNU Library General Public License */
-/* as published by the Free Software Foundation; either version 2 */
-/* of the License, or (at your option) any later version. */
-/* */
-/* This program is distributed in the hope that it will be useful, */
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
-/* GNU Library General Public License for more details. */
-
-/* Redefine siglongjmp and longjmp so that they interact correctly
- with cleanup handlers */
-
-#include <setjmp.h>
-#include "pthread.h"
-#include "internals.h"
-
-/* These functions are not declared anywhere since they shouldn't be
- used at another place but here. */
-extern void __libc_siglongjmp (sigjmp_buf env, int val)
- __attribute__ ((noreturn));
-extern void __libc_longjmp (sigjmp_buf env, int val)
- __attribute__ ((noreturn));
-
-
-static void pthread_cleanup_upto(__jmp_buf target)
-{
- pthread_descr self = thread_self();
- struct _pthread_cleanup_buffer * c;
-
- for (c = THREAD_GETMEM(self, p_cleanup);
- c != NULL && _JMPBUF_UNWINDS(target, c);
- c = c->__prev)
- c->__routine(c->__arg);
- THREAD_SETMEM(self, p_cleanup, c);
- if (THREAD_GETMEM(self, p_in_sighandler)
- && _JMPBUF_UNWINDS(target, THREAD_GETMEM(self, p_in_sighandler)))
- THREAD_SETMEM(self, p_in_sighandler, NULL);
-}
-
-void siglongjmp(sigjmp_buf env, int val)
-{
- pthread_cleanup_upto(env->__jmpbuf);
- __libc_siglongjmp(env, val);
-}
-
-void longjmp(jmp_buf env, int val)
-{
- pthread_cleanup_upto(env->__jmpbuf);
- __libc_longjmp(env, val);
-}
diff -uNr -x .#* -x CVS libc/linuxthreads/sysdeps/pthread/ptlongjmp.c libc-work/linuxthreads/sysdeps/pthread/ptlongjmp.c
--- libc/linuxthreads/sysdeps/pthread/ptlongjmp.c Wed Dec 31 19:00:00 1969
+++ libc-work/linuxthreads/sysdeps/pthread/ptlongjmp.c Tue Oct 27 08:52:00 1998
@@ -0,0 +1,55 @@
+/* Linuxthreads - a simple clone()-based implementation of Posix */
+/* threads for Linux. */
+/* Copyright (C) 1998 Xavier Leroy (Xavier.Leroy@inria.fr) */
+/* */
+/* This program is free software; you can redistribute it and/or */
+/* modify it under the terms of the GNU Library General Public License */
+/* as published by the Free Software Foundation; either version 2 */
+/* of the License, or (at your option) any later version. */
+/* */
+/* This program is distributed in the hope that it will be useful, */
+/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
+/* GNU Library General Public License for more details. */
+
+/* Redefine siglongjmp and longjmp so that they interact correctly
+ with cleanup handlers */
+
+#include <setjmp.h>
+#include "pthread.h"
+#include "internals.h"
+
+/* These functions are not declared anywhere since they shouldn't be
+ used at another place but here. */
+extern void __libc_siglongjmp (sigjmp_buf env, int val)
+ __attribute__ ((noreturn));
+extern void __libc_longjmp (sigjmp_buf env, int val)
+ __attribute__ ((noreturn));
+
+
+static void pthread_cleanup_upto(__jmp_buf target)
+{
+ pthread_descr self = thread_self();
+ struct _pthread_cleanup_buffer * c;
+
+ for (c = THREAD_GETMEM(self, p_cleanup);
+ c != NULL && _JMPBUF_UNWINDS(target, c);
+ c = c->__prev)
+ c->__routine(c->__arg);
+ THREAD_SETMEM(self, p_cleanup, c);
+ if (THREAD_GETMEM(self, p_in_sighandler)
+ && _JMPBUF_UNWINDS(target, THREAD_GETMEM(self, p_in_sighandler)))
+ THREAD_SETMEM(self, p_in_sighandler, NULL);
+}
+
+void siglongjmp(sigjmp_buf env, int val)
+{
+ pthread_cleanup_upto(env->__jmpbuf);
+ __libc_siglongjmp(env, val);
+}
+
+void longjmp(jmp_buf env, int val)
+{
+ pthread_cleanup_upto(env->__jmpbuf);
+ __libc_longjmp(env, val);
+}
diff -uNr -x .#* -x CVS libc/linuxthreads/sysdeps/unix/sysv/linux/powerpc/altivec/Makefile libc-work/linuxthreads/sysdeps/unix/sysv/linux/powerpc/altivec/Makefile
--- libc/linuxthreads/sysdeps/unix/sysv/linux/powerpc/altivec/Makefile Wed Dec 31 19:00:00 1969
+++ libc-work/linuxthreads/sysdeps/unix/sysv/linux/powerpc/altivec/Makefile Sun Feb 25 12:33:43 2001
@@ -0,0 +1,3 @@
+ifeq ($(subdir),linuxthreads)
+libpthread-routines += old-ptlongjmp
+endif
diff -uNr -x .#* -x CVS libc/linuxthreads/sysdeps/unix/sysv/linux/powerpc/altivec/Versions libc-work/linuxthreads/sysdeps/unix/sysv/linux/powerpc/altivec/Versions
--- libc/linuxthreads/sysdeps/unix/sysv/linux/powerpc/altivec/Versions Wed Dec 31 19:00:00 1969
+++ libc-work/linuxthreads/sysdeps/unix/sysv/linux/powerpc/altivec/Versions Tue Feb 27 01:25:11 2001
@@ -0,0 +1,5 @@
+libpthread {
+ GLIBC_ALTIVEC_2.2 {
+ siglongjmp; longjmp;
+ }
+}
diff -uNr -x .#* -x CVS libc/linuxthreads/sysdeps/unix/sysv/linux/powerpc/altivec/old-ptlongjmp.c libc-work/linuxthreads/sysdeps/unix/sysv/linux/powerpc/altivec/old-ptlongjmp.c
--- libc/linuxthreads/sysdeps/unix/sysv/linux/powerpc/altivec/old-ptlongjmp.c Wed Dec 31 19:00:00 1969
+++ libc-work/linuxthreads/sysdeps/unix/sysv/linux/powerpc/altivec/old-ptlongjmp.c Mon Feb 26 22:43:58 2001
@@ -0,0 +1,64 @@
+/* Linuxthreads - a simple clone()-based implementation of Posix */
+/* threads for Linux. */
+/* Copyright (C) 1998 Xavier Leroy (Xavier.Leroy@inria.fr) */
+/* */
+/* This program is free software; you can redistribute it and/or */
+/* modify it under the terms of the GNU Library General Public License */
+/* as published by the Free Software Foundation; either version 2 */
+/* of the License, or (at your option) any later version. */
+/* */
+/* This program is distributed in the hope that it will be useful, */
+/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
+/* GNU Library General Public License for more details. */
+
+/* Redefine siglongjmp and longjmp so that they interact correctly
+ with cleanup handlers */
+
+#include <novec_setjmp.h>
+#include <bp-sym.h>
+#include "pthread.h"
+#include "internals.h"
+
+/* These functions are not declared anywhere since they shouldn't be
+ used at another place but here. */
+extern void _novec__libc_siglongjmp (sigjmp_buf env, int val)
+ __attribute__ ((noreturn));
+extern void _novec__libc_longjmp (sigjmp_buf env, int val)
+ __attribute__ ((noreturn));
+
+
+static void pthread_cleanup_upto(__novec_jmp_buf target)
+{
+ pthread_descr self = thread_self();
+ struct _pthread_cleanup_buffer * c;
+
+ for (c = THREAD_GETMEM(self, p_cleanup);
+ c != NULL && _JMPBUF_UNWINDS(target, c);
+ c = c->__prev)
+ c->__routine(c->__arg);
+ THREAD_SETMEM(self, p_cleanup, c);
+ if (THREAD_GETMEM(self, p_in_sighandler)
+ && _JMPBUF_UNWINDS(target, THREAD_GETMEM(self, p_in_sighandler)))
+ THREAD_SETMEM(self, p_in_sighandler, NULL);
+}
+
+void novec_siglongjmp(sigjmp_buf env, int val)
+{
+ pthread_cleanup_upto(env->__jmpbuf);
+ _novec__libc_siglongjmp(env, val);
+}
+
+void novec_longjmp(jmp_buf env, int val)
+{
+ pthread_cleanup_upto(env->__jmpbuf);
+ _novec__libc_longjmp(env, val);
+}
+
+#ifdef ALTIVEC_SUPPORT_DEFAULT
+symbol_version (BP_SYM (novec_longjmp), BP_SYM (longjmp), GLIBC_2.0);
+symbol_version (BP_SYM (novec_siglongjmp), BP_SYM (siglongjmp), GLIBC_2.0);
+#else
+default_symbol_version (BP_SYM (novec_longjmp), BP_SYM (longjmp), GLIBC_2.0);
+default_symbol_version (BP_SYM (novec_siglongjmp), BP_SYM (siglongjmp), GLIBC_2.0);
+#endif
diff -uNr -x .#* -x CVS libc/linuxthreads/sysdeps/unix/sysv/linux/powerpc/altivec/ptlongjmp.c libc-work/linuxthreads/sysdeps/unix/sysv/linux/powerpc/altivec/ptlongjmp.c
--- libc/linuxthreads/sysdeps/unix/sysv/linux/powerpc/altivec/ptlongjmp.c Wed Dec 31 19:00:00 1969
+++ libc-work/linuxthreads/sysdeps/unix/sysv/linux/powerpc/altivec/ptlongjmp.c Mon Feb 26 22:43:49 2001
@@ -0,0 +1,64 @@
+/* Linuxthreads - a simple clone()-based implementation of Posix */
+/* threads for Linux. */
+/* Copyright (C) 1998 Xavier Leroy (Xavier.Leroy@inria.fr) */
+/* */
+/* This program is free software; you can redistribute it and/or */
+/* modify it under the terms of the GNU Library General Public License */
+/* as published by the Free Software Foundation; either version 2 */
+/* of the License, or (at your option) any later version. */
+/* */
+/* This program is distributed in the hope that it will be useful, */
+/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
+/* GNU Library General Public License for more details. */
+
+/* Redefine siglongjmp and longjmp so that they interact correctly
+ with cleanup handlers */
+
+#include <vec_setjmp.h>
+#include <bp-sym.h>
+#include "pthread.h"
+#include "internals.h"
+
+/* These functions are not declared anywhere since they shouldn't be
+ used at another place but here. */
+extern void _vec__libc_siglongjmp (sigjmp_buf env, int val)
+ __attribute__ ((noreturn));
+extern void _vec__libc_longjmp (sigjmp_buf env, int val)
+ __attribute__ ((noreturn));
+
+
+static void pthread_cleanup_upto(__vec_jmp_buf target)
+{
+ pthread_descr self = thread_self();
+ struct _pthread_cleanup_buffer * c;
+
+ for (c = THREAD_GETMEM(self, p_cleanup);
+ c != NULL && _JMPBUF_UNWINDS(target, c);
+ c = c->__prev)
+ c->__routine(c->__arg);
+ THREAD_SETMEM(self, p_cleanup, c);
+ if (THREAD_GETMEM(self, p_in_sighandler)
+ && _JMPBUF_UNWINDS(target, THREAD_GETMEM(self, p_in_sighandler)))
+ THREAD_SETMEM(self, p_in_sighandler, NULL);
+}
+
+void vec_siglongjmp(sigjmp_buf env, int val)
+{
+ pthread_cleanup_upto(env->__jmpbuf);
+ _vec__libc_siglongjmp(env, val);
+}
+
+void vec_longjmp(jmp_buf env, int val)
+{
+ pthread_cleanup_upto(env->__jmpbuf);
+ _vec__libc_longjmp(env, val);
+}
+
+#ifdef ALTIVEC_SUPPORT_DEFAULT
+default_symbol_version (BP_SYM (vec_longjmp), BP_SYM (longjmp), GLIBC_ALTIVEC_2.2);
+default_symbol_version (BP_SYM (vec_siglongjmp), BP_SYM (siglongjmp), GLIBC_ALTIVEC_2.2);
+#else
+symbol_version (BP_SYM (vec_longjmp), BP_SYM (longjmp), GLIBC_ALTIVEC_2.2);
+symbol_version (BP_SYM (vec_siglongjmp), BP_SYM (siglongjmp), GLIBC_ALTIVEC_2.2);
+#endif
diff -uNr -x .#* -x CVS libc/scripts/versions.awk libc-work/scripts/versions.awk
--- libc/scripts/versions.awk Mon Mar 20 13:33:09 2000
+++ libc-work/scripts/versions.awk Mon Feb 26 21:22:30 2001
@@ -54,6 +54,19 @@
}
else
actver = $1;
+ acttype = "global";
+ next;
+}
+
+# This matches an explicit switch to global symbols.
+/^ global:/ {
+ acttype = "global";
+ next;
+}
+
+# This matches an explicit switch to local symbols.
+/^ local:/ {
+ acttype = "local";
next;
}
@@ -61,7 +74,7 @@
# current library. This is the only place where we print something to
# the intermediate file.
/^ / {
- printf("%s %s %s\n", actlib, actver, $0) | sort;
+ printf("%s %s %s %s\n", actlib, actver, acttype, $0) | sort;
}
@@ -83,6 +96,7 @@
close(sort);
oldlib = "";
oldver = "";
+ oldtype = "";
printf("version-maps =");
while(getline < tmpfile) {
if ($1 != oldlib) {
@@ -103,11 +117,16 @@
closeversion(oldver, veryoldver);
veryoldver = oldver;
}
- printf("%s {\n global:\n", $2) > outfile;
+ printf("%s {\n", $2) > outfile;
oldver = $2;
+ oldtype = "";
+ }
+ if ($3 != oldtype) {
+ printf(" %s:\n", $3) > outfile;
+ oldtype = $3;
}
printf(" ") > outfile;
- for (n = 3; n <= NF; ++n) {
+ for (n = 4; n <= NF; ++n) {
printf(" %s", $n) > outfile;
}
printf("\n") > outfile;
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/Makefile libc-work/sysdeps/powerpc/Makefile
--- libc/sysdeps/powerpc/Makefile Mon Nov 27 18:32:47 2000
+++ libc-work/sysdeps/powerpc/Makefile Mon Feb 26 17:05:26 2001
@@ -1,7 +1,9 @@
# We always want to use the new mnemonic syntax even if we are on a RS6000
# machine.
+ifeq ($(with-altivec),no)
+cflags += -mnew-mnemonics -Wa,-mppc -mpowerpc
asm-CPPFLAGS += -Wa,-mppc
+endif
ifeq ($(subdir),math)
libm-support += fenv_const fe_nomask
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/Makefile libc-work/sysdeps/powerpc/altivec/Makefile
--- libc/sysdeps/powerpc/altivec/Makefile Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/Makefile Sat Feb 24 17:00:50 2001
@@ -0,0 +1,6 @@
+ifeq ($(subdir),setjmp)
+routines += $(addprefix old-, \
+ setjmp sigjmp bsd-setjmp bsd-_setjmp \
+ longjmp)
+routines += _vec__longjmp
+endif
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/Versions libc-work/sysdeps/powerpc/altivec/Versions
--- libc/sysdeps/powerpc/altivec/Versions Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/Versions Tue Feb 27 13:34:05 2001
@@ -0,0 +1,24 @@
+libc {
+ GLIBC_ALTIVEC_2.2 {
+ # functions with special/multiple interfaces
+ _longjmp; __sigsetjmp; _setjmp;
+
+ # l*
+ longjmp;
+
+ # s*
+ setjmp;
+
+ # helper functions
+ __libc_longjmp; __libc_siglongjmp;
+ _vec__libc_longjmp; _vec__libc_siglongjmp;
+ _novec__libc_longjmp; _novec__libc_siglongjmp;
+ }
+}
+
+ld {
+ GLIBC_ALTIVEC_2.2 {
+ local:
+ __sigsetjmp;
+ }
+}
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/__longjmp.S libc-work/sysdeps/powerpc/altivec/__longjmp.S
--- libc/sysdeps/powerpc/altivec/__longjmp.S Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/__longjmp.S Mon Feb 26 17:20:21 2001
@@ -0,0 +1,74 @@
+/* longjmp for PowerPC.
+ Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+#define _ASM
+#define _SETJMP_H
+#include <bits/novec_setjmp.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
+
+ENTRY (BP_SYM (__longjmp))
+ CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
+
+ lwz r1,(JB_GPR1*4)(r3)
+ lwz r2,(JB_GPR2*4)(r3)
+ lwz r0,(JB_LR*4)(r3)
+ lwz r14,((JB_GPRS+0)*4)(r3)
+ lfd fp14,((JB_FPRS+0*2)*4)(r3)
+ lwz r15,((JB_GPRS+1)*4)(r3)
+ lfd fp15,((JB_FPRS+1*2)*4)(r3)
+ lwz r16,((JB_GPRS+2)*4)(r3)
+ lfd fp16,((JB_FPRS+2*2)*4)(r3)
+ lwz r17,((JB_GPRS+3)*4)(r3)
+ lfd fp17,((JB_FPRS+3*2)*4)(r3)
+ lwz r18,((JB_GPRS+4)*4)(r3)
+ lfd fp18,((JB_FPRS+4*2)*4)(r3)
+ lwz r19,((JB_GPRS+5)*4)(r3)
+ lfd fp19,((JB_FPRS+5*2)*4)(r3)
+ lwz r20,((JB_GPRS+6)*4)(r3)
+ lfd fp20,((JB_FPRS+6*2)*4)(r3)
+ mtlr r0
+ lwz r21,((JB_GPRS+7)*4)(r3)
+ lfd fp21,((JB_FPRS+7*2)*4)(r3)
+ lwz r22,((JB_GPRS+8)*4)(r3)
+ lfd fp22,((JB_FPRS+8*2)*4)(r3)
+ lwz r0,(JB_CR*4)(r3)
+ lwz r23,((JB_GPRS+9)*4)(r3)
+ lfd fp23,((JB_FPRS+9*2)*4)(r3)
+ lwz r24,((JB_GPRS+10)*4)(r3)
+ lfd fp24,((JB_FPRS+10*2)*4)(r3)
+ lwz r25,((JB_GPRS+11)*4)(r3)
+ lfd fp25,((JB_FPRS+11*2)*4)(r3)
+ mtcrf 0xFF,r0
+ lwz r26,((JB_GPRS+12)*4)(r3)
+ lfd fp26,((JB_FPRS+12*2)*4)(r3)
+ lwz r27,((JB_GPRS+13)*4)(r3)
+ lfd fp27,((JB_FPRS+13*2)*4)(r3)
+ lwz r28,((JB_GPRS+14)*4)(r3)
+ lfd fp28,((JB_FPRS+14*2)*4)(r3)
+ lwz r29,((JB_GPRS+15)*4)(r3)
+ lfd fp29,((JB_FPRS+15*2)*4)(r3)
+ lwz r30,((JB_GPRS+16)*4)(r3)
+ lfd fp30,((JB_FPRS+16*2)*4)(r3)
+ lwz r31,((JB_GPRS+17)*4)(r3)
+ lfd fp31,((JB_FPRS+17*2)*4)(r3)
+ mr r3,r4
+ blr
+END (BP_SYM (__longjmp))
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/_vec__longjmp.S libc-work/sysdeps/powerpc/altivec/_vec__longjmp.S
--- libc/sysdeps/powerpc/altivec/_vec__longjmp.S Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/_vec__longjmp.S Mon Feb 26 18:05:15 2001
@@ -0,0 +1,103 @@
+/* longjmp for PowerPC.
+ Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+#define _ASM
+#define _SETJMP_H
+#include <bits/vec_setjmp.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
+
+ENTRY (BP_SYM (_vec___longjmp))
+ CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
+
+ lwz r1,(JB_GPR1*4)(r3)
+ lwz r2,(JB_GPR2*4)(r3)
+ lwz r0,(JB_LR*4)(r3)
+ lwz r14,((JB_GPRS+0)*4)(r3)
+ lfd fp14,((JB_FPRS+0*2)*4)(r3)
+ lwz r15,((JB_GPRS+1)*4)(r3)
+ lfd fp15,((JB_FPRS+1*2)*4)(r3)
+ lwz r16,((JB_GPRS+2)*4)(r3)
+ lfd fp16,((JB_FPRS+2*2)*4)(r3)
+ lwz r17,((JB_GPRS+3)*4)(r3)
+ lfd fp17,((JB_FPRS+3*2)*4)(r3)
+ lwz r18,((JB_GPRS+4)*4)(r3)
+ lfd fp18,((JB_FPRS+4*2)*4)(r3)
+ lwz r19,((JB_GPRS+5)*4)(r3)
+ lfd fp19,((JB_FPRS+5*2)*4)(r3)
+ lwz r20,((JB_GPRS+6)*4)(r3)
+ lfd fp20,((JB_FPRS+6*2)*4)(r3)
+ mtlr r0
+ lwz r21,((JB_GPRS+7)*4)(r3)
+ lfd fp21,((JB_FPRS+7*2)*4)(r3)
+ lwz r22,((JB_GPRS+8)*4)(r3)
+ lfd fp22,((JB_FPRS+8*2)*4)(r3)
+ lwz r0,(JB_CR*4)(r3)
+ lwz r23,((JB_GPRS+9)*4)(r3)
+ lfd fp23,((JB_FPRS+9*2)*4)(r3)
+ lwz r24,((JB_GPRS+10)*4)(r3)
+ lfd fp24,((JB_FPRS+10*2)*4)(r3)
+ lwz r25,((JB_GPRS+11)*4)(r3)
+ lfd fp25,((JB_FPRS+11*2)*4)(r3)
+ mtcrf 0xFF,r0
+ lwz r26,((JB_GPRS+12)*4)(r3)
+ lfd fp26,((JB_FPRS+12*2)*4)(r3)
+ lwz r27,((JB_GPRS+13)*4)(r3)
+ lfd fp27,((JB_FPRS+13*2)*4)(r3)
+ lwz r28,((JB_GPRS+14)*4)(r3)
+ lfd fp28,((JB_FPRS+14*2)*4)(r3)
+ lwz r29,((JB_GPRS+15)*4)(r3)
+ lfd fp29,((JB_FPRS+15*2)*4)(r3)
+ lwz r30,((JB_GPRS+16)*4)(r3)
+ lfd fp30,((JB_FPRS+16*2)*4)(r3)
+ lwz r31,((JB_GPRS+17)*4)(r3)
+ lfd fp31,((JB_FPRS+17*2)*4)(r3)
+
+ lwz r0,(JB_VRSAVE)(r3)
+ mtspr VRSAVE,r0
+
+ li r0,((JB_VRS+0*4)*4)
+ lvx v20,r3,r0
+ li r0,((JB_VRS+1*4)*4)
+ lvx v21,r3,r0
+ li r0,((JB_VRS+2*4)*4)
+ lvx v22,r3,r0
+ li r0,((JB_VRS+3*4)*4)
+ lvx v23,r3,r0
+ li r0,((JB_VRS+4*4)*4)
+ lvx v24,r3,r0
+ li r0,((JB_VRS+5*4)*4)
+ lvx v25,r3,r0
+ li r0,((JB_VRS+6*4)*4)
+ lvx v26,r3,r0
+ li r0,((JB_VRS+7*4)*4)
+ lvx v27,r3,r0
+ li r0,((JB_VRS+8*4)*4)
+ lvx v28,r3,r0
+ li r0,((JB_VRS+9*4)*4)
+ lvx v29,r3,r0
+ li r0,((JB_VRS+10*4)*4)
+ lvx v30,r3,r0
+ li r0,((JB_VRS+11*4)*4)
+ lvx v31,r3,r0
+
+ mr r3,r4
+ blr
+END (BP_SYM (_vec___longjmp))
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/bits/novec_setjmp.h libc-work/sysdeps/powerpc/altivec/bits/novec_setjmp.h
--- libc/sysdeps/powerpc/altivec/bits/novec_setjmp.h Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/bits/novec_setjmp.h Fri Feb 23 00:47:33 2001
@@ -0,0 +1,43 @@
+/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* Define the machine-dependent type `jmp_buf'. PowerPC version. */
+
+/* The previous bits/setjmp.h had __jmp_buf defined as a structure.
+ We use an array of 'long int' instead, to make writing the
+ assembler easier. Naturally, user code should not depend on
+ either representation. */
+
+#if defined __USE_MISC || defined _ASM
+# define JB_GPR1 0 /* Also known as the stack pointer */
+# define JB_GPR2 1
+# define JB_LR 2 /* The address we will return to */
+# define JB_GPRS 3 /* GPRs 14 through 31 are saved, 18 in total */
+# define JB_CR 21 /* Condition code registers. */
+# define JB_FPRS 22 /* FPRs 14 through 31 are saved, 18*2 words total */
+# define JB_SIZE (58*4)
+#endif
+
+#ifndef _ASM
+typedef long int __novec_jmp_buf[58];
+#endif
+
+/* Test if longjmp to JMPBUF would unwind the frame
+ containing a local variable at ADDRESS. */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+ ((void *) (address) < (void *) (jmpbuf)[JB_GPR1])
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/bits/vec_setjmp.h libc-work/sysdeps/powerpc/altivec/bits/vec_setjmp.h
--- libc/sysdeps/powerpc/altivec/bits/vec_setjmp.h Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/bits/vec_setjmp.h Mon Feb 26 17:44:05 2001
@@ -0,0 +1,46 @@
+/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* Define the machine-dependent type `jmp_buf'. PowerPC version. */
+
+/* The previous bits/setjmp.h had __jmp_buf defined as a structure.
+ We use an array of 'long int' instead, to make writing the
+ assembler easier. Naturally, user code should not depend on
+ either representation. */
+/* This doesn't follow what the altivec PIM defines for SVR4 ABI. Oh well */
+
+#if defined __USE_MISC || defined _ASM
+# define JB_GPR1 0 /* Also known as the stack pointer */
+# define JB_GPR2 1
+# define JB_LR 2 /* The address we will return to */
+# define JB_GPRS 3 /* GPRs 14 through 31 are saved, 18 in total */
+# define JB_CR 21 /* Condition code registers. */
+# define JB_FPRS 22 /* FPRs 14 through 31 are saved, 18*2 words total */
+# define JB_VRSAVE 58 /* VRSAVE register */
+# define JB_VRS 60 /* Vector registers v20-v31 are saved, 48 words total */
+# define JB_SIZE (108*4)
+#endif
+
+#ifndef _ASM
+typedef long int __vec_jmp_buf[108] __attribute__ ((__aligned__(16)));
+#endif
+
+/* Test if longjmp to JMPBUF would unwind the frame
+ containing a local variable at ADDRESS. */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+ ((void *) (address) < (void *) (jmpbuf)[JB_GPR1])
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/bsd-_setjmp.S libc-work/sysdeps/powerpc/altivec/bsd-_setjmp.S
--- libc/sysdeps/powerpc/altivec/bsd-_setjmp.S Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/bsd-_setjmp.S Sat Feb 24 17:36:03 2001
@@ -0,0 +1,36 @@
+/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. PowerPC version.
+ Copyright (C) 1994, 1997, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* This just does a tail-call to `__sigsetjmp (ARG, 0)'.
+ We cannot do it in C because it must be a tail-call, so frame-unwinding
+ in setjmp doesn't clobber the state restored by longjmp. */
+
+#include <sysdep.h>
+#include <bp-sym.h>
+
+ENTRY (BP_SYM (_vec__setjmp))
+ li r4,0 /* Set second argument to 0. */
+ b JUMPTARGET(BP_SYM (_vec__sigsetjmp))
+END (BP_SYM (_vec__setjmp))
+
+#ifdef ALTIVEC_SUPPORT_DEFAULT
+default_symbol_version (BP_SYM (_vec__setjmp), BP_SYM (_setjmp), GLIBC_ALTIVEC_2.2)
+#else
+symbol_version (BP_SYM (_vec__setjmp), BP_SYM (_setjmp), GLIBC_ALTIVEC_2.2)
+#endif
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/bsd-setjmp.S libc-work/sysdeps/powerpc/altivec/bsd-setjmp.S
--- libc/sysdeps/powerpc/altivec/bsd-setjmp.S Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/bsd-setjmp.S Sat Feb 24 17:41:05 2001
@@ -0,0 +1,36 @@
+/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. PowerPC version.
+ Copyright (C) 1994, 1997, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
+ We cannot do it in C because it must be a tail-call, so frame-unwinding
+ in setjmp doesn't clobber the state restored by longjmp. */
+
+#include <sysdep.h>
+#include <bp-sym.h>
+
+ENTRY (BP_SYM (_vec_setjmp))
+ li r4,1 /* Set second argument to 1. */
+ b JUMPTARGET (BP_SYM (_vec__sigsetjmp))
+END (BP_SYM (_vec_setjmp))
+
+#ifdef ALTIVEC_SUPPORT_DEFAULT
+default_symbol_version (BP_SYM (_vec_setjmp), BP_SYM (setjmp), GLIBC_ALTIVEC_2.2)
+#else
+symbol_version (BP_SYM (_vec_setjmp), BP_SYM (setjmp), GLIBC_ALTIVEC_2.2)
+#endif
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/longjmp.c libc-work/sysdeps/powerpc/altivec/longjmp.c
--- libc/sysdeps/powerpc/altivec/longjmp.c Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/longjmp.c Tue Feb 27 00:48:49 2001
@@ -0,0 +1,61 @@
+/* Copyright (C) 1991, 92, 94, 95, 97, 98, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <stddef.h>
+#include <vec_setjmp.h>
+#include <signal.h>
+#include <bp-sym.h>
+
+/* Set the signal mask to the one specified in ENV, and jump
+ to the position specified in ENV, causing the setjmp
+ call there to return VAL, or 1 if VAL is 0. */
+void
+_vec__libc_siglongjmp (vec_sigjmp_buf env, int val)
+{
+ /* Perform any cleanups needed by the frames being unwound. */
+ /* FIXME - If there is ever a HURD/PPC, we will need two versions
+ of _longjmp_unwind. */
+ _longjmp_unwind (env, val);
+
+ if (env[0].__mask_was_saved)
+ /* Restore the saved signal mask. */
+ (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask,
+ (sigset_t *) NULL);
+
+ /* Call the machine-dependent function to restore machine state. */
+ _vec___longjmp (env[0].__jmpbuf, val ?: 1);
+}
+
+strong_alias (_vec__libc_siglongjmp, _vec__libc_longjmp);
+weak_alias (_vec__libc_siglongjmp, _vec__longjmp);
+weak_alias (_vec__libc_siglongjmp, _vec_longjmp);
+weak_alias (_vec__libc_siglongjmp, _vec_siglongjmp);
+
+#ifdef ALTIVEC_SUPPORT_DEFAULT
+default_symbol_version (BP_SYM (_vec__libc_siglongjmp), BP_SYM (__libc_siglongjmp), GLIBC_ALTIVEC_2.2);
+default_symbol_version (BP_SYM (_vec__libc_longjmp), BP_SYM (__libc_longjmp), GLIBC_ALTIVEC_2.2);
+default_symbol_version (BP_SYM (_vec__longjmp), BP_SYM (_longjmp), GLIBC_ALTIVEC_2.2);
+default_symbol_version (BP_SYM (_vec_longjmp), BP_SYM (longjmp), GLIBC_ALTIVEC_2.2);
+default_symbol_version (BP_SYM (_vec_siglongjmp), BP_SYM (siglongjmp), GLIBC_ALTIVEC_2.2);
+#else
+symbol_version (BP_SYM (_vec__libc_siglongjmp), BP_SYM (__libc_siglongjmp), GLIBC_ALTIVEC_2.2);
+symbol_version (BP_SYM (_vec__libc_longjmp), BP_SYM (__libc_longjmp), GLIBC_ALTIVEC_2.2);
+symbol_version (BP_SYM (_vec__longjmp), BP_SYM (_longjmp), GLIBC_ALTIVEC_2.2);
+symbol_version (BP_SYM (_vec_longjmp), BP_SYM (longjmp), GLIBC_ALTIVEC_2.2);
+symbol_version (BP_SYM (_vec_siglongjmp), BP_SYM (siglongjmp), GLIBC_ALTIVEC_2.2);
+#endif
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/novec_setjmp.h libc-work/sysdeps/powerpc/altivec/novec_setjmp.h
--- libc/sysdeps/powerpc/altivec/novec_setjmp.h Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/novec_setjmp.h Mon Feb 26 22:42:20 2001
@@ -0,0 +1,75 @@
+/* Copyright (C) 1991-1999, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#if defined(_VEC_SETJMP_H) || defined(_SETJMP_H)
+#error "Only one setjmp header may be included!"
+#endif
+
+#ifndef _NOVEC_SETJMP_H
+#define _NOVEC_SETJMP_H 1
+/* Deliberately pretend to be setjmp.h also. */
+#define _SETJMP_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/novec_setjmp.h> /* Get `__jmp_buf'. */
+#include <bits/sigset.h> /* Get `__sigset_t'. */
+
+/* Calling environment, plus possibly a saved signal mask. */
+typedef struct novec_jmp_buf_tag /* C++ doesn't like tagless structs. */
+ {
+ /* NOTE: The machine-dependent definitions of `__sigsetjmp'
+ assume that a `jmp_buf' begins with a `__jmp_buf' and that
+ `__mask_was_saved' follows it. Do not move these members
+ or add others before it. */
+ __novec_jmp_buf __jmpbuf; /* Calling environment. */
+ int __mask_was_saved; /* Saved the signal mask? */
+ __sigset_t __saved_mask; /* Saved signal mask. */
+ } novec_jmp_buf[1];
+
+/* Use the same type for `jmp_buf' and `sigjmp_buf'.
+ The `__mask_was_saved' flag determines whether
+ or not `longjmp' will restore the signal mask. */
+typedef novec_jmp_buf novec_sigjmp_buf;
+
+typedef novec_jmp_buf jmp_buf;
+typedef novec_jmp_buf sigjmp_buf;
+
+__END_DECLS
+
+/* Now define the internal interfaces. */
+
+/* Internal machine-dependent function to restore context sans signal mask. */
+extern void __longjmp (__novec_jmp_buf __env, int __val)
+ __attribute__ ((__noreturn__));
+
+/* Internal function to possibly save the current mask of blocked signals
+ in ENV, and always set the flag saying whether or not it was saved.
+ This is used by the machine-dependent definition of `__sigsetjmp'.
+ Always returns zero, for convenience. */
+extern int _novec__sigjmp_save (novec_jmp_buf __env, int __savemask);
+
+/* This is a little white lie; there's only one _longjmp_unwind. */
+extern void _longjmp_unwind (novec_jmp_buf env, int val);
+
+extern void __libc_siglongjmp (novec_sigjmp_buf __env, int __val)
+ __attribute__ ((noreturn));
+
+#endif /* novec_setjmp.h */
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/old-bsd-_setjmp.S libc-work/sysdeps/powerpc/altivec/old-bsd-_setjmp.S
--- libc/sysdeps/powerpc/altivec/old-bsd-_setjmp.S Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/old-bsd-_setjmp.S Mon Feb 26 21:24:44 2001
@@ -0,0 +1,36 @@
+/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. PowerPC version.
+ Copyright (C) 1994, 1997, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* This just does a tail-call to `__sigsetjmp (ARG, 0)'.
+ We cannot do it in C because it must be a tail-call, so frame-unwinding
+ in setjmp doesn't clobber the state restored by longjmp. */
+
+#include <sysdep.h>
+#include <bp-sym.h>
+
+ENTRY (BP_SYM (_novec__setjmp))
+ li r4,0 /* Set second argument to 0. */
+ b JUMPTARGET(BP_SYM (_novec__sigsetjmp))
+END (BP_SYM (_novec__setjmp))
+
+#ifdef ALTIVEC_SUPPORT_DEFAULT
+symbol_version (BP_SYM (_novec__setjmp), BP_SYM (_setjmp), GLIBC_2.0)
+#else
+default_symbol_version (BP_SYM (_novec__setjmp), BP_SYM (_setjmp), GLIBC_2.0)
+#endif
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/old-bsd-setjmp.S libc-work/sysdeps/powerpc/altivec/old-bsd-setjmp.S
--- libc/sysdeps/powerpc/altivec/old-bsd-setjmp.S Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/old-bsd-setjmp.S Mon Feb 26 21:24:50 2001
@@ -0,0 +1,36 @@
+/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. PowerPC version.
+ Copyright (C) 1994, 1997, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
+ We cannot do it in C because it must be a tail-call, so frame-unwinding
+ in setjmp doesn't clobber the state restored by longjmp. */
+
+#include <sysdep.h>
+#include <bp-sym.h>
+
+ENTRY (BP_SYM (_novec_setjmp))
+ li r4,1 /* Set second argument to 1. */
+ b JUMPTARGET (BP_SYM (_novec__sigsetjmp))
+END (BP_SYM (_novec_setjmp))
+
+#ifdef ALTIVEC_SUPPORT_DEFAULT
+symbol_version (BP_SYM (_novec_setjmp), BP_SYM (setjmp), GLIBC_2.0)
+#else
+default_symbol_version (BP_SYM (_novec_setjmp), BP_SYM (setjmp), GLIBC_2.0)
+#endif
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/old-longjmp.c libc-work/sysdeps/powerpc/altivec/old-longjmp.c
--- libc/sysdeps/powerpc/altivec/old-longjmp.c Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/old-longjmp.c Tue Feb 27 00:49:04 2001
@@ -0,0 +1,61 @@
+/* Copyright (C) 1991, 92, 94, 95, 97, 98, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <stddef.h>
+#include <novec_setjmp.h>
+#include <signal.h>
+#include <bp-sym.h>
+
+/* Set the signal mask to the one specified in ENV, and jump
+ to the position specified in ENV, causing the setjmp
+ call there to return VAL, or 1 if VAL is 0. */
+void
+_novec__libc_siglongjmp (novec_sigjmp_buf env, int val)
+{
+ /* Perform any cleanups needed by the frames being unwound. */
+ /* FIXME - If there is ever a HURD/PPC, we will need two versions
+ of _longjmp_unwind. */
+ _longjmp_unwind (env, val);
+
+ if (env[0].__mask_was_saved)
+ /* Restore the saved signal mask. */
+ (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask,
+ (sigset_t *) NULL);
+
+ /* Call the machine-dependent function to restore machine state. */
+ __longjmp (env[0].__jmpbuf, val ?: 1);
+}
+
+strong_alias (_novec__libc_siglongjmp, _novec__libc_longjmp);
+weak_alias (_novec__libc_siglongjmp, _novec__longjmp);
+weak_alias (_novec__libc_siglongjmp, _novec_longjmp);
+weak_alias (_novec__libc_siglongjmp, _novec_siglongjmp);
+
+#ifdef ALTIVEC_SUPPORT_DEFAULT
+symbol_version (BP_SYM (_novec__libc_siglongjmp), BP_SYM (__libc_siglongjmp), GLIBC_2.1);
+symbol_version (BP_SYM (_novec__libc_longjmp), BP_SYM (__libc_longjmp), GLIBC_2.1);
+symbol_version (BP_SYM (_novec__longjmp), BP_SYM (_longjmp), GLIBC_2.0);
+symbol_version (BP_SYM (_novec_longjmp), BP_SYM (longjmp), GLIBC_2.0);
+symbol_version (BP_SYM (_novec_siglongjmp), BP_SYM (siglongjmp), GLIBC_2.0);
+#else
+default_symbol_version (BP_SYM (_novec__libc_siglongjmp), BP_SYM (__libc_siglongjmp), GLIBC_2.1);
+default_symbol_version (BP_SYM (_novec__libc_longjmp), BP_SYM (__libc_longjmp), GLIBC_2.1);
+default_symbol_version (BP_SYM (_novec__longjmp), BP_SYM (_longjmp), GLIBC_2.0);
+default_symbol_version (BP_SYM (_novec_longjmp), BP_SYM (longjmp), GLIBC_2.0);
+default_symbol_version (BP_SYM (_novec_siglongjmp), BP_SYM (siglongjmp), GLIBC_2.0);
+#endif
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/old-setjmp.S libc-work/sysdeps/powerpc/altivec/old-setjmp.S
--- libc/sysdeps/powerpc/altivec/old-setjmp.S Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/old-setjmp.S Mon Feb 26 17:21:01 2001
@@ -0,0 +1,79 @@
+/* setjmp for PowerPC.
+ Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+#define _ASM
+#define _SETJMP_H
+#include <bits/novec_setjmp.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
+
+ENTRY (BP_SYM (_novec__sigsetjmp))
+ CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
+
+ stw r1,(JB_GPR1*4)(3)
+ mflr r0
+ stw r2,(JB_GPR2*4)(3)
+ stw r14,((JB_GPRS+0)*4)(3)
+ stfd fp14,((JB_FPRS+0*2)*4)(3)
+ stw r0,(JB_LR*4)(3)
+ stw r15,((JB_GPRS+1)*4)(3)
+ stfd fp15,((JB_FPRS+1*2)*4)(3)
+ mfcr r0
+ stw r16,((JB_GPRS+2)*4)(3)
+ stfd fp16,((JB_FPRS+2*2)*4)(3)
+ stw r0,(JB_CR*4)(3)
+ stw r17,((JB_GPRS+3)*4)(3)
+ stfd fp17,((JB_FPRS+3*2)*4)(3)
+ stw r18,((JB_GPRS+4)*4)(3)
+ stfd fp18,((JB_FPRS+4*2)*4)(3)
+ stw r19,((JB_GPRS+5)*4)(3)
+ stfd fp19,((JB_FPRS+5*2)*4)(3)
+ stw r20,((JB_GPRS+6)*4)(3)
+ stfd fp20,((JB_FPRS+6*2)*4)(3)
+ stw r21,((JB_GPRS+7)*4)(3)
+ stfd fp21,((JB_FPRS+7*2)*4)(3)
+ stw r22,((JB_GPRS+8)*4)(3)
+ stfd fp22,((JB_FPRS+8*2)*4)(3)
+ stw r23,((JB_GPRS+9)*4)(3)
+ stfd fp23,((JB_FPRS+9*2)*4)(3)
+ stw r24,((JB_GPRS+10)*4)(3)
+ stfd fp24,((JB_FPRS+10*2)*4)(3)
+ stw r25,((JB_GPRS+11)*4)(3)
+ stfd fp25,((JB_FPRS+11*2)*4)(3)
+ stw r26,((JB_GPRS+12)*4)(3)
+ stfd fp26,((JB_FPRS+12*2)*4)(3)
+ stw r27,((JB_GPRS+13)*4)(3)
+ stfd fp27,((JB_FPRS+13*2)*4)(3)
+ stw r28,((JB_GPRS+14)*4)(3)
+ stfd fp28,((JB_FPRS+14*2)*4)(3)
+ stw r29,((JB_GPRS+15)*4)(3)
+ stfd fp29,((JB_FPRS+15*2)*4)(3)
+ stw r30,((JB_GPRS+16)*4)(3)
+ stfd fp30,((JB_FPRS+16*2)*4)(3)
+ stw r31,((JB_GPRS+17)*4)(3)
+ stfd fp31,((JB_FPRS+17*2)*4)(3)
+ b JUMPTARGET (BP_SYM (_novec__sigjmp_save))
+END (BP_SYM (_novec__sigsetjmp))
+
+#ifdef ALTIVEC_SUPPORT_DEFAULT
+symbol_version (BP_SYM (_novec__sigsetjmp), BP_SYM (__sigsetjmp), GLIBC_2.0)
+#else
+default_symbol_version (BP_SYM (_novec__sigsetjmp), BP_SYM (__sigsetjmp), GLIBC_2.0)
+#endif
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/old-sigjmp.c libc-work/sysdeps/powerpc/altivec/old-sigjmp.c
--- libc/sysdeps/powerpc/altivec/old-sigjmp.c Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/old-sigjmp.c Fri Feb 23 00:49:21 2001
@@ -0,0 +1,35 @@
+/* Copyright (C) 1992, 1994, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <stddef.h>
+#include <signal.h>
+#include <novec_setjmp.h>
+
+/* This function is called by the `sigsetjmp' macro
+ before doing a `__setjmp' on ENV[0].__jmpbuf.
+ Always return zero. */
+
+int
+_novec__sigjmp_save (novec_sigjmp_buf env, int savemask)
+{
+ env[0].__mask_was_saved = (savemask &&
+ __sigprocmask (SIG_BLOCK, (sigset_t *) NULL,
+ &env[0].__saved_mask) == 0);
+
+ return 0;
+}
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/setjmp.S libc-work/sysdeps/powerpc/altivec/setjmp.S
--- libc/sysdeps/powerpc/altivec/setjmp.S Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/setjmp.S Mon Feb 26 17:29:04 2001
@@ -0,0 +1,107 @@
+/* setjmp for PowerPC.
+ Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+#define _ASM
+#define _SETJMP_H
+#include <bits/vec_setjmp.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
+
+ENTRY (BP_SYM (_vec__sigsetjmp))
+ CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
+
+ stw r1,(JB_GPR1*4)(3)
+ mflr r0
+ stw r2,(JB_GPR2*4)(3)
+ stw r14,((JB_GPRS+0)*4)(3)
+ stfd fp14,((JB_FPRS+0*2)*4)(3)
+ stw r0,(JB_LR*4)(3)
+ stw r15,((JB_GPRS+1)*4)(3)
+ stfd fp15,((JB_FPRS+1*2)*4)(3)
+ mfcr r0
+ stw r16,((JB_GPRS+2)*4)(3)
+ stfd fp16,((JB_FPRS+2*2)*4)(3)
+ stw r0,(JB_CR*4)(3)
+ stw r17,((JB_GPRS+3)*4)(3)
+ stfd fp17,((JB_FPRS+3*2)*4)(3)
+ stw r18,((JB_GPRS+4)*4)(3)
+ stfd fp18,((JB_FPRS+4*2)*4)(3)
+ stw r19,((JB_GPRS+5)*4)(3)
+ stfd fp19,((JB_FPRS+5*2)*4)(3)
+ stw r20,((JB_GPRS+6)*4)(3)
+ stfd fp20,((JB_FPRS+6*2)*4)(3)
+ stw r21,((JB_GPRS+7)*4)(3)
+ stfd fp21,((JB_FPRS+7*2)*4)(3)
+ stw r22,((JB_GPRS+8)*4)(3)
+ stfd fp22,((JB_FPRS+8*2)*4)(3)
+ stw r23,((JB_GPRS+9)*4)(3)
+ stfd fp23,((JB_FPRS+9*2)*4)(3)
+ stw r24,((JB_GPRS+10)*4)(3)
+ stfd fp24,((JB_FPRS+10*2)*4)(3)
+ stw r25,((JB_GPRS+11)*4)(3)
+ stfd fp25,((JB_FPRS+11*2)*4)(3)
+ stw r26,((JB_GPRS+12)*4)(3)
+ stfd fp26,((JB_FPRS+12*2)*4)(3)
+ stw r27,((JB_GPRS+13)*4)(3)
+ stfd fp27,((JB_FPRS+13*2)*4)(3)
+ stw r28,((JB_GPRS+14)*4)(3)
+ stfd fp28,((JB_FPRS+14*2)*4)(3)
+ stw r29,((JB_GPRS+15)*4)(3)
+ stfd fp29,((JB_FPRS+15*2)*4)(3)
+ stw r30,((JB_GPRS+16)*4)(3)
+ stfd fp30,((JB_FPRS+16*2)*4)(3)
+ stw r31,((JB_GPRS+17)*4)(3)
+ stfd fp31,((JB_FPRS+17*2)*4)(3)
+
+ mfspr r0,VRSAVE
+ stw r0,(JB_VRSAVE)(r3)
+ li r0,((JB_VRS+0*4)*4)
+ stvx v20,r3,r0
+ li r0,((JB_VRS+1*4)*4)
+ stvx v21,r3,r0
+ li r0,((JB_VRS+2*4)*4)
+ stvx v22,r3,r0
+ li r0,((JB_VRS+3*4)*4)
+ stvx v23,r3,r0
+ li r0,((JB_VRS+4*4)*4)
+ stvx v24,r3,r0
+ li r0,((JB_VRS+5*4)*4)
+ stvx v25,r3,r0
+ li r0,((JB_VRS+6*4)*4)
+ stvx v26,r3,r0
+ li r0,((JB_VRS+7*4)*4)
+ stvx v27,r3,r0
+ li r0,((JB_VRS+8*4)*4)
+ stvx v28,r3,r0
+ li r0,((JB_VRS+9*4)*4)
+ stvx v29,r3,r0
+ li r0,((JB_VRS+10*4)*4)
+ stvx v30,r3,r0
+ li r0,((JB_VRS+11*4)*4)
+ stvx v31,r3,r0
+
+ b JUMPTARGET (BP_SYM (_vec__sigjmp_save))
+END (BP_SYM (_vec__sigsetjmp))
+
+#ifdef ALTIVEC_SUPPORT_DEFAULT
+default_symbol_version (BP_SYM (_vec__sigsetjmp), BP_SYM (__sigsetjmp), GLIBC_ALTIVEC_2.2)
+#else
+symbol_version (BP_SYM (_vec__sigsetjmp), BP_SYM (__sigsetjmp), GLIBC_ALTIVEC_2.2)
+#endif
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/sigjmp.c libc-work/sysdeps/powerpc/altivec/sigjmp.c
--- libc/sysdeps/powerpc/altivec/sigjmp.c Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/sigjmp.c Fri Feb 23 00:39:07 2001
@@ -0,0 +1,35 @@
+/* Copyright (C) 1992, 1994, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <stddef.h>
+#include <signal.h>
+#include <vec_setjmp.h>
+
+/* This function is called by the `sigsetjmp' macro
+ before doing a `__setjmp' on ENV[0].__jmpbuf.
+ Always return zero. */
+
+int
+_vec__sigjmp_save (vec_sigjmp_buf env, int savemask)
+{
+ env[0].__mask_was_saved = (savemask &&
+ __sigprocmask (SIG_BLOCK, (sigset_t *) NULL,
+ &env[0].__saved_mask) == 0);
+
+ return 0;
+}
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec/vec_setjmp.h libc-work/sysdeps/powerpc/altivec/vec_setjmp.h
--- libc/sysdeps/powerpc/altivec/vec_setjmp.h Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec/vec_setjmp.h Mon Feb 26 22:42:03 2001
@@ -0,0 +1,75 @@
+/* Copyright (C) 1991-1999, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#if defined(_NOVEC_SETJMP_H) || defined(_SETJMP_H)
+#error "Only one setjmp header may be included!"
+#endif
+
+#ifndef _VEC_SETJMP_H
+#define _VEC_SETJMP_H 1
+/* Deliberately pretend to be setjmp.h also. */
+#define _SETJMP_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/vec_setjmp.h> /* Get `__jmp_buf'. */
+#include <bits/sigset.h> /* Get `__sigset_t'. */
+
+/* Calling environment, plus possibly a saved signal mask. */
+typedef struct vec_jmp_buf_tag /* C++ doesn't like tagless structs. */
+ {
+ /* NOTE: The machine-dependent definitions of `__sigsetjmp'
+ assume that a `jmp_buf' begins with a `__jmp_buf' and that
+ `__mask_was_saved' follows it. Do not move these members
+ or add others before it. */
+ __vec_jmp_buf __jmpbuf; /* Calling environment. */
+ int __mask_was_saved; /* Saved the signal mask? */
+ __sigset_t __saved_mask; /* Saved signal mask. */
+ } vec_jmp_buf[1];
+
+/* Use the same type for `jmp_buf' and `sigjmp_buf'.
+ The `__mask_was_saved' flag determines whether
+ or not `longjmp' will restore the signal mask. */
+typedef vec_jmp_buf vec_sigjmp_buf;
+
+typedef vec_jmp_buf jmp_buf;
+typedef vec_jmp_buf sigjmp_buf;
+
+__END_DECLS
+
+/* Now define the internal interfaces. */
+
+/* Internal machine-dependent function to restore context sans signal mask. */
+extern void _vec___longjmp (__vec_jmp_buf __env, int __val)
+ __attribute__ ((__noreturn__));
+
+/* Internal function to possibly save the current mask of blocked signals
+ in ENV, and always set the flag saying whether or not it was saved.
+ This is used by the machine-dependent definition of `__sigsetjmp'.
+ Always returns zero, for convenience. */
+extern int _vec__sigjmp_save (vec_jmp_buf __env, int __savemask);
+
+/* This is a little white lie; there's only one _longjmp_unwind. */
+extern void _longjmp_unwind (vec_jmp_buf env, int val);
+
+extern void _vec__libc_siglongjmp (vec_sigjmp_buf __env, int __val)
+ __attribute__ ((noreturn));
+
+#endif /* vec_setjmp.h */
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/altivec-default/bits/setjmp.h libc-work/sysdeps/powerpc/altivec-default/bits/setjmp.h
--- libc/sysdeps/powerpc/altivec-default/bits/setjmp.h Wed Dec 31 19:00:00 1969
+++ libc-work/sysdeps/powerpc/altivec-default/bits/setjmp.h Mon Feb 26 17:44:16 2001
@@ -0,0 +1,50 @@
+/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* Define the machine-dependent type `jmp_buf'. PowerPC version. */
+
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
+/* The previous bits/setjmp.h had __jmp_buf defined as a structure.
+ We use an array of 'long int' instead, to make writing the
+ assembler easier. Naturally, user code should not depend on
+ either representation. */
+/* This doesn't follow what the altivec PIM defines for SVR4 ABI. Oh well */
+
+#if defined __USE_MISC || defined _ASM
+# define JB_GPR1 0 /* Also known as the stack pointer */
+# define JB_GPR2 1
+# define JB_LR 2 /* The address we will return to */
+# define JB_GPRS 3 /* GPRs 14 through 31 are saved, 18 in total */
+# define JB_CR 21 /* Condition code registers. */
+# define JB_FPRS 22 /* FPRs 14 through 31 are saved, 18*2 words total */
+# define JB_VRSAVE 58 /* VRSAVE register */
+# define JB_VRS 60 /* Vector registers v20-v31 are saved, 48 words total */
+# define JB_SIZE (108*4)
+#endif
+
+#ifndef _ASM
+typedef long int __jmp_buf[108] __attribute__ ((__aligned__(16)));
+#endif
+
+/* Test if longjmp to JMPBUF would unwind the frame
+ containing a local variable at ADDRESS. */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+ ((void *) (address) < (void *) (jmpbuf)[JB_GPR1])
diff -uNr -x .#* -x CVS libc/sysdeps/powerpc/sysdep.h libc-work/sysdeps/powerpc/sysdep.h
--- libc/sysdeps/powerpc/sysdep.h Sun Oct 10 16:32:25 1999
+++ libc-work/sysdeps/powerpc/sysdep.h Mon Feb 26 17:28:01 2001
@@ -100,4 +100,40 @@
#define cr6 6
#define cr7 7
+/* Vector registers. */
+#define v0 0
+#define v1 1
+#define v2 2
+#define v3 3
+#define v4 4
+#define v5 5
+#define v6 6
+#define v7 7
+#define v8 8
+#define v9 9
+#define v10 10
+#define v11 11
+#define v12 12
+#define v13 13
+#define v14 14
+#define v15 15
+#define v16 16
+#define v17 17
+#define v18 18
+#define v19 19
+#define v20 20
+#define v21 21
+#define v22 22
+#define v23 23
+#define v24 24
+#define v25 25
+#define v26 26
+#define v27 27
+#define v28 28
+#define v29 29
+#define v30 30
+#define v31 31
+
+#define VRSAVE 256
+
#endif /* assembler */