Fix libgfortran FMA3/FMA4 tests
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Sun, 28 May 2017 19:12:45 +0000 (19:12 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Sun, 28 May 2017 19:12:45 +0000 (19:12 +0000)
* acinclude.m4 (LIBGFOR_CHECK_FMA3): Use test from
check_effective_target_fma in gcc.target/i386/i386.exp.
(LIBGFOR_CHECK_FMA4): Use test from check_effective_target_fma4.
* configure: Regenerate.

From-SVN: r248547

libgfortran/ChangeLog
libgfortran/acinclude.m4
libgfortran/configure

index 720b1ce22657e526712515e0dbd1e7e9697840ee..eaeac6ad0b7d03fc9fe0dd805a3b752f6fc278f3 100644 (file)
@@ -1,3 +1,10 @@
+2017-05-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * acinclude.m4 (LIBGFOR_CHECK_FMA3): Use test from
+       check_effective_target_fma in gcc.target/i386/i386.exp.
+       (LIBGFOR_CHECK_FMA4): Use test from check_effective_target_fma4.
+       * configure: Regenerate.
+
 2017-05-26  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR boostrap/80889
index b501a5e4ef9e229574a3c4933d12152e73a5196a..90df4eea7b763f56d4910709b5525bc361786740 100644 (file)
@@ -459,10 +459,13 @@ AC_DEFUN([LIBGFOR_CHECK_FMA3], [
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS="-O2 -mfma -mno-fma4"
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-       float
-       flt_mul_add (float a, float b, float c)
+        typedef float __m128 __attribute__ ((__vector_size__ (16)));
+       typedef float __v4sf __attribute__ ((__vector_size__ (16)));
+       __m128 _mm_macc_ps(__m128 __A, __m128 __B, __m128 __C)
        {
-               return __builtin_fmaf (a, b, c);
+           return (__m128) __builtin_ia32_vfmaddps ((__v4sf)__A,
+                                                    (__v4sf)__B,
+                                                    (__v4sf)__C);
         }]], [[]])],
        AC_DEFINE(HAVE_FMA3, 1,
        [Define if FMA3 instructions can be compiled.]),
@@ -476,10 +479,13 @@ AC_DEFUN([LIBGFOR_CHECK_FMA4], [
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS="-O2 -mfma4 -mno-fma"
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-       float
-       flt_mul_add (float a, float b, float c)
+        typedef float __m128 __attribute__ ((__vector_size__ (16)));
+       typedef float __v4sf __attribute__ ((__vector_size__ (16)));
+       __m128 _mm_macc_ps(__m128 __A, __m128 __B, __m128 __C)
        {
-               return __builtin_fmaf (a, b, c);
+           return (__m128) __builtin_ia32_vfmaddps ((__v4sf)__A,
+                                                    (__v4sf)__B,
+                                                    (__v4sf)__C);
         }]], [[]])],
        AC_DEFINE(HAVE_FMA4, 1,
        [Define if FMA4 instructions can be compiled.]),
index 28f10d57474a74a27bb2ae328074ce54a795060c..87c83cab73a9364037b965f974bd60a91732e269 100755 (executable)
@@ -26372,10 +26372,13 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-       float
-       flt_mul_add (float a, float b, float c)
+        typedef float __m128 __attribute__ ((__vector_size__ (16)));
+       typedef float __v4sf __attribute__ ((__vector_size__ (16)));
+       __m128 _mm_macc_ps(__m128 __A, __m128 __B, __m128 __C)
        {
-               return __builtin_fmaf (a, b, c);
+           return (__m128) __builtin_ia32_vfmaddps ((__v4sf)__A,
+                                                    (__v4sf)__B,
+                                                    (__v4sf)__C);
         }
 int
 main ()
@@ -26401,10 +26404,13 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-       float
-       flt_mul_add (float a, float b, float c)
+        typedef float __m128 __attribute__ ((__vector_size__ (16)));
+       typedef float __v4sf __attribute__ ((__vector_size__ (16)));
+       __m128 _mm_macc_ps(__m128 __A, __m128 __B, __m128 __C)
        {
-               return __builtin_fmaf (a, b, c);
+           return (__m128) __builtin_ia32_vfmaddps ((__v4sf)__A,
+                                                    (__v4sf)__B,
+                                                    (__v4sf)__C);
         }
 int
 main ()