powerpc: Remove powerpc64 bzero optimizations

The symbol is not present in current POSIX specification and compiler
already generates memset call.
This commit is contained in:
Adhemerval Zanella 2022-02-10 14:18:28 -03:00
parent 68122d8a04
commit 4e81019f30
15 changed files with 1 additions and 197 deletions

View file

@ -1,20 +0,0 @@
/* Optimized bzero `implementation' for PowerPC64.
Copyright (C) 1997-2022 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
<https://www.gnu.org/licenses/>. */
/* This code was moved into memset.S to solve a double stub call problem.
@local would have worked but it is not supported in PowerPC64 asm. */

View file

@ -242,15 +242,3 @@ L(bcdz_tail):
END_GEN_TB (MEMSET,TB_TOCLESS)
libc_hidden_builtin_def (memset)
/* Copied from bzero.S to prevent the linker from inserting a stub
between bzero and memset. */
ENTRY_TOCLESS (__bzero)
CALL_MCOUNT 2
mr r5,r4
li r4,0
b L(_memset)
END (__bzero)
#ifndef __bzero
weak_alias (__bzero, bzero)
#endif

View file

@ -253,16 +253,3 @@ L(medium_28t):
blr
END_GEN_TB (MEMSET,TB_TOCLESS)
libc_hidden_builtin_def (memset)
#ifndef NO_BZERO_IMPL
/* Copied from bzero.S to prevent the linker from inserting a stub
between bzero and memset. */
ENTRY (__bzero)
CALL_MCOUNT 3
mr r5,r4
li r4,0
b L(_memset)
END_GEN_TB (__bzero,TB_TOCLESS)
weak_alias (__bzero, bzero)
#endif

View file

@ -1,54 +0,0 @@
/* Multiple versions of bzero. PowerPC64 version.
Copyright (C) 2013-2022 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
<https://www.gnu.org/licenses/>. */
/* Define multiple versions only for definition in libc. */
#if IS_IN (libc)
# include <string.h>
# include <strings.h>
# include "init-arch.h"
extern __typeof (bzero) __bzero_ppc attribute_hidden;
extern __typeof (bzero) __bzero_power4 attribute_hidden;
extern __typeof (bzero) __bzero_power6 attribute_hidden;
extern __typeof (bzero) __bzero_power7 attribute_hidden;
extern __typeof (bzero) __bzero_power8 attribute_hidden;
# ifdef __LITTLE_ENDIAN__
extern __typeof (bzero) __bzero_power10 attribute_hidden;
# endif
libc_ifunc (__bzero,
# ifdef __LITTLE_ENDIAN__
(hwcap2 & PPC_FEATURE2_ARCH_3_1
&& hwcap2 & PPC_FEATURE2_HAS_ISEL
&& hwcap & PPC_FEATURE_HAS_VSX)
? __bzero_power10 :
# endif
(hwcap2 & PPC_FEATURE2_ARCH_2_07
&& hwcap & PPC_FEATURE_HAS_ALTIVEC)
? __bzero_power8 :
(hwcap & PPC_FEATURE_HAS_VSX)
? __bzero_power7 :
(hwcap & PPC_FEATURE_ARCH_2_05
&& hwcap & PPC_FEATURE_HAS_ALTIVEC)
? __bzero_power6 :
(hwcap & PPC_FEATURE_POWER4)
? __bzero_power4
: __bzero_ppc);
weak_alias (__bzero, bzero)
#endif

View file

