ce426f
# commit 6a31fe7f9cce72b69fce8fe499a2c6ad492c2311
ce426f
# Author: Alan Modra <amodra@gmail.com>
ce426f
# Date:   Sat Aug 17 18:32:18 2013 +0930
ce426f
# 
ce426f
#     PowerPC floating point little-endian [13 of 15]
ce426f
#     http://sourceware.org/ml/libc-alpha/2013-08/msg00088.html
ce426f
#     
ce426f
#         * sysdeps/powerpc/powerpc32/fpu/s_roundf.S: Increase alignment of
ce426f
#         constants to usual value for .cst8 section, and remove redundant
ce426f
#         high address load.
ce426f
#         * sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S: Use float
ce426f
#         constant for 0x1p52.  Load little-endian words of double from
ce426f
#         correct stack offsets.
ce426f
# 
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_roundf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_roundf.S
ce426f
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_roundf.S	2014-05-27 22:50:13.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_roundf.S	2014-05-27 22:50:13.000000000 -0500
ce426f
@@ -19,7 +19,7 @@
ce426f
 #include <sysdep.h>
ce426f
 
ce426f
 	.section	.rodata.cst8,"aM",@progbits,8
ce426f
-	.align	2
ce426f
+	.align	3
ce426f
 .LC0:	/* 2**23 */
ce426f
 	.long 0x4b000000
ce426f
 .LC1:	/* 0.5 */
ce426f
@@ -60,7 +60,6 @@
ce426f
 #ifdef SHARED
ce426f
 	lfs	fp10,.LC1-.LC0(r9)
ce426f
 #else
ce426f
-	lis	r9,.LC1@ha
ce426f
 	lfs	fp10,.LC1@l(r9)
ce426f
 #endif
ce426f
 	ble-	cr6,.L4
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S
ce426f
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S	2014-05-27 22:50:13.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S	2014-05-27 22:50:13.000000000 -0500
ce426f
@@ -19,12 +19,10 @@
ce426f
 #include <sysdep.h>
ce426f
 #include <math_ldbl_opt.h>
ce426f
 
ce426f
- .section .rodata.cst12,"aM",@progbits,12
ce426f
+ .section .rodata.cst8,"aM",@progbits,8
ce426f
  .align 3
ce426f
- .LC0:   /* 0x1.0000000000000p+52 == 2^52 */
ce426f
-	.long 0x43300000
ce426f
-	.long 0x00000000
ce426f
-	.long 0x3f000000 /* Use this for 0.5  */
ce426f
+ .LC0:	.long (52+127)<<23 /* 0x1p+52  */
ce426f
+	.long (-1+127)<<23 /* 0.5  */
ce426f
 
ce426f
 	.section	".text"
ce426f
 
ce426f
@@ -57,12 +55,12 @@
ce426f
 	addi	r9,r9,.LC0-got_label@l
ce426f
 	mtlr	r11
ce426f
 	cfi_same_value (lr)
ce426f
-	lfd	fp9,0(r9)
ce426f
-	lfs	fp10,8(r9)
ce426f
+	lfs	fp9,0(r9)
ce426f
+	lfs	fp10,4(r9)
ce426f
 #else
ce426f
 	lis r9,.LC0@ha
ce426f
-	lfd fp9,.LC0@l(r9)	/* Load 2^52 into fpr9.  */
ce426f
-	lfs fp10,.LC0@l+8(r9)	/* Load 0.5 into fpr10.  */
ce426f
+	lfs fp9,.LC0@l(r9)	/* Load 2^52 into fpr9.  */
ce426f
+	lfs fp10,.LC0@l+4(r9)	/* Load 0.5 into fpr10.  */
ce426f
 #endif
ce426f
 	fabs	fp2,fp1		/* Get the absolute value of x.  */
ce426f
 	fsub	fp12,fp10,fp10	/* Compute 0.0 into fpr12.  */
ce426f
@@ -80,8 +78,8 @@
ce426f
 	nop
ce426f
 	nop
ce426f
 	nop
ce426f
-	lwz	r4,12(r1)	/* Load return as integer.  */
ce426f
-	lwz	r3,8(r1)
ce426f
+	lwz	r3,8+HIWORD(r1)	/* Load return as integer.  */
ce426f
+	lwz	r4,8+LOWORD(r1)
ce426f
 .Lout:
ce426f
 	addi	r1,r1,16
ce426f
 	blr