From a367f5f58b969a5e2b9a83a45435187813d22793 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 22 Nov 2025 09:40:18 +0100 Subject: [PATCH] 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. --- common_arm64.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common_arm64.h b/common_arm64.h index 5856898a2b..2002de90fd 100644 --- a/common_arm64.h +++ b/common_arm64.h @@ -114,9 +114,9 @@ static __inline BLASULONG rpcc(void){ #else 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)); + + __asm__ __volatile__ ("isb\n\tmrs %0,cntvct_el0":"=r"(ret)); + __asm__ __volatile__ ("mrs %x0,cntfrq_el0\n\tclz %w0, %w0":"=&r"(shift)); return ret << shift; #endif