Skip to content

Commit 4197c35

Browse files
committed
Set proper assembler arch for MIPS64
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
1 parent fae9368 commit 4197c35

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

common_mips64.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ static inline unsigned int rpcc(void){
8686
//__asm__ __volatile__("dmfc0 %0, $25, 1": "=r"(tmp):: "memory");
8787
//ret=tmp;
8888
__asm__ __volatile__(".set push \n"
89+
#if !defined(__mips_isa_rev) || __mips_isa_rev < 2
8990
".set mips32r2\n"
91+
#endif
9092
"rdhwr %0, $2\n"
9193
".set pop": "=r"(ret):: "memory");
9294

@@ -99,7 +101,9 @@ static inline unsigned int rpcc(void){
99101
static inline int WhereAmI(void){
100102
int ret=0;
101103
__asm__ __volatile__(".set push \n"
104+
#if !defined(__mips_isa_rev) || __mips_isa_rev < 2
102105
".set mips32r2\n"
106+
#endif
103107
"rdhwr %0, $0\n"
104108
".set pop": "=r"(ret):: "memory");
105109
return ret;
@@ -197,9 +201,15 @@ static inline int blas_quickdivide(blasint x, blasint y){
197201

198202
#if defined(ASSEMBLER) && !defined(NEEDPARAM)
199203

204+
#if defined(__mips_isa_rev) && __mips_isa_rev >= 6
205+
#define ASSEMBLER_ARCH mips64r6
206+
#else
207+
#define ASSEMBLER_ARCH mips64
208+
#endif
209+
200210
#define PROLOGUE \
201211
.text ;\
202-
.set mips64 ;\
212+
.set ASSEMBLER_ARCH ;\
203213
.align 5 ;\
204214
.globl REALNAME ;\
205215
.ent REALNAME ;\

0 commit comments

Comments
 (0)