]> git.ipfire.org Git - thirdparty/glibc.git/commit
x86: Correct index_cpu_LZCNT [BZ #23456]
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 29 Jul 2018 13:08:59 +0000 (06:08 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 29 Jul 2018 13:30:59 +0000 (06:30 -0700)
commita452341529ef0a952b576e20d3c7e3c48dcb8427
tree3aef3d0368da4f4c6d7a45a6f53aae49bcceaaa2
parent8623cfe300b4fe88e8b7343bb15829bfe4317609
x86: Correct index_cpu_LZCNT [BZ #23456]

cpu-features.h has

 #define bit_cpu_LZCNT (1 << 5)
 #define index_cpu_LZCNT COMMON_CPUID_INDEX_1
 #define reg_LZCNT

But the LZCNT feature bit is in COMMON_CPUID_INDEX_80000001:

Initial EAX Value: 80000001H
ECX Extended Processor Signature and Feature Bits:
Bit 05: LZCNT available

index_cpu_LZCNT should be COMMON_CPUID_INDEX_80000001, not
COMMON_CPUID_INDEX_1.  The VMX feature bit is in COMMON_CPUID_INDEX_1:

Initial EAX Value: 01H
Feature Information Returned in the ECX Register:
5 VMX

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
[BZ #23456]
* sysdeps/x86/cpu-features.h (index_cpu_LZCNT): Set to
COMMON_CPUID_INDEX_80000001.

(cherry picked from commit 65d87ade1ee6f3ac099105e3511bd09bdc24cf3f)
ChangeLog
NEWS
sysdeps/x86/cpu-features.h