From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgw.gov.kz (mgw.gov.kz [89.218.88.242]) by dpdk.org (Postfix) with ESMTP id 25FB15A74 for ; Thu, 5 Mar 2015 17:11:59 +0100 (CET) Received: from mgw.gov.kz (mx.ctsat.kz [178.89.4.95]) by mgw.gov.kz with ESMTP id t25GBvst016306-t25GBvsu016306; Thu, 5 Mar 2015 22:11:58 +0600 Received: from EXCASHUB1.rgp.local (192.168.40.51) by EdgeForefront.rgp.local (192.168.40.59) with Microsoft SMTP Server (TLS) id 14.2.247.3; Thu, 5 Mar 2015 22:10:17 +0600 Received: from [192.168.35.15] (192.168.35.15) by excashub1.rgp.local (192.168.40.48) with Microsoft SMTP Server (TLS) id 14.2.247.3; Thu, 5 Mar 2015 22:12:01 +0600 Message-ID: <54F87FEE.8090408@sts.kz> Date: Thu, 5 Mar 2015 22:10:22 +0600 From: Yerden Zhumabekov User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Michael Qiu , References: <1425561339-13300-1-git-send-email-michael.qiu@intel.com> <1425561339-13300-2-git-send-email-michael.qiu@intel.com> In-Reply-To: <1425561339-13300-2-git-send-email-michael.qiu@intel.com> Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [192.168.35.15] X-FEAS-SYSTEM-WL: e_zhumabekov@sts.kz Subject: Re: [dpdk-dev] [PATCH 1/3] librte_hash: Fix unsupported instruction `crc32' in i686 platform 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: Thu, 05 Mar 2015 16:11:59 -0000 Hi Michael, Thanks for this patch, in fact I didn't try to compile it on i686 when developing original software fallback for CRC32. I think if we want to make code compilable as wide as possible, we should compile out all SSE4.2 instructions. As to the patch, we may compile out 'crc32l' instruction emitting code if the arch is not x86. This concerns two functions: crc32c_sse42_u32() and crc32c_sse42_u64_mimic(). The compile check might be something like this: #if defined(RTE_ARCH_I686) || defined(RTE_ARCH_X86_64) #endif Otherwise, the patch looks good. 05.03.2015 19:15, Michael Qiu =EF=E8=F8=E5=F2: > CC rte_hash.o > Error: unsupported instruction `crc32' > > The root cause is that i686 platform does not support 'crc32q' > Need make it only available in x86_64 platform > > Signed-off-by: Michael Qiu > --- > lib/librte_hash/rte_hash_crc.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_= crc.h > index d28bb2a..4e9546f 100644 > --- a/lib/librte_hash/rte_hash_crc.h > +++ b/lib/librte_hash/rte_hash_crc.h > @@ -374,6 +374,7 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val) > return init_val; > } > =20 > +#ifdef RTE_ARCH_X86_64 > static inline uint32_t > crc32c_sse42_u64(uint64_t data, uint64_t init_val) > { > @@ -383,6 +384,7 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val) > : [data] "rm" (data)); > return init_val; > } > +#endif > =20 > static inline uint32_t > crc32c_sse42_u64_mimic(uint64_t data, uint64_t init_val) > @@ -476,8 +478,10 @@ rte_hash_crc_4byte(uint32_t data, uint32_t init_va= l) > static inline uint32_t > rte_hash_crc_8byte(uint64_t data, uint32_t init_val) > { > +#ifdef RTE_ARCH_X86_64 > if (likely(crc32_alg =3D=3D CRC32_SSE42_x64)) > return crc32c_sse42_u64(data, init_val); > +#endif > =20 > if (likely(crc32_alg & CRC32_SSE42)) > return crc32c_sse42_u64_mimic(data, init_val); --=20 Sincerely, Yerden Zhumabekov State Technical Service Astana, KZ