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 ED9EF7E18 for ; Wed, 19 Nov 2014 12:49:28 +0100 (CET) Received: from mgw.gov.kz (mx.ctsat.kz [178.89.4.95]) by mgw.gov.kz with ESMTP id sAJBxqlU002917-sAJBxqlW002917 (version=TLSv1.0 cipher=AES128-SHA bits=128 verify=NO); Wed, 19 Nov 2014 17:59:52 +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:59:40 +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:59:52 +0600 Message-ID: <546C862B.3090901@sts.kz> Date: Wed, 19 Nov 2014 17:59:39 +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: "Ananyev, Konstantin" , "Richardson, Bruce" , Neil Horman References: <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> <20141119113408.GA10004@hmsreliant.think-freely.org> <20141119113827.GB2604@bricha3-MOBL3> <2601191342CEEE43887BDE71AB977258213B6C4D@IRSMSX105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB977258213B6C4D@IRSMSX105.ger.corp.intel.com> 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:49:29 -0000 19.11.2014 17:50, Ananyev, Konstantin пишет: > > As I remember with gcc & icc it is possible to specify tht you'd like to compile that particular function > for different target. > From https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html: > "target > The target attribute is used to specify that a function is to be compiled with different target options than specified on the command line. This can be used for instance to have functions compiled with a different ISA (instruction set architecture) than the default. You can also use the ‘#pragma GCC target’ pragma to set more than one function to be compiled with specific target options. See Function Specific Option Pragmas, for details about the ‘#pragma GCC target’ pragma. > For instance on a 386, you could compile one function with target("sse4.1,arch=core2") and another with target("sse4a,arch=amdfam10"). This is equivalent to compiling the first function with -msse4.1 and -march=core2 options, and the second function with -msse4a and -march=amdfam10 options. It is up to the user to make sure that a function is only invoked on a machine that supports the particular ISA it is compiled for (for example by using cpuid on 386 to determine what feature bits and architecture family are used). > > int core2_func (void) __attribute__ ((__target__ ("arch=core2"))); > int sse3_func (void) __attribute__ ((__target__ ("sse3"))); > You can either use multiple strings to specify multiple options, or separate the options with a comma (‘,’). > > The target attribute is presently implemented for i386/x86_64, PowerPC, and Nios II targets only. The options supported are specific to each target. > > On the 386, the following options are allowed: > ... > ‘sse4.2’ > ‘no-sse4.2’" > > Wouldn't that suit your purposes? > Probably you can even keep your function inline with that approach. Very nice. Thank you. I will test it. -- Sincerely, Yerden Zhumabekov State Technical Service Astana, KZ