Skip to content

Commit a367f5f

Browse files
committed
fix: rpcc on linux aarch64
The inline assembly code seems ill-formed and gcc/clang are not generating the same thing. This also removes hundreds of `warning: value size does not match register size specified by the constraint and modifier` when building with clang.
1 parent 28eeef5 commit a367f5f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

common_arm64.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ static __inline BLASULONG rpcc(void){
114114
#else
115115
BLASULONG ret = 0;
116116
blasint shift;
117-
118-
__asm__ __volatile__ ("isb; mrs %0,cntvct_el0":"=r"(ret));
119-
__asm__ __volatile__ ("mrs %0,cntfrq_el0; clz %w0, %w0":"=&r"(shift));
117+
118+
__asm__ __volatile__ ("isb\n\tmrs %0,cntvct_el0":"=r"(ret));
119+
__asm__ __volatile__ ("mrs %x0,cntfrq_el0\n\tclz %w0, %w0":"=&r"(shift));
120120

121121
return ret << shift;
122122
#endif

0 commit comments

Comments
 (0)