From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yerden Zhumabekov Subject: Re: [PATCH v4 3/5] hash: add fallback to software CRC32 implementation Date: Wed, 19 Nov 2014 17:59:39 +0600 Message-ID: <546C862B.3090901@sts.kz> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Cc: "dev-VfR2kkLFssw@public.gmane.org" To: "Ananyev, Konstantin" , "Richardson, Bruce" , Neil Horman Return-path: In-Reply-To: <2601191342CEEE43887BDE71AB977258213B6C4D-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@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" 19.11.2014 17:50, Ananyev, Konstantin =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > As I remember with gcc & icc it is possible to specify tht you'd like t= o 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 compil= ed 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 =E2= =80=98#pragma GCC target=E2=80=99 pragma to set more than one function to= be compiled with specific target options. See Function Specific Option P= ragmas, for details about the =E2=80=98#pragma GCC target=E2=80=99 pragma= . > For instance on a 386, you could compile one function with target("sse4= .1,arch=3Dcore2") and another with target("sse4a,arch=3Damdfam10"). This = is equivalent to compiling the first function with -msse4.1 and -march=3D= core2 options, and the second function with -msse4a and -march=3Damdfam10= options. It is up to the user to make sure that a function is only invok= ed 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 architec= ture family are used). > > int core2_func (void) __attribute__ ((__target__ ("arch=3Dcor= e2"))); > int sse3_func (void) __attribute__ ((__target__ ("sse3"))); > You can either use multiple strings to specify multiple options, or sep= arate the options with a comma (=E2=80=98,=E2=80=99). > > The target attribute is presently implemented for i386/x86_64, PowerPC,= and Nios II targets only. The options supported are specific to each tar= get. > > On the 386, the following options are allowed: > ... > =E2=80=98sse4.2=E2=80=99 > =E2=80=98no-sse4.2=E2=80=99" > > 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. --=20 Sincerely, Yerden Zhumabekov State Technical Service Astana, KZ