This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/2] Add _arch_/_cpu_ to index_*/bit_* in x86 cpu-features.h
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Sun, 6 Mar 2016 07:46:49 -0800
- Subject: Re: [PATCH 1/2] Add _arch_/_cpu_ to index_*/bit_* in x86 cpu-features.h
- Authentication-results: sourceware.org; auth=none
- References: <1457049161-13783-1-git-send-email-hjl dot tools at gmail dot com>
On Thu, Mar 3, 2016 at 3:52 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> index_* and bit_* macros are used to access cpuid and feature arrays o
> struct cpu_features. It is very easy to use bits and indices of cpuid
> array on feature array, especially in assembly codes. For example,
> sysdeps/i386/i686/multiarch/bcopy.S has
>
> HAS_CPU_FEATURE (Fast_Rep_String)
>
> which should be
>
> HAS_ARCH_FEATURE (Fast_Rep_String)
>
> We change index_* and bit_* to index_cpu_*/index_arch_* and
> bit_cpu_*/bit_arch_* so that we can catch such error at build time.
>
> [BZ #19762]
> * sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h
> (EXTRA_LD_ENVVARS): Add _arch_ to index_*/bit_*.
> * sysdeps/x86/cpu-features.c (init_cpu_features): Likewise.
> * sysdeps/x86/cpu-features.h (bit_*): Renamed to ...
> (bit_arch_*): This for feature array.
> (bit_*): Renamed to ...
> (bit_cpu_*): This for cpu array.
> (index_*): Renamed to ...
> (index_arch_*): This for feature array.
> (index_*): Renamed to ...
> (index_cpu_*): This for cpu array.
> [__ASSEMBLER__] (HAS_FEATURE): Add and use field.
> [__ASSEMBLER__] (HAS_CPU_FEATURE)): Pass cpu to HAS_FEATURE.
> [__ASSEMBLER__] (HAS_ARCH_FEATURE)): Pass arch to HAS_FEATURE.
> [!__ASSEMBLER__] (HAS_CPU_FEATURE): Replace index_##name and
> bit_##name with index_cpu_##name and bit_cpu_##name.
> [!__ASSEMBLER__] (HAS_ARCH_FEATURE): Replace index_##name and
> bit_##name with index_arch_##name and bit_arch_##name.
Any comments? This change is almost mechanical. But it is
very useful to avoid typos.
--
H.J.