]> sourceware.org Git - newlib-cygwin.git/commitdiff
[ARM] Select appropriate memcpy implementation for ARMv8-a.
authorMarcus Shawcroft <marcus.shawcroft@arm.com>
Tue, 3 Nov 2015 11:02:15 +0000 (11:02 +0000)
committerMarcus Shawcroft <marcus.shawcroft@arm.com>
Tue, 3 Nov 2015 11:04:55 +0000 (11:04 +0000)
The newlib configury logic that detects architecture version and
chooses an appropriate memcpy implementation does not consider
ARMv8-a.

This patch adds configury logic to detect ARMv8-a along with the
associated changes in Makefile.am and memcpy.

newlib/ChangeLog
newlib/libc/machine/arm/Makefile.am
newlib/libc/machine/arm/Makefile.in
newlib/libc/machine/arm/configure
newlib/libc/machine/arm/configure.in
newlib/libc/machine/arm/memcpy.S

index 9d91f7b8d72c22d6e4fc3cbdff4b5740c7fe985e..3dec6e2c9b616856214af46ce792973066828a76 100644 (file)
@@ -1,3 +1,12 @@
+2015-11-03  Marcus Shawcroft  <marcus.shawcroft@arm.com>
+
+       * libc/machine/arm/configure.in: Check for __ARM_ARCH_8A__.
+       * libc/machine/arm/memcpy.S: Handle __ARM_ARCH_8A__.
+       * libc/machine/arm/Makefile.am: Consider HAVE_ARMV8A in memcpy
+       selection.
+       * libc/machine/arm/Makefile.in: Regenerate.
+       * libc/machine/arm/configure: Regenerate.
+
 2015-11-02  Jon Turney  <jon.turney@dronecode.org.uk>
 
        * HOWTO: Update.
index 55bc0a7ad5967e242dece8b8e82a5ffaf36032df..0eb1cf12f2804c46e10d17926b20c4126354221b 100644 (file)
@@ -33,6 +33,10 @@ if OPT_SIZE
 MEMCPY_SRC=
 MEMCPY_OBJ=
 else
+if HAVE_ARMV8A
+MEMCPY_SRC=memcpy.S
+MEMCPY_OBJ=$(lpfx)memcpy.o
+else
 if HAVE_ARMV7A
 MEMCPY_SRC=memcpy.S
 MEMCPY_OBJ=$(lpfx)memcpy.o
@@ -45,6 +49,7 @@ MEMCPY_SRC=
 MEMCPY_OBJ=
 endif !HAVE_ARMV7M
 endif !HAVE_ARMV7A
+endif !HAVE_ARMV8A
 endif !OPT_SIZE
 
 lib_a_SOURCES = setjmp.S access.c strcmp.S strcpy.c \
index 7a3506e094ae660178f4a04c1ac0a746e5c6c239..81dea309903bceb26681223fb8c17a82ac847300 100644 (file)
@@ -71,12 +71,14 @@ lib_a_AR = $(AR) $(ARFLAGS)
 @HAVE_THUMB1_FALSE@am__DEPENDENCIES_1 = $(lpfx)strlen.o
 @HAVE_THUMB1_TRUE@@OPT_SIZE_TRUE@am__DEPENDENCIES_1 = $(lpfx)strlen.o
 @HAVE_ARMV7_TRUE@am__DEPENDENCIES_2 = $(lpfx)memchr.o
