2011-10-24 Ulrich Drepper <drepper@gmail.com>
- * sysdeps/x86_64/dla.h (DLA_FMS): Some compilers fail to inline
- __builtin_fma in some situations. Have to use an asm.
+ * sysdeps/x86_64/dla.h: Move to ...
+ * sysdeps/x86_64/fpu/dla.h: ...here.
+ (DLA_FMS): Some compilers fail to inline __builtin_fma in some
+ situations. Use __builtin_fma only for gcc 4.6 and up.
* config.make.in: Add have-mfma4 entry.
* configure.in: Substitute libc_cv_cc_fma4.
+#include <features.h>
+
#ifdef __FMA4__
-# define DLA_FMS(x,y,z) \
+# if __GNUC_PREREQ (4, 6)
+# define DLA_FMS(x,y,z) \
+ __builtin_fma (x, y, -(z))
+# else
+# define DLA_FMS(x,y,z) \
({ double __z; \
asm ("vfmsubsd %3, %2, %1, %0" \
: "=x" (__z) \
: "x" ((double) (x)), "xm" ((double) (y)) , "x" ((double) (z))); \
__z; })
+# endif
#endif
#include "sysdeps/ieee754/dbl-64/dla.h"