summaryrefslogtreecommitdiffstats
path: root/newlib/libc/machine/arm/memcpy.S
diff options
context:
space:
mode:
authorMarcus Shawcroft <marcus.shawcroft@arm.com>2015-10-30 15:14:53 +0000
committerMarcus Shawcroft <marcus.shawcroft@arm.com>2015-11-06 15:40:31 +0000
commit72be1dead45eb48d3f63b944ff0082952d30d105 (patch)
treedcd8f156a5269e6343f27e027ff81233171b2bef /newlib/libc/machine/arm/memcpy.S
parentcdb1ebe10729457093fce4df92ae1cd185c854f2 (diff)
downloadcygnal-72be1dead45eb48d3f63b944ff0082952d30d105.tar.gz
cygnal-72be1dead45eb48d3f63b944ff0082952d30d105.tar.bz2
cygnal-72be1dead45eb48d3f63b944ff0082952d30d105.zip
Reorganize memcpy selection.
This patch cleans up the auto configury mechanism used to select different implementations of memcpy for various architecture versions. The approach here is to remove the selection of memcpy within automake and instead use complimentary logic in memcpy-stub.c and memcpy.S to choose between the generic memcpy.c implemenation or one of the architecture specific memcpy*.S implemenations. Regressed for armv7-a armv5 armv8-a, correct selection of memcpy implementation by manual inspection of a test program built for these three architectures. This revised patch flips the remaining preprocessor logic in memcpy-stub.c to use ACLE defines as requested in the previous review and removes the now disused HAVE_ARMV7A and HAVE_ARMV8A configure.in support.
Diffstat (limited to 'newlib/libc/machine/arm/memcpy.S')
-rw-r--r--newlib/libc/machine/arm/memcpy.S23
1 files changed, 9 insertions, 14 deletions
diff --git a/newlib/libc/machine/arm/memcpy.S b/newlib/libc/machine/arm/memcpy.S
index b1bab88bf..d9d5810a7 100644
--- a/newlib/libc/machine/arm/memcpy.S
+++ b/newlib/libc/machine/arm/memcpy.S
@@ -26,27 +26,22 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#if defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)
- /* Leave this field blank. So the memcpy() is not defined, and this will
- automatically pull in the default C definition of memcpy() from
- ../../string/memcpy.c. No need to include this file explicitely.
- The lib_a-memcpy.o will not be generated, so it won't replace the default
- lib_a-memcpy.o which is generated by ../../string/memcpy.c.
- See the commands in configure.in and Makefile.am for more details.
+/* The structure of the following #if #else #endif conditional chain
+ must match the chain in memcpy-stub.c. */
+
+#include "acle-compat.h"
- However, if we need to rewrite this function to be more efficient, we
- can add the corresponding assembly code into this field and change the
- commands in configure.in and Makefile.am to allow the corresponding
- lib_a-memcpy.o to be generated.
- */
+#if defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)
+ /* Defined in memcpy-stub.c. */
#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__)
+#elif __ARM_ARCH >= 7 && __ARM_ARCH_PROFILE == 'M'
#include "memcpy-armv7m.S"
#else
- /* Leave this filed blank. See the commands above. */
+ /* Defined in memcpy-stub.c. */
+
#endif