]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/matmul_r4.c
re PR libfortran/78379 (Processor-specific versions for matmul)
[thirdparty/gcc.git] / libgfortran / generated / matmul_r4.c
index b7a40d30b5d11e5df64da5b81adc3da06d64161d..ac7306fe035f8830c4475b85aba2e00355c8c443 100644 (file)
@@ -74,13 +74,6 @@ extern void matmul_r4 (gfc_array_r4 * const restrict retarray,
        int blas_limit, blas_call gemm);
 export_proto(matmul_r4);
 
-#if defined(HAVE_AVX) && defined(HAVE_AVX2)
-/* REAL types generate identical code for AVX and AVX2.  Only generate
-   an AVX2 function if we are dealing with integer.  */
-#undef HAVE_AVX2
-#endif
-
-
 /* Put exhaustive list of possible architectures here here, ORed together.  */
 
 #if defined(HAVE_AVX) || defined(HAVE_AVX2) || defined(HAVE_AVX512F)
@@ -632,7 +625,7 @@ matmul_r4_avx (gfc_array_r4 * const restrict retarray,
 static void
 matmul_r4_avx2 (gfc_array_r4 * const restrict retarray, 
        gfc_array_r4 * const restrict a, gfc_array_r4 * const restrict b, int try_blas,
-       int blas_limit, blas_call gemm) __attribute__((__target__("avx2")));
+       int blas_limit, blas_call gemm) __attribute__((__target__("avx2,fma")));
 static void
 matmul_r4_avx2 (gfc_array_r4 * const restrict retarray, 
        gfc_array_r4 * const restrict a, gfc_array_r4 * const restrict b, int try_blas,
@@ -2281,7 +2274,8 @@ void matmul_r4 (gfc_array_r4 * const restrict retarray,
 #endif  /* HAVE_AVX512F */
 
 #ifdef HAVE_AVX2
-         if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX2))
+         if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX2))
+            && (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
            {
              matmul_p = matmul_r4_avx2;
              goto tailcall;