|
|
5de29b |
# commit 7b88401f3b25325b1381798a0eccb3efe7751fec
|
|
|
5de29b |
# Author: Alan Modra <amodra@gmail.com>
|
|
|
5de29b |
# Date: Sat Aug 17 18:31:45 2013 +0930
|
|
|
5de29b |
#
|
|
|
5de29b |
# PowerPC floating point little-endian [12 of 15]
|
|
|
5de29b |
# http://sourceware.org/ml/libc-alpha/2013-08/msg00087.html
|
|
|
5de29b |
#
|
|
|
5de29b |
# Fixes for little-endian in 32-bit assembly.
|
|
|
5de29b |
#
|
|
|
5de29b |
# * sysdeps/powerpc/sysdep.h (LOWORD, HIWORD, HISHORT): Define.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Load little-endian
|
|
|
5de29b |
# words of double from correct stack offsets.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc32/fpu/s_copysignl.S: Likewise.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc32/fpu/s_lrint.S: Likewise.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc32/fpu/s_lround.S: Likewise.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S: Likewise.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S: Likewise.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S: Likewise.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S: Likewise.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S: Likewise.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S: Likewise.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S: Likewise.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S: Likewise.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S: Likewise.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S: Likewise.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S: Likewise.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S: Likewise.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S: Use HISHORT.
|
|
|
5de29b |
# * sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S: Likewise.
|
|
|
5de29b |
#
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysign.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysign.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysign.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysign.S 2014-05-27 22:45:46.000000000 -0500
|
|
|
5de29b |
@@ -29,7 +29,7 @@
|
|
|
5de29b |
stwu r1,-16(r1)
|
|
|
5de29b |
cfi_adjust_cfa_offset (16)
|
|
|
5de29b |
stfd fp2,8(r1)
|
|
|
5de29b |
- lwz r3,8(r1)
|
|
|
5de29b |
+ lwz r3,8+HIWORD(r1)
|
|
|
5de29b |
cmpwi r3,0
|
|
|
5de29b |
addi r1,r1,16
|
|
|
5de29b |
cfi_adjust_cfa_offset (-16)
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S 2014-05-27 22:45:46.000000000 -0500
|
|
|
5de29b |
@@ -30,7 +30,7 @@
|
|
|
5de29b |
fmr fp0,fp1
|
|
|
5de29b |
fabs fp1,fp1
|
|
|
5de29b |
fcmpu cr7,fp0,fp1
|
|
|
5de29b |
- lwz r3,8(r1)
|
|
|
5de29b |
+ lwz r3,8+HIWORD(r1)
|
|
|
5de29b |
cmpwi cr6,r3,0
|
|
|
5de29b |
addi r1,r1,16
|
|
|
5de29b |
cfi_adjust_cfa_offset (-16)
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lrint.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lrint.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lrint.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lrint.S 2014-05-27 22:45:46.000000000 -0500
|
|
|
5de29b |
@@ -24,10 +24,10 @@
|
|
|
5de29b |
stwu r1,-16(r1)
|
|
|
5de29b |
fctiw fp13,fp1
|
|
|
5de29b |
stfd fp13,8(r1)
|
|
|
5de29b |
- nop /* Insure the following load is in a different dispatch group */
|
|
|
5de29b |
+ nop /* Ensure the following load is in a different dispatch group */
|
|
|
5de29b |
nop /* to avoid pipe stall on POWER4&5. */
|
|
|
5de29b |
nop
|
|
|
5de29b |
- lwz r3,12(r1)
|
|
|
5de29b |
+ lwz r3,8+LOWORD(r1)
|
|
|
5de29b |
addi r1,r1,16
|
|
|
5de29b |
blr
|
|
|
5de29b |
END (__lrint)
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lround.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lround.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lround.S 2014-05-27 22:45:46.000000000 -0500
|
|
|
5de29b |
@@ -67,7 +67,7 @@
|
|
|
5de29b |
nop /* Ensure the following load is in a different dispatch */
|
|
|
5de29b |
nop /* group to avoid pipe stall on POWER4&5. */
|
|
|
5de29b |
nop
|
|
|
5de29b |
- lwz r3,12(r1) /* Load return as integer. */
|
|
|
5de29b |
+ lwz r3,8+LOWORD(r1) /* Load return as integer. */
|
|
|
5de29b |
.Lout:
|
|
|
5de29b |
addi r1,r1,16
|
|
|
5de29b |
blr
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S 2014-05-27 22:48:09.000000000 -0500
|
|
|
5de29b |
@@ -29,8 +29,8 @@
|
|
|
5de29b |
nop /* Insure the following load is in a different dispatch group */
|
|
|
5de29b |
nop /* to avoid pipe stall on POWER4&5. */
|
|
|
5de29b |
nop
|
|
|
5de29b |
- lwz r3,8(r1)
|
|
|
5de29b |
- lwz r4,12(r1)
|
|
|
5de29b |
+ lwz r3,8+HIWORD(r1)
|
|
|
5de29b |
+ lwz r4,8+LOWORD(r1)
|
|
|
5de29b |
addi r1,r1,16
|
|
|
5de29b |
blr
|
|
|
5de29b |
END (__llrint)
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S 2014-05-27 22:48:44.000000000 -0500
|
|
|
5de29b |
@@ -28,8 +28,8 @@
|
|
|
5de29b |
nop /* Insure the following load is in a different dispatch group */
|
|
|
5de29b |
nop /* to avoid pipe stall on POWER4&5. */
|
|
|
5de29b |
nop
|
|
|
5de29b |
- lwz r3,8(r1)
|
|
|
5de29b |
- lwz r4,12(r1)
|
|
|
5de29b |
+ lwz r3,8+HIWORD(r1)
|
|
|
5de29b |
+ lwz r4,8+LOWORD(r1)
|
|
|
5de29b |
addi r1,r1,16
|
|
|
5de29b |
blr
|
|
|
5de29b |
END (__llrintf)
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S 2014-05-27 22:45:46.000000000 -0500
|
|
|
5de29b |
@@ -27,8 +27,8 @@
|
|
|
5de29b |
ori r1,r1,0
|
|
|
5de29b |
stfd fp1,24(r1) /* copy FPR to GPR */
|
|
|
5de29b |
ori r1,r1,0
|
|
|
5de29b |
- lwz r4,24(r1)
|
|
|
5de29b |
- lwz r5,28(r1)
|
|
|
5de29b |
+ lwz r4,24+HIWORD(r1)
|
|
|
5de29b |
+ lwz r5,24+LOWORD(r1)
|
|
|
5de29b |
lis r0,0x7ff0 /* const long r0 0x7ff00000 00000000 */
|
|
|
5de29b |
clrlwi r4,r4,1 /* x = fabs(x) */
|
|
|
5de29b |
cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S 2014-05-27 22:45:46.000000000 -0500
|
|
|
5de29b |
@@ -39,8 +39,8 @@
|
|
|
5de29b |
nop /* Ensure the following load is in a different dispatch */
|
|
|
5de29b |
nop /* group to avoid pipe stall on POWER4&5. */
|
|
|
5de29b |
nop
|
|
|
5de29b |
- lwz r4,12(r1)
|
|
|
5de29b |
- lwz r3,8(r1)
|
|
|
5de29b |
+ lwz r3,8+HIWORD(r1)
|
|
|
5de29b |
+ lwz r4,8+LOWORD(r1)
|
|
|
5de29b |
addi r1,r1,16
|
|
|
5de29b |
blr
|
|
|
5de29b |
END (__llround)
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S 2014-05-27 22:45:46.000000000 -0500
|
|
|
5de29b |
@@ -38,7 +38,7 @@
|
|
|
5de29b |
nop /* Ensure the following load is in a different dispatch */
|
|
|
5de29b |
nop /* group to avoid pipe stall on POWER4&5. */
|
|
|
5de29b |
nop
|
|
|
5de29b |
- lwz r3,12(r1)
|
|
|
5de29b |
+ lwz r3,8+LOWORD(r1)
|
|
|
5de29b |
addi r1,r1,16
|
|
|
5de29b |
blr
|
|
|
5de29b |
END (__lround)
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S 2014-05-27 22:45:46.000000000 -0500
|
|
|
5de29b |
@@ -27,8 +27,8 @@
|
|
|
5de29b |
ori r1,r1,0
|
|
|
5de29b |
stfd fp1,24(r1) /* copy FPR to GPR */
|
|
|
5de29b |
ori r1,r1,0
|
|
|
5de29b |
- lwz r4,24(r1)
|
|
|
5de29b |
- lwz r5,28(r1)
|
|
|
5de29b |
+ lwz r4,24+HIWORD(r1)
|
|
|
5de29b |
+ lwz r5,24+LOWORD(r1)
|
|
|
5de29b |
lis r0,0x7ff0 /* const long r0 0x7ff00000 00000000 */
|
|
|
5de29b |
clrlwi r4,r4,1 /* x = fabs(x) */
|
|
|
5de29b |
cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S 2014-05-27 22:46:52.000000000 -0500
|
|
|
5de29b |
@@ -29,8 +29,8 @@
|
|
|
5de29b |
/* Insure the following load is in a different dispatch group by
|
|
|
5de29b |
inserting "group ending nop". */
|
|
|
5de29b |
ori r1,r1,0
|
|
|
5de29b |
- lwz r3,8(r1)
|
|
|
5de29b |
- lwz r4,12(r1)
|
|
|
5de29b |
+ lwz r3,8+HIWORD(r1)
|
|
|
5de29b |
+ lwz r4,8+LOWORD(r1)
|
|
|
5de29b |
addi r1,r1,16
|
|
|
5de29b |
blr
|
|
|
5de29b |
END (__llrint)
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S 2014-05-27 22:47:29.000000000 -0500
|
|
|
5de29b |
@@ -28,8 +28,8 @@
|
|
|
5de29b |
/* Insure the following load is in a different dispatch group by
|
|
|
5de29b |
inserting "group ending nop". */
|
|
|
5de29b |
ori r1,r1,0
|
|
|
5de29b |
- lwz r3,8(r1)
|
|
|
5de29b |
- lwz r4,12(r1)
|
|
|
5de29b |
+ lwz r3,8+HIWORD(r1)
|
|
|
5de29b |
+ lwz r4,8+LOWORD(r1)
|
|
|
5de29b |
addi r1,r1,16
|
|
|
5de29b |
blr
|
|
|
5de29b |
END (__llrintf)
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S 2014-05-27 22:45:46.000000000 -0500
|
|
|
5de29b |
@@ -39,8 +39,8 @@
|
|
|
5de29b |
/* Insure the following load is in a different dispatch group by
|
|
|
5de29b |
inserting "group ending nop". */
|
|
|
5de29b |
ori r1,r1,0
|
|
|
5de29b |
- lwz r4,12(r1)
|
|
|
5de29b |
- lwz r3,8(r1)
|
|
|
5de29b |
+ lwz r3,8+HIWORD(r1)
|
|
|
5de29b |
+ lwz r4,8+LOWORD(r1)
|
|
|
5de29b |
addi r1,r1,16
|
|
|
5de29b |
blr
|
|
|
5de29b |
END (__llround)
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S 2014-05-27 22:45:46.000000000 -0500
|
|
|
5de29b |
@@ -54,9 +54,8 @@
|
|
|
5de29b |
stfd fp1,8(r1) /* Transfer FP to GPR's. */
|
|
|
5de29b |
|
|
|
5de29b |
ori 2,2,0 /* Force a new dispatch group. */
|
|
|
5de29b |
- lhz r0,8(r1) /* Fetch the upper portion of the high word of
|
|
|
5de29b |
- the FP value (where the exponent and sign bits
|
|
|
5de29b |
- are). */
|
|
|
5de29b |
+ lhz r0,8+HISHORT(r1) /* Fetch the upper 16 bits of the FP value
|
|
|
5de29b |
+ (biased exponent and sign bit). */
|
|
|
5de29b |
clrlwi r0,r0,17 /* r0 = abs(r0). */
|
|
|
5de29b |
addi r1,r1,16 /* Reset the stack pointer. */
|
|
|
5de29b |
cmpwi cr7,r0,0x7ff0 /* r4 == 0x7ff0?. */
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S 2014-05-27 22:45:46.000000000 -0500
|
|
|
5de29b |
@@ -48,14 +48,13 @@
|
|
|
5de29b |
li r3,0
|
|
|
5de29b |
bflr 29 /* If not INF, return. */
|
|
|
5de29b |
|
|
|
5de29b |
- /* Either we have -INF/+INF or a denormal. */
|
|
|
5de29b |
+ /* Either we have +INF or -INF. */
|
|
|
5de29b |
|
|
|
5de29b |
stwu r1,-16(r1) /* Allocate stack space. */
|
|
|
5de29b |
stfd fp1,8(r1) /* Transfer FP to GPR's. */
|
|
|
5de29b |
ori 2,2,0 /* Force a new dispatch group. */
|
|
|
5de29b |
- lhz r4,8(r1) /* Fetch the upper portion of the high word of
|
|
|
5de29b |
- the FP value (where the exponent and sign bits
|
|
|
5de29b |
- are). */
|
|
|
5de29b |
+ lhz r4,8+HISHORT(r1) /* Fetch the upper 16 bits of the FP value
|
|
|
5de29b |
+ (biased exponent and sign bit). */
|
|
|
5de29b |
addi r1,r1,16 /* Reset the stack pointer. */
|
|
|
5de29b |
cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */
|
|
|
5de29b |
li r3,1
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S 2014-05-27 22:45:46.000000000 -0500
|
|
|
5de29b |
@@ -53,8 +53,8 @@
|
|
|
5de29b |
stwu r1,-16(r1) /* Allocate stack space. */
|
|
|
5de29b |
stfd fp1,8(r1) /* Transfer FP to GPR's. */
|
|
|
5de29b |
ori 2,2,0 /* Force a new dispatch group. */
|
|
|
5de29b |
- lwz r4,8(r1) /* Load the upper half of the FP value. */
|
|
|
5de29b |
- lwz r5,12(r1) /* Load the lower half of the FP value. */
|
|
|
5de29b |
+ lwz r4,8+HIWORD(r1) /* Load the upper half of the FP value. */
|
|
|
5de29b |
+ lwz r5,8+LOWORD(r1) /* Load the lower half of the FP value. */
|
|
|
5de29b |
addi r1,r1,16 /* Reset the stack pointer. */
|
|
|
5de29b |
lis r0,0x7ff0 /* Load the upper portion for an INF/NaN. */
|
|
|
5de29b |
clrlwi r4,r4,1 /* r4 = abs(r4). */
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S 2014-05-27 22:45:46.000000000 -0500
|
|
|
5de29b |
@@ -39,10 +39,8 @@
|
|
|
5de29b |
|
|
|
5de29b |
stfd fp1,-16(r1) /* Transfer FP to GPR's. */
|
|
|
5de29b |
ori 2,2,0 /* Force a new dispatch group. */
|
|
|
5de29b |
-
|
|
|
5de29b |
- lhz r4,-16(r1) /* Fetch the upper portion of the high word of
|
|
|
5de29b |
- the FP value (where the exponent and sign bits
|
|
|
5de29b |
- are). */
|
|
|
5de29b |
+ lhz r4,-16+HISHORT(r1) /* Fetch the upper 16 bits of the FP value
|
|
|
5de29b |
+ (biased exponent and sign bit). */
|
|
|
5de29b |
clrlwi r4,r4,17 /* r4 = abs(r4). */
|
|
|
5de29b |
cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */
|
|
|
5de29b |
bltlr cr7 /* LT means finite, other non-finite. */
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S 2014-05-27 22:45:46.000000000 -0500
|
|
|
5de29b |
@@ -38,9 +38,8 @@
|
|
|
5de29b |
|
|
|
5de29b |
stfd fp1,-16(r1) /* Transfer FP to GPR's. */
|
|
|
5de29b |
ori 2,2,0 /* Force a new dispatch group. */
|
|
|
5de29b |
- lhz r4,-16(r1) /* Fetch the upper portion of the high word of
|
|
|
5de29b |
- the FP value (where the exponent and sign bits
|
|
|
5de29b |
- are). */
|
|
|
5de29b |
+ lhz r4,-16+HISHORT(r1) /* Fetch the upper 16 bits of the FP value
|
|
|
5de29b |
+ (biased exponent and sign bit). */
|
|
|
5de29b |
cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */
|
|
|
5de29b |
li r3,1
|
|
|
5de29b |
beqlr cr7 /* EQ means INF, otherwise -INF. */
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h 2014-05-27 22:45:44.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h 2014-05-27 22:45:46.000000000 -0500
|
|
|
5de29b |
@@ -144,6 +144,21 @@
|
|
|
5de29b |
|
|
|
5de29b |
#define VRSAVE 256
|
|
|
5de29b |
|
|
|
5de29b |
+/* The 32-bit words of a 64-bit dword are at these offsets in memory. */
|
|
|
5de29b |
+#if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN
|
|
|
5de29b |
+# define LOWORD 0
|
|
|
5de29b |
+# define HIWORD 4
|
|
|
5de29b |
+#else
|
|
|
5de29b |
+# define LOWORD 4
|
|
|
5de29b |
+# define HIWORD 0
|
|
|
5de29b |
+#endif
|
|
|
5de29b |
+
|
|
|
5de29b |
+/* The high 16-bit word of a 64-bit dword is at this offset in memory. */
|
|
|
5de29b |
+#if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN
|
|
|
5de29b |
+# define HISHORT 6
|
|
|
5de29b |
+#else
|
|
|
5de29b |
+# define HISHORT 0
|
|
|
5de29b |
+#endif
|
|
|
5de29b |
|
|
|
5de29b |
/* This seems to always be the case on PPC. */
|
|
|
5de29b |
#define ALIGNARG(log2) log2
|