-@HAVE_ARMV7A_FALSE@@HAVE_ARMV7M_TRUE@@OPT_SIZE_FALSE@am__DEPENDENCIES_3 = $(lpfx)memcpy.o
-@HAVE_ARMV7A_TRUE@@OPT_SIZE_FALSE@am__DEPENDENCIES_3 =  \
-@HAVE_ARMV7A_TRUE@@OPT_SIZE_FALSE@     $(lpfx)memcpy.o
-@HAVE_ARMV7A_FALSE@@HAVE_ARMV7M_TRUE@@OPT_SIZE_FALSE@am__objects_1 = lib_a-memcpy.$(OBJEXT)
-@HAVE_ARMV7A_TRUE@@OPT_SIZE_FALSE@am__objects_1 =  \
-@HAVE_ARMV7A_TRUE@@OPT_SIZE_FALSE@     lib_a-memcpy.$(OBJEXT)
+@HAVE_ARMV7A_FALSE@@HAVE_ARMV7M_TRUE@@HAVE_ARMV8A_FALSE@@OPT_SIZE_FALSE@am__DEPENDENCIES_3 = $(lpfx)memcpy.o
+@HAVE_ARMV7A_TRUE@@HAVE_ARMV8A_FALSE@@OPT_SIZE_FALSE@am__DEPENDENCIES_3 = $(lpfx)memcpy.o
+@HAVE_ARMV8A_TRUE@@OPT_SIZE_FALSE@am__DEPENDENCIES_3 =  \
+@HAVE_ARMV8A_TRUE@@OPT_SIZE_FALSE@     $(lpfx)memcpy.o
+@HAVE_ARMV7A_FALSE@@HAVE_ARMV7M_TRUE@@HAVE_ARMV8A_FALSE@@OPT_SIZE_FALSE@am__objects_1 = lib_a-memcpy.$(OBJEXT)
+@HAVE_ARMV7A_TRUE@@HAVE_ARMV8A_FALSE@@OPT_SIZE_FALSE@am__objects_1 = lib_a-memcpy.$(OBJEXT)
+@HAVE_ARMV8A_TRUE@@OPT_SIZE_FALSE@am__objects_1 =  \
+@HAVE_ARMV8A_TRUE@@OPT_SIZE_FALSE@     lib_a-memcpy.$(OBJEXT)
 @HAVE_ARMV7_TRUE@am__objects_2 = lib_a-memchr.$(OBJEXT)
 @HAVE_THUMB1_FALSE@am__objects_3 = lib_a-strlen.$(OBJEXT)
 @HAVE_THUMB1_TRUE@@OPT_SIZE_TRUE@am__objects_3 =  \
@@ -226,13 +228,15 @@ noinst_LIBRARIES = lib.a
 @HAVE_ARMV7_TRUE@MEMCHR_SRC = memchr.S
 @HAVE_ARMV7_FALSE@MEMCHR_OBJ = 
 @HAVE_ARMV7_TRUE@MEMCHR_OBJ = $(lpfx)memchr.o
-@HAVE_ARMV7A_FALSE@@HAVE_ARMV7M_FALSE@@OPT_SIZE_FALSE@MEMCPY_SRC = 
-@HAVE_ARMV7A_FALSE@@HAVE_ARMV7M_TRUE@@OPT_SIZE_FALSE@MEMCPY_SRC = memcpy.S
-@HAVE_ARMV7A_TRUE@@OPT_SIZE_FALSE@MEMCPY_SRC = memcpy.S
+@HAVE_ARMV7A_FALSE@@HAVE_ARMV7M_FALSE@@HAVE_ARMV8A_FALSE@@OPT_SIZE_FALSE@MEMCPY_SRC = 
+@HAVE_ARMV7A_FALSE@@HAVE_ARMV7M_TRUE@@HAVE_ARMV8A_FALSE@@OPT_SIZE_FALSE@MEMCPY_SRC = memcpy.S
+@HAVE_ARMV7A_TRUE@@HAVE_ARMV8A_FALSE@@OPT_SIZE_FALSE@MEMCPY_SRC = memcpy.S
+@HAVE_ARMV8A_TRUE@@OPT_SIZE_FALSE@MEMCPY_SRC = memcpy.S
 @OPT_SIZE_TRUE@MEMCPY_SRC = 
-@HAVE_ARMV7A_FALSE@@HAVE_ARMV7M_FALSE@@OPT_SIZE_FALSE@MEMCPY_OBJ = 
-@HAVE_ARMV7A_FALSE@@HAVE_ARMV7M_TRUE@@OPT_SIZE_FALSE@MEMCPY_OBJ = $(lpfx)memcpy.o
-@HAVE_ARMV7A_TRUE@@OPT_SIZE_FALSE@MEMCPY_OBJ = $(lpfx)memcpy.o
+@HAVE_ARMV7A_FALSE@@HAVE_ARMV7M_FALSE@@HAVE_ARMV8A_FALSE@@OPT_SIZE_FALSE@MEMCPY_OBJ = 
+@HAVE_ARMV7A_FALSE@@HAVE_ARMV7M_TRUE@@HAVE_ARMV8A_FALSE@@OPT_SIZE_FALSE@MEMCPY_OBJ = $(lpfx)memcpy.o
+@HAVE_ARMV7A_TRUE@@HAVE_ARMV8A_FALSE@@OPT_SIZE_FALSE@MEMCPY_OBJ = $(lpfx)memcpy.o
+@HAVE_ARMV8A_TRUE@@OPT_SIZE_FALSE@MEMCPY_OBJ = $(lpfx)memcpy.o
 @OPT_SIZE_TRUE@MEMCPY_OBJ = 
 lib_a_SOURCES = setjmp.S access.c strcmp.S strcpy.c \
                $(MEMCPY_SRC) $(MEMCHR_SRC) $(STRLEN_SRC) \