@ -223,27 +223,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__memcmp_power4)
IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_ppc))
/* Support sysdeps/powerpc/powerpc64/multiarch/bzero.c. */
IFUNC_IMPL (i, name, bzero,
#ifdef __LITTLE_ENDIAN__
IFUNC_IMPL_ADD (array, i, bzero,
hwcap2 & PPC_FEATURE2_ARCH_3_1
&& hwcap2 & PPC_FEATURE2_HAS_ISEL
&& hwcap & PPC_FEATURE_HAS_VSX,
__bzero_power10)
#endif
IFUNC_IMPL_ADD (array, i, bzero, hwcap2 & PPC_FEATURE2_ARCH_2_07
&& hwcap & PPC_FEATURE_HAS_ALTIVEC,
__bzero_power8)
IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_HAS_VSX,
__bzero_power7)
IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_ARCH_2_05
&& hwcap & PPC_FEATURE_HAS_ALTIVEC,
__bzero_power6)
IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_POWER4,
__bzero_power4)
IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ppc))
/* Support sysdeps/powerpc/powerpc64/multiarch/mempcpy.c. */
IFUNC_IMPL (i, name, mempcpy,
IFUNC_IMPL_ADD (array, i, mempcpy,

View file

@ -21,7 +21,4 @@
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
#undef __bzero
#define __bzero __bzero_power10
#include <sysdeps/powerpc/powerpc64/le/power10/memset.S>

View file

@ -21,7 +21,4 @@
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
#undef __bzero
#define __bzero __bzero_power4
#include <sysdeps/powerpc/powerpc64/power4/memset.S>

View file

@ -21,7 +21,4 @@
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
#undef __bzero
#define __bzero __bzero_power6
#include <sysdeps/powerpc/powerpc64/power6/memset.S>

View file

@ -21,6 +21,4 @@
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
#undef __bzero
#define __bzero __bzero_power7
#include <sysdeps/powerpc/powerpc64/power7/memset.S>

View file

@ -21,7 +21,4 @@
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
#undef __bzero
#define __bzero __bzero_power8
#include <sysdeps/powerpc/powerpc64/power8/memset.S>

View file

@ -1,4 +1,4 @@
/* Default memset/bzero implementation for PowerPC64.
/* Default memset implementation for PowerPC64.
Copyright (C) 2013-2022 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@ -18,17 +18,6 @@
#include <sysdep.h>
/* Copied from bzero.S to prevent the linker from inserting a stub
between bzero and memset. NOTE: this code should be positioned
before ENTRY/END_GEN_TB redefinition. */
ENTRY (__bzero_ppc)
CALL_MCOUNT 3
mr r5,r4
li r4,0
b L(_memset)
END_GEN_TB (__bzero_ppc,TB_TOCLESS)
#if defined SHARED && IS_IN (libc)
# define MEMSET __memset_ppc
@ -36,7 +25,4 @@ END_GEN_TB (__bzero_ppc,TB_TOCLESS)
# define libc_hidden_builtin_def(name)
#endif
/* Do not implement __bzero at powerpc64/memset.S. */
#define NO_BZERO_IMPL
#include <sysdeps/powerpc/powerpc64/memset.S>

View file

@ -237,15 +237,3 @@ L(medium_28t):
blr
END_GEN_TB (MEMSET,TB_TOCLESS)
libc_hidden_builtin_def (memset)
/* Copied from bzero.S to prevent the linker from inserting a stub
between bzero and memset. */
ENTRY_TOCLESS (__bzero)
CALL_MCOUNT 3
mr r5,r4
li r4,0
b L(_memset)
END (__bzero)
#ifndef __bzero
weak_alias (__bzero, bzero)
#endif

View file

@ -381,15 +381,3 @@ L(medium_28t):
blr
END_GEN_TB (MEMSET,TB_TOCLESS)
libc_hidden_builtin_def (memset)
/* Copied from bzero.S to prevent the linker from inserting a stub
between bzero and memset. */
ENTRY_TOCLESS (__bzero)
CALL_MCOUNT 3
mr r5,r4
li r4,0
b L(_memset)
END (__bzero)
#ifndef __bzero
weak_alias (__bzero, bzero)
#endif

View file

@ -384,15 +384,3 @@ L(small):
END_GEN_TB (MEMSET,TB_TOCLESS)
libc_hidden_builtin_def (memset)
/* Copied from bzero.S to prevent the linker from inserting a stub
between bzero and memset. */
ENTRY_TOCLESS (__bzero)
CALL_MCOUNT 3
mr r5,r4
li r4,0
b L(_memset)
END (__bzero)
#ifndef __bzero
weak_alias (__bzero, bzero)
#endif

View file

@ -504,15 +504,3 @@ L(LE7_tail5):
END_GEN_TB (MEMSET,TB_TOCLESS)
libc_hidden_builtin_def (memset)
/* Copied from bzero.S to prevent the linker from inserting a stub
between bzero and memset. */
ENTRY_TOCLESS (__bzero)
CALL_MCOUNT 3
mr r5,r4
li r4,0
b L(_memset)
END (__bzero)
#ifndef __bzero
weak_alias (__bzero, bzero)
#endif