https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94694

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, I meant something like:
--- libgfortran/configure.ac.jj 2020-01-24 22:34:36.340641225 +0100
+++ libgfortran/configure.ac    2020-04-21 18:03:02.494598615 +0200
@@ -392,6 +392,9 @@ GCC_CHECK_MATH_FUNC([cabsl])
 GCC_CHECK_MATH_FUNC([floorf])
 GCC_CHECK_MATH_FUNC([floor])
 GCC_CHECK_MATH_FUNC([floorl])
+GCC_CHECK_MATH_FUNC([fmaf])
+GCC_CHECK_MATH_FUNC([fma])
+GCC_CHECK_MATH_FUNC([fmal])
 GCC_CHECK_MATH_FUNC([fmodf])
 GCC_CHECK_MATH_FUNC([fmod])
 GCC_CHECK_MATH_FUNC([fmodl])
--- libgfortran/intrinsics/c99_functions.c.jj   2020-01-12 11:54:38.736378361
+0100
+++ libgfortran/intrinsics/c99_functions.c      2020-04-21 18:00:54.368527655
+0200
@@ -229,6 +229,17 @@ ceilf (float x)
 }
 #endif

+#if !defined(HAVE_COPYSIGN) && HAVE_INLINE_BUILTIN_COPYSIGN
+#define HAVE_COPYSIGN 1
+double copysign (double x, double y);
+
+double
+copysign (double x, double y)
+{
+  return __builtin_copysign (x, y);
+}
+#endif
+
 #ifndef HAVE_COPYSIGNF
 #define HAVE_COPYSIGNF 1
 float copysignf (float x, float y);
@@ -2112,3 +2123,36 @@ lgammaf (float x)
   return (float) lgamma ((double) x);
 }
 #endif
+
+#ifndef HAVE_FMA
+#define HAVE_FMA 1
+double fma (double, double, double);
+
+double
+fma (double x, double y, double z)
+{
+  return x * y + z;
+}
+#endif
+
+#ifndef HAVE_FMAF
+#define HAVE_FMAF 1
+float fmaf (float, float, float);
+
+float
+fmaf (float x, float y, float z)
+{
+  return fma (x, y, z);
+}
+#endif
+
+#ifndef HAVE_FMAL
+#define HAVE_FMAL 1
+long double fmaf (long double, long double, long double);
+
+long double
+fmaf (long double x, long double y, long double z)
+{
+  return x * y + z;
+}
+#endif

except that the test in configure for HAVE_INLINE_BUILTIN_COPYSIGN still needs
to be written.

Reply via email to