Skip to content

Commit 48f5a89

Browse files
authored
Merge pull request #2282 from martin-frbg/issue2281
Optimize RPCC function on ARM64
2 parents 4ae1610 + b687fba commit 48f5a89

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

common_arm64.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,18 @@ static void __inline blas_lock(volatile BLASULONG *address){
7878

7979
#define BLAS_LOCK_DEFINED
8080

81+
#if !defined(OS_DARWIN) && !defined (OS_ANDROID)
82+
static __inline BLASULONG rpcc(void){
83+
BLASULONG ret = 0;
84+
85+
__asm__ __volatile__ ("isb; mrs %0,cntvct_el0":"=r"(ret));
8186

87+
return ret;
88+
}
89+
90+
#define RPCC_DEFINED
91+
#define RPCC64BIT
92+
#endif
8293

8394
static inline int blas_quickdivide(blasint x, blasint y){
8495
return x / y;

0 commit comments

Comments
 (0)