mirror of git://sourceware.org/git/glibc.git
powerpc: refactor memset IFUNC.
Clean up the IFUNC implementations for powerpc in order to remove unneeded macro definitions. Tested on ppc64le with and without --disable-multi-arch flag. * sysdeps/powerpc/powerpc64/multiarch/memset-power4.S: Define the implementation-specific function name and remove unneeded macros definition. * sysdeps/powerpc/powerpc64/multiarch/memset-power6.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memset-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memset-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/memset.S: Set a default function name if not defined and pass as parameter to macros accordingly. * sysdeps/powerpc/powerpc64/power4/memset.S: Likewise. * sysdeps/powerpc/powerpc64/power6/memset.S: Likewise. * sysdeps/powerpc/powerpc64/power7/memset.S: Likewise. * sysdeps/powerpc/powerpc64/power8/memset.S: Likewise.
This commit is contained in:
parent
f0748b70a8
commit
18e0054bf7
14
ChangeLog
14
ChangeLog
|
@ -1,5 +1,19 @@
|
||||||
2017-04-11 Wainer dos Santos Moschetta <wainersm@linux.vnet.ibm.com>
|
2017-04-11 Wainer dos Santos Moschetta <wainersm@linux.vnet.ibm.com>
|
||||||
|
|
||||||
|
* sysdeps/powerpc/powerpc64/multiarch/memset-power4.S: Define the
|
||||||
|
implementation-specific function name and remove unneeded macros
|
||||||
|
definition.
|
||||||
|
* sysdeps/powerpc/powerpc64/multiarch/memset-power6.S: Likewise.
|
||||||
|
* sysdeps/powerpc/powerpc64/multiarch/memset-power7.S: Likewise.
|
||||||
|
* sysdeps/powerpc/powerpc64/multiarch/memset-power8.S: Likewise.
|
||||||
|
* sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S: Likewise.
|
||||||
|
* sysdeps/powerpc/powerpc64/memset.S: Set a default function name if
|
||||||
|
not defined and pass as parameter to macros accordingly.
|
||||||
|
* sysdeps/powerpc/powerpc64/power4/memset.S: Likewise.
|
||||||
|
* sysdeps/powerpc/powerpc64/power6/memset.S: Likewise.
|
||||||
|
* sysdeps/powerpc/powerpc64/power7/memset.S: Likewise.
|
||||||
|
* sysdeps/powerpc/powerpc64/power8/memset.S: Likewise.
|
||||||
|
|
||||||
* sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S: Define the
|
* sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S: Define the
|
||||||
strcasestr implementation name and remove unneeded macros definition.
|
strcasestr implementation name and remove unneeded macros definition.
|
||||||
* sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S: Define
|
* sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S: Define
|
||||||
|
|
|
@ -31,7 +31,11 @@
|
||||||
cache line (256 bits). There is a special case for setting cache lines
|
cache line (256 bits). There is a special case for setting cache lines
|
||||||
to 0, to take advantage of the dcbz instruction. */
|
to 0, to take advantage of the dcbz instruction. */
|
||||||
|
|
||||||
EALIGN (memset, 5, 0)
|
#ifndef MEMSET
|
||||||
|
# define MEMSET memset
|
||||||
|
#endif
|
||||||
|
|
||||||
|
EALIGN (MEMSET, 5, 0)
|
||||||
CALL_MCOUNT 3
|
CALL_MCOUNT 3
|
||||||
|
|
||||||
#define rTMP r0
|
#define rTMP r0
|
||||||
|
@ -244,7 +248,7 @@ L(medium_27f):
|
||||||
L(medium_28t):
|
L(medium_28t):
|
||||||
std rCHR, -8(rMEMP)
|
std rCHR, -8(rMEMP)
|
||||||
blr
|
blr
|
||||||
END_GEN_TB (memset,TB_TOCLESS)
|
END_GEN_TB (MEMSET,TB_TOCLESS)
|
||||||
libc_hidden_builtin_def (memset)
|
libc_hidden_builtin_def (memset)
|
||||||
|
|
||||||
#ifndef NO_BZERO_IMPL
|
#ifndef NO_BZERO_IMPL
|
||||||
|
|
|
@ -18,21 +18,7 @@
|
||||||
|
|
||||||
#include <sysdep.h>
|
#include <sysdep.h>
|
||||||
|
|
||||||
#undef EALIGN
|
#define MEMSET __memset_power4
|
||||||
#define EALIGN(name, alignt, words) \
|
|
||||||
.section ".text"; \
|
|
||||||
ENTRY_2(__memset_power4) \
|
|
||||||
.align ALIGNARG(alignt); \
|
|
||||||
EALIGN_W_##words; \
|
|
||||||
BODY_LABEL(__memset_power4): \
|
|
||||||
cfi_startproc; \
|
|
||||||
LOCALENTRY(__memset_power4)
|
|
||||||
|
|
||||||
#undef END_GEN_TB
|
|
||||||
#define END_GEN_TB(name, mask) \
|
|
||||||
cfi_endproc; \
|
|
||||||
TRACEBACK_MASK(__memset_power4,mask) \
|
|
||||||
END_2(__memset_power4)
|
|
||||||
|
|
||||||
#undef libc_hidden_builtin_def
|
#undef libc_hidden_builtin_def
|
||||||
#define libc_hidden_builtin_def(name)
|
#define libc_hidden_builtin_def(name)
|
||||||
|
|
|
@ -18,21 +18,7 @@
|
||||||
|
|
||||||
#include <sysdep.h>
|
#include <sysdep.h>
|
||||||
|
|
||||||
#undef EALIGN
|
#define MEMSET __memset_power6
|
||||||
#define EALIGN(name, alignt, words) \
|
|
||||||
.section ".text"; \
|
|
||||||
ENTRY_2(__memset_power6) \
|
|
||||||
.align ALIGNARG(alignt); \
|
|
||||||
EALIGN_W_##words; \
|
|
||||||
BODY_LABEL(__memset_power6): \
|
|
||||||
cfi_startproc; \
|
|
||||||
LOCALENTRY(__memset_power6)
|
|
||||||
|
|
||||||
#undef END_GEN_TB
|
|
||||||
#define END_GEN_TB(name, mask) \
|
|
||||||
cfi_endproc; \
|
|
||||||
TRACEBACK_MASK(__memset_power6,mask) \
|
|
||||||
END_2(__memset_power6)
|
|
||||||
|
|
||||||
#undef libc_hidden_builtin_def
|
#undef libc_hidden_builtin_def
|
||||||
#define libc_hidden_builtin_def(name)
|
#define libc_hidden_builtin_def(name)
|
||||||
|
|
|
@ -18,21 +18,7 @@
|
||||||
|
|
||||||
#include <sysdep.h>
|
#include <sysdep.h>
|
||||||
|
|
||||||
#undef EALIGN
|
#define MEMSET __memset_power7
|
||||||
#define EALIGN(name, alignt, words) \
|
|
||||||
.section ".text"; \
|
|
||||||
ENTRY_2(__memset_power7) \
|
|
||||||
.align ALIGNARG(alignt); \
|
|
||||||
EALIGN_W_##words; \
|
|
||||||
BODY_LABEL(__memset_power7): \
|
|
||||||
cfi_startproc; \
|
|
||||||
LOCALENTRY(__memset_power7)
|
|
||||||
|
|
||||||
#undef END_GEN_TB
|
|
||||||
#define END_GEN_TB(name, mask) \
|
|
||||||
cfi_endproc; \
|
|
||||||
TRACEBACK_MASK(__memset_power7,mask) \
|
|
||||||
END_2(__memset_power7)
|
|
||||||
|
|
||||||
#undef libc_hidden_builtin_def
|
#undef libc_hidden_builtin_def
|
||||||
#define libc_hidden_builtin_def(name)
|
#define libc_hidden_builtin_def(name)
|
||||||
|
|
|
@ -18,21 +18,7 @@
|
||||||
|
|
||||||
#include <sysdep.h>
|
#include <sysdep.h>
|
||||||
|
|
||||||
#undef EALIGN
|
#define MEMSET __memset_power8
|
||||||
#define EALIGN(name, alignt, words) \
|
|
||||||
.section ".text"; \
|
|
||||||
ENTRY_2(__memset_power8) \
|
|
||||||
.align ALIGNARG(alignt); \
|
|
||||||
EALIGN_W_##words; \
|
|
||||||
BODY_LABEL(__memset_power8): \
|
|
||||||
cfi_startproc; \
|
|
||||||
LOCALENTRY(__memset_power8)
|
|
||||||
|
|
||||||
#undef END_GEN_TB
|
|
||||||
#define END_GEN_TB(name, mask) \
|
|
||||||
cfi_endproc; \
|
|
||||||
TRACEBACK_MASK(__memset_power8,mask) \
|
|
||||||
END_2(__memset_power8)
|
|
||||||
|
|
||||||
#undef libc_hidden_builtin_def
|
#undef libc_hidden_builtin_def
|
||||||
#define libc_hidden_builtin_def(name)
|
#define libc_hidden_builtin_def(name)
|
||||||
|
|
|
@ -30,21 +30,7 @@ END_GEN_TB (__bzero_ppc,TB_TOCLESS)
|
||||||
|
|
||||||
|
|
||||||
#if defined SHARED && IS_IN (libc)
|
#if defined SHARED && IS_IN (libc)
|
||||||
# undef EALIGN
|
# define MEMSET __memset_ppc
|
||||||
# define EALIGN(name, alignt, words) \
|
|
||||||
.section ".text"; \
|
|
||||||
ENTRY_2(__memset_ppc) \
|
|
||||||
.align ALIGNARG(alignt); \
|
|
||||||
EALIGN_W_##words; \
|
|
||||||
BODY_LABEL(__memset_ppc): \
|
|
||||||
cfi_startproc; \
|
|
||||||
LOCALENTRY(__memset_ppc)
|
|
||||||
|
|
||||||
# undef END_GEN_TB
|
|
||||||
# define END_GEN_TB(name, mask) \
|
|
||||||
cfi_endproc; \
|
|
||||||
TRACEBACK_MASK(__memset_ppc,mask) \
|
|
||||||
END_2(__memset_ppc)
|
|
||||||
|
|
||||||
# undef libc_hidden_builtin_def
|
# undef libc_hidden_builtin_def
|
||||||
# define libc_hidden_builtin_def(name)
|
# define libc_hidden_builtin_def(name)
|
||||||
|
|
|
@ -25,8 +25,11 @@
|
||||||
cache line (256 bits). There is a special case for setting cache lines
|
cache line (256 bits). There is a special case for setting cache lines
|
||||||
to 0, to take advantage of the dcbz instruction. */
|
to 0, to take advantage of the dcbz instruction. */
|
||||||
|
|
||||||
|
#ifndef MEMSET
|
||||||
|
# define MEMSET memset
|
||||||
|
#endif
|
||||||
.machine power4
|
.machine power4
|
||||||
EALIGN (memset, 5, 0)
|
EALIGN (MEMSET, 5, 0)
|
||||||
CALL_MCOUNT 3
|
CALL_MCOUNT 3
|
||||||
|
|
||||||
#define rTMP r0
|
#define rTMP r0
|
||||||
|
@ -232,7 +235,7 @@ L(medium_27f):
|
||||||
L(medium_28t):
|
L(medium_28t):
|
||||||
std rCHR, -8(rMEMP)
|
std rCHR, -8(rMEMP)
|
||||||
blr
|
blr
|
||||||
END_GEN_TB (memset,TB_TOCLESS)
|
END_GEN_TB (MEMSET,TB_TOCLESS)
|
||||||
libc_hidden_builtin_def (memset)
|
libc_hidden_builtin_def (memset)
|
||||||
|
|
||||||
/* Copied from bzero.S to prevent the linker from inserting a stub
|
/* Copied from bzero.S to prevent the linker from inserting a stub
|
||||||
|
|
|
@ -25,8 +25,11 @@
|
||||||
cache line (256 bits). There is a special case for setting cache lines
|
cache line (256 bits). There is a special case for setting cache lines
|
||||||
to 0, to take advantage of the dcbz instruction. */
|
to 0, to take advantage of the dcbz instruction. */
|
||||||
|
|
||||||
|
#ifndef MEMSET
|
||||||
|
# define MEMSET memset
|
||||||
|
#endif
|
||||||
.machine power6
|
.machine power6
|
||||||
EALIGN (memset, 7, 0)
|
EALIGN (MEMSET, 7, 0)
|
||||||
CALL_MCOUNT 3
|
CALL_MCOUNT 3
|
||||||
|
|
||||||
#define rTMP r0
|
#define rTMP r0
|
||||||
|
@ -376,7 +379,7 @@ L(medium_27f):
|
||||||
L(medium_28t):
|
L(medium_28t):
|
||||||
std rCHR, -8(rMEMP)
|
std rCHR, -8(rMEMP)
|
||||||
blr
|
blr
|
||||||
END_GEN_TB (memset,TB_TOCLESS)
|
END_GEN_TB (MEMSET,TB_TOCLESS)
|
||||||
libc_hidden_builtin_def (memset)
|
libc_hidden_builtin_def (memset)
|
||||||
|
|
||||||
/* Copied from bzero.S to prevent the linker from inserting a stub
|
/* Copied from bzero.S to prevent the linker from inserting a stub
|
||||||
|
|
|
@ -22,8 +22,11 @@
|
||||||
/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
|
/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
|
||||||
Returns 's'. */
|
Returns 's'. */
|
||||||
|
|
||||||
|
#ifndef MEMSET
|
||||||
|
# define MEMSET memset
|
||||||
|
#endif
|
||||||
.machine power7
|
.machine power7
|
||||||
EALIGN (memset, 5, 0)
|
EALIGN (MEMSET, 5, 0)
|
||||||
CALL_MCOUNT 3
|
CALL_MCOUNT 3
|
||||||
|
|
||||||
L(_memset):
|
L(_memset):
|
||||||
|
@ -380,7 +383,7 @@ L(small):
|
||||||
stw 4,4(10)
|
stw 4,4(10)
|
||||||
blr
|
blr
|
||||||
|
|
||||||
END_GEN_TB (memset,TB_TOCLESS)
|
END_GEN_TB (MEMSET,TB_TOCLESS)
|
||||||
libc_hidden_builtin_def (memset)
|
libc_hidden_builtin_def (memset)
|
||||||
|
|
||||||
/* Copied from bzero.S to prevent the linker from inserting a stub
|
/* Copied from bzero.S to prevent the linker from inserting a stub
|
||||||
|
|
|
@ -23,11 +23,15 @@
|
||||||
/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
|
/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
|
||||||
Returns 's'. */
|
Returns 's'. */
|
||||||
|
|
||||||
|
#ifndef MEMSET
|
||||||
|
# define MEMSET memset
|
||||||
|
#endif
|
||||||
|
|
||||||
/* No need to use .machine power8 since mtvsrd is already
|
/* No need to use .machine power8 since mtvsrd is already
|
||||||
handled by the define. It avoid breakage on binutils
|
handled by the define. It avoid breakage on binutils
|
||||||
that does not support this machine specifier. */
|
that does not support this machine specifier. */
|
||||||
.machine power7
|
.machine power7
|
||||||
EALIGN (memset, 5, 0)
|
EALIGN (MEMSET, 5, 0)
|
||||||
CALL_MCOUNT 3
|
CALL_MCOUNT 3
|
||||||
|
|
||||||
L(_memset):
|
L(_memset):
|
||||||
|
@ -438,7 +442,7 @@ L(write_LE_8):
|
||||||
stw r4,0(r10)
|
stw r4,0(r10)
|
||||||
stw r4,4(r10)
|
stw r4,4(r10)
|
||||||
blr
|
blr
|
||||||
END_GEN_TB (memset,TB_TOCLESS)
|
END_GEN_TB (MEMSET,TB_TOCLESS)
|
||||||
libc_hidden_builtin_def (memset)
|
libc_hidden_builtin_def (memset)
|
||||||
|
|
||||||
/* Copied from bzero.S to prevent the linker from inserting a stub
|
/* Copied from bzero.S to prevent the linker from inserting a stub
|
||||||
|
|
Loading…
Reference in New Issue