From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v7 1/3] eal/x86: run-time dispatch over memcpy Date: Fri, 13 Oct 2017 09:21:52 +0200 Message-ID: <1709550.5v5ZG7JxHL@xps> References: <1507157911-8702-1-git-send-email-xiaoyun.li@intel.com> <35071535.8NSjKInSoG@xps> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, "Ananyev, Konstantin" , "Richardson, Bruce" , "Lu, Wenzhuo" , "Zhang, Helin" To: "Li, Xiaoyun" Return-path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 203EF1B614 for ; Fri, 13 Oct 2017 09:21:54 +0200 (CEST) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 13/10/2017 03:06, Li, Xiaoyun: > Hi > Sorry for the late reply. I took AL last 3 days. > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > 05/10/2017 14:33, Xiaoyun Li: > > > +/** > > > + * Macro for copying unaligned block from one location to another > > > +with constant load offset, > > > + * 47 bytes leftover maximum, > > > + * locations should not overlap. > > > + * Requirements: > > > + * - Store is aligned > > > + * - Load offset is , which must be immediate value within > > > +[1, 15] > > > + * - For , make sure bit backwards & <16 - offset> bit > > > +forwards are available for loading > > > + * - , , must be variables > > > + * - __m128i ~ must be pre-defined */ #define > > > +MOVEUNALIGNED_LEFT47_IMM(dst, src, len, > > > > Naive question: > > Is there a real benefit of using a macro compared to a static inline function > > optimized by a modern compiler? > > > The macro is in the existing DPDK codes. I didn't touch it. I just change the file name and the function name to rte_memcpy_internal. > So I am not clear about if there is real benefit. > In my opinion, I think it is the same as static inline function. > > Do I need to change them to inline function? In this patch, it appears as a new macro. If you can, inline function is cleaner for the new one. > > Anyway, if you are doing a new version, please reduce lines length and fix > > the indent from spaces to tabs. > > > They are original DPDK codes so I didn't touch them. > But in next version, I will fix them. Just to be sure: we are talking about fixing checkpatch warnings only for the code added, changed or moved. Thanks