This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] Add _arch_/_cpu_ to index_*/bit_* in x86 cpu-features.h


> > --- a/sysdeps/x86_64/tst-audit10.c
> > +++ b/sysdeps/x86_64/tst-audit10.c
> > @@ -17,13 +17,13 @@
> >     <http://www.gnu.org/licenses/>.  */
> >  
> >  #include <cpuid.h>
> > -#include <cpu-features.h>
> >  
> >  int tst_audit10_aux (void);
> >  
> >  static int
> >  avx512_enabled (void)
> >  {
> > +#ifdef bit_AVX512F
> >    unsigned int eax, ebx, ecx, edx;
> >  
> >    if (__get_cpuid (1, &eax, &ebx, &ecx, &edx) == 0
> > @@ -38,6 +38,9 @@ avx512_enabled (void)
> >  
> >    /* Verify that ZMM, YMM and XMM states are enabled.  */
> >    return (eax & 0xe6) == 0xe6;
> > +#else
> > +  return 0;
> > +#endif
> >  }
> >  
> >  static int
> 
> I have committed this, after testing compilation with GCC 4.7 and GCC
> 5.3.  Bug 19860 mentions a second compilation error, which I did not
> see.  I'm waiting for details on that one, maybe it was a spurious issue.

It occurred to me later that having this use #ifdef HAVE_AVX512_SUPPORT
would be better.  That is, we expect a compiler that accepts -mavx512f
to provide a <cpuid.h> that defines bit_AVX512F.  If we have -mavx512f
support but somehow get a <cpuid.h> missing bit_AVX512F, that should be
a build error because the compiler installation is self-inconsistent.


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]