This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] x86: Add MathVec_Prefer_No_AVX512 to cpu-features [BZ #21967]
On Tue, Sep 12, 2017 at 7:27 AM, Senkevich, Andrew
<andrew.senkevich@intel.com> wrote:
>> -----Original Message-----
>> From: H.J. Lu [mailto:hjl.tools@gmail.com]
>> Sent: Monday, September 4, 2017 22:27
>> To: Senkevich, Andrew <andrew.senkevich@intel.com>
>> Cc: GNU C Library <libc-alpha@sourceware.org>
>> Subject: Re: [PATCH] x86: Add MathVec_Prefer_No_AVX512 to cpu-features [BZ
>> #21967]
>>
>> On Mon, Sep 4, 2017 at 3:16 AM, Senkevich, Andrew
>> <andrew.senkevich@intel.com> wrote:
>> >> -----Original Message-----
>> >> From: Lu, Hongjiu
>> >> Sent: Friday, September 1, 2017 19:41
>> >> To: GNU C Library <libc-alpha@sourceware.org>
>> >> Cc: Senkevich, Andrew <andrew.senkevich@intel.com>
>> >> Subject: [PATCH] x86: Add MathVec_Prefer_No_AVX512 to cpu-features
>> >> [BZ #21967]
>> >>
>> >> AVX512 functions in mathvec are used on machines with AVX512. An
>> >> AVX2 wrapper is also provided and it can be used when the AVX512
>> >> version isn't profitable. MathVec_Prefer_No_AVX512 is addded to cpu-
>> features.
>> >> If glibc.tune.hwcaps=MathVec_Prefer_No_AVX512 is set in
>> >> GLIBC_TUNABLES environment variable, the AVX2 wrapper will be used.
>> >>
>> >> Tested on x86-64 machines with and without AVX512. Also verified
>> >> glibc.tune.hwcaps=MathVec_Prefer_No_AVX512 on AVX512 machine.
>> >>
>> >> Any comments?
>> >
>> > But libc selects AVX2 mem/str on SKX, looks like libmvec should do the same
>> (and backward option MathVec_Prefer_AVX512 needed).
>> >
>>
>> AVX2 mem/str can be called from codes which may use only SSE or AVX. But
>> AVX512 functions in mathvec are called only from AVX512 programs. Do we
>> have benchmarks to show that AVX512 programs are faster with AVX2 mathvec?
>
> I agree, if compiler vectorizes with AVX512 then Glibc should use AVX512 implementations in mathvec by default.
>
I am checking it in. Thanks.
--
H.J.