[PATCH] <bits/platform/x86.h>: Correct x86_cpu_TBM
H.J. Lu
hjl.tools@gmail.com
Thu Feb 17 00:10:44 GMT 2022
On Mon, Feb 22, 2021 at 1:49 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu via Libc-alpha:
>
> >> Checking HAS_CPU_FEATURE (TBM):
> >> HAS_CPU_FEATURE (TBM): 0
> >> cpuinfo (tbm): 1
> >> *** failure ***
> >
> > Please try th patch enclosed here.
> >
> >> 2 differences between /proc/cpuinfo and glibc code.
> >>
> >
> > Thanks.
> >
> > H.J.
> > ---
> > x86_cpu_TBM should be x86_cpu_index_80000001_ecx + 21.
> > ---
> > sysdeps/x86/bits/platform/x86.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/sysdeps/x86/bits/platform/x86.h b/sysdeps/x86/bits/platform/x86.h
> > index 8f423ae721..dd59224b7f 100644
> > --- a/sysdeps/x86/bits/platform/x86.h
> > +++ b/sysdeps/x86/bits/platform/x86.h
> > @@ -244,7 +244,7 @@ enum
> > x86_cpu_XOP = x86_cpu_index_80000001_ecx + 11,
> > x86_cpu_LWP = x86_cpu_index_80000001_ecx + 15,
> > x86_cpu_FMA4 = x86_cpu_index_80000001_ecx + 16,
> > - x86_cpu_TBM = x86_cpu_index_80000001_ecx + 20,
> > + x86_cpu_TBM = x86_cpu_index_80000001_ecx + 21,
> >
> > x86_cpu_index_80000001_edx
> > = (CPUID_INDEX_80000001 * 8 * 4 * sizeof (unsigned int)
>
> I've verified this works works on a system with tbm in /proc/cpuinfo.
> the bit offset also matches what's documented elsewhere. Looks good to
> me.
>
> Thanks,
> Florian
>
I am backporting this to 2.33 branch.
--
H.J.
More information about the Libc-alpha
mailing list