mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-04 21:37:31 +08:00
libgfortran: Use __builtin_cpu_is/__builtin_cpu_supports
* m4/matmul.m4: Don't include <config/i386/cpuinfo.h>. Use __builtin_cpu_is/__builtin_cpu_supports * generated/matmul_c10.c: Regenerated. * generated/matmul_c16.c: Likewise. * generated/matmul_c4.c: Likewise. * generated/matmul_c8.c: Likewise. * generated/matmul_i1.c: Likewise. * generated/matmul_i16.c: Likewise. * generated/matmul_i2.c: Likewise. * generated/matmul_i4.c: Likewise. * generated/matmul_i8.c: Likewise. * generated/matmul_r10.c: Likewise. * generated/matmul_r16.c: Likewise. * generated/matmul_r4.c: Likewise. * generated/matmul_r8.c: Likewise.
This commit is contained in:
parent
9e02b45ffc
commit
8ebc2f5e05
@ -1,3 +1,21 @@
|
||||
2020-05-21 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* m4/matmul.m4: Don't include <config/i386/cpuinfo.h>. Use
|
||||
__builtin_cpu_is/__builtin_cpu_supports
|
||||
* generated/matmul_c10.c: Regenerated.
|
||||
* generated/matmul_c16.c: Likewise.
|
||||
* generated/matmul_c4.c: Likewise.
|
||||
* generated/matmul_c8.c: Likewise.
|
||||
* generated/matmul_i1.c: Likewise.
|
||||
* generated/matmul_i16.c: Likewise.
|
||||
* generated/matmul_i2.c: Likewise.
|
||||
* generated/matmul_i4.c: Likewise.
|
||||
* generated/matmul_i8.c: Likewise.
|
||||
* generated/matmul_r10.c: Likewise.
|
||||
* generated/matmul_r16.c: Likewise.
|
||||
* generated/matmul_r4.c: Likewise.
|
||||
* generated/matmul_r8.c: Likewise.
|
||||
|
||||
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR bootstrap/95147
|
||||
|
@ -2367,7 +2367,6 @@ matmul_c10_vanilla (gfc_array_c10 * const restrict retarray,
|
||||
|
||||
/* Currently, this is i386 only. Adjust for other architectures. */
|
||||
|
||||
#include <config/i386/cpuinfo.h>
|
||||
void matmul_c10 (gfc_array_c10 * const restrict retarray,
|
||||
gfc_array_c10 * const restrict a, gfc_array_c10 * const restrict b, int try_blas,
|
||||
int blas_limit, blas_call gemm)
|
||||
@ -2384,11 +2383,11 @@ void matmul_c10 (gfc_array_c10 * const restrict retarray,
|
||||
if (matmul_fn == NULL)
|
||||
{
|
||||
matmul_fn = matmul_c10_vanilla;
|
||||
if (__cpu_model.__cpu_vendor == VENDOR_INTEL)
|
||||
if (__builtin_cpu_is ("intel"))
|
||||
{
|
||||
/* Run down the available processors in order of preference. */
|
||||
#ifdef HAVE_AVX512F
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX512F))
|
||||
if (__builtin_cpu_supports ("avx512f"))
|
||||
{
|
||||
matmul_fn = matmul_c10_avx512f;
|
||||
goto store;
|
||||
@ -2397,8 +2396,8 @@ void matmul_c10 (gfc_array_c10 * const restrict retarray,
|
||||
#endif /* HAVE_AVX512F */
|
||||
|
||||
#ifdef HAVE_AVX2
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX2))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx2")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_c10_avx2;
|
||||
goto store;
|
||||
@ -2407,26 +2406,26 @@ void matmul_c10 (gfc_array_c10 * const restrict retarray,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
if (__builtin_cpu_supports ("avx"))
|
||||
{
|
||||
matmul_fn = matmul_c10_avx;
|
||||
goto store;
|
||||
}
|
||||
#endif /* HAVE_AVX */
|
||||
}
|
||||
else if (__cpu_model.__cpu_vendor == VENDOR_AMD)
|
||||
else if (__builtin_cpu_is ("amd"))
|
||||
{
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA3) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_c10_avx128_fma3;
|
||||
goto store;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA4) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA4)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma4"))
|
||||
{
|
||||
matmul_fn = matmul_c10_avx128_fma4;
|
||||
goto store;
|
||||
|
@ -2367,7 +2367,6 @@ matmul_c16_vanilla (gfc_array_c16 * const restrict retarray,
|
||||
|
||||
/* Currently, this is i386 only. Adjust for other architectures. */
|
||||
|
||||
#include <config/i386/cpuinfo.h>
|
||||
void matmul_c16 (gfc_array_c16 * const restrict retarray,
|
||||
gfc_array_c16 * const restrict a, gfc_array_c16 * const restrict b, int try_blas,
|
||||
int blas_limit, blas_call gemm)
|
||||
@ -2384,11 +2383,11 @@ void matmul_c16 (gfc_array_c16 * const restrict retarray,
|
||||
if (matmul_fn == NULL)
|
||||
{
|
||||
matmul_fn = matmul_c16_vanilla;
|
||||
if (__cpu_model.__cpu_vendor == VENDOR_INTEL)
|
||||
if (__builtin_cpu_is ("intel"))
|
||||
{
|
||||
/* Run down the available processors in order of preference. */
|
||||
#ifdef HAVE_AVX512F
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX512F))
|
||||
if (__builtin_cpu_supports ("avx512f"))
|
||||
{
|
||||
matmul_fn = matmul_c16_avx512f;
|
||||
goto store;
|
||||
@ -2397,8 +2396,8 @@ void matmul_c16 (gfc_array_c16 * const restrict retarray,
|
||||
#endif /* HAVE_AVX512F */
|
||||
|
||||
#ifdef HAVE_AVX2
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX2))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx2")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_c16_avx2;
|
||||
goto store;
|
||||
@ -2407,26 +2406,26 @@ void matmul_c16 (gfc_array_c16 * const restrict retarray,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
if (__builtin_cpu_supports ("avx"))
|
||||
{
|
||||
matmul_fn = matmul_c16_avx;
|
||||
goto store;
|
||||
}
|
||||
#endif /* HAVE_AVX */
|
||||
}
|
||||
else if (__cpu_model.__cpu_vendor == VENDOR_AMD)
|
||||
else if (__builtin_cpu_is ("amd"))
|
||||
{
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA3) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_c16_avx128_fma3;
|
||||
goto store;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA4) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA4)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma4"))
|
||||
{
|
||||
matmul_fn = matmul_c16_avx128_fma4;
|
||||
goto store;
|
||||
|
@ -2367,7 +2367,6 @@ matmul_c4_vanilla (gfc_array_c4 * const restrict retarray,
|
||||
|
||||
/* Currently, this is i386 only. Adjust for other architectures. */
|
||||
|
||||
#include <config/i386/cpuinfo.h>
|
||||
void matmul_c4 (gfc_array_c4 * const restrict retarray,
|
||||
gfc_array_c4 * const restrict a, gfc_array_c4 * const restrict b, int try_blas,
|
||||
int blas_limit, blas_call gemm)
|
||||
@ -2384,11 +2383,11 @@ void matmul_c4 (gfc_array_c4 * const restrict retarray,
|
||||
if (matmul_fn == NULL)
|
||||
{
|
||||
matmul_fn = matmul_c4_vanilla;
|
||||
if (__cpu_model.__cpu_vendor == VENDOR_INTEL)
|
||||
if (__builtin_cpu_is ("intel"))
|
||||
{
|
||||
/* Run down the available processors in order of preference. */
|
||||
#ifdef HAVE_AVX512F
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX512F))
|
||||
if (__builtin_cpu_supports ("avx512f"))
|
||||
{
|
||||
matmul_fn = matmul_c4_avx512f;
|
||||
goto store;
|
||||
@ -2397,8 +2396,8 @@ void matmul_c4 (gfc_array_c4 * const restrict retarray,
|
||||
#endif /* HAVE_AVX512F */
|
||||
|
||||
#ifdef HAVE_AVX2
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX2))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx2")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_c4_avx2;
|
||||
goto store;
|
||||
@ -2407,26 +2406,26 @@ void matmul_c4 (gfc_array_c4 * const restrict retarray,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
if (__builtin_cpu_supports ("avx"))
|
||||
{
|
||||
matmul_fn = matmul_c4_avx;
|
||||
goto store;
|
||||
}
|
||||
#endif /* HAVE_AVX */
|
||||
}
|
||||
else if (__cpu_model.__cpu_vendor == VENDOR_AMD)
|
||||
else if (__builtin_cpu_is ("amd"))
|
||||
{
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA3) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_c4_avx128_fma3;
|
||||
goto store;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA4) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA4)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma4"))
|
||||
{
|
||||
matmul_fn = matmul_c4_avx128_fma4;
|
||||
goto store;
|
||||
|
@ -2367,7 +2367,6 @@ matmul_c8_vanilla (gfc_array_c8 * const restrict retarray,
|
||||
|
||||
/* Currently, this is i386 only. Adjust for other architectures. */
|
||||
|
||||
#include <config/i386/cpuinfo.h>
|
||||
void matmul_c8 (gfc_array_c8 * const restrict retarray,
|
||||
gfc_array_c8 * const restrict a, gfc_array_c8 * const restrict b, int try_blas,
|
||||
int blas_limit, blas_call gemm)
|
||||
@ -2384,11 +2383,11 @@ void matmul_c8 (gfc_array_c8 * const restrict retarray,
|
||||
if (matmul_fn == NULL)
|
||||
{
|
||||
matmul_fn = matmul_c8_vanilla;
|
||||
if (__cpu_model.__cpu_vendor == VENDOR_INTEL)
|
||||
if (__builtin_cpu_is ("intel"))
|
||||
{
|
||||
/* Run down the available processors in order of preference. */
|
||||
#ifdef HAVE_AVX512F
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX512F))
|
||||
if (__builtin_cpu_supports ("avx512f"))
|
||||
{
|
||||
matmul_fn = matmul_c8_avx512f;
|
||||
goto store;
|
||||
@ -2397,8 +2396,8 @@ void matmul_c8 (gfc_array_c8 * const restrict retarray,
|
||||
#endif /* HAVE_AVX512F */
|
||||
|
||||
#ifdef HAVE_AVX2
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX2))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx2")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_c8_avx2;
|
||||
goto store;
|
||||
@ -2407,26 +2406,26 @@ void matmul_c8 (gfc_array_c8 * const restrict retarray,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
if (__builtin_cpu_supports ("avx"))
|
||||
{
|
||||
matmul_fn = matmul_c8_avx;
|
||||
goto store;
|
||||
}
|
||||
#endif /* HAVE_AVX */
|
||||
}
|
||||
else if (__cpu_model.__cpu_vendor == VENDOR_AMD)
|
||||
else if (__builtin_cpu_is ("amd"))
|
||||
{
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA3) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_c8_avx128_fma3;
|
||||
goto store;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA4) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA4)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma4"))
|
||||
{
|
||||
matmul_fn = matmul_c8_avx128_fma4;
|
||||
goto store;
|
||||
|
@ -2367,7 +2367,6 @@ matmul_i1_vanilla (gfc_array_i1 * const restrict retarray,
|
||||
|
||||
/* Currently, this is i386 only. Adjust for other architectures. */
|
||||
|
||||
#include <config/i386/cpuinfo.h>
|
||||
void matmul_i1 (gfc_array_i1 * const restrict retarray,
|
||||
gfc_array_i1 * const restrict a, gfc_array_i1 * const restrict b, int try_blas,
|
||||
int blas_limit, blas_call gemm)
|
||||
@ -2384,11 +2383,11 @@ void matmul_i1 (gfc_array_i1 * const restrict retarray,
|
||||
if (matmul_fn == NULL)
|
||||
{
|
||||
matmul_fn = matmul_i1_vanilla;
|
||||
if (__cpu_model.__cpu_vendor == VENDOR_INTEL)
|
||||
if (__builtin_cpu_is ("intel"))
|
||||
{
|
||||
/* Run down the available processors in order of preference. */
|
||||
#ifdef HAVE_AVX512F
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX512F))
|
||||
if (__builtin_cpu_supports ("avx512f"))
|
||||
{
|
||||
matmul_fn = matmul_i1_avx512f;
|
||||
goto store;
|
||||
@ -2397,8 +2396,8 @@ void matmul_i1 (gfc_array_i1 * const restrict retarray,
|
||||
#endif /* HAVE_AVX512F */
|
||||
|
||||
#ifdef HAVE_AVX2
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX2))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx2")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_i1_avx2;
|
||||
goto store;
|
||||
@ -2407,26 +2406,26 @@ void matmul_i1 (gfc_array_i1 * const restrict retarray,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
if (__builtin_cpu_supports ("avx"))
|
||||
{
|
||||
matmul_fn = matmul_i1_avx;
|
||||
goto store;
|
||||
}
|
||||
#endif /* HAVE_AVX */
|
||||
}
|
||||
else if (__cpu_model.__cpu_vendor == VENDOR_AMD)
|
||||
else if (__builtin_cpu_is ("amd"))
|
||||
{
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA3) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_i1_avx128_fma3;
|
||||
goto store;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA4) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA4)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma4"))
|
||||
{
|
||||
matmul_fn = matmul_i1_avx128_fma4;
|
||||
goto store;
|
||||
|
@ -2367,7 +2367,6 @@ matmul_i16_vanilla (gfc_array_i16 * const restrict retarray,
|
||||
|
||||
/* Currently, this is i386 only. Adjust for other architectures. */
|
||||
|
||||
#include <config/i386/cpuinfo.h>
|
||||
void matmul_i16 (gfc_array_i16 * const restrict retarray,
|
||||
gfc_array_i16 * const restrict a, gfc_array_i16 * const restrict b, int try_blas,
|
||||
int blas_limit, blas_call gemm)
|
||||
@ -2384,11 +2383,11 @@ void matmul_i16 (gfc_array_i16 * const restrict retarray,
|
||||
if (matmul_fn == NULL)
|
||||
{
|
||||
matmul_fn = matmul_i16_vanilla;
|
||||
if (__cpu_model.__cpu_vendor == VENDOR_INTEL)
|
||||
if (__builtin_cpu_is ("intel"))
|
||||
{
|
||||
/* Run down the available processors in order of preference. */
|
||||
#ifdef HAVE_AVX512F
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX512F))
|
||||
if (__builtin_cpu_supports ("avx512f"))
|
||||
{
|
||||
matmul_fn = matmul_i16_avx512f;
|
||||
goto store;
|
||||
@ -2397,8 +2396,8 @@ void matmul_i16 (gfc_array_i16 * const restrict retarray,
|
||||
#endif /* HAVE_AVX512F */
|
||||
|
||||
#ifdef HAVE_AVX2
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX2))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx2")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_i16_avx2;
|
||||
goto store;
|
||||
@ -2407,26 +2406,26 @@ void matmul_i16 (gfc_array_i16 * const restrict retarray,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
if (__builtin_cpu_supports ("avx"))
|
||||
{
|
||||
matmul_fn = matmul_i16_avx;
|
||||
goto store;
|
||||
}
|
||||
#endif /* HAVE_AVX */
|
||||
}
|
||||
else if (__cpu_model.__cpu_vendor == VENDOR_AMD)
|
||||
else if (__builtin_cpu_is ("amd"))
|
||||
{
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA3) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_i16_avx128_fma3;
|
||||
goto store;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA4) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA4)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma4"))
|
||||
{
|
||||
matmul_fn = matmul_i16_avx128_fma4;
|
||||
goto store;
|
||||
|
@ -2367,7 +2367,6 @@ matmul_i2_vanilla (gfc_array_i2 * const restrict retarray,
|
||||
|
||||
/* Currently, this is i386 only. Adjust for other architectures. */
|
||||
|
||||
#include <config/i386/cpuinfo.h>
|
||||
void matmul_i2 (gfc_array_i2 * const restrict retarray,
|
||||
gfc_array_i2 * const restrict a, gfc_array_i2 * const restrict b, int try_blas,
|
||||
int blas_limit, blas_call gemm)
|
||||
@ -2384,11 +2383,11 @@ void matmul_i2 (gfc_array_i2 * const restrict retarray,
|
||||
if (matmul_fn == NULL)
|
||||
{
|
||||
matmul_fn = matmul_i2_vanilla;
|
||||
if (__cpu_model.__cpu_vendor == VENDOR_INTEL)
|
||||
if (__builtin_cpu_is ("intel"))
|
||||
{
|
||||
/* Run down the available processors in order of preference. */
|
||||
#ifdef HAVE_AVX512F
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX512F))
|
||||
if (__builtin_cpu_supports ("avx512f"))
|
||||
{
|
||||
matmul_fn = matmul_i2_avx512f;
|
||||
goto store;
|
||||
@ -2397,8 +2396,8 @@ void matmul_i2 (gfc_array_i2 * const restrict retarray,
|
||||
#endif /* HAVE_AVX512F */
|
||||
|
||||
#ifdef HAVE_AVX2
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX2))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx2")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_i2_avx2;
|
||||
goto store;
|
||||
@ -2407,26 +2406,26 @@ void matmul_i2 (gfc_array_i2 * const restrict retarray,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
if (__builtin_cpu_supports ("avx"))
|
||||
{
|
||||
matmul_fn = matmul_i2_avx;
|
||||
goto store;
|
||||
}
|
||||
#endif /* HAVE_AVX */
|
||||
}
|
||||
else if (__cpu_model.__cpu_vendor == VENDOR_AMD)
|
||||
else if (__builtin_cpu_is ("amd"))
|
||||
{
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA3) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_i2_avx128_fma3;
|
||||
goto store;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA4) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA4)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma4"))
|
||||
{
|
||||
matmul_fn = matmul_i2_avx128_fma4;
|
||||
goto store;
|
||||
|
@ -2367,7 +2367,6 @@ matmul_i4_vanilla (gfc_array_i4 * const restrict retarray,
|
||||
|
||||
/* Currently, this is i386 only. Adjust for other architectures. */
|
||||
|
||||
#include <config/i386/cpuinfo.h>
|
||||
void matmul_i4 (gfc_array_i4 * const restrict retarray,
|
||||
gfc_array_i4 * const restrict a, gfc_array_i4 * const restrict b, int try_blas,
|
||||
int blas_limit, blas_call gemm)
|
||||
@ -2384,11 +2383,11 @@ void matmul_i4 (gfc_array_i4 * const restrict retarray,
|
||||
if (matmul_fn == NULL)
|
||||
{
|
||||
matmul_fn = matmul_i4_vanilla;
|
||||
if (__cpu_model.__cpu_vendor == VENDOR_INTEL)
|
||||
if (__builtin_cpu_is ("intel"))
|
||||
{
|
||||
/* Run down the available processors in order of preference. */
|
||||
#ifdef HAVE_AVX512F
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX512F))
|
||||
if (__builtin_cpu_supports ("avx512f"))
|
||||
{
|
||||
matmul_fn = matmul_i4_avx512f;
|
||||
goto store;
|
||||
@ -2397,8 +2396,8 @@ void matmul_i4 (gfc_array_i4 * const restrict retarray,
|
||||
#endif /* HAVE_AVX512F */
|
||||
|
||||
#ifdef HAVE_AVX2
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX2))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx2")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_i4_avx2;
|
||||
goto store;
|
||||
@ -2407,26 +2406,26 @@ void matmul_i4 (gfc_array_i4 * const restrict retarray,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
if (__builtin_cpu_supports ("avx"))
|
||||
{
|
||||
matmul_fn = matmul_i4_avx;
|
||||
goto store;
|
||||
}
|
||||
#endif /* HAVE_AVX */
|
||||
}
|
||||
else if (__cpu_model.__cpu_vendor == VENDOR_AMD)
|
||||
else if (__builtin_cpu_is ("amd"))
|
||||
{
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA3) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_i4_avx128_fma3;
|
||||
goto store;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA4) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA4)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma4"))
|
||||
{
|
||||
matmul_fn = matmul_i4_avx128_fma4;
|
||||
goto store;
|
||||
|
@ -2367,7 +2367,6 @@ matmul_i8_vanilla (gfc_array_i8 * const restrict retarray,
|
||||
|
||||
/* Currently, this is i386 only. Adjust for other architectures. */
|
||||
|
||||
#include <config/i386/cpuinfo.h>
|
||||
void matmul_i8 (gfc_array_i8 * const restrict retarray,
|
||||
gfc_array_i8 * const restrict a, gfc_array_i8 * const restrict b, int try_blas,
|
||||
int blas_limit, blas_call gemm)
|
||||
@ -2384,11 +2383,11 @@ void matmul_i8 (gfc_array_i8 * const restrict retarray,
|
||||
if (matmul_fn == NULL)
|
||||
{
|
||||
matmul_fn = matmul_i8_vanilla;
|
||||
if (__cpu_model.__cpu_vendor == VENDOR_INTEL)
|
||||
if (__builtin_cpu_is ("intel"))
|
||||
{
|
||||
/* Run down the available processors in order of preference. */
|
||||
#ifdef HAVE_AVX512F
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX512F))
|
||||
if (__builtin_cpu_supports ("avx512f"))
|
||||
{
|
||||
matmul_fn = matmul_i8_avx512f;
|
||||
goto store;
|
||||
@ -2397,8 +2396,8 @@ void matmul_i8 (gfc_array_i8 * const restrict retarray,
|
||||
#endif /* HAVE_AVX512F */
|
||||
|
||||
#ifdef HAVE_AVX2
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX2))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx2")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_i8_avx2;
|
||||
goto store;
|
||||
@ -2407,26 +2406,26 @@ void matmul_i8 (gfc_array_i8 * const restrict retarray,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
if (__builtin_cpu_supports ("avx"))
|
||||
{
|
||||
matmul_fn = matmul_i8_avx;
|
||||
goto store;
|
||||
}
|
||||
#endif /* HAVE_AVX */
|
||||
}
|
||||
else if (__cpu_model.__cpu_vendor == VENDOR_AMD)
|
||||
else if (__builtin_cpu_is ("amd"))
|
||||
{
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA3) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_i8_avx128_fma3;
|
||||
goto store;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA4) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA4)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma4"))
|
||||
{
|
||||
matmul_fn = matmul_i8_avx128_fma4;
|
||||
goto store;
|
||||
|
@ -2367,7 +2367,6 @@ matmul_r10_vanilla (gfc_array_r10 * const restrict retarray,
|
||||
|
||||
/* Currently, this is i386 only. Adjust for other architectures. */
|
||||
|
||||
#include <config/i386/cpuinfo.h>
|
||||
void matmul_r10 (gfc_array_r10 * const restrict retarray,
|
||||
gfc_array_r10 * const restrict a, gfc_array_r10 * const restrict b, int try_blas,
|
||||
int blas_limit, blas_call gemm)
|
||||
@ -2384,11 +2383,11 @@ void matmul_r10 (gfc_array_r10 * const restrict retarray,
|
||||
if (matmul_fn == NULL)
|
||||
{
|
||||
matmul_fn = matmul_r10_vanilla;
|
||||
if (__cpu_model.__cpu_vendor == VENDOR_INTEL)
|
||||
if (__builtin_cpu_is ("intel"))
|
||||
{
|
||||
/* Run down the available processors in order of preference. */
|
||||
#ifdef HAVE_AVX512F
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX512F))
|
||||
if (__builtin_cpu_supports ("avx512f"))
|
||||
{
|
||||
matmul_fn = matmul_r10_avx512f;
|
||||
goto store;
|
||||
@ -2397,8 +2396,8 @@ void matmul_r10 (gfc_array_r10 * const restrict retarray,
|
||||
#endif /* HAVE_AVX512F */
|
||||
|
||||
#ifdef HAVE_AVX2
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX2))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx2")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_r10_avx2;
|
||||
goto store;
|
||||
@ -2407,26 +2406,26 @@ void matmul_r10 (gfc_array_r10 * const restrict retarray,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
if (__builtin_cpu_supports ("avx"))
|
||||
{
|
||||
matmul_fn = matmul_r10_avx;
|
||||
goto store;
|
||||
}
|
||||
#endif /* HAVE_AVX */
|
||||
}
|
||||
else if (__cpu_model.__cpu_vendor == VENDOR_AMD)
|
||||
else if (__builtin_cpu_is ("amd"))
|
||||
{
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA3) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_r10_avx128_fma3;
|
||||
goto store;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA4) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA4)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma4"))
|
||||
{
|
||||
matmul_fn = matmul_r10_avx128_fma4;
|
||||
goto store;
|
||||
|
@ -2367,7 +2367,6 @@ matmul_r16_vanilla (gfc_array_r16 * const restrict retarray,
|
||||
|
||||
/* Currently, this is i386 only. Adjust for other architectures. */
|
||||
|
||||
#include <config/i386/cpuinfo.h>
|
||||
void matmul_r16 (gfc_array_r16 * const restrict retarray,
|
||||
gfc_array_r16 * const restrict a, gfc_array_r16 * const restrict b, int try_blas,
|
||||
int blas_limit, blas_call gemm)
|
||||
@ -2384,11 +2383,11 @@ void matmul_r16 (gfc_array_r16 * const restrict retarray,
|
||||
if (matmul_fn == NULL)
|
||||
{
|
||||
matmul_fn = matmul_r16_vanilla;
|
||||
if (__cpu_model.__cpu_vendor == VENDOR_INTEL)
|
||||
if (__builtin_cpu_is ("intel"))
|
||||
{
|
||||
/* Run down the available processors in order of preference. */
|
||||
#ifdef HAVE_AVX512F
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX512F))
|
||||
if (__builtin_cpu_supports ("avx512f"))
|
||||
{
|
||||
matmul_fn = matmul_r16_avx512f;
|
||||
goto store;
|
||||
@ -2397,8 +2396,8 @@ void matmul_r16 (gfc_array_r16 * const restrict retarray,
|
||||
#endif /* HAVE_AVX512F */
|
||||
|
||||
#ifdef HAVE_AVX2
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX2))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx2")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_r16_avx2;
|
||||
goto store;
|
||||
@ -2407,26 +2406,26 @@ void matmul_r16 (gfc_array_r16 * const restrict retarray,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
if (__builtin_cpu_supports ("avx"))
|
||||
{
|
||||
matmul_fn = matmul_r16_avx;
|
||||
goto store;
|
||||
}
|
||||
#endif /* HAVE_AVX */
|
||||
}
|
||||
else if (__cpu_model.__cpu_vendor == VENDOR_AMD)
|
||||
else if (__builtin_cpu_is ("amd"))
|
||||
{
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA3) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_r16_avx128_fma3;
|
||||
goto store;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA4) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA4)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma4"))
|
||||
{
|
||||
matmul_fn = matmul_r16_avx128_fma4;
|
||||
goto store;
|
||||
|
@ -2367,7 +2367,6 @@ matmul_r4_vanilla (gfc_array_r4 * const restrict retarray,
|
||||
|
||||
/* Currently, this is i386 only. Adjust for other architectures. */
|
||||
|
||||
#include <config/i386/cpuinfo.h>
|
||||
void matmul_r4 (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)
|
||||
@ -2384,11 +2383,11 @@ void matmul_r4 (gfc_array_r4 * const restrict retarray,
|
||||
if (matmul_fn == NULL)
|
||||
{
|
||||
matmul_fn = matmul_r4_vanilla;
|
||||
if (__cpu_model.__cpu_vendor == VENDOR_INTEL)
|
||||
if (__builtin_cpu_is ("intel"))
|
||||
{
|
||||
/* Run down the available processors in order of preference. */
|
||||
#ifdef HAVE_AVX512F
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX512F))
|
||||
if (__builtin_cpu_supports ("avx512f"))
|
||||
{
|
||||
matmul_fn = matmul_r4_avx512f;
|
||||
goto store;
|
||||
@ -2397,8 +2396,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))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx2")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_r4_avx2;
|
||||
goto store;
|
||||
@ -2407,26 +2406,26 @@ void matmul_r4 (gfc_array_r4 * const restrict retarray,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
if (__builtin_cpu_supports ("avx"))
|
||||
{
|
||||
matmul_fn = matmul_r4_avx;
|
||||
goto store;
|
||||
}
|
||||
#endif /* HAVE_AVX */
|
||||
}
|
||||
else if (__cpu_model.__cpu_vendor == VENDOR_AMD)
|
||||
else if (__builtin_cpu_is ("amd"))
|
||||
{
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA3) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_r4_avx128_fma3;
|
||||
goto store;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA4) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA4)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma4"))
|
||||
{
|
||||
matmul_fn = matmul_r4_avx128_fma4;
|
||||
goto store;
|
||||
|
@ -2367,7 +2367,6 @@ matmul_r8_vanilla (gfc_array_r8 * const restrict retarray,
|
||||
|
||||
/* Currently, this is i386 only. Adjust for other architectures. */
|
||||
|
||||
#include <config/i386/cpuinfo.h>
|
||||
void matmul_r8 (gfc_array_r8 * const restrict retarray,
|
||||
gfc_array_r8 * const restrict a, gfc_array_r8 * const restrict b, int try_blas,
|
||||
int blas_limit, blas_call gemm)
|
||||
@ -2384,11 +2383,11 @@ void matmul_r8 (gfc_array_r8 * const restrict retarray,
|
||||
if (matmul_fn == NULL)
|
||||
{
|
||||
matmul_fn = matmul_r8_vanilla;
|
||||
if (__cpu_model.__cpu_vendor == VENDOR_INTEL)
|
||||
if (__builtin_cpu_is ("intel"))
|
||||
{
|
||||
/* Run down the available processors in order of preference. */
|
||||
#ifdef HAVE_AVX512F
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX512F))
|
||||
if (__builtin_cpu_supports ("avx512f"))
|
||||
{
|
||||
matmul_fn = matmul_r8_avx512f;
|
||||
goto store;
|
||||
@ -2397,8 +2396,8 @@ void matmul_r8 (gfc_array_r8 * const restrict retarray,
|
||||
#endif /* HAVE_AVX512F */
|
||||
|
||||
#ifdef HAVE_AVX2
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX2))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx2")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_r8_avx2;
|
||||
goto store;
|
||||
@ -2407,26 +2406,26 @@ void matmul_r8 (gfc_array_r8 * const restrict retarray,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
if (__builtin_cpu_supports ("avx"))
|
||||
{
|
||||
matmul_fn = matmul_r8_avx;
|
||||
goto store;
|
||||
}
|
||||
#endif /* HAVE_AVX */
|
||||
}
|
||||
else if (__cpu_model.__cpu_vendor == VENDOR_AMD)
|
||||
else if (__builtin_cpu_is ("amd"))
|
||||
{
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA3) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_r8_avx128_fma3;
|
||||
goto store;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA4) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA4)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma4"))
|
||||
{
|
||||
matmul_fn = matmul_r8_avx128_fma4;
|
||||
goto store;
|
||||
|
@ -134,7 +134,6 @@ internal_proto('matmul_name`);
|
||||
|
||||
/* Currently, this is i386 only. Adjust for other architectures. */
|
||||
|
||||
#include <config/i386/cpuinfo.h>
|
||||
void matmul_'rtype_code` ('rtype` * const restrict retarray,
|
||||
'rtype` * const restrict a, 'rtype` * const restrict b, int try_blas,
|
||||
int blas_limit, blas_call gemm)
|
||||
@ -151,11 +150,11 @@ void matmul_'rtype_code` ('rtype` * const restrict retarray,
|
||||
if (matmul_fn == NULL)
|
||||
{
|
||||
matmul_fn = matmul_'rtype_code`_vanilla;
|
||||
if (__cpu_model.__cpu_vendor == VENDOR_INTEL)
|
||||
if (__builtin_cpu_is ("intel"))
|
||||
{
|
||||
/* Run down the available processors in order of preference. */
|
||||
#ifdef HAVE_AVX512F
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX512F))
|
||||
if (__builtin_cpu_supports ("avx512f"))
|
||||
{
|
||||
matmul_fn = matmul_'rtype_code`_avx512f;
|
||||
goto store;
|
||||
@ -164,8 +163,8 @@ void matmul_'rtype_code` ('rtype` * const restrict retarray,
|
||||
#endif /* HAVE_AVX512F */
|
||||
|
||||
#ifdef HAVE_AVX2
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX2))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx2")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_'rtype_code`_avx2;
|
||||
goto store;
|
||||
@ -174,26 +173,26 @@ void matmul_'rtype_code` ('rtype` * const restrict retarray,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX
|
||||
if (__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
if (__builtin_cpu_supports ("avx"))
|
||||
{
|
||||
matmul_fn = matmul_'rtype_code`_avx;
|
||||
goto store;
|
||||
}
|
||||
#endif /* HAVE_AVX */
|
||||
}
|
||||
else if (__cpu_model.__cpu_vendor == VENDOR_AMD)
|
||||
else if (__builtin_cpu_is ("amd"))
|
||||
{
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA3) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma"))
|
||||
{
|
||||
matmul_fn = matmul_'rtype_code`_avx128_fma3;
|
||||
goto store;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_AVX) && defined(HAVE_FMA4) && defined(HAVE_AVX128)
|
||||
if ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX))
|
||||
&& (__cpu_model.__cpu_features[0] & (1 << FEATURE_FMA4)))
|
||||
if (__builtin_cpu_supports ("avx")
|
||||
&& __builtin_cpu_supports ("fma4"))
|
||||
{
|
||||
matmul_fn = matmul_'rtype_code`_avx128_fma4;
|
||||
goto store;
|
||||
|
Loading…
Reference in New Issue
Block a user