diff options
-rw-r--r-- | libgfortran/ChangeLog | 7 | ||||
-rw-r--r-- | libgfortran/acinclude.m4 | 18 | ||||
-rwxr-xr-x | libgfortran/configure | 18 |
3 files changed, 31 insertions, 12 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 720b1ce..eaeac6a 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -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 diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4 index b501a5e..90df4ee 100644 --- a/libgfortran/acinclude.m4 +++ b/libgfortran/acinclude.m4 @@ -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.]), diff --git a/libgfortran/configure b/libgfortran/configure index 28f10d5..87c83ca 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -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 () |