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

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 20 14:57:04 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")) {
----------------
slachowsky wrote:

done, this is checked in a separate preproc test called `riscv-atomics.c`

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


More information about the llvm-commits mailing list