From 285e69e2d16c6c4d5addcc124801c1aed01b1e2d Mon Sep 17 00:00:00 2001 From: Xianyi Zhang Date: Thu, 17 Nov 2011 16:46:26 +0000 Subject: [PATCH] Disable using simple thread level3 to fix a bug on Loongson 3B. --- Makefile.system | 9 ++++++++- common_mips64.h | 9 +++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Makefile.system b/Makefile.system index 985f95084..da3820fec 100644 --- a/Makefile.system +++ b/Makefile.system @@ -275,7 +275,12 @@ endif BINARY_DEFINED = 1 endif -ifeq ($(CORE), LOONGSON3A) +ifeq ($(CORE), LOONGSON3A) +CCOMMON_OPT += -march=mips64 +FCOMMON_OPT += -march=mips64 +endif + +ifeq ($(CORE), LOONGSON3B) CCOMMON_OPT += -march=mips64 FCOMMON_OPT += -march=mips64 endif @@ -529,8 +534,10 @@ ifdef SMP CCOMMON_OPT += -DSMP_SERVER ifeq ($(ARCH), mips64) +ifneq ($(CORE), LOONGSON3B) USE_SIMPLE_THREADED_LEVEL3 = 1 endif +endif ifeq ($(USE_OPENMP), 1) # USE_SIMPLE_THREADED_LEVEL3 = 1 diff --git a/common_mips64.h b/common_mips64.h index 5db96c4aa..560f2c372 100644 --- a/common_mips64.h +++ b/common_mips64.h @@ -119,7 +119,8 @@ static inline unsigned int rpcc(void){ return ret; } -//#if defined(LOONGSON3A) || defined(LOONGSON3B) +#if defined(LOONGSON3A) || defined(LOONGSON3B) +#define WHEREAMI static inline int WhereAmI(void){ int ret=0; __asm__ __volatile__(".set push \n" @@ -129,7 +130,7 @@ static inline int WhereAmI(void){ return ret; } -//#endif +#endif static inline int blas_quickdivide(blasint x, blasint y){ return x / y; @@ -252,8 +253,8 @@ REALNAME: ;\ #endif #if defined(LOONGSON3B) -#define PAGESIZE (16UL << 10) -#define FIXED_PAGESIZE (16UL << 10) +#define PAGESIZE (32UL << 10) +#define FIXED_PAGESIZE (32UL << 10) #endif #ifndef PAGESIZE