This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] powerpc: Add a POWER8-optimized version of cosf()
- From: "Tulio Magno Quites Machado Filho" <tuliom at linux dot vnet dot ibm dot com>
- To: pc at us dot ibm dot com, libc-alpha at sourceware dot org
- Cc:
- Date: Wed, 10 May 2017 15:45:41 -0300
- Subject: Re: [PATCH] powerpc: Add a POWER8-optimized version of cosf()
- Authentication-results: sourceware.org; auth=none
- References: <9d04a192-e8bf-d7be-ec77-a955100941da@us.ibm.com>
Paul Clarke <pc@us.ibm.com> writes:
> diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-ppc64.c
> new file mode 100644
> index 0000000..59e8a77
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-ppc64.c
> @@ -0,0 +1,26 @@
> +/* cosf function. PowerPC64 default version.
> + Copyright (C) 2017 Free Software Foundation, Inc.
> + This file is part of the GNU C Library.
> +
> + The GNU C Library is free software; you can redistribute it and/or
> + modify it under the terms of the GNU Lesser General Public
> + License as published by the Free Software Foundation; either
> + version 2.1 of the License, or (at your option) any later version.
> +
> + The GNU C Library is distributed in the hope that it will be useful,
> + but WITHOUT ANY WARRANTY; without even the implied warranty of
> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + Lesser General Public License for more details.
> +
> + You should have received a copy of the GNU Lesser General Public
> + License along with the GNU C Library; if not, see
> + <http://www.gnu.org/licenses/>. */
> +
> +#include <sysdep.h>
> +
> +#undef weak_alias
> +#define weak_alias(a, b)
> +
> +#define __cosf __cosf_ppc64
> +
> +#include <sysdeps/ieee754/flt-32/s_cosf.c>
I think this file should be including sysdeps/powerpc/fpu/s_cosf.c instead
in order to avoid performance regressions in older processors.
Looks good to me with this fix.
Thanks,
--
Tulio Magno