[PATCH] Set index_arch_AVX_Fast_Unaligned_Load only for Intel processors

H.J. Lu hjl.tools@gmail.com
Mon Mar 21 15:16:00 GMT 2016


On Fri, Mar 18, 2016 at 1:25 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Since only Intel processors with AVX2 have fast unaligned load, we
> should set index_arch_AVX_Fast_Unaligned_Load only for Intel processors.
>
> Add PTR_HAS_CPU_FEATURE and PTR_HAS_ARCH_FEATURE to aoid loading
> GLRO(dl_x86_cpu_features) in cpu-features.c.
>
> Tested on x86-64.  OK for master?
>
> H.J.
> ---
>         * sysdeps/x86/cpu-features.c (get_common_indeces): Remove
>         inline.  Set AVX, AVX2, AVX512, FMA and FMA4 usable bits here.
>         processors.
>         (init_cpu_features): Replace HAS_CPU_FEATURE and
>         PTR_HAS_ARCH_FEATURE with PTR_HAS_CPU_FEATURE and
>         PTR_HAS_ARCH_FEATURE.  Set index_arch_AVX_Fast_Unaligned_Load
>         for Intel processors with usable AVX2.
>         * sysdeps/x86/cpu-features.h (PTR_HAS_CPU_FEATURE): New macro.
>         (PTR_HAS_ARCH_FEATURE): Likewise.
>         (HAS_CPU_FEATURE): Use PTR_HAS_CPU_FEATURE.
>         (HAS_ARCH_FEATURE): Use PTR_HAS_ARCH_FEATURE.

Here is the updated patch to rename PTR_HAS_CPU_FEATURE
and PTR_HAS_ARCH_FEATURE to CPU_FEATURES_CPU_P and
CPU_FEATURES_ARCH_P.  It also calls get_common_indeces
for other processors to detect AVX, AVX2, AVX512, FMA and FMA4.
This should help fix

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

by setting AVX_Fast_Unaligned_Load only for Intel processors.

OK for master?

Thanks.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Set-index_arch_AVX_Fast_Unaligned_Load-only-for-Inte.patch
Type: text/x-patch
Size: 9155 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160321/257d2284/attachment.bin>


More information about the Libc-alpha mailing list