]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
ARM: Make multiarch memcpy always use NEON when compiler does
authorRoland McGrath <roland@hack.frob.com>
Mon, 13 May 2013 22:41:46 +0000 (15:41 -0700)
committerRoland McGrath <roland@hack.frob.com>
Mon, 13 May 2013 23:13:14 +0000 (16:13 -0700)
ports/ChangeLog.arm
ports/sysdeps/arm/armv7/multiarch/ifunc-impl-list.c
ports/sysdeps/arm/armv7/multiarch/memcpy.S
ports/sysdeps/arm/armv7/multiarch/memcpy_neon.S
ports/sysdeps/arm/armv7/multiarch/memcpy_vfp.S

index 372096e71984c3f626ef23b1b708a1012346f6f5..2565518c5e10f691edd1228e9aa457563cb51d2c 100644 (file)
@@ -1,3 +1,15 @@
+2013-05-13  Roland McGrath  <roland@hack.frob.com>
+
+       * sysdeps/arm/armv7/multiarch/memcpy.S [__ARM_NEON__]: Don't define
+       memcpy here, just __memcpy_arm and __aeabi_memcpy*.
+       * sysdeps/arm/armv7/multiarch/memcpy_neon.S [__ARM_NEON__]:
+       Define memcpy here, not __memcpy_neon.
+       * sysdeps/arm/armv7/multiarch/memcpy_vfp.S [__ARM_NEON__]:
+       Define nothing here.
+       * sysdeps/arm/armv7/multiarch/ifunc-impl-list.c
+       (__libc_ifunc_impl_list) [__ARM_NEON__]: Don't list __memcpy_vfp;
+       use memcpy name for NEON implementation.
+
 2013-05-08  Will Newton  <will.newton@linaro.org>
 
        * sysdeps/arm/armv7/multiarch/Makefile: New file.
index 0dcdcd62444dcd41c7436466477e5d214a1e03c4..9c2487fd228b1ec04b6a91330c4313f9d56334e0 100644 (file)
@@ -35,9 +35,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 
   IFUNC_IMPL (i, name, memcpy,
              IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_ARM_NEON,
-                             __memcpy_neon)
+#ifdef __ARM_NEON__
+                              memcpy
+#else
+                             __memcpy_neon
+#endif
+                              )
+#ifndef __ARM_NEON__
              IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_ARM_VFP,
                              __memcpy_vfp)
+#endif
              IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_arm));
 
   return i;
index 1b12465a8bfe2796898d3421cae7106c94a467b9..81c01d3eac99026918816041593ce35e2ac3ade5 100644 (file)
 #include <sysdep.h>
 #include <rtld-global-offsets.h>
 
-#if !defined NOT_IN_libc
+#ifndef NOT_IN_libc
+/* Under __ARM_NEON__, memcpy_neon.S defines the name memcpy.  */
+# ifndef __ARM_NEON__
        .text
 ENTRY(memcpy)
        .type   memcpy, %gnu_indirect_function
-#ifdef __SOFTFP__
+# ifdef __SOFTFP__
        ldr     r1, .Lmemcpy_arm
        tst     r0, #HWCAP_ARM_VFP
        ldrne   r1, .Lmemcpy_vfp
-#else
+# else
        ldr     r1, .Lmemcpy_vfp
-#endif
+# endif
        tst     r0, #HWCAP_ARM_NEON
        ldrne   r1, .Lmemcpy_neon
 1:
        add     r0, r1, pc
        DO_RET(lr)
 
-#ifdef __SOFTFP__
+# ifdef __SOFTFP__
 .Lmemcpy_arm:
        .long   C_SYMBOL_NAME(__memcpy_arm) - 1b - PC_OFS
-#endif
+# endif
 .Lmemcpy_neon:
        .long   C_SYMBOL_NAME(__memcpy_neon) - 1b - PC_OFS
 .Lmemcpy_vfp:
@@ -51,6 +53,7 @@ ENTRY(memcpy)
 END(memcpy)
 
 libc_hidden_builtin_def (memcpy)
+#endif  /* Not __ARM_NEON__.  */
 
 /* These versions of memcpy are defined not to clobber any VFP or NEON
    registers so they must always call the ARM variant of the memcpy code.  */
index c0ef1f8983a0e1ac11893b15b31189cf55e81a19..e60d1cc0e1d37178a3eb9a23d4d6e115b8fe09aa 100644 (file)
@@ -1,3 +1,9 @@
+#ifdef __ARM_NEON__
+/* Under __ARM_NEON__, this file defines memcpy directly.  */
+libc_hidden_builtin_def (memcpy)
+#else
+# define memcpy __memcpy_neon
+#endif
+
 #define MEMCPY_NEON
-#define memcpy __memcpy_neon
 #include "memcpy_impl.S"
index d21b702e909bdd83a579c2a51e94f1ae7f3350ea..e008c041edc4931ab5ea7370d98cd2b227145fbb 100644 (file)
@@ -1,3 +1,7 @@
-#define MEMCPY_VFP
-#define memcpy __memcpy_vfp
-#include "memcpy_impl.S"
+/* Under __ARM_NEON__, memcpy_neon.S defines memcpy directly
+   and the __memcpy_vfp code will never be used.  */
+#ifndef __ARM_NEON__
+# define MEMCPY_VFP
+# define memcpy __memcpy_vfp
+# include "memcpy_impl.S"
+#endif