[PATCH 1/14] [x86_64] Vector math functions (vector cos)
Joseph Myers
joseph@codesourcery.com
Fri May 15 19:07:00 GMT 2015
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
More information about the Libc-alpha
mailing list