This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 6/6] powerpc: wordcopy/memmove cleanup for ppc32


This patch cleanup some multiarch code related to memmmove
optimization. Initial IFUNC support added specialized wordcopy
symbols which turned in local IFUNC calls used by memmove default
implementation.  The patch removes the internal IFUNC for wordcopy
symbols and uses local branches in the memmmove optimization instead.

Tested on powerpc64, powerpc64le, and powerpc32-fpu.

--

 	* sysdeps/powerpc/powerpc32/power4/multiarch/Makefile
	[sysdep_routines]: Remove wordcopy-power6 object.
	* sysdeps/powerpc/powerpc32/power4/multiarch/memmove-power7.c
	(__memmove_power7): Use local call for wordcopy and memcpy symbols.
	* sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c
	(__memmove_ppc32): Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power6.c: Remove
	file.
	* sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy.c: Remove file.
	* sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c [IS_IN (libc)]:
	Remove preprocessor.

--

diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile
index 2271d57..bd9d360 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile
@@ -9,7 +9,7 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
 		   strcasecmp-power7 strcasecmp_l-power7 strncase-power7 \
 		   strncase_l-power7 strchrnul-power7 strchrnul-ppc32 \
 		   strchr-power7 strchr-ppc32 \
-		   wordcopy-power7 wordcopy-power6 wordcopy-ppc32 \
+		   wordcopy-power7 wordcopy-ppc32 \
 		   memmove-power7 memmove-ppc
 
 CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memmove-power7.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memmove-power7.c
index 8f2614d..5a7fc5f 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memmove-power7.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memmove-power7.c
@@ -17,6 +17,17 @@
    not, see <http://www.gnu.org/licenses/>.  */
 
 #include <string.h>
+#include <memcopy.h>
+
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power7;
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power7;
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power7;
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power7;
+
+#define _wordcopy_fwd_aligned       _wordcopy_fwd_aligned_power7
+#define _wordcopy_fwd_dest_aligned  _wordcopy_fwd_dest_aligned_power7
+#define _wordcopy_bwd_aligned       _wordcopy_bwd_aligned_power7
+#define _wordcopy_bwd_dest_aligned  _wordcopy_bwd_dest_aligned_power7
 
 extern __typeof (memcpy) __memcpy_power7;
 #define memcpy __memcpy_power7
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memmove-ppc.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memmove-ppc.c
index d7ba5a8..b543a8a 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memmove-ppc.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memmove-ppc.c
@@ -17,6 +17,17 @@
    not, see <http://www.gnu.org/licenses/>.  */
 
 #include <string.h>
+#include <memcopy.h>
+
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_ppc;
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_ppc;
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_ppc;
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_ppc;
+
+#define _wordcopy_fwd_aligned       _wordcopy_fwd_aligned_ppc
+#define _wordcopy_fwd_dest_aligned  _wordcopy_fwd_dest_aligned_ppc
+#define _wordcopy_bwd_aligned       _wordcopy_bwd_aligned_ppc
+#define _wordcopy_bwd_dest_aligned  _wordcopy_bwd_dest_aligned_ppc
 
 extern __typeof (memcpy) __memcpy_ppc;
 #define memcpy __memcpy_ppc
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power6.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power6.c
deleted file mode 100644
index 65dd8c8..0000000
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power6.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (C) 2013-2015 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 WORDCOPY_FWD_ALIGNED      _wordcopy_fwd_aligned_power6
-#define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned_power6
-#define WORDCOPY_BWD_ALIGNED      _wordcopy_bwd_aligned_power6
-#define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned_power6
-
-#include <sysdeps/powerpc/power6/wordcopy.c>
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c
index 41e4118..82af17c 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c
@@ -15,9 +15,13 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define WORDCOPY_FWD_ALIGNED      _wordcopy_fwd_aligned_ppc
-#define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned_ppc
-#define WORDCOPY_BWD_ALIGNED      _wordcopy_bwd_aligned_ppc
-#define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned_ppc
+#if IS_IN (libc)
+# define WORDCOPY_FWD_ALIGNED      _wordcopy_fwd_aligned_ppc
+# define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned_ppc
+# define WORDCOPY_BWD_ALIGNED      _wordcopy_bwd_aligned_ppc
+# define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned_ppc
 
-#include <sysdeps/powerpc/power4/wordcopy.c>
+# include <sysdeps/powerpc/power4/wordcopy.c>
+#else
+# include <string/wordcopy.c>
+#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy.c
deleted file mode 100644
index cc27540..0000000
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Multiple versions of wordcopy functions.
-   Copyright (C) 2013-2015 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/>.  */
-
-#if IS_IN (libc)
-# include <stddef.h>
-# include <memcopy.h>
-# include <shlib-compat.h>
-# include "init-arch.h"
-
-extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_ppc
-attribute_hidden;
-extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power6
-attribute_hidden;
-extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power7
-attribute_hidden;
-
-libc_ifunc (_wordcopy_fwd_aligned,
-            (hwcap & PPC_FEATURE_HAS_VSX)
-            ? _wordcopy_fwd_aligned_power7 :
-	      (hwcap & PPC_FEATURE_ARCH_2_05)
-              ? _wordcopy_fwd_aligned_power6
-            : _wordcopy_fwd_aligned_ppc);
-
-
-extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_ppc
-attribute_hidden;
-extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power6
-attribute_hidden;
-extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power7
-attribute_hidden;
-
-libc_ifunc (_wordcopy_fwd_dest_aligned,
-            (hwcap & PPC_FEATURE_HAS_VSX)
-            ? _wordcopy_fwd_dest_aligned_power7 :
-	      (hwcap & PPC_FEATURE_ARCH_2_05)
-              ? _wordcopy_fwd_dest_aligned_power6
-            : _wordcopy_fwd_dest_aligned_ppc);
-
-
-extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_ppc
-attribute_hidden;
-extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power6
-attribute_hidden;
-extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power7
-attribute_hidden;
-
-libc_ifunc (_wordcopy_bwd_aligned,
-            (hwcap & PPC_FEATURE_HAS_VSX)
-            ? _wordcopy_bwd_aligned_power7 :
-	      (hwcap & PPC_FEATURE_ARCH_2_05)
-              ? _wordcopy_bwd_aligned_power6
-            : _wordcopy_bwd_aligned_ppc);
-
-
-extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_ppc
-attribute_hidden;
-extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power6
-attribute_hidden;
-extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power7
-attribute_hidden;
-
-libc_ifunc (_wordcopy_bwd_dest_aligned,
-            (hwcap & PPC_FEATURE_HAS_VSX)
-            ? _wordcopy_bwd_dest_aligned_power7 :
-	      (hwcap & PPC_FEATURE_ARCH_2_05)
-              ? _wordcopy_bwd_dest_aligned_power6
-            : _wordcopy_bwd_dest_aligned_ppc);
-
-#else
-#include <sysdeps/powerpc/power4/wordcopy.c>
-#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c
index b8ecda7..5d7b9fd 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c
@@ -15,8 +15,4 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
 #include <sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c>
-#else
-#include <string/wordcopy.c>
-#endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]