On Mon, Jan 12, 2015 at 07:38:10PM +0300, Andrew Senkevich wrote: > > during work on addition vector math functions to Glibc and discussions > > with community was found an issue with meaning of “#pragma omp declare > > simd” (which will appear in math.h). > > > > Issue is there are no working way to specify ISA of vector function > > in GCC 5.0, and hence no way to determine exact vector function name. > > > > Here is description of exact meaning of “#pragma omp declare simd” for > > x86_64. > > > > This is proposed as agreement between compilers supporting OpenMP. > > > > *************** OpenMP vector function ABI for x86_64 *************** > > > > Name of vector math function is based on Intel Vector Function ABI > > (http://www.cilkplus.org/sites/default/files/open_specifications/Intel-ABI-Vector-Function-2012-v0.9.5.pdf) > > with a little difference in part of name specifying ISA – namely > > letters b, c, d instead of x, y, Y. > > > > #pragma omp declare simd notinbranch simdlen(2) for some function > > “func” means what the name of vector version is: > > > > _ZGVbN2v_func (it is SSE4 implementation). > > > > #pragma omp declare simd notinbranch simdlen(4) for some function > > “func” means what the following names are available: > > > > _ZGVcN4v_func (it is AVX implementation) > > and > > _ZGVdN4v_func (it is AVX2 implementation). > > > > Every vector function should be provided by math library for each > > supported ISA (currently SSE4, AVX and AVX2). > > Semantics of those pragmas are independent of the processor for which > > code is being generated. > > Those pragmas must not be interpreted as meaning version of other ISA > > of functions are available even if code is being built for a processor > > with such ISA support. > > Any future ABI extension that defines additional vector function > > versions will also define a different pragma to declare their > > availability. > > > > ********************************************************************* > > > > Any feedback? > > is this agreement OK? > > Consensus is required to commit x86_64 vector math functions by Glibc > maintainer.
With the difference that b stands for SSE2, not SSE4, and the fact that those functions do not use the __regcall calling conventions, but normal psABI calling conventions after replacing the arguments/return values with the vectors documented in the 0.9.5 pdf (and/or adding the vector mask arg) it describes what has been implemented, yes. Jakub