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/14] [x86_64] Vector math functions (vector cos)


On Fri, 15 May 2015, Szabolcs Nagy wrote:

> > +#if defined __x86_64__ && defined __FAST_MATH__
> > +# if defined _OPENMP && _OPENMP >= 201307
> > +/* OpenMP case.  */
> > +#  define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch")
> > +#  undef __DECL_SIMD_cos
> > +#  define __DECL_SIMD_cos __DECL_SIMD_x86_64
> > +# endif
> > +#endif
> 
> why does math.h have #ifdef _OPENMP ? (and __FAST_MATH__)

Because this pragma to declare that the vector functions are available 
(for the compiler to vectorize calls to scalar functions) is an OpenMP 
pragma, only available when OpenMP is enabled.  They might also be made 
available in other cases in future when appropriate pragmas (e.g. 
CilkPlus) are available.  __FAST_MATH__ is because these functions may not 
meet the normal glibc rules regarding accuracy of results and exceptions.

See the discussions starting last September of the approach for adding 
vector libm functions.

-- 
Joseph S. Myers
joseph@codesourcery.com


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