Thursday, October 21, 2010

Glibc: moving forward to gcc-4.6

Glibc: moving forward to gcc-4.6

Author: Ulrich Drepper
Date:   Tue Oct 19 12:56:42 2010 -0400

    Provide FP_FAST_FMA{,F,L} definitions for x86/x86-64.

diff --git a/sysdeps/x86_64/bits/mathdef.h b/sysdeps/x86_64/bits/mathdef.h
index 7b16189..9146392 100644
--- a/sysdeps/x86_64/bits/mathdef.h
+++ b/sysdeps/x86_64/bits/mathdef.h
[..]

+/* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l}
+   builtins are supported.  */
+# if __FP_FAST_FMA
+#  define FP_FAST_FMA 1
+# endif
+
+# if __FP_FAST_FMAF
+#  define FP_FAST_FMAF 1
+# endif
+
+# if __FP_FAST_FMAL
+#  define FP_FAST_FMAL 1
+# endif
+
 #endif /* ISO C99 */


http://www.linuxselfhelp.com/gnu/glibc/html_chapter/libc_20.html
On processors which do not implement multiply-add in hardware, fma can be very slow since it must avoid intermediate rounding. `math.h' defines the symbols FP_FAST_FMA, FP_FAST_FMAF, and FP_FAST_FMAL when the corresponding version of fma is no slower than the expression `x*y + z'. In the GNU C library, this always means the operation is implemented in hardware.

No comments:

Post a Comment