about summary refs log tree commit diff
path: root/sysdeps/x86_64/fpu/multiarch/e_atan2.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-10-25 21:34:55 -0400
committerUlrich Drepper <drepper@gmail.com>2011-10-25 21:34:55 -0400
commite0016b11d6186a7003d7204cb100acab9bbcd940 (patch)
tree8c702a330664d113edbdaff9ba4ec67e266bbb80 /sysdeps/x86_64/fpu/multiarch/e_atan2.c
parentffb124cc518c182e238c20abb0ff8bdeaefefd66 (diff)
downloadglibc-e0016b11d6186a7003d7204cb100acab9bbcd940.tar.gz
glibc-e0016b11d6186a7003d7204cb100acab9bbcd940.tar.xz
glibc-e0016b11d6186a7003d7204cb100acab9bbcd940.zip
Add AVX optimized versions for some x86-64 math functions
Diffstat (limited to 'sysdeps/x86_64/fpu/multiarch/e_atan2.c')
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_atan2.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sysdeps/x86_64/fpu/multiarch/e_atan2.c b/sysdeps/x86_64/fpu/multiarch/e_atan2.c
index 12fc929068..6867c6e64e 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_atan2.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_atan2.c
@@ -1,12 +1,20 @@
-#ifdef HAVE_FMA4_SUPPORT
+#if defined HAVE_FMA4_SUPPORT || defined HAVE_AVX_SUPPORT
 # include <init-arch.h>
 # include <math_private.h>
 
 extern double __ieee754_atan2_sse2 (double, double);
+extern double __ieee754_atan2_avx (double, double);
+# ifdef HAVE_FMA4_SUPPORT
 extern double __ieee754_atan2_fma4 (double, double);
+# else
+#  undef HAS_FMA4
+#  define HAS_FMA4 0
+#  define __ieee754_atan2_fma4 ((void *) 0)
+# endif
 
 libm_ifunc (__ieee754_atan2,
-	    HAS_FMA4 ? __ieee754_atan2_fma4 : __ieee754_atan2_sse2);
+	    HAS_FMA4 ? __ieee754_atan2_fma4
+	    : (HAS_AVX ? __ieee754_atan2_avx : __ieee754_atan2_sse2));
 strong_alias (__ieee754_atan2, __atan2_finite)
 
 # define __ieee754_atan2 __ieee754_atan2_sse2