V9 [PATCH] x86: Support usable check for all CPU features

H.J. Lu hjl.tools@gmail.com
Tue Jul 7 11:46:08 GMT 2020


On Tue, Jul 7, 2020 at 4:18 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu:
>
> > Good point.  Here is the updated patch to only copy known bits.
>
> I see a build failure.  What other patches do I need to apply before
> this one?

Here is the updated patch.

> In file included from ../sysdeps/x86/ldsodefs.h:24,
>                  from ../sysdeps/gnu/ldsodefs.h:46,
>                  from ../sysdeps/unix/sysv/linux/ldsodefs.h:25,
>                  from ../sysdeps/x86/init-arch.h:21,
>                  from ../sysdeps/x86/cacheinfo.c:26:
> ../sysdeps/x86/cacheinfo.c: In function ‘init_cacheinfo’:
> ../sysdeps/x86/cpu-features.h:123:20: error: ‘index_arch_AVX512F_Usable’ undeclared (first use in this function)
>   123 |   ((ptr->preferred[index_arch_##name] & bit_arch_##name) != 0)
>       |                    ^~~~~~~~~~~
> ../sysdeps/x86/cpu-features.h:143:3: note: in expansion of macro ‘CPU_FEATURE_PREFERRED_P’
>   143 |   CPU_FEATURE_PREFERRED_P (ptr, name)
>       |   ^~~~~~~~~~~~~~~~~~~~~~~
> ../sysdeps/x86/cacheinfo.c:886:7: note: in expansion of macro ‘CPU_FEATURES_ARCH_P’
>   886 |   if (CPU_FEATURES_ARCH_P (cpu_features, AVX512F_Usable)
>       |       ^~~~~~~~~~~~~~~~~~~
> ../sysdeps/x86/cpu-features.h:123:20: note: each undeclared identifier is reported only once for each function it appears in
>   123 |   ((ptr->preferred[index_arch_##name] & bit_arch_##name) != 0)
>       |                    ^~~~~~~~~~~
> ../sysdeps/x86/cpu-features.h:143:3: note: in expansion of macro ‘CPU_FEATURE_PREFERRED_P’
>   143 |   CPU_FEATURE_PREFERRED_P (ptr, name)
>       |   ^~~~~~~~~~~~~~~~~~~~~~~
> ../sysdeps/x86/cacheinfo.c:886:7: note: in expansion of macro ‘CPU_FEATURES_ARCH_P’
>   886 |   if (CPU_FEATURES_ARCH_P (cpu_features, AVX512F_Usable)
>       |       ^~~~~~~~~~~~~~~~~~~
> ../sysdeps/x86/cpu-features.h:123:41: error: ‘bit_arch_AVX512F_Usable’ undeclared (first use in this function)
>   123 |   ((ptr->preferred[index_arch_##name] & bit_arch_##name) != 0)
>       |                                         ^~~~~~~~~
> ../sysdeps/x86/cpu-features.h:143:3: note: in expansion of macro ‘CPU_FEATURE_PREFERRED_P’
>   143 |   CPU_FEATURE_PREFERRED_P (ptr, name)
>       |   ^~~~~~~~~~~~~~~~~~~~~~~
> ../sysdeps/x86/cacheinfo.c:886:7: note: in expansion of macro ‘CPU_FEATURES_ARCH_P’
>   886 |   if (CPU_FEATURES_ARCH_P (cpu_features, AVX512F_Usable)
>       |       ^~~~~~~~~~~~~~~~~~~
>
> I'm particularly interested in the size of the data structure.
>

With -O2 -g, I got

   text    data     bss     dec     hex filename
1783714   20576   16168 1820458 1bc72a new libc.so
1783858   20592   16176 1820626 1bc7d2 old libc.so
 164426    7184     376 171986   29fd2 new ld.so
 164930    7088     376 172394   2a16a old ld.so

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-x86-Support-usable-check-for-all-CPU-features.patch
Type: text/x-patch
Size: 153466 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20200707/83950bf8/attachment-0001.bin>


More information about the Libc-alpha mailing list