GCCVERSIONGT5 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \> 5)
GCCVERSIONGTEQ7 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 7)
GCCVERSIONGTEQ9 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 9)
+GCCVERSIONGTEQ11 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 11)
+GCCVERSIONGTEQ10 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 10)
# Note that the behavior of -dumpversion is compile-time-configurable for
# gcc-7.x and newer. Use -dumpfullversion there
ifeq ($(GCCVERSIONGTEQ7),1)
else
$(info, OpenBLAS: Your gcc version is too old to build the POWER9 kernels.)
endif
-GCCVERSIONGTEQ11 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 11)
ifeq ($(GCCVERSIONGTEQ11), 1)
DYNAMIC_CORE += POWER10
+else ifeq ($(GCCVERSIONEQ10), 1)
+ifeq ($(GCCMINORVERSIONGTEQ2), 1)
+DYNAMIC_CORE += POWER10
+endif
else
$(info, OpenBLAS: Your gcc version is too old to build the POWER10 kernels.)
endif
#if (!defined __GNUC__) || ( __GNUC__ >= 6)
extern gotoblas_t gotoblas_POWER9;
#endif
-#if (!defined __GNUC__) || ( __GNUC__ >= 11)
+#if (!defined __GNUC__) || ( __GNUC__ >= 11) \
+ || (__GNUC__ == 10 && __GNUC_MINOR__ >= 2)
+#define HAVE_P10_SUPPORT 1
+#endif
+#ifdef HAVE_P10_SUPPORT
extern gotoblas_t gotoblas_POWER10;
#endif
#if (!defined __GNUC__) || ( __GNUC__ >= 6)
if (gotoblas == &gotoblas_POWER9) return corename[3];
#endif
-#if (!defined __GNUC__) || ( __GNUC__ >= 11)
+#ifdef HAVE_P10_SUPPORT
if (gotoblas == &gotoblas_POWER10) return corename[4];
#endif
return corename[0];
if (__builtin_cpu_is("power9"))
return &gotoblas_POWER9;
#endif
-#if (!defined __GNUC__) || ( __GNUC__ >= 11)
+#ifdef HAVE_P10_SUPPORT
if (__builtin_cpu_supports ("arch_3_1") && __builtin_cpu_supports ("mma"))
return &gotoblas_POWER10;
#endif
#if (!defined __GNUC__) || ( __GNUC__ >= 6)
case 3: return (&gotoblas_POWER9);
#endif
-#if (!defined __GNUC__) || ( __GNUC__ >= 11)
+#ifdef HAVE_P10_SUPPORT
case 4: return (&gotoblas_POWER10);
#endif
default: return NULL;