Use inline asm for DLA_FMS because of broken old compilers
authorUlrich Drepper <drepper@gmail.com>
Tue, 25 Oct 2011 01:17:10 +0000 (21:17 -0400)
committerUlrich Drepper <drepper@gmail.com>
Tue, 25 Oct 2011 01:17:10 +0000 (21:17 -0400)
ChangeLog
sysdeps/x86_64/dla.h

index a2e155a..108d9a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 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.
+
        * config.make.in: Add have-mfma4 entry.
        * configure.in: Substitute libc_cv_cc_fma4.
        * math/Makefile (dbl-only-routines): Add sincostab.
index 7aa06e5..6fe8f74 100644 (file)
@@ -1,6 +1,10 @@
-#if defined __FMA4__ || defined __FMA__
+#ifdef __FMA4__
 # define DLA_FMS(x,y,z) \
-  __builtin_fma (x, y, -z)
+  ({ double __z;                                                             \
+     asm ("vfmsubsd %3, %2, %1, %0"                                          \
+         : "=x" (__z)                                                        \
+         : "x" ((double) (x)), "xm" ((double) (y)) , "x" ((double) (z)));    \
+    __z; })
 #endif
 
 #include "sysdeps/ieee754/dbl-64/dla.h"