[RFC] How to add vector math functions to Glibc
H.J. Lu
hjl.tools@gmail.com
Thu Sep 25 20:03:00 GMT 2014
On Thu, Sep 25, 2014 at 12:55 PM, Carlos O'Donell <carlos@redhat.com> wrote:
> On 09/25/2014 03:37 PM, H.J. Lu wrote:
>> On Thu, Sep 25, 2014 at 12:27 PM, Carlos O'Donell <carlos@redhat.com> wrote:
>>> On 09/25/2014 11:40 AM, H.J. Lu wrote:
>>>> On Thu, Sep 25, 2014 at 8:17 AM, Andrew Senkevich
>>>> <andrew.n.senkevich@gmail.com> wrote:
>>>>>> If consensus ends up being to have such a library (libmvec or libmvect?),
>>>>>> then the installation rules for libm.so as a linker script should go in
>>>>>> math/Makefile, not the toplevel Makerules. (I don't know what if any
>>>>>> changes might be needed to allow subdirectories to provide libraries as
>>>>>> linker scripts.)
>>>>>
>>>>> There were three options about the place where to add vectorized math functions:
>>>>>
>>>>> 1. GLIBC (libm)
>>>>> 2. GLIBC (additional library)
>>>>> 3. GCC
>>>>>
>>>>> In GLIBC cases build of vectorized functions can be conditional, no
>>>>> additional -lmvec required because of libm.so installed as linked
>>>>> script in case of vectorized functions available, so it seems not very
>>>>> important whether functions located in additional library or in libm.
>>>>>
>>>>
>>>> I don't think they should be in libm since most of applications
>>>> won't use those vector functions, which increase libm size
>>>> unnecessarily. A separate library is better.
>>>
>>> I agree. A distinct libmvec.so is best.
>>>
>>> I see the consensus that #2 is the way forward.
>>
>> Since this vector library targets GCC, there are
>> pros to put it in GCC.
>
> Sorry, I don't understand this part, and perhaps that's why I didn't
> understand question 7 in the previous post.
>
> What does it mean for the vector library to target GCC?
>
From
https://sourceware.org/glibc/wiki/libm#Addition_of_x86_64_vector_math_functions_to_Glibc
3.1. Goal
Main goal is to improve vectorization of GCC with OpenMP4.0 SIMD
constructs (#2.8 in http://www.openmp.org/mp-documents/OpenMP4.0.0.pdf
and Cilk Plus constructs (#6-8 in
http://www.cilkplus.org/sites/default/files/open_specifications/Intel_Cilk_plus_lang_spec_1.2.htm)
on x86_64 by adding SSE4, AVX and AVX2 vector implementations of
several vector math functions (float and double versions). AVX-512
versions are planned to be added later. These functions can be also
used manually (with intrinsics) by developers to obtain speedup.
So it is mainly for GCC.
--
H.J.
More information about the Libc-alpha
mailing list