about summary refs log tree commit diff
path: root/sysdeps/x86_64/fpu/dla.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-10-24 22:11:21 -0400
committerUlrich Drepper <drepper@gmail.com>2011-10-24 22:11:21 -0400
commit202c9deb15ee43bcbe70b36fa9bae050b8633c27 (patch)
treeda6f340b0a0475b22c0ec7664f2dfea47aaad153 /sysdeps/x86_64/fpu/dla.h
parent485683c35f020bd8b926e9673adb9b748380e8ce (diff)
downloadglibc-202c9deb15ee43bcbe70b36fa9bae050b8633c27.tar.gz
glibc-202c9deb15ee43bcbe70b36fa9bae050b8633c27.tar.xz
glibc-202c9deb15ee43bcbe70b36fa9bae050b8633c27.zip
Better DLA_FMS
It's better to use __builtin_fma if it works.  Use it for gcc 4.6 and
higher.  Move the x86-64 dla.h to the correct place.
Diffstat (limited to 'sysdeps/x86_64/fpu/dla.h')
-rw-r--r--sysdeps/x86_64/fpu/dla.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/sysdeps/x86_64/fpu/dla.h b/sysdeps/x86_64/fpu/dla.h
new file mode 100644
index 0000000000..fa2d52bbf0
--- /dev/null
+++ b/sysdeps/x86_64/fpu/dla.h
@@ -0,0 +1,17 @@
+#include <features.h>
+
+#ifdef __FMA4__
+# 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"