mirror of git://sourceware.org/git/glibc.git
powerpc: refactor memcpy and mempcpy 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/memcpy-a2.S: Define the implementation-specific function name and remove unneeded macros definition. * sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S: Likewise. * sysdeps/powerpc/powerpc64/a2/memcpy.S: Set a default function name if not defined and pass as parameter to macros accordingly. * sysdeps/powerpc/powerpc64/cell/memcpy.S: Likewise. * sysdeps/powerpc/powerpc64/memcpy.S: Likewise. * sysdeps/powerpc/powerpc64/power4/memcpy.S: Likewise. * sysdeps/powerpc/powerpc64/power6/memcpy.S: Likewise. * sysdeps/powerpc/powerpc64/power7/memcpy.S: Likewise. * sysdeps/powerpc/powerpc64/power7/mempcpy.S: Likewise.
This commit is contained in:
parent
ff06a55aef
commit
72fd128a08
18
ChangeLog
18
ChangeLog
|
@ -1,5 +1,23 @@
|
|||
2017-04-11 Wainer dos Santos Moschetta <wainersm@linux.vnet.ibm.com>
|
||||
|
||||
* sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S: Define the
|
||||
implementation-specific function name and remove unneeded
|
||||
macros definition.
|
||||
* sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S: Likewise.
|
||||
* sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S: Likewise.
|
||||
* sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S: Likewise.
|
||||
* sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S: Likewise.
|
||||
* sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S: Likewise.
|
||||
* sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S: Likewise.
|
||||
* sysdeps/powerpc/powerpc64/a2/memcpy.S: Set a default function
|
||||
name if not defined and pass as parameter to macros accordingly.
|
||||
* sysdeps/powerpc/powerpc64/cell/memcpy.S: Likewise.
|
||||
* sysdeps/powerpc/powerpc64/memcpy.S: Likewise.
|
||||
* sysdeps/powerpc/powerpc64/power4/memcpy.S: Likewise.
|
||||
* sysdeps/powerpc/powerpc64/power6/memcpy.S: Likewise.
|
||||
* sysdeps/powerpc/powerpc64/power7/memcpy.S: Likewise.
|
||||
* sysdeps/powerpc/powerpc64/power7/mempcpy.S: Likewise.
|
||||
|
||||
* sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S: Define the
|
||||
implementation-specific function name and remove unneeded macros
|
||||
definition.
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
|
||||
#include <sysdep.h>
|
||||
|
||||
#ifndef MEMCPY
|
||||
# define MEMCPY memcpy
|
||||
#endif
|
||||
|
||||
#define PREFETCH_AHEAD 4 /* no cache lines SRC prefetching ahead */
|
||||
#define ZERO_AHEAD 2 /* no cache lines DST zeroing ahead */
|
||||
|
||||
|
@ -30,7 +34,7 @@
|
|||
|
||||
|
||||
.machine a2
|
||||
EALIGN (memcpy, 5, 0)
|
||||
EALIGN (MEMCPY, 5, 0)
|
||||
CALL_MCOUNT 3
|
||||
|
||||
dcbt 0,r4 /* Prefetch ONE SRC cacheline */
|
||||
|
@ -520,5 +524,5 @@ L(endloop2_128):
|
|||
b L(lessthancacheline)
|
||||
|
||||
|
||||
END_GEN_TB (memcpy,TB_TOCLESS)
|
||||
END_GEN_TB (MEMCPY,TB_TOCLESS)
|
||||
libc_hidden_builtin_def (memcpy)
|
||||
|
|
|
@ -18,6 +18,10 @@
|
|||
|
||||
#include <sysdep.h>
|
||||
|
||||
#ifndef MEMCPY
|
||||
# define MEMCPY memcpy
|
||||
#endif
|
||||
|
||||
#define PREFETCH_AHEAD 6 /* no cache lines SRC prefetching ahead */
|
||||
#define ZERO_AHEAD 4 /* no cache lines DST zeroing ahead */
|
||||
|
||||
|
@ -39,7 +43,7 @@
|
|||
|
||||
.align 7
|
||||
|
||||
EALIGN (memcpy, 5, 0)
|
||||
EALIGN (MEMCPY, 5, 0)
|
||||
CALL_MCOUNT 3
|
||||
|
||||
dcbt 0,r4 /* Prefetch ONE SRC cacheline */
|
||||
|
@ -238,5 +242,5 @@ EALIGN (memcpy, 5, 0)
|
|||
stb r0,0(r6)
|
||||
1: blr
|
||||
|
||||
END_GEN_TB (memcpy,TB_TOCLESS)
|
||||
END_GEN_TB (MEMCPY,TB_TOCLESS)
|
||||
libc_hidden_builtin_def (memcpy)
|
||||
|
|
|
@ -33,7 +33,11 @@
|
|||
possible when both source and destination are doubleword aligned.
|
||||
Each case has a optimized unrolled loop. */
|
||||
|
||||
EALIGN (memcpy, 5, 0)
|
||||
#ifndef MEMCPY
|
||||
# define MEMCPY memcpy
|
||||
#endif
|
||||
|
||||
EALIGN (MEMCPY, 5, 0)
|
||||
CALL_MCOUNT 3
|
||||
|
||||
cmpldi cr1,5,31
|
||||
|
@ -389,5 +393,5 @@ EALIGN (memcpy, 5, 0)
|
|||
ld 31,-8(1)
|
||||
ld 3,-16(1)
|
||||
blr
|
||||
END_GEN_TB (memcpy,TB_TOCLESS)
|
||||
END_GEN_TB (MEMCPY,TB_TOCLESS)
|
||||
libc_hidden_builtin_def (memcpy)
|
||||
|
|
|
@ -18,21 +18,7 @@
|
|||
|
||||
#include <sysdep.h>
|
||||
|
||||
#undef EALIGN
|
||||
#define EALIGN(name, alignt, words) \
|
||||
.section ".text"; \
|
||||
ENTRY_2(__memcpy_a2) \
|
||||
.align ALIGNARG(alignt); \
|
||||
EALIGN_W_##words; \
|
||||
BODY_LABEL(__memcpy_a2): \
|
||||
cfi_startproc; \
|
||||
LOCALENTRY(__memcpy_a2)
|
||||
|
||||
#undef END_GEN_TB
|
||||
#define END_GEN_TB(name, mask) \
|
||||
cfi_endproc; \
|
||||
TRACEBACK_MASK(__memcpy_a2,mask) \
|
||||
END_2(__memcpy_a2)
|
||||
#define MEMCPY __memcpy_a2
|
||||
|
||||
#undef libc_hidden_builtin_def
|
||||
#define libc_hidden_builtin_def(name)
|
||||
|
|
|
@ -18,21 +18,7 @@
|
|||
|
||||
#include <sysdep.h>
|
||||
|
||||
#undef EALIGN
|
||||
#define EALIGN(name, alignt, words) \
|
||||
.section ".text"; \
|
||||
ENTRY_2(__memcpy_cell) \
|
||||
.align ALIGNARG(alignt); \
|
||||
EALIGN_W_##words; \
|
||||
BODY_LABEL(__memcpy_cell): \
|
||||
cfi_startproc; \
|
||||
LOCALENTRY(__memcpy_cell)
|
||||
|
||||
#undef END_GEN_TB
|
||||
#define END_GEN_TB(name, mask) \
|
||||
cfi_endproc; \
|
||||
TRACEBACK_MASK(__memcpy_cell,mask) \
|
||||
END_2(__memcpy_cell)
|
||||
#define MEMCPY __memcpy_cell
|
||||
|
||||
#undef libc_hidden_builtin_def
|
||||
#define libc_hidden_builtin_def(name)
|
||||
|
|
|
@ -18,21 +18,7 @@
|
|||
|
||||
#include <sysdep.h>
|
||||
|
||||
#undef EALIGN
|
||||
#define EALIGN(name, alignt, words) \
|
||||
.section ".text"; \
|
||||
ENTRY_2(__memcpy_power4) \
|
||||
.align ALIGNARG(alignt); \
|
||||
EALIGN_W_##words; \
|
||||
BODY_LABEL(__memcpy_power4): \
|
||||
cfi_startproc; \
|
||||
LOCALENTRY(__memcpy_power4)
|
||||
|
||||
#undef END_GEN_TB
|
||||
#define END_GEN_TB(name, mask) \
|
||||
cfi_endproc; \
|
||||
TRACEBACK_MASK(__memcpy_power4,mask) \
|
||||
END_2(__memcpy_power4)
|
||||
#define MEMCPY __memcpy_power4
|
||||
|
||||
#undef libc_hidden_builtin_def
|
||||
#define libc_hidden_builtin_def(name)
|
||||
|
|
|
@ -18,21 +18,7 @@
|
|||
|
||||
#include <sysdep.h>
|
||||
|
||||
#undef EALIGN
|
||||
#define EALIGN(name, alignt, words) \
|
||||
.section ".text"; \
|
||||
ENTRY_2(__memcpy_power6) \
|
||||
.align ALIGNARG(alignt); \
|
||||
EALIGN_W_##words; \
|
||||
BODY_LABEL(__memcpy_power6): \
|
||||
cfi_startproc; \
|
||||
LOCALENTRY(__memcpy_power6)
|
||||
|
||||
#undef END_GEN_TB
|
||||
#define END_GEN_TB(name, mask) \
|
||||
cfi_endproc; \
|
||||
TRACEBACK_MASK(__memcpy_power6,mask) \
|
||||
END_2(__memcpy_power6)
|
||||
#define MEMCPY __memcpy_power6
|
||||
|
||||
#undef libc_hidden_builtin_def
|
||||
#define libc_hidden_builtin_def(name)
|
||||
|
|
|
@ -18,21 +18,7 @@
|
|||
|
||||
#include <sysdep.h>
|
||||
|
||||
#undef EALIGN
|
||||
#define EALIGN(name, alignt, words) \
|
||||
.section ".text"; \
|
||||
ENTRY_2(__memcpy_power7) \
|
||||
.align ALIGNARG(alignt); \
|
||||
EALIGN_W_##words; \
|
||||
BODY_LABEL(__memcpy_power7): \
|
||||
cfi_startproc; \
|
||||
LOCALENTRY(__memcpy_power7)
|
||||
|
||||
#undef END_GEN_TB
|
||||
#define END_GEN_TB(name, mask) \
|
||||
cfi_endproc; \
|
||||
TRACEBACK_MASK(__memcpy_power7,mask) \
|
||||
END_2(__memcpy_power7)
|
||||
#define MEMCPY __memcpy_power7
|
||||
|
||||
#undef libc_hidden_builtin_def
|
||||
#define libc_hidden_builtin_def(name)
|
||||
|
|
|
@ -19,21 +19,7 @@
|
|||
#include <sysdep.h>
|
||||
|
||||
#if defined SHARED && IS_IN (libc)
|
||||
# undef EALIGN
|
||||
# define EALIGN(name, alignt, words) \
|
||||
.section ".text"; \
|
||||
ENTRY_2(__memcpy_ppc) \
|
||||
.align ALIGNARG(alignt); \
|
||||
EALIGN_W_##words; \
|
||||
BODY_LABEL(__memcpy_ppc): \
|
||||
cfi_startproc; \
|
||||
LOCALENTRY(__memcpy_ppc)
|
||||
|
||||
# undef END_GEN_TB
|
||||
# define END_GEN_TB(name, mask) \
|
||||
cfi_endproc; \
|
||||
TRACEBACK_MASK(__memcpy_ppc,mask) \
|
||||
END_2(__memcpy_ppc)
|
||||
# define MEMCPY __memcpy_ppc
|
||||
|
||||
# undef libc_hidden_builtin_def
|
||||
# define libc_hidden_builtin_def(name)
|
||||
|
|
|
@ -18,21 +18,7 @@
|
|||
|
||||
#include <sysdep.h>
|
||||
|
||||
#undef EALIGN
|
||||
#define EALIGN(name, alignt, words) \
|
||||
.section ".text"; \
|
||||
ENTRY_2(__mempcpy_power7) \
|
||||
.align ALIGNARG(alignt); \
|
||||
EALIGN_W_##words; \
|
||||
BODY_LABEL(__mempcpy_power7): \
|
||||
cfi_startproc; \
|
||||
LOCALENTRY(__mempcpy_power7)
|
||||
|
||||
#undef END_GEN_TB
|
||||
#define END_GEN_TB(name, mask) \
|
||||
cfi_endproc; \
|
||||
TRACEBACK_MASK(__mempcpy_power7,mask) \
|
||||
END_2(__mempcpy_power7)
|
||||
#define MEMPCPY __mempcpy_power7
|
||||
|
||||
#undef libc_hidden_builtin_def
|
||||
#define libc_hidden_builtin_def(name)
|
||||
|
|
|
@ -33,8 +33,11 @@
|
|||
possible when both source and destination are doubleword aligned.
|
||||
Each case has a optimized unrolled loop. */
|
||||
|
||||
#ifndef MEMCPY
|
||||
# define MEMCPY memcpy
|
||||
#endif
|
||||
.machine power4
|
||||
EALIGN (memcpy, 5, 0)
|
||||
EALIGN (MEMCPY, 5, 0)
|
||||
CALL_MCOUNT 3
|
||||
|
||||
cmpldi cr1,5,31
|
||||
|
@ -470,5 +473,5 @@ EALIGN (memcpy, 5, 0)
|
|||
ld 31,-8(1)
|
||||
ld 3,-16(1)
|
||||
blr
|
||||
END_GEN_TB (memcpy,TB_TOCLESS)
|
||||
END_GEN_TB (MEMCPY,TB_TOCLESS)
|
||||
libc_hidden_builtin_def (memcpy)
|
||||
|
|
|
@ -40,8 +40,11 @@
|
|||
the source but may take a risk and only require word alignment
|
||||
for the destination. */
|
||||
|
||||
#ifndef MEMCPY
|
||||
# define MEMCPY memcpy
|
||||
#endif
|
||||
.machine "power6"
|
||||
EALIGN (memcpy, 7, 0)
|
||||
EALIGN (MEMCPY, 7, 0)
|
||||
CALL_MCOUNT 3
|
||||
|
||||
cmpldi cr1,5,31
|
||||
|
@ -1492,5 +1495,5 @@ L(du_done):
|
|||
ld 31,-8(1)
|
||||
ld 3,-16(1)
|
||||
blr
|
||||
END_GEN_TB (memcpy,TB_TOCLESS)
|
||||
END_GEN_TB (MEMCPY,TB_TOCLESS)
|
||||
libc_hidden_builtin_def (memcpy)
|
||||
|
|
|
@ -23,12 +23,16 @@
|
|||
/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
|
||||
Returns 'dst'. */
|
||||
|
||||
#ifndef MEMCPY
|
||||
# define MEMCPY memcpy
|
||||
#endif
|
||||
|
||||
#define dst 11 /* Use r11 so r3 kept unchanged. */
|
||||
#define src 4
|
||||
#define cnt 5
|
||||
|
||||
.machine power7
|
||||
EALIGN (memcpy, 5, 0)
|
||||
EALIGN (MEMCPY, 5, 0)
|
||||
CALL_MCOUNT 3
|
||||
|
||||
cmpldi cr1,cnt,31
|
||||
|
@ -422,5 +426,5 @@ L(end_unaligned_loop):
|
|||
/* Return original DST pointer. */
|
||||
blr
|
||||
|
||||
END_GEN_TB (memcpy,TB_TOCLESS)
|
||||
END_GEN_TB (MEMCPY,TB_TOCLESS)
|
||||
libc_hidden_builtin_def (memcpy)
|
||||
|
|
|
@ -23,8 +23,11 @@
|
|||
/* __ptr_t [r3] __mempcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
|
||||
Returns 'dst' + 'len'. */
|
||||
|
||||
#ifndef MEMPCPY
|
||||
# define MEMPCPY __mempcpy
|
||||
#endif
|
||||
.machine power7
|
||||
EALIGN (__mempcpy, 5, 0)
|
||||
EALIGN (MEMPCPY, 5, 0)
|
||||
CALL_MCOUNT 3
|
||||
|
||||
cmpldi cr1,5,31
|
||||
|
@ -463,7 +466,7 @@ L(end_unaligned_loop):
|
|||
add 3,3,5
|
||||
blr
|
||||
|
||||
END_GEN_TB (__mempcpy,TB_TOCLESS)
|
||||
END_GEN_TB (MEMPCPY,TB_TOCLESS)
|
||||
libc_hidden_def (__mempcpy)
|
||||
weak_alias (__mempcpy, mempcpy)
|
||||
libc_hidden_builtin_def (mempcpy)
|
||||
|
|
Loading…
Reference in New Issue