Browse Source

Merge pull request #2467 from AGSaidi/rpcc

Make rpcc() on arm64 get closer to what x86 returns
tags/v0.3.9
Martin Kroeker GitHub 6 years ago
parent
commit
a731a9bbb9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      common_arm64.h

+ 3
- 1
common_arm64.h View File

@@ -81,10 +81,12 @@ static void __inline blas_lock(volatile BLASULONG *address){
#if !defined(OS_DARWIN) && !defined (OS_ANDROID)
static __inline BLASULONG rpcc(void){
BLASULONG ret = 0;
blasint shift;
__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


Loading…
Cancel
Save