qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 1/2] configure: detect ifunc and avx2 attribu


From: Li, Liang Z
Subject: Re: [Qemu-devel] [PATCH v4 1/2] configure: detect ifunc and avx2 attribute
Date: Wed, 20 Jan 2016 10:43:05 +0000

> On 20/01/2016 10:05, Liang Li wrote:
> > Detect if the compiler can support the ifun and avx2, if so, set
> > CONFIG_AVX2_OPT which will be used to turn on the avx2 instruction
> > optimization.
> >
> > Signed-off-by: Liang Li <address@hidden>
> > ---
> >  configure | 20 ++++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> >
> > diff --git a/configure b/configure
> > index 44ac9ab..b7f4661 100755
> > --- a/configure
> > +++ b/configure
> > @@ -310,6 +310,7 @@ smartcard=""
> >  libusb=""
> >  usb_redir=""
> >  opengl=""
> > +avx2_opt=""
> >  zlib="yes"
> >  lzo=""
> >  snappy=""
> > @@ -1827,6 +1828,20 @@ EOF
> >  fi
> >
> >  ##########################################
> > +# avx2 optimization requirement check
> > +
> > +cat > $TMPC << EOF
> > +static void bar(void) {}
> 
> Might be nicer to use "void *" and return an actual function name:
> 
> static void bar(void) {}
> static void *bar_ifunc(void) { return (void *)bar; } void foo(void)
> __attribute__((ifunc("bar_ifunc")));
> 
> And also you probably should use "readelf --syms ... | grep IFUNC.*foo"
> to check that the attribute was not ignored.
> 
> Paolo
> 

Got it, will change in the next version.

Liang



reply via email to

[Prev in Thread] Current Thread [Next in Thread]