From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yerden Zhumabekov Subject: Re: [PATCH 1/3 v2] librte_hash: Fix unsupported instruction `crc32' in i686 platform Date: Thu, 5 Mar 2015 23:02:45 +0600 Message-ID: <54F88C35.3070602@sts.kz> References: <1425561339-13300-2-git-send-email-michael.qiu@intel.com> <1425574530-16019-1-git-send-email-michael.qiu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable To: Michael Qiu , Return-path: In-Reply-To: <1425574530-16019-1-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Acked-by: Yerden Zhumabekov 05.03.2015 22:55, 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 > --- > v2 --> v1: > Make crc32 instruction only works in X86 platform > lib/librte_hash/rte_hash_crc.h | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_= crc.h > index d28bb2a..c0a789e 100644 > --- a/lib/librte_hash/rte_hash_crc.h > +++ b/lib/librte_hash/rte_hash_crc.h > @@ -364,6 +364,7 @@ crc32c_2words(uint64_t data, uint32_t init_val) > return crc; > } > =20 > +#if defined RTE_ARCH_I686 || defined RTE_ARCH_X86_64 > static inline uint32_t > crc32c_sse42_u32(uint32_t data, uint32_t init_val) > { > @@ -373,7 +374,9 @@ crc32c_sse42_u32(uint32_t data, uint32_t init_val) > : [data] "rm" (data)); > return init_val; > } > +#endif > =20 > +#ifdef RTE_ARCH_X86_64 > static inline uint32_t > crc32c_sse42_u64(uint64_t data, uint64_t init_val) > { > @@ -383,7 +386,9 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val) > : [data] "rm" (data)); > return init_val; > } > +#endif > =20 > +#if defined RTE_ARCH_I686 || defined RTE_ARCH_X86_64 > static inline uint32_t > crc32c_sse42_u64_mimic(uint64_t data, uint64_t init_val) > { > @@ -397,6 +402,7 @@ crc32c_sse42_u64_mimic(uint64_t data, uint64_t init= _val) > init_val =3D crc32c_sse42_u32(d.u32[1], init_val); > return init_val; > } > +#endif > =20 > #define CRC32_SW (1U << 0) > #define CRC32_SSE42 (1U << 1) > @@ -455,8 +461,10 @@ rte_hash_crc_init_alg(void) > static inline uint32_t > rte_hash_crc_4byte(uint32_t data, uint32_t init_val) > { > +#if defined RTE_ARCH_I686 || defined RTE_ARCH_X86_64 > if (likely(crc32_alg & CRC32_SSE42)) > return crc32c_sse42_u32(data, init_val); > +#endif > =20 > return crc32c_1word(data, init_val); > } > @@ -476,11 +484,15 @@ rte_hash_crc_4byte(uint32_t data, uint32_t init_v= al) > 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 defined RTE_ARCH_I686 || defined RTE_ARCH_X86_64 > if (likely(crc32_alg & CRC32_SSE42)) > return crc32c_sse42_u64_mimic(data, init_val); > +#endif > =20 > return crc32c_2words(data, init_val); > } --=20 Sincerely, Yerden Zhumabekov State Technical Service Astana, KZ