This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] PPC use __CPU_HAS_FSQRT in e_sqrt.c/e_sqrtf.c
- From: Steven Munroe <munroesj at us dot ibm dot com>
- To: libc-alpha at sources dot redhat dot com
- Cc: Dwayne McConnell <decimal at us dot ibm dot com>, Jakub Jelinek <jakub at redhat dot com>, Roland McGrath <roland at redhat dot com>
- Date: Tue, 11 Apr 2006 16:34:03 -0500
- Subject: [PATCH] PPC use __CPU_HAS_FSQRT in e_sqrt.c/e_sqrtf.c
This is a continuation of Jakub's patch that defined __CPU_HAS_FSQRT by
using it in powerpc/fpu/e_sqrt.c and e_sqrtf.c. In addition I refined
the conditional definition of __CPU_HAS_FSQRT based on _ARCH_PWR4 or
__WORDSIZE. This elliminates the dl_hwcap check for 64-bit and for
32-bit --with-cpu=[power4, power5, power5+, 970] cases. Finally I
cleaned up some comments that ended in "we".
Roland does this use of _ARCH_PWR4 in mathinline.h meet your "trivial"
clip level for inclusion in mainline?
2006-04-07 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/fpu/bits/mathinline.h
[__WORDSIZE == 64 || _ARCH_PWR4]: Define __CPU_HAS_FSQRT.
(__ieee754_sqrt): Fix comment.
(__ieee754_sqrtf): Fix comment.
* sysdeps/powerpc/fpu/e_sqrt.c (__ieee754_sqrt): Fix comment.
Check __CPU_HAS_FSQRT instead of dl_hwcap.
* sysdeps/powerpc/fpu/e_sqrtf.c (__ieee754_sqrtf): Fix comment.
Check __CPU_HAS_FSQRT instead of dl_hwcap.
diff -urN libc24-cvstip-20060406/sysdeps/powerpc/fpu/bits/mathinline.h libc24/sysdeps/powerpc/fpu/bits/mathinline.h
--- libc24-cvstip-20060406/sysdeps/powerpc/fpu/bits/mathinline.h 2006-01-21 13:40:59.000000000 -0600
+++ libc24/sysdeps/powerpc/fpu/bits/mathinline.h 2006-04-07 16:25:33.913017504 -0500
@@ -129,7 +129,7 @@
#include <ldsodefs.h>
#include <dl-procinfo.h>
-# if __WORDSIZE == 64
+# if (__WORDSIZE == 64) || defined _ARCH_PWR4
# define __CPU_HAS_FSQRT 1
# else
# define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0)
@@ -141,7 +141,7 @@
{
double __z;
- /* If the CPU is 64-bit we can use the optional FP instructions we. */
+ /* If the CPU is 64-bit we can use the optional FP instructions. */
if (__CPU_HAS_FSQRT)
{
/* Volatile is required to prevent the compiler from moving the
@@ -163,7 +163,7 @@
{
float __z;
- /* If the CPU is 64-bit we can use the optional FP instructions we. */
+ /* If the CPU is 64-bit we can use the optional FP instructions. */
if (__CPU_HAS_FSQRT)
{
/* Volatile is required to prevent the compiler from moving the
diff -urN libc24-cvstip-20060406/sysdeps/powerpc/fpu/e_sqrt.c libc24/sysdeps/powerpc/fpu/e_sqrt.c
--- libc24-cvstip-20060406/sysdeps/powerpc/fpu/e_sqrt.c 2005-11-17 17:33:52.000000000 -0600
+++ libc24/sysdeps/powerpc/fpu/e_sqrt.c 2006-04-07 16:25:57.727990208 -0500
@@ -169,8 +169,8 @@
{
double z;
- /* If the CPU is 64-bit we can use the optional FP instructions we. */
- if ((GLRO (dl_hwcap) & PPC_FEATURE_64) != 0)
+ /* If the CPU is 64-bit we can use the optional FP instructions. */
+ if (__CPU_HAS_FSQRT)
{
/* Volatile is required to prevent the compiler from moving the
fsqrt instruction above the branch. */
diff -urN libc24-cvstip-20060406/sysdeps/powerpc/fpu/e_sqrtf.c libc24/sysdeps/powerpc/fpu/e_sqrtf.c
--- libc24-cvstip-20060406/sysdeps/powerpc/fpu/e_sqrtf.c 2005-11-17 17:33:52.000000000 -0600
+++ libc24/sysdeps/powerpc/fpu/e_sqrtf.c 2006-04-07 16:26:22.424963608 -0500
@@ -146,8 +146,8 @@
{
double z;
- /* If the CPU is 64-bit we can use the optional FP instructions we. */
- if ((GLRO (dl_hwcap) & PPC_FEATURE_64) != 0)
+ /* If the CPU is 64-bit we can use the optional FP instructions. */
+ if (__CPU_HAS_FSQRT)
{
/* Volatile is required to prevent the compiler from moving the
fsqrt instruction above the branch. */