[PATCH] x86_64: Utilize vector math functions w/o -fopenmp

Joseph Myers joseph@codesourcery.com
Fri Dec 4 15:46:00 GMT 2015


On Fri, 4 Dec 2015, Andrew Senkevich wrote:

> +# elif __GNUC_PREREQ (6,0)
> +/* W/o OpenMP use GCC 6.*  __attribute__((__simd__)).  */
> +#  define __ATTR_SIMD_x86_64 __attribute__((__simd__("notinbranch")))
> +#  undef __DECL_SIMD_cos
> +#  define __DECL_SIMD_cos __ATTR_SIMD_x86_64

Why do you need to duplicate the list of functions?  It would seem better 
to define __DECL_SIMD_x86_64 with two different definitions depending on 
the macros predefined by the compiler, then define all the 
__DECL_SIMD_<func> macros if __DECL_SIMD_x86_64 has been defined.

# if defined _OPENMP && _OPENMP >= 201307
#  define __DECL_SIMD_x86_64 ...
# elif __GNUC_PREREQ (6,0)
#  define __DECL_SIMD_x86_64 ...
# endif
# ifdef __DECL_SIMD_x86_64
#  undef __DECL_SIMD_cos
#  define __DECL_SIMD_cos __DECL_SIMD_x86_64
etc.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list