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: Joseph Myers <joseph at codesourcery dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 18 Aug 2015 20:21:15 +0000
- 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> <CAMe9rOoj5iqxejDxui7AvWtQ1nvwxemHkxvDrMzk9NcpECZ+yQ at mail dot gmail dot com>
On Tue, 18 Aug 2015, H.J. Lu wrote:
> 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.
What I'm suggesting requires a header that does not define or use any
identifiers outside of the implementation namespace, so that it can be
included by other installed headers. This is substantially different from
cpu-features.h.
--
Joseph S. Myers
joseph@codesourcery.com