This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/N] x86_64 vectorization support: vectorized math functions addition to Glibc


On 11-09-2014 07:11, Matthew Fortune wrote:
> Joseph S. Myers <joseph@codesourcery.com> writes:
>> On Wed, 10 Sep 2014, Andrew Senkevich wrote:
>>
>>> Hi all,
>>>
>>> this is the first patch in the series of patches which will add Intel
>>> vectorized math functions to Glibc.
>> Please start by raising general design questions on libc-alpha before
>> sending any patches; only send patches once there is consensus on the
>> general questions and that consensus has been written up on a wiki page.
>> For example:
> FWIW I had envisaged vectorised math functions looking more generic such
> that they were not dependent on vector size:
>
> void sin_simd (float* dst, float* src, int count)
> {
>   while (count > 0)
>   {
>     *dst = sinf (*src);
>     dst++;
>     src++;
>     count--;
>   }
> }
>
> With this pattern, the precise SIMD ISA extension is not important to the
> caller. The additional cost of loading/storing the data compared with the
> number of instructions required to perform the vectorised operation does
> not seem significant. Ifunc is then the obvious way to select the widest
> SIMD available at runtime.

That not the AIM of this proposal, neither it is best suited for a SIMD
math library.  For most cases I want to work on limited and fixed sizes provided
by ISA, and to make function calls using an ABI to pass arguments along registers.
For instance, using AVX from Intel or VSX for POWER I would like to pass along
128-bits of data (4xfloat) in register and return is in same way.  The same
principle applies to longer SIMD types, for instance AVX2.

That's why Joseph has put 'But one glibc version could have a function vectorized
for ISA extensions A and B, with another  version adding it vectorized for C.'

Right now, I would like some discussion on how we will handle all the question
Joseph has posed, before any patch posting.

>
> Matthew
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]