aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWainer dos Santos Moschetta <wainersm@linux.vnet.ibm.com>2017-04-11 14:18:35 -0300
committerTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>2017-04-11 17:13:55 -0300
commit18e0054bf7c57cb5e6b90961be167164d58b1098 (patch)
tree5d1a44b43a9f36e2f6c6b30b7f88003137efeea3
parentf0748b70a84fc9f08507b58841356e45ea516076 (diff)
downloadglibc-18e0054bf7c57cb5e6b90961be167164d58b1098.zip
glibc-18e0054bf7c57cb5e6b90961be167164d58b1098.tar.gz
glibc-18e0054bf7c57cb5e6b90961be167164d58b1098.tar.bz2
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.
-rw-r--r--ChangeLog14
-rw-r--r--sysdeps/powerpc/powerpc64/memset.S8
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset-power4.S16
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset-power6.S16
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset-power7.S16
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset-power8.S16
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S16
-rw-r--r--sysdeps/powerpc/powerpc64/power4/memset.S7
-rw-r--r--sysdeps/powerpc/powerpc64/power6/memset.S7
-rw-r--r--sysdeps/powerpc/powerpc64/power7/memset.S7
-rw-r--r--sysdeps/powerpc/powerpc64/power8/memset.S8
11 files changed, 46 insertions, 85 deletions
diff --git a/ChangeLog b/ChangeLog
index 3b069a9..7c0ce89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
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
strcasestr implementation name and remove unneeded macros definition.
* sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S: Define
diff --git a/sysdeps/powerpc/powerpc64/memset.S b/sysdeps/powerpc/powerpc64/memset.S
index 9a3c31e..f6581b5 100644
--- a/sysdeps/powerpc/powerpc64/memset.S
+++ b/sysdeps/powerpc/powerpc64/memset.S
@@ -31,7 +31,11 @@
cache line (256 bits). There is a special case for setting cache lines
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
#define rTMP r0
@@ -244,7 +248,7 @@ L(medium_27f):
L(medium_28t):
std rCHR, -8(rMEMP)
blr
-END_GEN_TB (memset,TB_TOCLESS)
+END_GEN_TB (MEMSET,TB_TOCLESS)
libc_hidden_builtin_def (memset)
#ifndef NO_BZERO_IMPL
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S
index 6a11d6d..3908e8e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S
@@ -18,21 +18,7 @@
#include <sysdep.h>
-#undef EALIGN
-#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)
+#define MEMSET __memset_power4
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S
index 7791c10..4ddbd2e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S
@@ -18,21 +18,7 @@
#include <sysdep.h>
-#undef EALIGN
-#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)
+#define MEMSET __memset_power6
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S
index 1755503..97f686b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S
@@ -18,21 +18,7 @@
#include <sysdep.h>
-#undef EALIGN
-#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)
+#define MEMSET __memset_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S
index 70856cb..ea30353 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S
@@ -18,21 +18,7 @@
#include <sysdep.h>
-#undef EALIGN
-#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)
+#define MEMSET __memset_power8
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
index aaa2ba9..0f16e21 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
@@ -30,21 +30,7 @@ END_GEN_TB (__bzero_ppc,TB_TOCLESS)
#if defined SHARED && IS_IN (libc)
-# undef EALIGN
-# 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)
+# define MEMSET __memset_ppc
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/power4/memset.S b/sysdeps/powerpc/powerpc64/power4/memset.S
index 6686005..a57214e 100644
--- a/sysdeps/powerpc/powerpc64/power4/memset.S
+++ b/sysdeps/powerpc/powerpc64/power4/memset.S
@@ -25,8 +25,11 @@
cache line (256 bits). There is a special case for setting cache lines
to 0, to take advantage of the dcbz instruction. */
+#ifndef MEMSET
+# define MEMSET memset
+#endif
.machine power4
-EALIGN (memset, 5, 0)
+EALIGN (MEMSET, 5, 0)
CALL_MCOUNT 3
#define rTMP r0
@@ -232,7 +235,7 @@ L(medium_27f):
L(medium_28t):
std rCHR, -8(rMEMP)
blr
-END_GEN_TB (memset,TB_TOCLESS)
+END_GEN_TB (MEMSET,TB_TOCLESS)
libc_hidden_builtin_def (memset)
/* Copied from bzero.S to prevent the linker from inserting a stub
diff --git a/sysdeps/powerpc/powerpc64/power6/memset.S b/sysdeps/powerpc/powerpc64/power6/memset.S
index 6130a1c..aee1c8e 100644
--- a/sysdeps/powerpc/powerpc64/power6/memset.S
+++ b/sysdeps/powerpc/powerpc64/power6/memset.S
@@ -25,8 +25,11 @@
cache line (256 bits). There is a special case for setting cache lines
to 0, to take advantage of the dcbz instruction. */
+#ifndef MEMSET
+# define MEMSET memset
+#endif
.machine power6
-EALIGN (memset, 7, 0)
+EALIGN (MEMSET, 7, 0)
CALL_MCOUNT 3
#define rTMP r0
@@ -376,7 +379,7 @@ L(medium_27f):
L(medium_28t):
std rCHR, -8(rMEMP)
blr
-END_GEN_TB (memset,TB_TOCLESS)
+END_GEN_TB (MEMSET,TB_TOCLESS)
libc_hidden_builtin_def (memset)
/* Copied from bzero.S to prevent the linker from inserting a stub
diff --git a/sysdeps/powerpc/powerpc64/power7/memset.S b/sysdeps/powerpc/powerpc64/power7/memset.S
index 2fe1757..21933c0 100644
--- a/sysdeps/powerpc/powerpc64/power7/memset.S
+++ b/sysdeps/powerpc/powerpc64/power7/memset.S
@@ -22,8 +22,11 @@
/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
Returns 's'. */
+#ifndef MEMSET
+# define MEMSET memset
+#endif
.machine power7
-EALIGN (memset, 5, 0)
+EALIGN (MEMSET, 5, 0)
CALL_MCOUNT 3
L(_memset):
@@ -380,7 +383,7 @@ L(small):
stw 4,4(10)
blr
-END_GEN_TB (memset,TB_TOCLESS)
+END_GEN_TB (MEMSET,TB_TOCLESS)
libc_hidden_builtin_def (memset)
/* Copied from bzero.S to prevent the linker from inserting a stub
diff --git a/sysdeps/powerpc/powerpc64/power8/memset.S b/sysdeps/powerpc/powerpc64/power8/memset.S
index 5dc257d..bc734c9 100644
--- a/sysdeps/powerpc/powerpc64/power8/memset.S
+++ b/sysdeps/powerpc/powerpc64/power8/memset.S
@@ -23,11 +23,15 @@
/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
Returns 's'. */
+#ifndef MEMSET
+# define MEMSET memset
+#endif
+
/* No need to use .machine power8 since mtvsrd is already
handled by the define. It avoid breakage on binutils
that does not support this machine specifier. */
.machine power7
-EALIGN (memset, 5, 0)
+EALIGN (MEMSET, 5, 0)
CALL_MCOUNT 3
L(_memset):
@@ -438,7 +442,7 @@ L(write_LE_8):
stw r4,0(r10)
stw r4,4(r10)
blr
-END_GEN_TB (memset,TB_TOCLESS)
+END_GEN_TB (MEMSET,TB_TOCLESS)
libc_hidden_builtin_def (memset)
/* Copied from bzero.S to prevent the linker from inserting a stub