This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Define HAS_CPUID/HAS_I586/HAS_I686 from -march=
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 18 Aug 2015 09:08:32 -0700
- Subject: Re: [PATCH] Define HAS_CPUID/HAS_I586/HAS_I686 from -march=
- Authentication-results: sourceware.org; auth=none
- References: <20150817231005 dot GA24205 at intel dot com> <20150818143258 dot GM1584 at vapier> <CAMe9rOov73oYeEtXF3OjK62xmRcm60ptU_LRo99=40OrUwhrWw at mail dot gmail dot com> <20150818160232 dot GN1584 at vapier>
On Tue, Aug 18, 2015 at 9:02 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> On 18 Aug 2015 07:56, H.J. Lu wrote:
>> On Tue, Aug 18, 2015 at 7:32 AM, Mike Frysinger wrote:
>> > On 17 Aug 2015 16:10, H.J. Lu wrote:
>> >> +#ifdef __x86_64__
>> >> +# define HAS_CPUID 1
>> >> +#elif defined __pentium__
>> >> +# define HAS_CPUID 1
>> >> +# define HAS_I586 1
>> >> +# define HAS_I686 0
>> >> +#elif (defined __pentiumpro__ || defined __pentium4__ \
>> >> + || defined __nocona__ || defined __atom__ \
>> >> + || defined __core2__ || defined __corei7__ \
>> >> + || defined __corei7_avx__ || defined __core_avx2__ \
>> >> + || defined __nehalem__ || defined __sandybridge__ \
>> >> + || defined __haswell__ || defined __knl__ \
>> >> + || defined __bonnell__ || defined __silvermont__ \
>> >> + || defined __k6__ || defined __k8__ \
>> >> + || defined __athlon__ || defined __amdfam10__ \
>> >> + || defined __bdver1__ || defined __bdver2__ \
>> >> + || defined __bdver3__ || defined __bdver4__ \
>> >> + || defined __btver1__ || defined __btver2__)
>> >> +# define HAS_CPUID 1
>> >> +# define HAS_I586 1
>> >> +# define HAS_I686 1
>> >> +#else
>> >> +# define HAS_CPUID 0
>> >> +# define HAS_I586 0
>> >> +# define HAS_I686 0
>> >> +#endif
>> >
>> > why is testing for __i686__ & __i586__ unacceptable ?
>>
>> -march=haswell doesn't define __i686__ since __i686__ is
>> mapped to -mach=i686.
>
> that's not entirely accurate. i did check before posting, but it looks like
> the first two entries do set up i586 and i686 correctly (and i stopped after
> spot checking the first two). so i guess change __pentium__ to __i586__ and
> __pentiumpro__ to __i686__ ?
> -mike
My change is based on sysdeps/x86/bits/string.h and
sysdeps/x86/bits/byteswap.h. None of them check
__i586__ nor __i686__.
--
H.J.