index 48551009c8badac7c9ac60350bd3180f14f51346..9f82c7f22844de2c1a514f3d318720c7f56b0d5b 100755 (executable)
@@ -567,6 +567,8 @@ LIBOBJS
 CFLAGS
 HAVE_ARMV7M_FALSE
 HAVE_ARMV7M_TRUE
+HAVE_ARMV8A_FALSE
+HAVE_ARMV8A_TRUE
 HAVE_ARMV7A_FALSE
 HAVE_ARMV7A_TRUE
 HAVE_ARMV7_FALSE
@@ -3589,6 +3591,48 @@ else
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether armv8a processor is supported" >&5
+$as_echo_n "checking whether armv8a processor is supported... " >&6; }
+if ${acnewlib_cv_armv8a_processor+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.c <<EOF
+
+#if defined (__ARM_ARCH_8A__) && defined (__ARM_FEATURE_UNALIGNED)
+  #define HAVE_ARMV8A
+ #else
+  #error "ARMV8A is not supported."
+#endif
+int main () {
+  return 0;
+}
+EOF
+if { ac_try='${CC} $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c
+                                                       1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+then
+  acnewlib_cv_armv8a_processor=yes;
+else
+  acnewlib_cv_armv8a_processor=no;
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acnewlib_cv_armv8a_processor" >&5
+$as_echo "$acnewlib_cv_armv8a_processor" >&6; }
+
+ if test x"$acnewlib_cv_armv8a_processor" = x"yes"; then
+  HAVE_ARMV8A_TRUE=
+  HAVE_ARMV8A_FALSE='#'
+else
+  HAVE_ARMV8A_TRUE='#'
+  HAVE_ARMV8A_FALSE=
+fi
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether armv7m processor is supported" >&5
 $as_echo_n "checking whether armv7m processor is supported... " >&6; }
 if ${acnewlib_cv_armv7m_processor+:} false; then :
@@ -3837,6 +3881,10 @@ if test -z "${HAVE_ARMV7A_TRUE}" && test -z "${HAVE_ARMV7A_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_ARMV7A\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${HAVE_ARMV8A_TRUE}" && test -z "${HAVE_ARMV8A_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_ARMV8A\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${HAVE_ARMV7M_TRUE}" && test -z "${HAVE_ARMV7M_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_ARMV7M\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
index edf92223852ebf9f97f9e281a2ca94ee5b30c3c0..69fbe2b0396b7536db3f10f1aa88205d649c6cb3 100644 (file)
@@ -111,6 +111,31 @@ rm -f conftest*])
 
 AM_CONDITIONAL(HAVE_ARMV7A, test x"$acnewlib_cv_armv7a_processor" = x"yes")
 
+dnl Check for whether ARM_ARCH_8A is defined.
+AC_CACHE_CHECK(whether armv8a processor is supported,
+              acnewlib_cv_armv8a_processor, [dnl
+cat > conftest.c <<EOF
+
+#if defined (__ARM_ARCH_8A__) && defined (__ARM_FEATURE_UNALIGNED)
+  #define HAVE_ARMV8A
+ #else
+  #error "ARMV8A is not supported."
+#endif
+int main () {
+  return 0;
+}
+EOF
+if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c
+                                                       1>&AS_MESSAGE_LOG_FD])
+then
+  acnewlib_cv_armv8a_processor=yes;
+else
+  acnewlib_cv_armv8a_processor=no;
+fi
+rm -f conftest*])
+
+AM_CONDITIONAL(HAVE_ARMV8A, test x"$acnewlib_cv_armv8a_processor" = x"yes")
+
 dnl Check for whether ARM_ARCH_7M is defined.
 AC_CACHE_CHECK(whether armv7m processor is supported,
               acnewlib_cv_armv7m_processor, [dnl
index 399752424e467a74a0a05c53c8a605744be48768..b1bab88bf00e4c1fe9ba5ea15ad5b5278c003b89 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 ARM Ltd
+ * Copyright (c) 2013-2015 ARM Ltd
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -40,7 +40,8 @@
      lib_a-memcpy.o to be generated.
   */
 
-#elif defined (__ARM_ARCH_7A__) && defined (__ARM_FEATURE_UNALIGNED)
+#elif (__ARM_ARCH >= 7 && __ARM_ARCH_PROFILE == 'A' \
+       && defined (__ARM_FEATURE_UNALIGNED))
 #include "memcpy-armv7a.S"
 
 #elif defined (__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
This page took 0.081052 seconds and 5 git commands to generate.