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


2014-09-12 21:08 GMT+04:00 Jakub Jelinek <jakub@redhat.com>:

> On Fri, Sep 12, 2014 at 05:03:06PM +0000, Joseph S. Myers wrote:
>> That's what this patch does - but we need a way for the headers to declare
>> to GCC which vector ISAs have such versions of a given function available,
>> in a way that works both for (new GCC, old glibc) (GCC knows about newer
>> vector ISAs without function versions in that glibc, and mustn't try to
>> generate calls to functions that glibc doesn't have) and (old GCC, new
>> glibc) (glibc is declaring availability of vector versions the old GCC
>> doesn't know how to use, so the references to those vector versions need
>> to be quietly ignored or conditional on GCC version).

> In Cilk+ there is a way to tell which ISA the elemental function is compiled
> for.  In OpenMP we've made a GCC ABI decision that on i?86/x86_64 all of
> SSE2, AVX, AVX2 and AVX-512 passing conventions are used; those can be
> emitted as aliases, thunks or real functions (have to optimize this on GCC
> side at some point).  E.g. in Intel ABI (which uses different letters) it
> always uses just SSE2.
> When/if AVX-1024 is added, we won't change the ABI, so one will still have
> to use two AVX-512 calls; but perhaps we can add as OpenMP extension
> some clause like Cilk+ has to specify ISA.

As we see processor clause unfortunately not parsed by GCC.
So no such way to specify ISA for both OpenMP and Cilk+ so far.

GCC 4.9 and 5.0 both can vectorize in SSE2, AVX, AVX2, AVX-512 (with
-mavx512f generated 2 calls of AVX2 versions).
For x86_64 we will add all of SSE2, AVX, AVX2 versions (some through wrappers).

Jakub, do you think we can plan to add processor clauses into GCC 6?

If yes, we can have separate SIMD declarations in math.h into 2 parts:
without processor clause under condition on GCC version is < 6.0 (we
just know that these compiler versions and glibc are synced in the
sense of versions of vector math functions) and with processor clause
under condition on GCC version is >= 6.0.

Does it look reasonable?


--
WBR,
Andrew


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