From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wes1-so1.wedos.net (wes1-so1.wedos.net [46.28.106.15]) by dpdk.org (Postfix) with ESMTP id C983B8DA2 for ; Tue, 27 Oct 2015 20:16:15 +0100 (CET) Received: from pcviktorin.fit.vutbr.cz (pcviktorin.fit.vutbr.cz [147.229.13.147]) by wes1-so1.wedos.net (Postfix) with ESMTPSA id 3nljSH4PcDz4xc; Tue, 27 Oct 2015 20:16:15 +0100 (CET) From: Jan Viktorin To: dev@dpdk.org, David Hunt , David Marchand , "Ananyev, Konstantin" Date: Tue, 27 Oct 2015 20:13:41 +0100 Message-Id: <1445973229-22058-10-git-send-email-viktorin@rehivetech.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1445973229-22058-1-git-send-email-viktorin@rehivetech.com> References: <1445877458-31052-1-git-send-email-viktorin@rehivetech.com> <1445973229-22058-1-git-send-email-viktorin@rehivetech.com> Subject: [dpdk-dev] [PATCH v3 09/17] eal/arm: use vector memcpy only when NEON is enabled X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2015 19:16:15 -0000 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 --- .../common/include/arch/arm/rte_memcpy.h | 59 +++++++++++++++++++++- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/include/arch/arm/rte_memcpy.h b/lib/librte_eal/common/include/arch/arm/rte_memcpy.h index ac885e9..75e8bda 100644 --- a/lib/librte_eal/common/include/arch/arm/rte_memcpy.h +++ b/lib/librte_eal/common/include/arch/arm/rte_memcpy.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) { @@ -263,6 +266,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.1