[PATCH] riscv: cmpxchg: Use .option arch for Zacas and Zabha
Paul Walmsley
pjw at kernel.org
Thu Aug 6 09:34:23 PDT 2026
On Fri, 17 Jul 2026, Vivian Wang wrote:
> Instead of adding these to -march globally, use .option arch to use
> instructions from these extensions only in code paths where we know they
> are available, like how it is done for most other extensions.
> TOOLCHAIN_HAS_{ZACAS,ZABHA} already depend on AS_HAS_OPTION_ARCH, so
> this is not a functionality regression even on older assemblers.
>
> Although the compiler is unlikely to generate atomics on its own accord,
> this aligns handling of Zacas and Zabha with most other extensions and
> improves consistency on how assembly code requiring extra extensions is
> written in kernel code.
>
> This is analogous to the use of __LSE_PREAMBLE or .arch_extension lse in
> arm64 code.
>
> Signed-off-by: Vivian Wang <wangruikang at iscas.ac.cn>
Thanks, queued for v7.3.
- Paul
More information about the linux-riscv
mailing list