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: Joseph Myers <joseph at codesourcery dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 18 Aug 2015 10:30:41 -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> <CAMe9rOq52Vu1M7Z1kLA6qJBoHFSN9Vu9fmF7SHZTXjOXv+6reA at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1508181612340 dot 17603 at digraph dot polyomino dot org dot uk>
On Tue, Aug 18, 2015 at 9:16 AM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Tue, 18 Aug 2015, H.J. Lu wrote:
>
>> My change is based on sysdeps/x86/bits/string.h and
>> sysdeps/x86/bits/byteswap.h. None of them check
>> __i586__ nor __i686__.
>
> Maybe
>
> (a) there should be a new (installed) bits/ header for x86, say
> bits/x86-arch.h, that defines __x86_arch to 4, 5 or 6 depending on such
> macros, so the logic doesn't need duplicating;
>
We can add cpu-features.h to installed header to provide both
run-time and compile-time CPU feature detection.
--
H.J.