This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/3] powerpc: Add a POWER8-optimized version of sincosf()
- From: "Tulio Magno Quites Machado Filho" <tuliom at linux dot vnet dot ibm dot com>
- To: Rajalakshmi Srinivasaraghavan <raji at linux dot vnet dot ibm dot com>, libc-alpha at sourceware dot org
- Cc: Paul Clarke <pc at us dot ibm dot com>
- Date: Fri, 29 Sep 2017 13:18:57 -0300
- Subject: Re: [PATCH 1/3] powerpc: Add a POWER8-optimized version of sincosf()
- Authentication-results: sourceware.org; auth=none
- References: <1501490976-25746-1-git-send-email-raji@linux.vnet.ibm.com> <1501490976-25746-2-git-send-email-raji@linux.vnet.ibm.com>
Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com> writes:
> This implementation is based on
> sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-power8.S
> sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-power8.S.
I think there is value in proposing this file as a generic implementation.
It may help other architectures too.
If we don't reach a consensus there, we may go back to a powerpc-specific
file.
> 2017-07-31 Paul Clarke <pc@us.ibm.com>
> Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
>
> * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
> [$(subdir) = math] (libm-sysdep_routines): Add s_sincosf-power8
> and s_sincosf-ppc64.
> * sysdeps/powerpc/powerpc64/fpu/multiarch/s_sincosf-power8.c:
> New file.
> * sysdeps/powerpc/powerpc64/fpu/multiarch/s_sincosf-ppc64.c:
> Likewise.
> * sysdeps/powerpc/powerpc64/fpu/multiarch/s_sincosf.c: Likewise.
> * sysdeps/powerpc/powerpc64/power8/fpu/s_sincosf.c: Likewise.
I noticed this file helps improve the performance even when built for power4.
I suggest to leave it as the default sincosf implementation for powerpc,
regardless of CPU.
However, it's still necessary to rebuild it for POWER8 as there is still
a performance improvement over the power4 one.
> diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
> index d6f14f360a..e570f087e8 100644
> --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
> +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
> @@ -27,7 +27,8 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
> s_llrint-power8 s_llround-power8 s_llroundf-ppc64 \
> e_expf-power8 e_expf-ppc64 \
> s_sinf-ppc64 s_sinf-power8 \
> - s_cosf-ppc64 s_cosf-power8
> + s_cosf-ppc64 s_cosf-power8 \
> + s_sincosf-ppc64 s_sincosf-power8
>
> CFLAGS-s_logbf-power7.c = -mcpu=power7
> CFLAGS-s_logbl-power7.c = -mcpu=power7
When rebuilding a C file to a specific processor, please ensure -mcpu is being
used, like the examples above.
--
Tulio Magno