[clang] [llvm] [RISCV][LLVM] Enable atomics for 'Zalrsc' (PR #163672)

Francesco Petrogalli via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 20 11:45:06 PDT 2025


================
@@ -192,8 +192,11 @@ void RISCVTargetInfo::getTargetDefines(const LangOptions &Opts,
     Builder.defineMacro("__riscv_muldiv");
   }
 
-  if (ISAInfo->hasExtension("a")) {
+  // The "a" extension is composed of "zalrsc" and "zaamo"
+  if (ISAInfo->hasExtension("a"))
     Builder.defineMacro("__riscv_atomic");
+
+  if (ISAInfo->hasExtension("zalrsc")) {
----------------
fpetrogalli wrote:

`__riscv_atomic` is tested under `test/Preprocessor/riscv-target-features.c`, but none of the `__GCC*` ones seem to be tested for RISCV. Please add a frontend test for those too, when enabling zalrsc

https://github.com/llvm/llvm-project/pull/163672


More information about the llvm-commits mailing list