patches/glibc/2.2.5/glibc-2.2.5-hhl-powerpc-fpu.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     1 # See http://sources.redhat.com/ml/crossgcc/2002-05/msg00132.html
     2 # This patch is taken directly from the Montavista Hard Hat Linux 2.0 source RPMs,
     3 # but has been rediffed against glibc-2.2.5
     4 
     5 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/Dist glibc-2.2.5/sysdeps/powerpc/Dist
     6 --- glibc-2.2.5.old/sysdeps/powerpc/Dist	Fri Jun 30 23:30:21 2000
     7 +++ glibc-2.2.5/sysdeps/powerpc/Dist	Thu Jul 10 11:43:17 2003
     8 @@ -1,9 +1,6 @@
     9  dl-machine.c
    10  dl-start.S
    11  ppc-mcount.S
    12 -fe_nomask.c
    13 -fprrest.S
    14 -fprsave.S
    15  gprsave1.S
    16  gprsave0.S
    17  gprrest1.S
    18 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/Makefile glibc-2.2.5/sysdeps/powerpc/Makefile
    19 --- glibc-2.2.5.old/sysdeps/powerpc/Makefile	Mon Nov 27 15:32:47 2000
    20 +++ glibc-2.2.5/sysdeps/powerpc/Makefile	Thu Jul 10 11:43:17 2003
    21 @@ -3,16 +3,12 @@
    22  +cflags += -mnew-mnemonics -Wa,-mppc -mpowerpc
    23  asm-CPPFLAGS += -Wa,-mppc
    24  
    25 -ifeq ($(subdir),math)
    26 -libm-support += fenv_const fe_nomask
    27 -endif
    28 -
    29  ifeq ($(subdir),gmon)
    30  sysdep_routines += ppc-mcount
    31  endif
    32  
    33  ifeq ($(subdir),misc)
    34 -sysdep_routines += gprsave0 gprrest0 gprsave1 gprrest1 fprsave fprrest
    35 +sysdep_routines += gprsave0 gprrest0 gprsave1 gprrest1
    36  endif
    37  
    38  # On PPC, -fpic works until the GOT contains 2^15 bytes, and possibly
    39 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/Versions glibc-2.2.5/sysdeps/powerpc/Versions
    40 --- glibc-2.2.5.old/sysdeps/powerpc/Versions	Mon Feb 28 13:27:57 2000
    41 +++ glibc-2.2.5/sysdeps/powerpc/Versions	Thu Jul 10 11:43:17 2003
    42 @@ -1,8 +1,4 @@
    43  libm {
    44 -  GLIBC_2.1 {
    45 -    # symbols used in macros from sysdeps/powerpc/bits/fenv.h
    46 -    __fe_dfl_env; __fe_enabled_env; __fe_nonieee_env; __fe_nomask_env;
    47 -  }
    48    GLIBC_2.2 {
    49      # Special functions to save and restore registers used by the
    50      # runtime libraries.
    51 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/__longjmp.S glibc-2.2.5/sysdeps/powerpc/__longjmp.S
    52 --- glibc-2.2.5.old/sysdeps/powerpc/__longjmp.S	Thu Jul  5 21:56:01 2001
    53 +++ glibc-2.2.5/sysdeps/powerpc/__longjmp.S	Thu Jul 10 11:43:17 2003
    54 @@ -24,6 +24,8 @@
    55  #include <bp-sym.h>
    56  #include <bp-asm.h>
    57  
    58 +/* The FPU loads have been removed from this file - see fpu/__longjmp.S */
    59 +
    60  ENTRY (BP_SYM (__longjmp))
    61  	CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
    62  
    63 @@ -31,44 +33,26 @@
    64  	lwz r2,(JB_GPR2*4)(r3)
    65  	lwz r0,(JB_LR*4)(r3)
    66  	lwz r14,((JB_GPRS+0)*4)(r3)
    67 -	lfd fp14,((JB_FPRS+0*2)*4)(r3)
    68  	lwz r15,((JB_GPRS+1)*4)(r3)
    69 -	lfd fp15,((JB_FPRS+1*2)*4)(r3)
    70  	lwz r16,((JB_GPRS+2)*4)(r3)
    71 -	lfd fp16,((JB_FPRS+2*2)*4)(r3)
    72  	lwz r17,((JB_GPRS+3)*4)(r3)
    73 -	lfd fp17,((JB_FPRS+3*2)*4)(r3)
    74  	lwz r18,((JB_GPRS+4)*4)(r3)
    75 -	lfd fp18,((JB_FPRS+4*2)*4)(r3)
    76  	lwz r19,((JB_GPRS+5)*4)(r3)
    77 -	lfd fp19,((JB_FPRS+5*2)*4)(r3)
    78  	lwz r20,((JB_GPRS+6)*4)(r3)
    79 -	lfd fp20,((JB_FPRS+6*2)*4)(r3)
    80  	mtlr r0
    81  	lwz r21,((JB_GPRS+7)*4)(r3)
    82 -	lfd fp21,((JB_FPRS+7*2)*4)(r3)
    83  	lwz r22,((JB_GPRS+8)*4)(r3)
    84 -	lfd fp22,((JB_FPRS+8*2)*4)(r3)
    85  	lwz r0,(JB_CR*4)(r3)
    86  	lwz r23,((JB_GPRS+9)*4)(r3)
    87 -	lfd fp23,((JB_FPRS+9*2)*4)(r3)
    88  	lwz r24,((JB_GPRS+10)*4)(r3)
    89 -	lfd fp24,((JB_FPRS+10*2)*4)(r3)
    90  	lwz r25,((JB_GPRS+11)*4)(r3)
    91 -	lfd fp25,((JB_FPRS+11*2)*4)(r3)
    92  	mtcrf 0xFF,r0
    93  	lwz r26,((JB_GPRS+12)*4)(r3)
    94 -	lfd fp26,((JB_FPRS+12*2)*4)(r3)
    95  	lwz r27,((JB_GPRS+13)*4)(r3)
    96 -	lfd fp27,((JB_FPRS+13*2)*4)(r3)
    97  	lwz r28,((JB_GPRS+14)*4)(r3)
    98 -	lfd fp28,((JB_FPRS+14*2)*4)(r3)
    99  	lwz r29,((JB_GPRS+15)*4)(r3)
   100 -	lfd fp29,((JB_FPRS+15*2)*4)(r3)
   101  	lwz r30,((JB_GPRS+16)*4)(r3)
   102 -	lfd fp30,((JB_FPRS+16*2)*4)(r3)
   103  	lwz r31,((JB_GPRS+17)*4)(r3)
   104 -	lfd fp31,((JB_FPRS+17*2)*4)(r3)
   105  	mr r3,r4
   106  	blr
   107  END (BP_SYM (__longjmp))
   108 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/bits/setjmp.h glibc-2.2.5/sysdeps/powerpc/bits/setjmp.h
   109 --- glibc-2.2.5.old/sysdeps/powerpc/bits/setjmp.h	Thu Jul  5 21:56:01 2001
   110 +++ glibc-2.2.5/sysdeps/powerpc/bits/setjmp.h	Thu Jul 10 11:43:17 2003
   111 @@ -17,6 +17,7 @@
   112     02111-1307 USA.  */
   113  
   114  /* Define the machine-dependent type `jmp_buf'.  PowerPC version.  */
   115 +/* For processors without floating point. */
   116  
   117  #ifndef _SETJMP_H
   118  # error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
   119 @@ -33,12 +34,11 @@
   120  # define JB_LR     2  /* The address we will return to */
   121  # define JB_GPRS   3  /* GPRs 14 through 31 are saved, 18 in total */
   122  # define JB_CR     21 /* Condition code registers. */
   123 -# define JB_FPRS   22 /* FPRs 14 through 31 are saved, 18*2 words total */
   124 -# define JB_SIZE   (58*4)
   125 +# define JB_SIZE   (22*4)
   126  #endif
   127  
   128  #ifndef	_ASM
   129 -typedef long int __jmp_buf[58];
   130 +typedef long int __jmp_buf[22];
   131  #endif
   132  
   133  /* Test if longjmp to JMPBUF would unwind the frame
   134 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/fclrexcpt.c glibc-2.2.5/sysdeps/powerpc/fclrexcpt.c
   135 --- glibc-2.2.5.old/sysdeps/powerpc/fclrexcpt.c	Thu Jul  5 21:56:01 2001
   136 +++ glibc-2.2.5/sysdeps/powerpc/fclrexcpt.c	Wed Dec 31 16:00:00 1969
   137 @@ -1,48 +0,0 @@
   138 -/* Clear given exceptions in current floating-point environment.
   139 -   Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc.
   140 -   This file is part of the GNU C Library.
   141 -
   142 -   The GNU C Library is free software; you can redistribute it and/or
   143 -   modify it under the terms of the GNU Lesser General Public
   144 -   License as published by the Free Software Foundation; either
   145 -   version 2.1 of the License, or (at your option) any later version.
   146 -
   147 -   The GNU C Library is distributed in the hope that it will be useful,
   148 -   but WITHOUT ANY WARRANTY; without even the implied warranty of
   149 -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   150 -   Lesser General Public License for more details.
   151 -
   152 -   You should have received a copy of the GNU Lesser General Public
   153 -   License along with the GNU C Library; if not, write to the Free
   154 -   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   155 -   02111-1307 USA.  */
   156 -
   157 -#include <fenv_libc.h>
   158 -
   159 -#undef feclearexcept
   160 -int
   161 -__feclearexcept (int excepts)
   162 -{
   163 -  fenv_union_t u;
   164 -
   165 -  /* Get the current state.  */
   166 -  u.fenv = fegetenv_register ();
   167 -
   168 -  /* Clear the relevant bits.  */
   169 -  u.l[1] = u.l[1] & ~((-(excepts >> (31 - FPSCR_VX) & 1) & FE_ALL_INVALID)
   170 -		      | (excepts & FPSCR_STICKY_BITS));
   171 -
   172 -  /* Put the new state in effect.  */
   173 -  fesetenv_register (u.fenv);
   174 -
   175 -  /* Success.  */
   176 -  return 0;
   177 -}
   178 -
   179 -#include <shlib-compat.h>
   180 -#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
   181 -strong_alias (__feclearexcept, __old_feclearexcept)
   182 -compat_symbol (libm, __old_feclearexcept, feclearexcept, GLIBC_2_1);
   183 -#endif
   184 -
   185 -versioned_symbol (libm, __feclearexcept, feclearexcept, GLIBC_2_2);
   186 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/fe_nomask.c glibc-2.2.5/sysdeps/powerpc/fe_nomask.c
   187 --- glibc-2.2.5.old/sysdeps/powerpc/fe_nomask.c	Thu Jul  5 21:56:01 2001
   188 +++ glibc-2.2.5/sysdeps/powerpc/fe_nomask.c	Wed Dec 31 16:00:00 1969
   189 @@ -1,32 +0,0 @@
   190 -/* Procedure definition for FE_NOMASK_ENV.
   191 -   Copyright (C) 1997 Free Software Foundation, Inc.
   192 -   This file is part of the GNU C Library.
   193 -
   194 -   The GNU C Library is free software; you can redistribute it and/or
   195 -   modify it under the terms of the GNU Lesser General Public
   196 -   License as published by the Free Software Foundation; either
   197 -   version 2.1 of the License, or (at your option) any later version.
   198 -
   199 -   The GNU C Library is distributed in the hope that it will be useful,
   200 -   but WITHOUT ANY WARRANTY; without even the implied warranty of
   201 -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   202 -   Lesser General Public License for more details.
   203 -
   204 -   You should have received a copy of the GNU Lesser General Public
   205 -   License along with the GNU C Library; if not, write to the Free
   206 -   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   207 -   02111-1307 USA.  */
   208 -
   209 -#include <fenv.h>
   210 -#include <errno.h>
   211 -
   212 -/* This is presently a stub, until it's decided how the kernels should
   213 -   support this.  */
   214 -
   215 -const fenv_t *
   216 -__fe_nomask_env(void)
   217 -{
   218 -  __set_errno (ENOSYS);
   219 -  return FE_ENABLED_ENV;
   220 -}
   221 -stub_warning (__fe_nomask_env)
   222 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/fprrest.S glibc-2.2.5/sysdeps/powerpc/fprrest.S
   223 --- glibc-2.2.5.old/sysdeps/powerpc/fprrest.S	Thu Jul  5 21:56:01 2001
   224 +++ glibc-2.2.5/sysdeps/powerpc/fprrest.S	Wed Dec 31 16:00:00 1969
   225 @@ -1,94 +0,0 @@
   226 -/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
   227 -   This file is part of the GNU C Library.
   228 -
   229 -   The GNU C Library is free software; you can redistribute it and/or
   230 -   modify it under the terms of the GNU Lesser General Public
   231 -   License as published by the Free Software Foundation; either
   232 -   version 2.1 of the License, or (at your option) any later version.
   233 -
   234 -   The GNU C Library is distributed in the hope that it will be useful,
   235 -   but WITHOUT ANY WARRANTY; without even the implied warranty of
   236 -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   237 -   Lesser General Public License for more details.
   238 -
   239 -   You should have received a copy of the GNU Lesser General Public
   240 -   License along with the GNU C Library; if not, write to the Free
   241 -   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   242 -   02111-1307 USA.  */
   243 -
   244 -/*
   245 -    Floating Point Registers (FPRs) restore routine
   246 -*/
   247 -
   248 -#include <sysdep.h>
   249 -
   250 -ENTRY(_restfpr_all)
   251 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf14)
   252 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_14)
   253 -C_TEXT(_restf14):
   254 -C_TEXT(_restfpr_14):	lfd	fp14,-144(r1)
   255 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf15)
   256 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_15)
   257 -C_TEXT(_restf15):
   258 -C_TEXT(_restfpr_15):	lfd	fp15,-136(r1)
   259 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf16)
   260 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_16)
   261 -C_TEXT(_restf16):
   262 -C_TEXT(_restfpr_16):	lfd	fp16,-128(r1)
   263 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf17)
   264 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_17)
   265 -C_TEXT(_restf17):
   266 -C_TEXT(_restfpr_17):	lfd	fp17,-120(r1)
   267 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf18)
   268 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_18)
   269 -C_TEXT(_restf18):
   270 -C_TEXT(_restfpr_18):	lfd	fp18,-112(r1)
   271 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf19)
   272 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_19)
   273 -C_TEXT(_restf19):
   274 -C_TEXT(_restfpr_19):	lfd	fp19,-104(r1)
   275 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf20)
   276 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_20)
   277 -C_TEXT(_restf20):
   278 -C_TEXT(_restfpr_20):	lfd	fp20,-96(r1)
   279 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf21)
   280 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_21)
   281 -C_TEXT(_restf21):
   282 -C_TEXT(_restfpr_21):	lfd	fp21,-88(r1)
   283 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf22)
   284 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_22)
   285 -C_TEXT(_restf22):
   286 -C_TEXT(_restfpr_22):	lfd	fp22,-80(r1)
   287 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf23)
   288 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_23)
   289 -C_TEXT(_restf23):
   290 -C_TEXT(_restfpr_23):	lfd	fp23,-72(r1)
   291 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf24)
   292 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_24)
   293 -C_TEXT(_restf24):
   294 -C_TEXT(_restfpr_24):	lfd	fp24,-64(r1)
   295 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf25)
   296 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_25)
   297 -C_TEXT(_restf25):
   298 -C_TEXT(_restfpr_25):	lfd	fp25,-56(r1)
   299 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf26)
   300 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_26)
   301 -C_TEXT(_restf26):
   302 -C_TEXT(_restfpr_26):	lfd	fp26,-48(r1)
   303 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf27)
   304 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_27)
   305 -C_TEXT(_restf27):
   306 -C_TEXT(_restfpr_27):	lfd	fp27,-40(r1)
   307 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf28)
   308 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_28)
   309 -C_TEXT(_restf28):
   310 -C_TEXT(_restfpr_28):	lfd	fp28,-32(r1)
   311 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf29)
   312 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_29)
   313 -C_TEXT(_restf29):
   314 -C_TEXT(_restfpr_29):	lwz	r0,8(r1)	#get return address from frame
   315 -			lfd	fp29,-24(r1)    #restore f29
   316 -			mtlr	r0		#move return address to LR
   317 -			lfd	fp30,-16(r1)	#restore f30
   318 -			lfd	fp31,-8(r1)	#restore f31
   319 -			blr			#return
   320 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/fprsave.S glibc-2.2.5/sysdeps/powerpc/fprsave.S
   321 --- glibc-2.2.5.old/sysdeps/powerpc/fprsave.S	Thu Jul  5 21:56:01 2001
   322 +++ glibc-2.2.5/sysdeps/powerpc/fprsave.S	Wed Dec 31 16:00:00 1969
   323 @@ -1,93 +0,0 @@
   324 -/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
   325 -   This file is part of the GNU C Library.
   326 -
   327 -   The GNU C Library is free software; you can redistribute it and/or
   328 -   modify it under the terms of the GNU Lesser General Public
   329 -   License as published by the Free Software Foundation; either
   330 -   version 2.1 of the License, or (at your option) any later version.
   331 -
   332 -   The GNU C Library is distributed in the hope that it will be useful,
   333 -   but WITHOUT ANY WARRANTY; without even the implied warranty of
   334 -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   335 -   Lesser General Public License for more details.
   336 -
   337 -   You should have received a copy of the GNU Lesser General Public
   338 -   License along with the GNU C Library; if not, write to the Free
   339 -   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   340 -   02111-1307 USA.  */
   341 -
   342 -/*
   343 -    Floating Point Registers (FPRs) save routine
   344 -*/
   345 -
   346 -#include <sysdep.h>
   347 -
   348 -ENTRY(_savefpr_all)
   349 -                ASM_GLOBAL_DIRECTIVE C_TEXT(_savef14)
   350 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_14)
   351 -C_TEXT(_savef14):
   352 -C_TEXT(_savefpr_14):	stfd	fp14,-144(r1)
   353 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef15)
   354 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_15)
   355 -C_TEXT(_savef15):
   356 -C_TEXT(_savefpr_15):	stfd	fp15,-136(r1)
   357 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef16)
   358 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_16)
   359 -C_TEXT(_savef16):
   360 -C_TEXT(_savefpr_16):	stfd	fp16,-128(r1)
   361 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef17)
   362 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_17)
   363 -C_TEXT(_savef17):
   364 -C_TEXT(_savefpr_17):	stfd	fp17,-120(r1)
   365 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef18)
   366 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_18)
   367 -C_TEXT(_savef18):
   368 -C_TEXT(_savefpr_18):	stfd	fp18,-112(r1)
   369 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef19)
   370 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_19)
   371 -C_TEXT(_savef19):
   372 -C_TEXT(_savefpr_19):	stfd	fp19,-104(r1)
   373 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef20)
   374 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_20)
   375 -C_TEXT(_savef20):
   376 -C_TEXT(_savefpr_20):	stfd	fp20,-96(r1)
   377 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef21)
   378 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_21)
   379 -C_TEXT(_savef21):
   380 -C_TEXT(_savefpr_21):	stfd	fp21,-88(r1)
   381 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef22)
   382 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_22)
   383 -C_TEXT(_savef22):
   384 -C_TEXT(_savefpr_22):	stfd	fp22,-80(r1)
   385 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef23)
   386 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_23)
   387 -C_TEXT(_savef23):
   388 -C_TEXT(_savefpr_23):	stfd	fp23,-72(r1)
   389 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef24)
   390 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_24)
   391 -C_TEXT(_savef24):
   392 -C_TEXT(_savefpr_24):	stfd	fp24,-64(r1)
   393 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef25)
   394 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_25)
   395 -C_TEXT(_savef25):
   396 -C_TEXT(_savefpr_25):	stfd	fp25,-56(r1)
   397 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef26)
   398 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_26)
   399 -C_TEXT(_savef26):
   400 -C_TEXT(_savefpr_26):	stfd	fp26,-48(r1)
   401 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef27)
   402 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_27)
   403 -C_TEXT(_savef27):
   404 -C_TEXT(_savefpr_27):	stfd	fp27,-40(r1)
   405 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef28)
   406 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_28)
   407 -C_TEXT(_savef28):
   408 -C_TEXT(_savefpr_28):	stfd	fp28,-32(r1)
   409 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef29)
   410 -		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_29)
   411 -C_TEXT(_savef29):
   412 -C_TEXT(_savefpr_29):	stfd	fp29,-24(r1)	#save f29
   413 -			stfd	fp30,-16(r1)	#save f30
   414 -			stfd	fp31,-8(r1)	#save f31
   415 -			stw	r0,8(r1)	#save LR in callers frame
   416 -			blr			#return
   417 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/fpu/Dist glibc-2.2.5/sysdeps/powerpc/fpu/Dist
   418 --- glibc-2.2.5.old/sysdeps/powerpc/fpu/Dist	Wed Jan 26 17:48:02 2000
   419 +++ glibc-2.2.5/sysdeps/powerpc/fpu/Dist	Thu Jul 10 11:43:17 2003
   420 @@ -1,3 +1,6 @@
   421 +fe_nomask.c
   422 +fprrest.S
   423 +fprsave.S
   424  fenv_const.c
   425  fenv_libc.h
   426  t_sqrt.c
   427 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/fpu/Makefile glibc-2.2.5/sysdeps/powerpc/fpu/Makefile
   428 --- glibc-2.2.5.old/sysdeps/powerpc/fpu/Makefile	Mon Oct 11 15:29:00 1999
   429 +++ glibc-2.2.5/sysdeps/powerpc/fpu/Makefile	Thu Jul 10 11:43:17 2003
   430 @@ -1,3 +1,7 @@
   431  ifeq ($(subdir),math)
   432  libm-support += fenv_const fe_nomask t_sqrt
   433  endif
   434 +
   435 +ifeq ($(subdir),misc)
   436 +sysdep_routines += fprsave fprrest
   437 +endif
   438 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/fpu/Versions glibc-2.2.5/sysdeps/powerpc/fpu/Versions
   439 --- glibc-2.2.5.old/sysdeps/powerpc/fpu/Versions	Wed Dec 31 16:00:00 1969
   440 +++ glibc-2.2.5/sysdeps/powerpc/fpu/Versions	Thu Jul 10 11:43:17 2003
   441 @@ -0,0 +1,6 @@
   442 +libm {
   443 +  GLIBC_2.1 {
   444 +    # symbols used in macros from sysdeps/powerpc/bits/fenv.h
   445 +    __fe_dfl_env; __fe_enabled_env; __fe_nonieee_env; __fe_nomask_env;
   446 +  }
   447 +}
   448 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/fpu/__longjmp.S glibc-2.2.5/sysdeps/powerpc/fpu/__longjmp.S
   449 --- glibc-2.2.5.old/sysdeps/powerpc/fpu/__longjmp.S	Wed Dec 31 16:00:00 1969
   450 +++ glibc-2.2.5/sysdeps/powerpc/fpu/__longjmp.S	Thu Jul 10 11:43:17 2003
   451 @@ -0,0 +1,74 @@
   452 +/* longjmp for PowerPC.
   453 +   Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
   454 +   This file is part of the GNU C Library.
   455 +
   456 +   The GNU C Library is free software; you can redistribute it and/or
   457 +   modify it under the terms of the GNU Library General Public License as
   458 +   published by the Free Software Foundation; either version 2 of the
   459 +   License, or (at your option) any later version.
   460 +
   461 +   The GNU C Library is distributed in the hope that it will be useful,
   462 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
   463 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   464 +   Library General Public License for more details.
   465 +
   466 +   You should have received a copy of the GNU Library General Public
   467 +   License along with the GNU C Library; see the file COPYING.LIB.  If not,
   468 +   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   469 +   Boston, MA 02111-1307, USA.  */
   470 +
   471 +#include <sysdep.h>
   472 +#define _ASM
   473 +#define _SETJMP_H
   474 +#include <bits/setjmp.h>
   475 +#include <bp-sym.h>
   476 +#include <bp-asm.h>
   477 +
   478 +ENTRY (BP_SYM (__longjmp))
   479 +	CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
   480 +
   481 +	lwz r1,(JB_GPR1*4)(r3)
   482 +	lwz r2,(JB_GPR2*4)(r3)
   483 +	lwz r0,(JB_LR*4)(r3)
   484 +	lwz r14,((JB_GPRS+0)*4)(r3)
   485 +	lfd fp14,((JB_FPRS+0*2)*4)(r3)
   486 +	lwz r15,((JB_GPRS+1)*4)(r3)
   487 +	lfd fp15,((JB_FPRS+1*2)*4)(r3)
   488 +	lwz r16,((JB_GPRS+2)*4)(r3)
   489 +	lfd fp16,((JB_FPRS+2*2)*4)(r3)
   490 +	lwz r17,((JB_GPRS+3)*4)(r3)
   491 +	lfd fp17,((JB_FPRS+3*2)*4)(r3)
   492 +	lwz r18,((JB_GPRS+4)*4)(r3)
   493 +	lfd fp18,((JB_FPRS+4*2)*4)(r3)
   494 +	lwz r19,((JB_GPRS+5)*4)(r3)
   495 +	lfd fp19,((JB_FPRS+5*2)*4)(r3)
   496 +	lwz r20,((JB_GPRS+6)*4)(r3)
   497 +	lfd fp20,((JB_FPRS+6*2)*4)(r3)
   498 +	mtlr r0
   499 +	lwz r21,((JB_GPRS+7)*4)(r3)
   500 +	lfd fp21,((JB_FPRS+7*2)*4)(r3)
   501 +	lwz r22,((JB_GPRS+8)*4)(r3)
   502 +	lfd fp22,((JB_FPRS+8*2)*4)(r3)
   503 +	lwz r0,(JB_CR*4)(r3)
   504 +	lwz r23,((JB_GPRS+9)*4)(r3)
   505 +	lfd fp23,((JB_FPRS+9*2)*4)(r3)
   506 +	lwz r24,((JB_GPRS+10)*4)(r3)
   507 +	lfd fp24,((JB_FPRS+10*2)*4)(r3)
   508 +	lwz r25,((JB_GPRS+11)*4)(r3)
   509 +	lfd fp25,((JB_FPRS+11*2)*4)(r3)
   510 +	mtcrf 0xFF,r0
   511 +	lwz r26,((JB_GPRS+12)*4)(r3)
   512 +	lfd fp26,((JB_FPRS+12*2)*4)(r3)
   513 +	lwz r27,((JB_GPRS+13)*4)(r3)
   514 +	lfd fp27,((JB_FPRS+13*2)*4)(r3)
   515 +	lwz r28,((JB_GPRS+14)*4)(r3)
   516 +	lfd fp28,((JB_FPRS+14*2)*4)(r3)
   517 +	lwz r29,((JB_GPRS+15)*4)(r3)
   518 +	lfd fp29,((JB_FPRS+15*2)*4)(r3)
   519 +	lwz r30,((JB_GPRS+16)*4)(r3)
   520 +	lfd fp30,((JB_FPRS+16*2)*4)(r3)
   521 +	lwz r31,((JB_GPRS+17)*4)(r3)
   522 +	lfd fp31,((JB_FPRS+17*2)*4)(r3)
   523 +	mr r3,r4
   524 +	blr
   525 +END (BP_SYM (__longjmp))
   526 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/fpu/bits/setjmp.h glibc-2.2.5/sysdeps/powerpc/fpu/bits/setjmp.h
   527 --- glibc-2.2.5.old/sysdeps/powerpc/fpu/bits/setjmp.h	Wed Dec 31 16:00:00 1969
   528 +++ glibc-2.2.5/sysdeps/powerpc/fpu/bits/setjmp.h	Thu Jul 10 11:43:17 2003
   529 @@ -0,0 +1,47 @@
   530 +/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
   531 +   This file is part of the GNU C Library.
   532 +
   533 +   The GNU C Library is free software; you can redistribute it and/or
   534 +   modify it under the terms of the GNU Library General Public License as
   535 +   published by the Free Software Foundation; either version 2 of the
   536 +   License, or (at your option) any later version.
   537 +
   538 +   The GNU C Library is distributed in the hope that it will be useful,
   539 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
   540 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   541 +   Library General Public License for more details.
   542 +
   543 +   You should have received a copy of the GNU Library General Public
   544 +   License along with the GNU C Library; see the file COPYING.LIB.  If not,
   545 +   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   546 +   Boston, MA 02111-1307, USA.  */
   547 +
   548 +/* Define the machine-dependent type `jmp_buf'.  PowerPC version.  */
   549 +
   550 +#ifndef _SETJMP_H
   551 +# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
   552 +#endif
   553 +
   554 +/* The previous bits/setjmp.h had __jmp_buf defined as a structure.
   555 +   We use an array of 'long int' instead, to make writing the
   556 +   assembler easier. Naturally, user code should not depend on
   557 +   either representation. */
   558 +
   559 +#if defined __USE_MISC || defined _ASM
   560 +# define JB_GPR1   0  /* Also known as the stack pointer */
   561 +# define JB_GPR2   1
   562 +# define JB_LR     2  /* The address we will return to */
   563 +# define JB_GPRS   3  /* GPRs 14 through 31 are saved, 18 in total */
   564 +# define JB_CR     21 /* Condition code registers. */
   565 +# define JB_FPRS   22 /* FPRs 14 through 31 are saved, 18*2 words total */
   566 +# define JB_SIZE   (58*4)
   567 +#endif
   568 +
   569 +#ifndef	_ASM
   570 +typedef long int __jmp_buf[58];
   571 +#endif
   572 +
   573 +/* Test if longjmp to JMPBUF would unwind the frame
   574 +   containing a local variable at ADDRESS.  */
   575 +#define _JMPBUF_UNWINDS(jmpbuf, address) \
   576 +  ((void *) (address) < (void *) (jmpbuf)[JB_GPR1])
   577 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/fpu/fclrexcpt.c glibc-2.2.5/sysdeps/powerpc/fpu/fclrexcpt.c
   578 --- glibc-2.2.5.old/sysdeps/powerpc/fpu/fclrexcpt.c	Wed Dec 31 16:00:00 1969
   579 +++ glibc-2.2.5/sysdeps/powerpc/fpu/fclrexcpt.c	Thu Jul  5 21:56:01 2001
   580 @@ -0,0 +1,48 @@
   581 +/* Clear given exceptions in current floating-point environment.
   582 +   Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc.
   583 +   This file is part of the GNU C Library.
   584 +
   585 +   The GNU C Library is free software; you can redistribute it and/or
   586 +   modify it under the terms of the GNU Lesser General Public
   587 +   License as published by the Free Software Foundation; either
   588 +   version 2.1 of the License, or (at your option) any later version.
   589 +
   590 +   The GNU C Library is distributed in the hope that it will be useful,
   591 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
   592 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   593 +   Lesser General Public License for more details.
   594 +
   595 +   You should have received a copy of the GNU Lesser General Public
   596 +   License along with the GNU C Library; if not, write to the Free
   597 +   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   598 +   02111-1307 USA.  */
   599 +
   600 +#include <fenv_libc.h>
   601 +
   602 +#undef feclearexcept
   603 +int
   604 +__feclearexcept (int excepts)
   605 +{
   606 +  fenv_union_t u;
   607 +
   608 +  /* Get the current state.  */
   609 +  u.fenv = fegetenv_register ();
   610 +
   611 +  /* Clear the relevant bits.  */
   612 +  u.l[1] = u.l[1] & ~((-(excepts >> (31 - FPSCR_VX) & 1) & FE_ALL_INVALID)
   613 +		      | (excepts & FPSCR_STICKY_BITS));
   614 +
   615 +  /* Put the new state in effect.  */
   616 +  fesetenv_register (u.fenv);
   617 +
   618 +  /* Success.  */
   619 +  return 0;
   620 +}
   621 +
   622 +#include <shlib-compat.h>
   623 +#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
   624 +strong_alias (__feclearexcept, __old_feclearexcept)
   625 +compat_symbol (libm, __old_feclearexcept, feclearexcept, GLIBC_2_1);
   626 +#endif
   627 +
   628 +versioned_symbol (libm, __feclearexcept, feclearexcept, GLIBC_2_2);
   629 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/fpu/fe_nomask.c glibc-2.2.5/sysdeps/powerpc/fpu/fe_nomask.c
   630 --- glibc-2.2.5.old/sysdeps/powerpc/fpu/fe_nomask.c	Wed Dec 31 16:00:00 1969
   631 +++ glibc-2.2.5/sysdeps/powerpc/fpu/fe_nomask.c	Thu Jul  5 21:56:01 2001
   632 @@ -0,0 +1,32 @@
   633 +/* Procedure definition for FE_NOMASK_ENV.
   634 +   Copyright (C) 1997 Free Software Foundation, Inc.
   635 +   This file is part of the GNU C Library.
   636 +
   637 +   The GNU C Library is free software; you can redistribute it and/or
   638 +   modify it under the terms of the GNU Lesser General Public
   639 +   License as published by the Free Software Foundation; either
   640 +   version 2.1 of the License, or (at your option) any later version.
   641 +
   642 +   The GNU C Library is distributed in the hope that it will be useful,
   643 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
   644 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   645 +   Lesser General Public License for more details.
   646 +
   647 +   You should have received a copy of the GNU Lesser General Public
   648 +   License along with the GNU C Library; if not, write to the Free
   649 +   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   650 +   02111-1307 USA.  */
   651 +
   652 +#include <fenv.h>
   653 +#include <errno.h>
   654 +
   655 +/* This is presently a stub, until it's decided how the kernels should
   656 +   support this.  */
   657 +
   658 +const fenv_t *
   659 +__fe_nomask_env(void)
   660 +{
   661 +  __set_errno (ENOSYS);
   662 +  return FE_ENABLED_ENV;
   663 +}
   664 +stub_warning (__fe_nomask_env)
   665 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/fpu/fprrest.S glibc-2.2.5/sysdeps/powerpc/fpu/fprrest.S
   666 --- glibc-2.2.5.old/sysdeps/powerpc/fpu/fprrest.S	Wed Dec 31 16:00:00 1969
   667 +++ glibc-2.2.5/sysdeps/powerpc/fpu/fprrest.S	Thu Jul  5 21:56:01 2001
   668 @@ -0,0 +1,94 @@
   669 +/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
   670 +   This file is part of the GNU C Library.
   671 +
   672 +   The GNU C Library is free software; you can redistribute it and/or
   673 +   modify it under the terms of the GNU Lesser General Public
   674 +   License as published by the Free Software Foundation; either
   675 +   version 2.1 of the License, or (at your option) any later version.
   676 +
   677 +   The GNU C Library is distributed in the hope that it will be useful,
   678 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
   679 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   680 +   Lesser General Public License for more details.
   681 +
   682 +   You should have received a copy of the GNU Lesser General Public
   683 +   License along with the GNU C Library; if not, write to the Free
   684 +   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   685 +   02111-1307 USA.  */
   686 +
   687 +/*
   688 +    Floating Point Registers (FPRs) restore routine
   689 +*/
   690 +
   691 +#include <sysdep.h>
   692 +
   693 +ENTRY(_restfpr_all)
   694 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf14)
   695 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_14)
   696 +C_TEXT(_restf14):
   697 +C_TEXT(_restfpr_14):	lfd	fp14,-144(r1)
   698 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf15)
   699 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_15)
   700 +C_TEXT(_restf15):
   701 +C_TEXT(_restfpr_15):	lfd	fp15,-136(r1)
   702 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf16)
   703 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_16)
   704 +C_TEXT(_restf16):
   705 +C_TEXT(_restfpr_16):	lfd	fp16,-128(r1)
   706 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf17)
   707 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_17)
   708 +C_TEXT(_restf17):
   709 +C_TEXT(_restfpr_17):	lfd	fp17,-120(r1)
   710 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf18)
   711 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_18)
   712 +C_TEXT(_restf18):
   713 +C_TEXT(_restfpr_18):	lfd	fp18,-112(r1)
   714 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf19)
   715 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_19)
   716 +C_TEXT(_restf19):
   717 +C_TEXT(_restfpr_19):	lfd	fp19,-104(r1)
   718 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf20)
   719 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_20)
   720 +C_TEXT(_restf20):
   721 +C_TEXT(_restfpr_20):	lfd	fp20,-96(r1)
   722 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf21)
   723 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_21)
   724 +C_TEXT(_restf21):
   725 +C_TEXT(_restfpr_21):	lfd	fp21,-88(r1)
   726 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf22)
   727 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_22)
   728 +C_TEXT(_restf22):
   729 +C_TEXT(_restfpr_22):	lfd	fp22,-80(r1)
   730 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf23)
   731 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_23)
   732 +C_TEXT(_restf23):
   733 +C_TEXT(_restfpr_23):	lfd	fp23,-72(r1)
   734 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf24)
   735 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_24)
   736 +C_TEXT(_restf24):
   737 +C_TEXT(_restfpr_24):	lfd	fp24,-64(r1)
   738 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf25)
   739 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_25)
   740 +C_TEXT(_restf25):
   741 +C_TEXT(_restfpr_25):	lfd	fp25,-56(r1)
   742 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf26)
   743 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_26)
   744 +C_TEXT(_restf26):
   745 +C_TEXT(_restfpr_26):	lfd	fp26,-48(r1)
   746 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf27)
   747 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_27)
   748 +C_TEXT(_restf27):
   749 +C_TEXT(_restfpr_27):	lfd	fp27,-40(r1)
   750 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf28)
   751 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_28)
   752 +C_TEXT(_restf28):
   753 +C_TEXT(_restfpr_28):	lfd	fp28,-32(r1)
   754 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restf29)
   755 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_restfpr_29)
   756 +C_TEXT(_restf29):
   757 +C_TEXT(_restfpr_29):	lwz	r0,8(r1)	#get return address from frame
   758 +			lfd	fp29,-24(r1)    #restore f29
   759 +			mtlr	r0		#move return address to LR
   760 +			lfd	fp30,-16(r1)	#restore f30
   761 +			lfd	fp31,-8(r1)	#restore f31
   762 +			blr			#return
   763 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/fpu/fprsave.S glibc-2.2.5/sysdeps/powerpc/fpu/fprsave.S
   764 --- glibc-2.2.5.old/sysdeps/powerpc/fpu/fprsave.S	Wed Dec 31 16:00:00 1969
   765 +++ glibc-2.2.5/sysdeps/powerpc/fpu/fprsave.S	Thu Jul  5 21:56:01 2001
   766 @@ -0,0 +1,93 @@
   767 +/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
   768 +   This file is part of the GNU C Library.
   769 +
   770 +   The GNU C Library is free software; you can redistribute it and/or
   771 +   modify it under the terms of the GNU Lesser General Public
   772 +   License as published by the Free Software Foundation; either
   773 +   version 2.1 of the License, or (at your option) any later version.
   774 +
   775 +   The GNU C Library is distributed in the hope that it will be useful,
   776 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
   777 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   778 +   Lesser General Public License for more details.
   779 +
   780 +   You should have received a copy of the GNU Lesser General Public
   781 +   License along with the GNU C Library; if not, write to the Free
   782 +   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   783 +   02111-1307 USA.  */
   784 +
   785 +/*
   786 +    Floating Point Registers (FPRs) save routine
   787 +*/
   788 +
   789 +#include <sysdep.h>
   790 +
   791 +ENTRY(_savefpr_all)
   792 +                ASM_GLOBAL_DIRECTIVE C_TEXT(_savef14)
   793 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_14)
   794 +C_TEXT(_savef14):
   795 +C_TEXT(_savefpr_14):	stfd	fp14,-144(r1)
   796 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef15)
   797 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_15)
   798 +C_TEXT(_savef15):
   799 +C_TEXT(_savefpr_15):	stfd	fp15,-136(r1)
   800 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef16)
   801 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_16)
   802 +C_TEXT(_savef16):
   803 +C_TEXT(_savefpr_16):	stfd	fp16,-128(r1)
   804 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef17)
   805 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_17)
   806 +C_TEXT(_savef17):
   807 +C_TEXT(_savefpr_17):	stfd	fp17,-120(r1)
   808 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef18)
   809 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_18)
   810 +C_TEXT(_savef18):
   811 +C_TEXT(_savefpr_18):	stfd	fp18,-112(r1)
   812 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef19)
   813 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_19)
   814 +C_TEXT(_savef19):
   815 +C_TEXT(_savefpr_19):	stfd	fp19,-104(r1)
   816 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef20)
   817 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_20)
   818 +C_TEXT(_savef20):
   819 +C_TEXT(_savefpr_20):	stfd	fp20,-96(r1)
   820 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef21)
   821 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_21)
   822 +C_TEXT(_savef21):
   823 +C_TEXT(_savefpr_21):	stfd	fp21,-88(r1)
   824 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef22)
   825 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_22)
   826 +C_TEXT(_savef22):
   827 +C_TEXT(_savefpr_22):	stfd	fp22,-80(r1)
   828 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef23)
   829 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_23)
   830 +C_TEXT(_savef23):
   831 +C_TEXT(_savefpr_23):	stfd	fp23,-72(r1)
   832 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef24)
   833 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_24)
   834 +C_TEXT(_savef24):
   835 +C_TEXT(_savefpr_24):	stfd	fp24,-64(r1)
   836 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef25)
   837 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_25)
   838 +C_TEXT(_savef25):
   839 +C_TEXT(_savefpr_25):	stfd	fp25,-56(r1)
   840 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef26)
   841 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_26)
   842 +C_TEXT(_savef26):
   843 +C_TEXT(_savefpr_26):	stfd	fp26,-48(r1)
   844 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef27)
   845 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_27)
   846 +C_TEXT(_savef27):
   847 +C_TEXT(_savefpr_27):	stfd	fp27,-40(r1)
   848 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef28)
   849 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_28)
   850 +C_TEXT(_savef28):
   851 +C_TEXT(_savefpr_28):	stfd	fp28,-32(r1)
   852 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef29)
   853 +		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_29)
   854 +C_TEXT(_savef29):
   855 +C_TEXT(_savefpr_29):	stfd	fp29,-24(r1)	#save f29
   856 +			stfd	fp30,-16(r1)	#save f30
   857 +			stfd	fp31,-8(r1)	#save f31
   858 +			stw	r0,8(r1)	#save LR in callers frame
   859 +			blr			#return
   860 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/fpu/fpu_control.h glibc-2.2.5/sysdeps/powerpc/fpu/fpu_control.h
   861 --- glibc-2.2.5.old/sysdeps/powerpc/fpu/fpu_control.h	Wed Dec 31 16:00:00 1969
   862 +++ glibc-2.2.5/sysdeps/powerpc/fpu/fpu_control.h	Thu Jul  5 21:56:01 2001
   863 @@ -0,0 +1,67 @@
   864 +/* FPU control word definitions.  PowerPC version.
   865 +   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
   866 +   This file is part of the GNU C Library.
   867 +
   868 +   The GNU C Library is free software; you can redistribute it and/or
   869 +   modify it under the terms of the GNU Lesser General Public
   870 +   License as published by the Free Software Foundation; either
   871 +   version 2.1 of the License, or (at your option) any later version.
   872 +
   873 +   The GNU C Library is distributed in the hope that it will be useful,
   874 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
   875 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   876 +   Lesser General Public License for more details.
   877 +
   878 +   You should have received a copy of the GNU Lesser General Public
   879 +   License along with the GNU C Library; if not, write to the Free
   880 +   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   881 +   02111-1307 USA.  */
   882 +
   883 +#ifndef _FPU_CONTROL_H
   884 +#define _FPU_CONTROL_H
   885 +
   886 +/* rounding control */
   887 +#define _FPU_RC_NEAREST 0x00   /* RECOMMENDED */
   888 +#define _FPU_RC_DOWN    0x03
   889 +#define _FPU_RC_UP      0x02
   890 +#define _FPU_RC_ZERO    0x01
   891 +
   892 +#define _FPU_MASK_NI  0x04 /* non-ieee mode */
   893 +
   894 +/* masking of interrupts */
   895 +#define _FPU_MASK_ZM  0x10 /* zero divide */
   896 +#define _FPU_MASK_OM  0x40 /* overflow */
   897 +#define _FPU_MASK_UM  0x20 /* underflow */
   898 +#define _FPU_MASK_XM  0x08 /* inexact */
   899 +#define _FPU_MASK_IM  0x80 /* invalid operation */
   900 +
   901 +#define _FPU_RESERVED 0xffffff00 /* These bits are reserved are not changed. */
   902 +
   903 +/* The fdlibm code requires no interrupts for exceptions.  */
   904 +#define _FPU_DEFAULT  0x00000000 /* Default value.  */
   905 +
   906 +/* IEEE:  same as above, but (some) exceptions;
   907 +   we leave the 'inexact' exception off.
   908 + */
   909 +#define _FPU_IEEE     0x000000f0
   910 +
   911 +/* Type of the control word.  */
   912 +typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
   913 +
   914 +/* Macros for accessing the hardware control word.  */
   915 +#define _FPU_GETCW(cw) ( { \
   916 +  union { double d; fpu_control_t cw[2]; } tmp __attribute__ ((__aligned__(8))); \
   917 +  __asm__ ("mffs 0; stfd%U0 0,%0" : "=m" (tmp.d) : : "fr0"); \
   918 +  (cw)=tmp.cw[1]; \
   919 +  tmp.cw[1]; } )
   920 +#define _FPU_SETCW(cw) { \
   921 +  union { double d; fpu_control_t cw[2]; } tmp __attribute__ ((__aligned__(8))); \
   922 +  tmp.cw[0] = 0xFFF80000; /* More-or-less arbitrary; this is a QNaN. */ \
   923 +  tmp.cw[1] = cw; \
   924 +  __asm__ ("lfd%U0 0,%0; mtfsf 255,0" : : "m" (tmp.d) : "fr0"); \
   925 +}
   926 +
   927 +/* Default control word set at startup.  */
   928 +extern fpu_control_t __fpu_control;
   929 +
   930 +#endif /* _FPU_CONTROL_H */
   931 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/fpu/setjmp.S glibc-2.2.5/sysdeps/powerpc/fpu/setjmp.S
   932 --- glibc-2.2.5.old/sysdeps/powerpc/fpu/setjmp.S	Wed Dec 31 16:00:00 1969
   933 +++ glibc-2.2.5/sysdeps/powerpc/fpu/setjmp.S	Thu Jul 10 11:43:44 2003
   934 @@ -0,0 +1,73 @@
   935 +/* setjmp for PowerPC.
   936 +   Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
   937 +   This file is part of the GNU C Library.
   938 +
   939 +   The GNU C Library is free software; you can redistribute it and/or
   940 +   modify it under the terms of the GNU Library General Public License as
   941 +   published by the Free Software Foundation; either version 2 of the
   942 +   License, or (at your option) any later version.
   943 +
   944 +   The GNU C Library is distributed in the hope that it will be useful,
   945 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
   946 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   947 +   Library General Public License for more details.
   948 +
   949 +   You should have received a copy of the GNU Library General Public
   950 +   License along with the GNU C Library; see the file COPYING.LIB.  If not,
   951 +   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   952 +   Boston, MA 02111-1307, USA.  */
   953 +
   954 +#include <sysdep.h>
   955 +#define _ASM
   956 +#define _SETJMP_H
   957 +#include <bits/setjmp.h>
   958 +#include <bp-sym.h>
   959 +#include <bp-asm.h>
   960 +
   961 +ENTRY (BP_SYM (__sigsetjmp))
   962 +	CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
   963 +
   964 +	stw  r1,(JB_GPR1*4)(3)
   965 +	mflr r0
   966 +	stw  r2,(JB_GPR2*4)(3)
   967 +	stw  r14,((JB_GPRS+0)*4)(3)
   968 +	stfd fp14,((JB_FPRS+0*2)*4)(3)
   969 +	stw  r0,(JB_LR*4)(3)
   970 +	stw  r15,((JB_GPRS+1)*4)(3)
   971 +	stfd fp15,((JB_FPRS+1*2)*4)(3)
   972 +	mfcr r0
   973 +	stw  r16,((JB_GPRS+2)*4)(3)
   974 +	stfd fp16,((JB_FPRS+2*2)*4)(3)
   975 +	stw  r0,(JB_CR*4)(3)
   976 +	stw  r17,((JB_GPRS+3)*4)(3)
   977 +	stfd fp17,((JB_FPRS+3*2)*4)(3)
   978 +	stw  r18,((JB_GPRS+4)*4)(3)
   979 +	stfd fp18,((JB_FPRS+4*2)*4)(3)
   980 +	stw  r19,((JB_GPRS+5)*4)(3)
   981 +	stfd fp19,((JB_FPRS+5*2)*4)(3)
   982 +	stw  r20,((JB_GPRS+6)*4)(3)
   983 +	stfd fp20,((JB_FPRS+6*2)*4)(3)
   984 +	stw  r21,((JB_GPRS+7)*4)(3)
   985 +	stfd fp21,((JB_FPRS+7*2)*4)(3)
   986 +	stw  r22,((JB_GPRS+8)*4)(3)
   987 +	stfd fp22,((JB_FPRS+8*2)*4)(3)
   988 +	stw  r23,((JB_GPRS+9)*4)(3)
   989 +	stfd fp23,((JB_FPRS+9*2)*4)(3)
   990 +	stw  r24,((JB_GPRS+10)*4)(3)
   991 +	stfd fp24,((JB_FPRS+10*2)*4)(3)
   992 +	stw  r25,((JB_GPRS+11)*4)(3)
   993 +	stfd fp25,((JB_FPRS+11*2)*4)(3)
   994 +	stw  r26,((JB_GPRS+12)*4)(3)
   995 +	stfd fp26,((JB_FPRS+12*2)*4)(3)
   996 +	stw  r27,((JB_GPRS+13)*4)(3)
   997 +	stfd fp27,((JB_FPRS+13*2)*4)(3)
   998 +	stw  r28,((JB_GPRS+14)*4)(3)
   999 +	stfd fp28,((JB_FPRS+14*2)*4)(3)
  1000 +	stw  r29,((JB_GPRS+15)*4)(3)
  1001 +	stfd fp29,((JB_FPRS+15*2)*4)(3)
  1002 +	stw  r30,((JB_GPRS+16)*4)(3)
  1003 +	stfd fp30,((JB_FPRS+16*2)*4)(3)
  1004 +	stw  r31,((JB_GPRS+17)*4)(3)
  1005 +	stfd fp31,((JB_FPRS+17*2)*4)(3)
  1006 +	b JUMPTARGET (BP_SYM (__sigjmp_save))
  1007 +END (BP_SYM (__sigsetjmp))
  1008 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/fpu_control.h glibc-2.2.5/sysdeps/powerpc/fpu_control.h
  1009 --- glibc-2.2.5.old/sysdeps/powerpc/fpu_control.h	Thu Jul  5 21:56:01 2001
  1010 +++ glibc-2.2.5/sysdeps/powerpc/fpu_control.h	Wed Dec 31 16:00:00 1969
  1011 @@ -1,67 +0,0 @@
  1012 -/* FPU control word definitions.  PowerPC version.
  1013 -   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
  1014 -   This file is part of the GNU C Library.
  1015 -
  1016 -   The GNU C Library is free software; you can redistribute it and/or
  1017 -   modify it under the terms of the GNU Lesser General Public
  1018 -   License as published by the Free Software Foundation; either
  1019 -   version 2.1 of the License, or (at your option) any later version.
  1020 -
  1021 -   The GNU C Library is distributed in the hope that it will be useful,
  1022 -   but WITHOUT ANY WARRANTY; without even the implied warranty of
  1023 -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1024 -   Lesser General Public License for more details.
  1025 -
  1026 -   You should have received a copy of the GNU Lesser General Public
  1027 -   License along with the GNU C Library; if not, write to the Free
  1028 -   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  1029 -   02111-1307 USA.  */
  1030 -
  1031 -#ifndef _FPU_CONTROL_H
  1032 -#define _FPU_CONTROL_H
  1033 -
  1034 -/* rounding control */
  1035 -#define _FPU_RC_NEAREST 0x00   /* RECOMMENDED */
  1036 -#define _FPU_RC_DOWN    0x03
  1037 -#define _FPU_RC_UP      0x02
  1038 -#define _FPU_RC_ZERO    0x01
  1039 -
  1040 -#define _FPU_MASK_NI  0x04 /* non-ieee mode */
  1041 -
  1042 -/* masking of interrupts */
  1043 -#define _FPU_MASK_ZM  0x10 /* zero divide */
  1044 -#define _FPU_MASK_OM  0x40 /* overflow */
  1045 -#define _FPU_MASK_UM  0x20 /* underflow */
  1046 -#define _FPU_MASK_XM  0x08 /* inexact */
  1047 -#define _FPU_MASK_IM  0x80 /* invalid operation */
  1048 -
  1049 -#define _FPU_RESERVED 0xffffff00 /* These bits are reserved are not changed. */
  1050 -
  1051 -/* The fdlibm code requires no interrupts for exceptions.  */
  1052 -#define _FPU_DEFAULT  0x00000000 /* Default value.  */
  1053 -
  1054 -/* IEEE:  same as above, but (some) exceptions;
  1055 -   we leave the 'inexact' exception off.
  1056 - */
  1057 -#define _FPU_IEEE     0x000000f0
  1058 -
  1059 -/* Type of the control word.  */
  1060 -typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
  1061 -
  1062 -/* Macros for accessing the hardware control word.  */
  1063 -#define _FPU_GETCW(cw) ( { \
  1064 -  union { double d; fpu_control_t cw[2]; } tmp __attribute__ ((__aligned__(8))); \
  1065 -  __asm__ ("mffs 0; stfd%U0 0,%0" : "=m" (tmp.d) : : "fr0"); \
  1066 -  (cw)=tmp.cw[1]; \
  1067 -  tmp.cw[1]; } )
  1068 -#define _FPU_SETCW(cw) { \
  1069 -  union { double d; fpu_control_t cw[2]; } tmp __attribute__ ((__aligned__(8))); \
  1070 -  tmp.cw[0] = 0xFFF80000; /* More-or-less arbitrary; this is a QNaN. */ \
  1071 -  tmp.cw[1] = cw; \
  1072 -  __asm__ ("lfd%U0 0,%0; mtfsf 255,0" : : "m" (tmp.d) : "fr0"); \
  1073 -}
  1074 -
  1075 -/* Default control word set at startup.  */
  1076 -extern fpu_control_t __fpu_control;
  1077 -
  1078 -#endif /* _FPU_CONTROL_H */
  1079 diff -Naur glibc-2.2.5.old/sysdeps/powerpc/setjmp.S glibc-2.2.5/sysdeps/powerpc/setjmp.S
  1080 --- glibc-2.2.5.old/sysdeps/powerpc/setjmp.S	Thu Jul  5 21:56:01 2001
  1081 +++ glibc-2.2.5/sysdeps/powerpc/setjmp.S	Thu Jul 10 11:43:44 2003
  1082 @@ -24,6 +24,8 @@
  1083  #include <bp-sym.h>
  1084  #include <bp-asm.h>
  1085  
  1086 +/* The FPU stores have been removed from this file - see fpu/setjmp.S */
  1087 +
  1088  ENTRY (BP_SYM (__sigsetjmp))
  1089  	CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
  1090  
  1091 @@ -31,43 +33,25 @@
  1092  	mflr r0
  1093  	stw  r2,(JB_GPR2*4)(3)
  1094  	stw  r14,((JB_GPRS+0)*4)(3)
  1095 -	stfd fp14,((JB_FPRS+0*2)*4)(3)
  1096  	stw  r0,(JB_LR*4)(3)
  1097  	stw  r15,((JB_GPRS+1)*4)(3)
  1098 -	stfd fp15,((JB_FPRS+1*2)*4)(3)
  1099  	mfcr r0
  1100  	stw  r16,((JB_GPRS+2)*4)(3)
  1101 -	stfd fp16,((JB_FPRS+2*2)*4)(3)
  1102  	stw  r0,(JB_CR*4)(3)
  1103  	stw  r17,((JB_GPRS+3)*4)(3)
  1104 -	stfd fp17,((JB_FPRS+3*2)*4)(3)
  1105  	stw  r18,((JB_GPRS+4)*4)(3)
  1106 -	stfd fp18,((JB_FPRS+4*2)*4)(3)
  1107  	stw  r19,((JB_GPRS+5)*4)(3)
  1108 -	stfd fp19,((JB_FPRS+5*2)*4)(3)
  1109  	stw  r20,((JB_GPRS+6)*4)(3)
  1110 -	stfd fp20,((JB_FPRS+6*2)*4)(3)
  1111  	stw  r21,((JB_GPRS+7)*4)(3)
  1112 -	stfd fp21,((JB_FPRS+7*2)*4)(3)
  1113  	stw  r22,((JB_GPRS+8)*4)(3)
  1114 -	stfd fp22,((JB_FPRS+8*2)*4)(3)
  1115  	stw  r23,((JB_GPRS+9)*4)(3)
  1116 -	stfd fp23,((JB_FPRS+9*2)*4)(3)
  1117  	stw  r24,((JB_GPRS+10)*4)(3)
  1118 -	stfd fp24,((JB_FPRS+10*2)*4)(3)
  1119  	stw  r25,((JB_GPRS+11)*4)(3)
  1120 -	stfd fp25,((JB_FPRS+11*2)*4)(3)
  1121  	stw  r26,((JB_GPRS+12)*4)(3)
  1122 -	stfd fp26,((JB_FPRS+12*2)*4)(3)
  1123  	stw  r27,((JB_GPRS+13)*4)(3)
  1124 -	stfd fp27,((JB_FPRS+13*2)*4)(3)
  1125  	stw  r28,((JB_GPRS+14)*4)(3)
  1126 -	stfd fp28,((JB_FPRS+14*2)*4)(3)
  1127  	stw  r29,((JB_GPRS+15)*4)(3)
  1128 -	stfd fp29,((JB_FPRS+15*2)*4)(3)
  1129  	stw  r30,((JB_GPRS+16)*4)(3)
  1130 -	stfd fp30,((JB_FPRS+16*2)*4)(3)
  1131  	stw  r31,((JB_GPRS+17)*4)(3)
  1132 -	stfd fp31,((JB_FPRS+17*2)*4)(3)
  1133  	b JUMPTARGET (BP_SYM (__sigjmp_save))
  1134  END (BP_SYM (__sigsetjmp))