Provide a fallback MIPS64_GENERIC target
It is really dangerous to fallback to Loongson core on other MIPS64 processors. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
This commit is contained in:
parent
b633eb79f2
commit
a50b29c540
|
@ -677,7 +677,7 @@ endif
|
|||
endif
|
||||
|
||||
ifeq ($(ARCH), mips64)
|
||||
DYNAMIC_CORE = LOONGSON3R3 LOONGSON3R4
|
||||
DYNAMIC_CORE = LOONGSON3R3 LOONGSON3R4 MIPS64_GENERIC
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH), loongarch64)
|
||||
|
@ -856,6 +856,11 @@ CCOMMON_OPT += -mabi=32
|
|||
BINARY_DEFINED = 1
|
||||
endif
|
||||
|
||||
ifneq (, $(filter $(CORE), MIPS64_GENERIC))
|
||||
CCOMMON_OPT += -DNO_MSA
|
||||
FCOMMON_OPT += -DNO_MSA
|
||||
endif
|
||||
|
||||
ifneq (, $(filter $(CORE),LOONGSON3R3 LOONGSON3R4))
|
||||
CCOMMON_OPT += -march=loongson3a
|
||||
FCOMMON_OPT += -march=loongson3a
|
||||
|
|
|
@ -65,6 +65,7 @@ MIPS1004K
|
|||
MIPS24K
|
||||
|
||||
4.MIPS64 CPU:
|
||||
MIPS64_GENERIC
|
||||
SICORTEX
|
||||
LOONGSON3A
|
||||
LOONGSON3B
|
||||
|
|
|
@ -70,16 +70,18 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
/* or implied, of The University of Texas at Austin. */
|
||||
/*********************************************************************/
|
||||
|
||||
#define CPU_UNKNOWN 0
|
||||
#define CPU_SICORTEX 1
|
||||
#define CPU_LOONGSON3R3 2
|
||||
#define CPU_LOONGSON3R4 3
|
||||
#define CPU_I6400 4
|
||||
#define CPU_P6600 5
|
||||
#define CPU_I6500 6
|
||||
#define CPU_UNKNOWN 0
|
||||
#define CPU_MIPS64_GENERIC 1
|
||||
#define CPU_SICORTEX 2
|
||||
#define CPU_LOONGSON3R3 3
|
||||
#define CPU_LOONGSON3R4 4
|
||||
#define CPU_I6400 5
|
||||
#define CPU_P6600 6
|
||||
#define CPU_I6500 7
|
||||
|
||||
static char *cpuname[] = {
|
||||
"UNKNOWN",
|
||||
"MIPS64_GENERIC"
|
||||
"SICORTEX",
|
||||
"LOONGSON3R3",
|
||||
"LOONGSON3R4",
|
||||
|
@ -113,8 +115,11 @@ int detect(void){
|
|||
return CPU_SICORTEX;
|
||||
}
|
||||
}
|
||||
|
||||
return CPU_MIPS64_GENERIC;
|
||||
#else
|
||||
return CPU_UNKNOWN;
|
||||
#endif
|
||||
return CPU_UNKNOWN;
|
||||
}
|
||||
|
||||
char *get_corename(void){
|
||||
|
@ -136,9 +141,11 @@ void get_subarchitecture(void){
|
|||
printf("P6600");
|
||||
}else if(detect()==CPU_I6500){
|
||||
printf("I6500");
|
||||
}else{
|
||||
}else if(detect()==CPU_SICORTEX){
|
||||
printf("SICORTEX");
|
||||
}
|
||||
}else{
|
||||
printf("MIPS64_GENERIC");
|
||||
}
|
||||
}
|
||||
|
||||
void get_subdirname(void){
|
||||
|
@ -215,8 +222,8 @@ void get_libname(void){
|
|||
printf("p6600\n");
|
||||
}else if(detect()==CPU_I6500) {
|
||||
printf("i6500\n");
|
||||
}else{
|
||||
printf("mips64\n");
|
||||
}else {
|
||||
printf("mips64_generic\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,20 +49,23 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
extern gotoblas_t gotoblas_LOONGSON3R3;
|
||||
extern gotoblas_t gotoblas_LOONGSON3R4;
|
||||
extern gotoblas_t gotoblas_MIPS64_GENERIC;
|
||||
|
||||
extern void openblas_warning(int verbose, const char * msg);
|
||||
|
||||
#define NUM_CORETYPES 2
|
||||
#define NUM_CORETYPES 3
|
||||
|
||||
static char *corename[] = {
|
||||
"MIPS64_GENERIC"
|
||||
"loongson3r3",
|
||||
"loongson3r4",
|
||||
"UNKNOWN"
|
||||
};
|
||||
|
||||
char *gotoblas_corename(void) {
|
||||
if (gotoblas == &gotoblas_LOONGSON3R3) return corename[0];
|
||||
if (gotoblas == &gotoblas_LOONGSON3R4) return corename[1];
|
||||
if (gotoblas == &gotoblas_MIPS64_GENERIC) return corename[0];
|
||||
if (gotoblas == &gotoblas_LOONGSON3R3) return corename[1];
|
||||
if (gotoblas == &gotoblas_LOONGSON3R4) return corename[2];
|
||||
return corename[NUM_CORETYPES];
|
||||
}
|
||||
|
||||
|
@ -82,8 +85,9 @@ static gotoblas_t *force_coretype(char *coretype) {
|
|||
|
||||
switch (found)
|
||||
{
|
||||
case 0: return (&gotoblas_LOONGSON3R3);
|
||||
case 1: return (&gotoblas_LOONGSON3R4);
|
||||
case 0: return (&gotoblas_MIPS64_GENERIC);
|
||||
case 1: return (&gotoblas_LOONGSON3R3);
|
||||
case 2: return (&gotoblas_LOONGSON3R4);
|
||||
}
|
||||
snprintf(message, 128, "Core not found: %s\n", coretype);
|
||||
openblas_warning(1, message);
|
||||
|
@ -173,9 +177,9 @@ void gotoblas_dynamic_init(void) {
|
|||
|
||||
if (gotoblas == NULL)
|
||||
{
|
||||
snprintf(coremsg, 128, "Falling back to loongson3r3 core\n");
|
||||
snprintf(coremsg, 128, "Falling back to MIPS64_GENEIRC\n");
|
||||
openblas_warning(1, coremsg);
|
||||
gotoblas = &gotoblas_LOONGSON3R3;
|
||||
gotoblas = &gotoblas_MIPS64_GENERIC;
|
||||
}
|
||||
|
||||
if (gotoblas && gotoblas->init) {
|
||||
|
|
15
getarch.c
15
getarch.c
|
@ -131,6 +131,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
/* #define FORCE_PPC440 */
|
||||
/* #define FORCE_PPC440FP2 */
|
||||
/* #define FORCE_CELL */
|
||||
/* #define FORCE_MIPS64_GENERIC */
|
||||
/* #define FORCE_SICORTEX */
|
||||
/* #define FORCE_LOONGSON3R3 */
|
||||
/* #define FORCE_LOONGSON3R4 */
|
||||
|
@ -915,6 +916,20 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#define CORENAME "CELL"
|
||||
#endif
|
||||
|
||||
#ifdef FORCE_MIPS64_GENERIC
|
||||
#define FORCE
|
||||
#define ARCHITECTURE "MIPS"
|
||||
#define SUBARCHITECTURE "MIPS64_GENERIC"
|
||||
#define SUBDIRNAME "mips64"
|
||||
#define ARCHCONFIG "-DMIPS64_GENERIC " \
|
||||
"-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
|
||||
"-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
|
||||
"-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
|
||||
#define LIBNAME "mips64_generic"
|
||||
#define CORENAME "MIPS64_GENERIC"
|
||||
#else
|
||||
#endif
|
||||
|
||||
#ifdef FORCE_SICORTEX
|
||||
#define FORCE
|
||||
#define ARCHITECTURE "MIPS"
|
||||
|
|
|
@ -42,50 +42,58 @@ endif
|
|||
|
||||
ifndef SGEMMKERNEL
|
||||
SGEMMKERNEL = gemm_kernel.S
|
||||
ifneq ($(SGEMM_UNROLL_M), $(SGEMM_UNROLL_N))
|
||||
SGEMMINCOPY = ../generic/gemm_ncopy_2.c
|
||||
SGEMMITCOPY = ../generic/gemm_tcopy_2.c
|
||||
SGEMMINCOPYOBJ = sgemm_incopy$(TSUFFIX).$(SUFFIX)
|
||||
SGEMMITCOPYOBJ = sgemm_itcopy$(TSUFFIX).$(SUFFIX)
|
||||
endif
|
||||
SGEMMONCOPY = ../generic/gemm_ncopy_8.c
|
||||
SGEMMOTCOPY = ../generic/gemm_tcopy_8.c
|
||||
SGEMMINCOPYOBJ = sgemm_incopy.o
|
||||
SGEMMITCOPYOBJ = sgemm_itcopy.o
|
||||
SGEMMONCOPYOBJ = sgemm_oncopy.o
|
||||
SGEMMOTCOPYOBJ = sgemm_otcopy.o
|
||||
SGEMMONCOPYOBJ = sgemm_oncopy$(TSUFFIX).$(SUFFIX)
|
||||
SGEMMOTCOPYOBJ = sgemm_otcopy$(TSUFFIX).$(SUFFIX)
|
||||
endif
|
||||
|
||||
ifndef DGEMMKERNEL
|
||||
DGEMMKERNEL = gemm_kernel.S
|
||||
ifneq ($(DGEMM_UNROLL_M), $(DGEMM_UNROLL_N))
|
||||
DGEMMINCOPY = ../generic/gemm_ncopy_2.c
|
||||
DGEMMITCOPY = ../generic/gemm_tcopy_2.c
|
||||
DGEMMINCOPYOBJ = dgemm_incopy$(TSUFFIX).$(SUFFIX)
|
||||
DGEMMITCOPYOBJ = dgemm_itcopy$(TSUFFIX).$(SUFFIX)
|
||||
endif
|
||||
DGEMMONCOPY = ../generic/gemm_ncopy_8.c
|
||||
DGEMMOTCOPY = ../generic/gemm_tcopy_8.c
|
||||
DGEMMINCOPYOBJ = dgemm_incopy.o
|
||||
DGEMMITCOPYOBJ = dgemm_itcopy.o
|
||||
DGEMMONCOPYOBJ = dgemm_oncopy.o
|
||||
DGEMMOTCOPYOBJ = dgemm_otcopy.o
|
||||
DGEMMONCOPYOBJ = dgemm_oncopy$(TSUFFIX).$(SUFFIX)
|
||||
DGEMMOTCOPYOBJ = dgemm_otcopy$(TSUFFIX).$(SUFFIX)
|
||||
endif
|
||||
|
||||
ifndef CGEMMKERNEL
|
||||
CGEMMKERNEL = zgemm_kernel.S
|
||||
ifneq ($(CGEMM_UNROLL_M), $(CGEMM_UNROLL_N))
|
||||
CGEMMINCOPY = ../generic/zgemm_ncopy_1.c
|
||||
CGEMMITCOPY = ../generic/zgemm_tcopy_1.c
|
||||
CGEMMINCOPYOBJ = cgemm_incopy$(TSUFFIX).$(SUFFIX)
|
||||
CGEMMITCOPYOBJ = cgemm_itcopy$(TSUFFIX).$(SUFFIX)
|
||||
endif
|
||||
CGEMMONCOPY = ../generic/zgemm_ncopy_4.c
|
||||
CGEMMOTCOPY = ../generic/zgemm_tcopy_4.c
|
||||
CGEMMINCOPYOBJ = cgemm_incopy.o
|
||||
CGEMMITCOPYOBJ = cgemm_itcopy.o
|
||||
CGEMMONCOPYOBJ = cgemm_oncopy.o
|
||||
CGEMMOTCOPYOBJ = cgemm_otcopy.o
|
||||
CGEMMONCOPYOBJ = cgemm_oncopy$(TSUFFIX).$(SUFFIX)
|
||||
CGEMMOTCOPYOBJ = cgemm_otcopy$(TSUFFIX).$(SUFFIX)
|
||||
endif
|
||||
|
||||
ifndef ZGEMMKERNEL
|
||||
ZGEMMKERNEL = zgemm_kernel.S
|
||||
ifneq ($(ZGEMM_UNROLL_M), $(ZGEMM_UNROLL_N))
|
||||
ZGEMMINCOPY = ../generic/zgemm_ncopy_1.c
|
||||
ZGEMMITCOPY = ../generic/zgemm_tcopy_1.c
|
||||
ZGEMMINCOPYOBJ = zgemm_incopy$(TSUFFIX).$(SUFFIX)
|
||||
ZGEMMITCOPYOBJ = zgemm_itcopy$(TSUFFIX).$(SUFFIX)
|
||||
endif
|
||||
ZGEMMONCOPY = ../generic/zgemm_ncopy_4.c
|
||||
ZGEMMOTCOPY = ../generic/zgemm_tcopy_4.c
|
||||
ZGEMMINCOPYOBJ = zgemm_incopy.o
|
||||
ZGEMMITCOPYOBJ = zgemm_itcopy.o
|
||||
ZGEMMONCOPYOBJ = zgemm_oncopy.o
|
||||
ZGEMMOTCOPYOBJ = zgemm_otcopy.o
|
||||
ZGEMMONCOPYOBJ = zgemm_oncopy$(TSUFFIX).$(SUFFIX)
|
||||
ZGEMMOTCOPYOBJ = zgemm_otcopy$(TSUFFIX).$(SUFFIX)
|
||||
endif
|
||||
|
||||
ifndef SGEMM_BETA
|
||||
|
|
2
param.h
2
param.h
|
@ -2945,7 +2945,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#define SYMV_P 16
|
||||
#endif
|
||||
|
||||
#if defined(P5600) || defined(MIPS1004K) || defined(MIPS24K) || defined(I6400) || defined(P6600) || defined(I6500)
|
||||
#if defined(MIPS64_GENERIC) || defined(P5600) || defined(MIPS1004K) || defined(MIPS24K) || defined(I6400) || defined(P6600) || defined(I6500)
|
||||
#define SNUMOPT 2
|
||||
#define DNUMOPT 2
|
||||
|
||||
|
|
Loading…
Reference in New Issue