This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/3] powerpc: Add a POWER8-optimized version of sincosf()


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]