This is the mail archive of the glibc-bugs@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]

[Bug dynamic-link/19762] HAS_CPU_FEATURE/HAS_ARCH_FEATURE are easy to misuse


https://sourceware.org/bugzilla/show_bug.cgi?id=19762

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  6aa3e97e2530f9917f504eb4146af119a3f27229 (commit)
      from  f8e9c4d30c28b8815e65a391416e8b15d2e7cbb8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6aa3e97e2530f9917f504eb4146af119a3f27229

commit 6aa3e97e2530f9917f504eb4146af119a3f27229
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Mar 10 05:26:46 2016 -0800

    Add _arch_/_cpu_ to index_*/bit_* in x86 cpu-features.h

    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.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                       |   22 +++
 sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h |    8 +-
 sysdeps/x86/cpu-features.c                      |   80 +++++----
 sysdeps/x86/cpu-features.h                      |  222 ++++++++++++-----------
 4 files changed, 181 insertions(+), 151 deletions(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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