Hi Sorry for the late reply. I took AL last 3 days. > -----Original Message----- > From: Thomas Monjalon [mailto:tho...@monjalon.net] > Sent: Tuesday, October 10, 2017 01:47 > To: Li, Xiaoyun <xiaoyun...@intel.com> > Cc: dev@dpdk.org; Ananyev, Konstantin <konstantin.anan...@intel.com>; > Richardson, Bruce <bruce.richard...@intel.com>; Lu, Wenzhuo > <wenzhuo...@intel.com>; Zhang, Helin <helin.zh...@intel.com> > Subject: Re: [dpdk-dev] [PATCH v7 1/3] eal/x86: run-time dispatch over > memcpy > > 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 <offset>, which must be immediate value within > > +[1, 15] > > + * - For <src>, make sure <offset> bit backwards & <16 - offset> bit > > +forwards are available for loading > > + * - <dst>, <src>, <len> must be variables > > + * - __m128i <xmm0> ~ <xmm8> 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? > 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. Best Regards Xiaoyun Li > Thank you