[llvm] [clang] [RISCV] Add experimental support of Zaamo and Zalrsc (PR #77424)

2024-01-28 Thread Ved Shanbhogue via cfe-commits
ved-rivos wrote: > > > I guess Zaamo + Zacas is technically a way one could implement atomics > > > without LR/SC? > > > > > > The Zacas extension depends upon the A extension. > > I filed an issue asking about that >

[llvm] [clang] [RISCV] Add experimental support of Zaamo and Zalrsc (PR #77424)

2024-01-18 Thread Craig Topper via cfe-commits
topperc wrote: Can we split the CodeGen part out of this patch? https://github.com/llvm/llvm-project/pull/77424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [RISCV] Add experimental support of Zaamo and Zalrsc (PR #77424)

2024-01-18 Thread Alex Bradbury via cfe-commits
asb wrote: > However, I must say, I cannot understand why this is even a thing that anyone > would want. Why would anyone design a single-processor RISCV system that > doesn't implement LR/SC? If you don't have the issue of coherent memory > across multiple CPUs, LR/SC is utterly trivial to

[llvm] [clang] [RISCV] Add experimental support of Zaamo and Zalrsc (PR #77424)

2024-01-18 Thread James Y Knight via cfe-commits
jyknight wrote: Yes, that's an acceptable/correct solution in that circumstance. Given we already have a forced-atomics option, IMO it probably makes sense to still require users to specify that explicitly, rather than effectively defaulting it to on with Zaamo. However, I must say, I cannot

[llvm] [clang] [RISCV] Add experimental support of Zaamo and Zalrsc (PR #77424)

2024-01-15 Thread Alex Bradbury via cfe-commits
asb wrote: There should be a release note for this as well as the RISCVUsage update. I have concerns that the codegen part of this isn't correct. Specifically, the [requirement](https://llvm.org/docs/Atomics.html#atomics-and-codegen) that "One very important property of the atomic operations

[llvm] [clang] [RISCV] Add experimental support of Zaamo and Zalrsc (PR #77424)

2024-01-09 Thread Wang Pengcheng via cfe-commits
@@ -0,0 +1,11 @@ +# RUN: not llvm-mc -triple riscv32 -mattr=+experimental-zaamo < %s 2>&1 | FileCheck %s wangpc-pp wrote: This can be done in the future, I think. Current implementation refers to the `Zmmul` (which is a sub-extension of M extension). The case

[llvm] [clang] [RISCV] Add experimental support of Zaamo and Zalrsc (PR #77424)

2024-01-09 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp created https://github.com/llvm/llvm-project/pull/77424 `A` extension has been split into two parts: Zaamo (Atomic Memory Operations) and Zalrsc (Load-Reserved/Store-Conditional). See also https://github.com/riscv/riscv-zaamo-zalrsc. This patch adds the basic