Merge pull request #2467 from AGSaidi/rpcc
Make rpcc() on arm64 get closer to what x86 returns
This commit is contained in:
+3
-1
@@ -81,10 +81,12 @@ static void __inline blas_lock(volatile BLASULONG *address){
|
|||||||
#if !defined(OS_DARWIN) && !defined (OS_ANDROID)
|
#if !defined(OS_DARWIN) && !defined (OS_ANDROID)
|
||||||
static __inline BLASULONG rpcc(void){
|
static __inline BLASULONG rpcc(void){
|
||||||
BLASULONG ret = 0;
|
BLASULONG ret = 0;
|
||||||
|
blasint shift;
|
||||||
|
|
||||||
__asm__ __volatile__ ("isb; mrs %0,cntvct_el0":"=r"(ret));
|
__asm__ __volatile__ ("isb; mrs %0,cntvct_el0":"=r"(ret));
|
||||||
|
__asm__ __volatile__ ("mrs %0,cntfrq_el0; clz %w0, %w0":"=&r"(shift));
|
||||||
|
|
||||||
return ret;
|
return ret << shift;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define RPCC_DEFINED
|
#define RPCC_DEFINED
|
||||||
|
|||||||
Reference in New Issue
Block a user