From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v5] arch/arm: optimization for memcpy on AArch64 Date: Fri, 12 Jan 2018 18:03:48 +0100 Message-ID: <3668269.EoJLONrpA4@xps> References: <1511768985-21639-1-git-send-email-herbert.guan@arm.com> <1515061208-27252-1-git-send-email-herbert.guan@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, jerin.jacob@caviumnetworks.com To: Herbert Guan Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 18DC52951 for ; Fri, 12 Jan 2018 18:04:18 +0100 (CET) In-Reply-To: <1515061208-27252-1-git-send-email-herbert.guan@arm.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, All the code is using ARM64, but the title suggests AArch64. What is the difference between AArch64 and ARM64 (and ARMv8)? 04/01/2018 11:20, Herbert Guan: > +/************************************** > + * Beginning of customization section > + **************************************/ > +#define RTE_ARM64_MEMCPY_ALIGN_MASK 0x0F > +#ifndef RTE_ARCH_ARM64_MEMCPY_STRICT_ALIGN > +/* Only src unalignment will be treaed as unaligned copy */ typo: treaed > +#define RTE_ARM64_MEMCPY_IS_UNALIGNED_COPY(dst, src) \ > + ((uintptr_t)(dst) & RTE_ARM64_MEMCPY_ALIGN_MASK) > +#else > +/* Both dst and src unalignment will be treated as unaligned copy */ > +#define RTE_ARM64_MEMCPY_IS_UNALIGNED_COPY(dst, src) \ > + (((uintptr_t)(dst) | (uintptr_t)(src)) & RTE_ARM64_MEMCPY_ALIGN_MASK) > +#endif > + > + > +/* > + * If copy size is larger than threshold, memcpy() will be used. > + * Run "memcpy_perf_autotest" to determine the proper threshold. > + */ > +#define RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD ((size_t)(0xffffffff)) > +#define RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD ((size_t)(0xffffffff)) > + > +/* > + * The logic of USE_RTE_MEMCPY() can also be modified to best fit platform. > + */ > +#define USE_RTE_MEMCPY(dst, src, n) \ > +((!RTE_ARM64_MEMCPY_IS_UNALIGNED_COPY(dst, src) && \ > +n <= RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD) \ > +|| (RTE_ARM64_MEMCPY_IS_UNALIGNED_COPY(dst, src) && \ > +n <= RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD)) > + > +/************************************** > + * End of customization section > + **************************************/ Modifying the code to asjust the platform is not easy for deployment. Can we move some customization variables inside the configuration file?