*** newlib-1.11.0/newlib/libc/machine/powerpc/setjmp.S.orig	Fri Apr 19 12:16:17 2002
--- newlib-1.11.0/newlib/libc/machine/powerpc/setjmp.S	Thu Apr  3 14:35:38 2003
***************
*** 39,44 ****
--- 39,52 ----
  	stwu	4,4(3)		# offset 88
  				# one word pad to get floating point aligned on 8 byte boundary
  #ifndef _SOFT_FLOAT
+ #ifdef __rtems__
+ 	mfmsr	4
+ 	rlwinm. 4,4,0,18,18
+ 	bne		1f			# only save FPregs if FPU is enabled
+ 	addi	3,3,18*8		# skip FPregs
+ 	b		2f
+ 1:
+ #endif
  	stfdu	14,8(3)		# offset 96
  	stfdu	15,8(3)		# offset 104
  	stfdu	16,8(3)		# offset 112
***************
*** 57,62 ****
--- 65,73 ----
  	stfdu	29,8(3)		# offset 216
  	stfdu	30,8(3)		# offset 224
  	stfdu	31,8(3)		# offset 232
+ #ifdef __rtems__
+ 2:
+ #endif
  #endif
  
  	/* This requires a total of 21 * 4 + 18 * 8 + 4 + 4 + 4
***************
*** 129,138 ****
  	lwzu	31,4(3)		# offset 80
  	lwzu	5,4(3)		# offset 84
  	mtlr	5
  	lwzu	5,4(3)		# offset 88
- 	mtcrf	255,5
  				# one word pad to get floating point aligned on 8 byte boundary
  #ifndef _SOFT_FLOAT
  	lfdu	14,8(3)         # offset 96 
  	lfdu	15,8(3)         # offset 104
  	lfdu	16,8(3)         # offset 112
--- 140,158 ----
  	lwzu	31,4(3)		# offset 80
  	lwzu	5,4(3)		# offset 84
  	mtlr	5
+ #if !defined(_SOFT_FLOAT) && defined(__rtems__)
+ 	mfmsr	5
+ 	rlwinm. 5,5,0,18,18 # is MSR_FP set?
+ #endif
  	lwzu	5,4(3)		# offset 88
  				# one word pad to get floating point aligned on 8 byte boundary
  #ifndef _SOFT_FLOAT
+ #ifdef __rtems__
+ 	bne		1f
+ 	addi	3,3,18*8		# skip FPregs
+ 	b		2f
+ 1:
+ #endif
  	lfdu	14,8(3)         # offset 96 
  	lfdu	15,8(3)         # offset 104
  	lfdu	16,8(3)         # offset 112
***************
*** 151,157 ****
--- 171,181 ----
  	lfdu	29,8(3)         # offset 216
  	lfdu	30,8(3)         # offset 224
  	lfdu	31,8(3)         # offset 232
+ #ifdef __rtems__
+ 2:
+ #endif
  #endif
+ 	mtcrf	255,5
  
  #ifdef __ALTIVEC__
  	/* restore Altivec vrsave and v20-v31 registers */
