From 202c9deb15ee43bcbe70b36fa9bae050b8633c27 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 24 Oct 2011 22:11:21 -0400 Subject: 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. --- sysdeps/x86_64/dla.h | 10 ---------- sysdeps/x86_64/fpu/dla.h | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 10 deletions(-) delete mode 100644 sysdeps/x86_64/dla.h create mode 100644 sysdeps/x86_64/fpu/dla.h (limited to 'sysdeps/x86_64') diff --git a/sysdeps/x86_64/dla.h b/sysdeps/x86_64/dla.h deleted file mode 100644 index 6fe8f740f3..0000000000 --- a/sysdeps/x86_64/dla.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifdef __FMA4__ -# 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 - -#include "sysdeps/ieee754/dbl-64/dla.h" 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 + +#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" -- cgit 1.4.1