[PATCH] powerpc: Add a POWER8-optimized version of cosf()

Tulio Magno Quites Machado Filho tuliom@linux.vnet.ibm.com
Wed May 10 18:45:00 GMT 2017


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



More information about the Libc-alpha mailing list