From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Viktorin Subject: [PATCH v6 08/15] eal/arm: use vector memcpy only when NEON is enabled Date: Tue, 3 Nov 2015 00:47:21 +0100 Message-ID: <1446508048-16744-9-git-send-email-viktorin@rehivetech.com> References: <1446508048-16744-1-git-send-email-viktorin@rehivetech.com> Cc: dev@dpdk.org To: david.marchand@6wind.com, David Hunt , Thomas Monjalon , Jerin Jacob Return-path: Received: from wes1-so1.wedos.net (wes1-so1.wedos.net [46.28.106.15]) by dpdk.org (Postfix) with ESMTP id C7EC28E7D for ; Tue, 3 Nov 2015 00:50:21 +0100 (CET) In-Reply-To: <1446508048-16744-1-git-send-email-viktorin@rehivetech.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The GCC can be configured to avoid using NEON extensions. For that purpose, we provide just the memcpy implementation of the rte_memcpy. Based on the patch by David Hunt and Armuta Zende: lib: added support for armv7 architecture Signed-off-by: Jan Viktorin Signed-off-by: Amruta Zende Signed-off-by: David Hunt --- v5: prepare for applying ARMv8 --- .../common/include/arch/arm/rte_memcpy_32.h | 59 +++++++++++++++++++++- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/include/arch/arm/rte_memcpy_32.h b/lib/librte_eal/common/include/arch/arm/rte_memcpy_32.h index 11f8241..df47c0d 100644 --- a/lib/librte_eal/common/include/arch/arm/rte_memcpy_32.h +++ b/lib/librte_eal/common/include/arch/arm/rte_memcpy_32.h @@ -35,8 +35,6 @@ #include #include -/* ARM NEON Intrinsics are used to copy data */ -#include #ifdef __cplusplus extern "C" { @@ -44,6 +42,11 @@ extern "C" { #include "generic/rte_memcpy.h" +#ifdef __ARM_NEON_FP + +/* ARM NEON Intrinsics are used to copy data */ +#include + static inline void rte_mov16(uint8_t *dst, const uint8_t *src) { @@ -272,6 +275,58 @@ rte_memcpy_func(void *dst, const void *src, size_t n) return ret; } +#else + +static inline void +rte_mov16(uint8_t *dst, const uint8_t *src) +{ + memcpy(dst, src, 16); +} + +static inline void +rte_mov32(uint8_t *dst, const uint8_t *src) +{ + memcpy(dst, src, 32); +} + +static inline void +rte_mov48(uint8_t *dst, const uint8_t *src) +{ + memcpy(dst, src, 48); +} + +static inline void +rte_mov64(uint8_t *dst, const uint8_t *src) +{ + memcpy(dst, src, 64); +} + +static inline void +rte_mov128(uint8_t *dst, const uint8_t *src) +{ + memcpy(dst, src, 128); +} + +static inline void +rte_mov256(uint8_t *dst, const uint8_t *src) +{ + memcpy(dst, src, 256); +} + +static inline void * +rte_memcpy(void *dst, const void *src, size_t n) +{ + return memcpy(dst, src, n); +} + +static inline void * +rte_memcpy_func(void *dst, const void *src, size_t n) +{ + return memcpy(dst, src, n); +} + +#endif /* __ARM_NEON_FP */ + #ifdef __cplusplus } #endif -- 2.6.2