From patchwork Mon Oct 26 16:37:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Viktorin X-Patchwork-Id: 8027 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id C45698E83; Mon, 26 Oct 2015 17:39:42 +0100 (CET) Received: from wes1-so1.wedos.net (wes1-so1.wedos.net [46.28.106.15]) by dpdk.org (Postfix) with ESMTP id 42C478D85 for ; Mon, 26 Oct 2015 17:39:31 +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 3nl21v0c9Hz53d; Mon, 26 Oct 2015 17:39:31 +0100 (CET) From: Jan Viktorin To: Thomas Monjalon , David Hunt , dev@dpdk.org Date: Mon, 26 Oct 2015 17:37:31 +0100 Message-Id: <1445877458-31052-10-git-send-email-viktorin@rehivetech.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1445877458-31052-1-git-send-email-viktorin@rehivetech.com> References: <1445877458-31052-1-git-send-email-viktorin@rehivetech.com> Subject: [dpdk-dev] [PATCH v2 09/16] 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: , 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 --- .../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