aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorAndrew Senkevich <andrew.senkevich@intel.com>2015-12-07 21:58:26 +0300
committerAndrew Senkevich <andrew.senkevich@intel.com>2015-12-07 21:58:26 +0300
commit377ed004f2c5b498e0620426a0af447172351f35 (patch)
treefef8d735932661766b531d2daac7d229ffdee061 /sysdeps
parent5d1d4918eebdaaf0ab0a5baf28c502c32c21f12e (diff)
downloadglibc-377ed004f2c5b498e0620426a0af447172351f35.tar
glibc-377ed004f2c5b498e0620426a0af447172351f35.tar.gz
glibc-377ed004f2c5b498e0620426a0af447172351f35.tar.bz2
glibc-377ed004f2c5b498e0620426a0af447172351f35.zip
Utilize x86_64 vector math functions w/o -fopenmp.
This patch allows to use x86_64 vector math functions with GCC 6.* without OpenMP SIMD constructs. For additional details please visit <https://sourceware.org/glibc/wiki/libmvec#Example_2>. * sysdeps/x86/fpu/bits/math-vector.h: W/o -fopenmp declare vector math functions with GCC 6.* __attribute__ ((__simd__)).
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/x86/fpu/bits/math-vector.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/x86/fpu/bits/math-vector.h b/sysdeps/x86/fpu/bits/math-vector.h
index f3bfb869d4..495e895df9 100644
--- a/sysdeps/x86/fpu/bits/math-vector.h
+++ b/sysdeps/x86/fpu/bits/math-vector.h
@@ -28,6 +28,12 @@
# if defined _OPENMP && _OPENMP >= 201307
/* OpenMP case. */
# define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch")
+# elif __GNUC_PREREQ (6,0)
+/* W/o OpenMP use GCC 6.* __attribute__ ((__simd__)). */
+# define __DECL_SIMD_x86_64 __attribute__ ((__simd__ ("notinbranch")))
+# endif
+
+# ifdef __DECL_SIMD_x86_64
# undef __DECL_SIMD_cos
# define __DECL_SIMD_cos __DECL_SIMD_x86_64
# undef __DECL_SIMD_cosf