On 6/10/24 21:32, Jeff Law wrote:


On 6/10/24 6:15 PM, Andrea Parri wrote:
On Mon, Jun 10, 2024 at 02:46:54PM -0700, Patrick O'Neill wrote:
The A extension has been split into two parts: Zaamo and Zalrsc.
This patch adds basic support by making the A extension imply Zaamo and
Zalrsc.

Zaamo/Zalrsc spec: https://github.com/riscv/riscv-zaamo-zalrsc/tags
Ratification: https://jira.riscv.org/browse/RVS-1995

v2:
Rebased and updated some testcases that rely on the ISA string.

v3:
Regex-ify temp registers in added testcases.
Remove unintentional whitespace changes.
Add riscv_{a|ztso|zaamo|zalrsc} docs to sourcebuild.texi (and move core-v bi
extension doc into appropriate section).

Edwin Lu (1):
   RISC-V: Add basic Zaamo and Zalrsc support

Patrick O'Neill (2):
   RISC-V: Add Zalrsc and Zaamo testsuite support
   RISC-V: Add Zalrsc amo-op patterns

While providing a proper/detailed review of the series goes above my
"GCC internals" skills, I've applied the series and checked that the
generated code for some atomic operations meet expectations (expecta-
tions which, w/ "only Zaamo", are arguably quite low as mentioned in
v2 and elsewhere):
Thanks for taking the time.  We realize you're not a GCC expert, but having an extra pair of eyes on the atomics is always appreciated.


Tested-by: Andrea Parri <and...@rivosinc.com>

   Andrea


P.S. Unrelated to the changes at stake, but perhaps worth mentioning:
w/ and w/o these changes, the following
[ ... ]
I'll leave this to Patrick to decide if he wants to update.  I'm always hesitant to weaken this stuff as I'm sure there's somebody, somewhere that assumes the stronger primitives.
This is a great find by Andrea. At first glance it looks like we handle
SI/DI cases but fall over for subword loads/stores which causes gcc to
emit the overly-conservative fences:

https://godbolt.org/z/68no8z98E

LLVM already emits fences for subword loads/stores in line with the PSABI:

https://godbolt.org/z/MGfqMv1eE

I'll make a follow-up patch to bring us in line with the PSABI mappings.

Patrick

Jeff

Reply via email to