]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/x86_64/fpu/multiarch/s_fmaf.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / x86_64 / fpu / multiarch / s_fmaf.c
index 0dcf273ea0007a5615c0d63fd629f7bdae71ca0b..754e38ca62041f9eec425fcc949929b5c43d970e 100644 (file)
@@ -1,5 +1,5 @@
 /* FMA version of fmaf.
-   Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA. */
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 #include <math.h>
 #include <init-arch.h>
-
-#ifdef HAVE_AVX_SUPPORT
+#include <libm-alias-float.h>
 
 extern float __fmaf_sse2 (float x, float y, float z) attribute_hidden;
 
@@ -34,25 +32,19 @@ __fmaf_fma3 (float x, float y, float z)
 }
 
 
-# ifdef HAVE_FMA4_SUPPORT
 static float
 __fmaf_fma4 (float x, float y, float z)
 {
-  asm ("vfmaddss %3, %2, %1, %0" : "=x" (x) : "x" (x), "xm" (y), "xm" (z));
+  asm ("vfmaddss %3, %2, %1, %0" : "=x" (x) : "x" (x), "x" (y), "x" (z));
   return x;
 }
-# else
-#  undef HAS_FMA4
-#  define HAS_FMA4 0
-#  define __fmaf_fma4 ((void *) 0)
-# endif
 
 
-libm_ifunc (__fmaf, HAS_FMA
-           ? __fmaf_fma3 : (HAS_FMA4 ? __fmaf_fma4 : __fmaf_sse2));
-weak_alias (__fmaf, fmaf)
+libm_ifunc (__fmaf, HAS_ARCH_FEATURE (FMA_Usable)
+           ? __fmaf_fma3 : (HAS_ARCH_FEATURE (FMA4_Usable)
+                            ? __fmaf_fma4 : __fmaf_sse2));
+libm_alias_float (__fma, fma)
 
-# define __fmaf __fmaf_sse2
-#endif
+#define __fmaf __fmaf_sse2
 
 #include <sysdeps/ieee754/dbl-64/s_fmaf.c>