LoongArch64: Add WhereAmI()
This commit is contained in:
parent
2183dbcfe2
commit
6deb52812d
|
@ -83,6 +83,19 @@ static inline int blas_quickdivide(blasint x, blasint y){
|
||||||
return x / y;
|
return x / y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NO_AFFINITY
|
||||||
|
static inline int WhereAmI(void){
|
||||||
|
int ret = 0, counter = 0;
|
||||||
|
__asm__ volatile (
|
||||||
|
"rdtimel.w %[counter], %[id]"
|
||||||
|
: [id]"=r"(ret), [counter]"=r"(counter)
|
||||||
|
:
|
||||||
|
: "memory"
|
||||||
|
);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DOUBLE
|
#ifdef DOUBLE
|
||||||
#define GET_IMAGE(res) __asm__ __volatile__("fmov.d %0, $f2" : "=f"(res) : : "memory")
|
#define GET_IMAGE(res) __asm__ __volatile__("fmov.d %0, $f2" : "=f"(res) : : "memory")
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue