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 62B847E18 for ; Wed, 19 Nov 2014 12:25:42 +0100 (CET) Received: from mgw.gov.kz (mx.ctsat.kz [178.89.4.95]) by mgw.gov.kz with ESMTP id sAJBa54S032022-sAJBa54U032022 (version=TLSv1.0 cipher=AES128-SHA bits=128 verify=NO); Wed, 19 Nov 2014 17:36:05 +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; Wed, 19 Nov 2014 17:35:53 +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; Wed, 19 Nov 2014 17:36:05 +0600 Message-ID: <546C8097.6000509@sts.kz> Date: Wed, 19 Nov 2014 17:35:51 +0600 From: Yerden Zhumabekov User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Bruce Richardson , Neil Horman References: <1409724351-23786-1-git-send-email-e_zhumabekov@sts.kz> <20141118144138.GB32375@hmsreliant.think-freely.org> <546B607B.9030808@sts.kz> <20141118160005.GC32375@hmsreliant.think-freely.org> <546B7E2D.7050705@sts.kz> <20141118174619.GE32375@hmsreliant.think-freely.org> <20141118175226.GC5840@bricha3-MOBL3> <20141118213624.GF32375@hmsreliant.think-freely.org> <20141119101614.GA6532@bricha3-MOBL3> In-Reply-To: <20141119101614.GA6532@bricha3-MOBL3> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [192.168.35.15] X-FEAS-SYSTEM-WL: e_zhumabekov@sts.kz Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v4 3/5] hash: add fallback to software CRC32 implementation 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: Wed, 19 Nov 2014 11:25:42 -0000 19.11.2014 16:16, Bruce Richardson пишет: > On Tue, Nov 18, 2014 at 04:36:24PM -0500, Neil Horman wrote: >> an alternate option would be to not use the intrinsic, and craft some explicit >> __asm__ statement that executes the right sse42 instructions. That way the asm >> is directly emitted, without requiring the -msse42 flag at all, and it will just >> work in all the files that call it. >> > I really don't like that approach. I think using intrinsics is much more > maintainable. > static inline uint32_t crc32_sse42_u32(uint32_t data, uint32_t init_val) { /*··__asm__ volatile( ············"crc32l %[data], %[init_val];" ············: [init_val] "+r" (init_val) ············: [data] "rm" (data)); ····return init_val;*/ But wait, will __builtin_ia32_crc32si and __builtin_ia32_crc32di functions do the trick? ICC has them? What about prototyping functions and extracting their bodies to separate module? Does it break anything? -- Sincerely, Yerden Zhumabekov State Technical Service Astana, KZ