mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 21:10:07 +00:00
PowerPC: multiarch memset/bzero for PowerPC32
This commit is contained in:
parent
ab3e3a46d5
commit
20ed471427
20
ChangeLog
20
ChangeLog
@ -1,3 +1,23 @@
|
|||||||
|
2013-12-06 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
|
||||||
|
|
||||||
|
* sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power6.S: New file.
|
||||||
|
* sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power7.S: New file.
|
||||||
|
* sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S: New file.
|
||||||
|
* sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c: New file:
|
||||||
|
multiarch bzero for PPC32.
|
||||||
|
* sysdeps/powerpc/powerpc32/power4/multiarch/memset-power6.S: New
|
||||||
|
file.
|
||||||
|
* sysdeps/powerpc/powerpc32/power4/multiarch/memset-power7.S: New
|
||||||
|
file.
|
||||||
|
* sysdeps/powerpc/powerpc32/power4/multiarch/memset-ppc32.S: New file.
|
||||||
|
* sysdeps/powerpc/powerpc/powerpc32/power4/multiarch/memset.c: New
|
||||||
|
file: multiarch memset for PPC32.
|
||||||
|
* sysdeps/powerpc/powerpc32/power4/multiarch/rtld-memset.S: New file.
|
||||||
|
* sysdeps/powerpc/powerpc32/power4/multiarch/Makefile: Add bzero and
|
||||||
|
memset multiarch objects.
|
||||||
|
* sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c
|
||||||
|
(__libc_ifunc_impl_list): Likewise.
|
||||||
|
|
||||||
2013-12-06 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
|
2013-12-06 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
|
||||||
|
|
||||||
* sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S: New
|
* sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S: New
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
ifeq ($(subdir),string)
|
ifeq ($(subdir),string)
|
||||||
sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
|
sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
|
||||||
memcpy-ppc32 memcmp-power7 memcmp-ppc32
|
memcpy-ppc32 memcmp-power7 memcmp-ppc32 memset-power7 \
|
||||||
|
memset-power6 memset-ppc32 bzero-power7 bzero-power6 \
|
||||||
|
bzero-ppc32
|
||||||
endif
|
endif
|
||||||
|
26
sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power6.S
Normal file
26
sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power6.S
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/* Optimized bzero implementation for PowerPC32/POWER6.
|
||||||
|
Copyright (C) 2010-2013 Free Software Foundation, Inc.
|
||||||
|
Contributed by Luis Machado <luisgpm@br.ibm.com>.
|
||||||
|
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>
|
||||||
|
|
||||||
|
ENTRY (__bzero_power6)
|
||||||
|
mr r5,r4
|
||||||
|
li r4,0
|
||||||
|
b __memset_power6@local
|
||||||
|
END (__bzero_power6)
|
26
sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power7.S
Normal file
26
sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power7.S
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/* Optimized bzero implementation for PowerPC32/POWER7.
|
||||||
|
Copyright (C) 2010-2013 Free Software Foundation, Inc.
|
||||||
|
Contributed by Luis Machado <luisgpm@br.ibm.com>.
|
||||||
|
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>
|
||||||
|
|
||||||
|
ENTRY (__bzero_power7)
|
||||||
|
mr r5,r4
|
||||||
|
li r4,0
|
||||||
|
b __memset_power7@local
|
||||||
|
END (__bzero_power7)
|
26
sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S
Normal file
26
sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/* Optimized bzero implementation for PowerPC32/PPC32.
|
||||||
|
Copyright (C) 2010-2013 Free Software Foundation, Inc.
|
||||||
|
Contributed by Luis Machado <luisgpm@br.ibm.com>.
|
||||||
|
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>
|
||||||
|
|
||||||
|
ENTRY (__bzero_ppc)
|
||||||
|
mr r5,r4
|
||||||
|
li r4,0
|
||||||
|
b __memset_ppc@local
|
||||||
|
END (__bzero_ppc)
|
37
sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c
Normal file
37
sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/* Multiple versions of bzero.
|
||||||
|
Copyright (C) 2013 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/>. */
|
||||||
|
|
||||||
|
/* Define multiple versions only for definition in libc. */
|
||||||
|
#if defined SHARED && !defined NOT_IN_libc
|
||||||
|
# include <string.h>
|
||||||
|
# include <strings.h>
|
||||||
|
# include "init-arch.h"
|
||||||
|
|
||||||
|
extern __typeof (bzero) __bzero_ppc attribute_hidden;
|
||||||
|
extern __typeof (bzero) __bzero_power6 attribute_hidden;
|
||||||
|
extern __typeof (bzero) __bzero_power7 attribute_hidden;
|
||||||
|
|
||||||
|
libc_ifunc (__bzero,
|
||||||
|
(hwcap & PPC_FEATURE_HAS_VSX)
|
||||||
|
? __bzero_power7 :
|
||||||
|
(hwcap & PPC_FEATURE_ARCH_2_05)
|
||||||
|
? __bzero_power6
|
||||||
|
: __bzero_ppc);
|
||||||
|
|
||||||
|
weak_alias (__bzero, bzero)
|
||||||
|
#endif
|
@ -58,6 +58,23 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
|
|||||||
IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_CELL_BE,
|
IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_CELL_BE,
|
||||||
__memcpy_cell)
|
__memcpy_cell)
|
||||||
IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_ppc))
|
IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_ppc))
|
||||||
|
|
||||||
|
/* Support sysdeps/powerpc/powerpc32/power4/multiarch/memset.c. */
|
||||||
|
IFUNC_IMPL (i, name, memset,
|
||||||
|
IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_HAS_VSX,
|
||||||
|
__memset_power7)
|
||||||
|
IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_ARCH_2_05,
|
||||||
|
__memset_power6)
|
||||||
|
IFUNC_IMPL_ADD (array, i, memset, 1, __memset_ppc))
|
||||||
|
|
||||||
|
/* Support sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c. */
|
||||||
|
IFUNC_IMPL (i, name, bzero,
|
||||||
|
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,
|
||||||
|
__bzero_power6)
|
||||||
|
IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ppc))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Support sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c. */
|
/* Support sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c. */
|
||||||
|
38
sysdeps/powerpc/powerpc32/power4/multiarch/memset-power6.S
Normal file
38
sysdeps/powerpc/powerpc32/power4/multiarch/memset-power6.S
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/* Optimized 32-bit memset implementation for POWER6.
|
||||||
|
Copyright (C) 2013 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 EALIGN
|
||||||
|
#define EALIGN(name, alignt, words) \
|
||||||
|
.globl C_SYMBOL_NAME(__memset_power6); \
|
||||||
|
.type C_SYMBOL_NAME(__memset_power6),@function; \
|
||||||
|
.align ALIGNARG(alignt); \
|
||||||
|
EALIGN_W_##words; \
|
||||||
|
C_LABEL(__memset_power6) \
|
||||||
|
cfi_startproc;
|
||||||
|
|
||||||
|
#undef END
|
||||||
|
#define END(name) \
|
||||||
|
cfi_endproc; \
|
||||||
|
ASM_SIZE_DIRECTIVE(__memset_power6)
|
||||||
|
|
||||||
|
#undef libc_hidden_builtin_def
|
||||||
|
#define libc_hidden_builtin_def(name)
|
||||||
|
|
||||||
|
#include <sysdeps/powerpc/powerpc32/power6/memset.S>
|
38
sysdeps/powerpc/powerpc32/power4/multiarch/memset-power7.S
Normal file
38
sysdeps/powerpc/powerpc32/power4/multiarch/memset-power7.S
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/* Optimized memset implementation for PowerPC32/POWER7.
|
||||||
|
Copyright (C) 2013 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 EALIGN
|
||||||
|
#define EALIGN(name, alignt, words) \
|
||||||
|
.globl C_SYMBOL_NAME(__memset_power7); \
|
||||||
|
.type C_SYMBOL_NAME(__memset_power7),@function; \
|
||||||
|
.align ALIGNARG(alignt); \
|
||||||
|
EALIGN_W_##words; \
|
||||||
|
C_LABEL(__memset_power7) \
|
||||||
|
cfi_startproc;
|
||||||
|
|
||||||
|
#undef END
|
||||||
|
#define END(name) \
|
||||||
|
cfi_endproc; \
|
||||||
|
ASM_SIZE_DIRECTIVE(__memset_power7)
|
||||||
|
|
||||||
|
#undef libc_hidden_builtin_def
|
||||||
|
#define libc_hidden_builtin_def(name)
|
||||||
|
|
||||||
|
#include <sysdeps/powerpc/powerpc32/power7/memset.S>
|
41
sysdeps/powerpc/powerpc32/power4/multiarch/memset-ppc32.S
Normal file
41
sysdeps/powerpc/powerpc32/power4/multiarch/memset-ppc32.S
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/* Default memset implementation for PowerPC32.
|
||||||
|
Copyright (C) 1997-2013 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>
|
||||||
|
|
||||||
|
#if defined SHARED && !defined NOT_IN_libc
|
||||||
|
# undef EALIGN
|
||||||
|
# define EALIGN(name, alignt, words) \
|
||||||
|
.globl C_SYMBOL_NAME(__memset_ppc); \
|
||||||
|
.type C_SYMBOL_NAME(__memset_ppc),@function; \
|
||||||
|
.align ALIGNARG(alignt); \
|
||||||
|
EALIGN_W_##words; \
|
||||||
|
C_LABEL(__memset_ppc) \
|
||||||
|
cfi_startproc;
|
||||||
|
|
||||||
|
# undef END
|
||||||
|
# define END(name) \
|
||||||
|
cfi_endproc; \
|
||||||
|
ASM_SIZE_DIRECTIVE(__memset_ppc)
|
||||||
|
|
||||||
|
# undef libc_hidden_builtin_def
|
||||||
|
# define libc_hidden_builtin_def(name) \
|
||||||
|
.globl __GI_memset; __GI_memset = __memset_ppc
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <sysdeps/powerpc/powerpc32/power4/memset.S>
|
37
sysdeps/powerpc/powerpc32/power4/multiarch/memset.c
Normal file
37
sysdeps/powerpc/powerpc32/power4/multiarch/memset.c
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/* Multiple versions of memset.
|
||||||
|
Copyright (C) 2013 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/>. */
|
||||||
|
|
||||||
|
/* Define multiple versions only for definition in libc. */
|
||||||
|
#if defined SHARED && !defined NOT_IN_libc
|
||||||
|
# include <string.h>
|
||||||
|
# include <shlib-compat.h>
|
||||||
|
# include "init-arch.h"
|
||||||
|
|
||||||
|
extern __typeof (memset) __memset_ppc attribute_hidden;
|
||||||
|
extern __typeof (memset) __memset_power6 attribute_hidden;
|
||||||
|
extern __typeof (memset) __memset_power7 attribute_hidden;
|
||||||
|
|
||||||
|
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
|
||||||
|
ifunc symbol properly. */
|
||||||
|
libc_ifunc (memset,
|
||||||
|
(hwcap & PPC_FEATURE_HAS_VSX)
|
||||||
|
? __memset_power7 :
|
||||||
|
(hwcap & PPC_FEATURE_ARCH_2_05)
|
||||||
|
? __memset_power6
|
||||||
|
: __memset_ppc);
|
||||||
|
#endif
|
18
sysdeps/powerpc/powerpc32/power4/multiarch/rtld-memset.S
Normal file
18
sysdeps/powerpc/powerpc32/power4/multiarch/rtld-memset.S
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/* Copyright (C) 2013 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 <sysdeps/powerpc/powerpc32/power4/memset.S>
|
Loading…
Reference in New Issue
Block a user