[PATCH 0/1] RISC-V: Add support for 'Zacas' atomic CAS

Tsukasa OI research_trasio@irq.a4lg.com
Sat Oct 21 03:12:08 GMT 2023


Hi,

This patch adds support for now frozen (and being ratification) 'Zacas'
extension, containing atomic CAS instructions.

There are two patch sets by other people:

By Gianluca Guida (in 2023 May; RFC PATCH v2 at that time):
<https://sourceware.org/pipermail/binutils/2023-May/127700.html>
By Jiawei (in 2023 July; withdrawn):
<https://sourceware.org/pipermail/binutils/2023-July/128556.html>

... but independently developed.


Note that, this is one of the extensions that require the concept of
register pairs or register groups because it contains 2*XLEN-width
(double-word) CAS instructions.

We are better to reject invalid encodings considering the consensus after
the discussion of RISC-V GNU Toolchain meeting at 2022-10-06 (the feedback
of my proposal itself wasn't positive but we agreed that we are better to
detect invalid encodings as early as possible [I mean, in the assembler])
and the feedback to Gianluca's first RFC PATCH by Jan:
<https://sourceware.org/pipermail/binutils/2023-May/127407.html>


Differences to Gianluka's:
1.  Correct data size (INSN_DREF|INSN_*_BYTE) we are handling
2.  Make register pair matching function to be template
    to enable reusing this framework for upcoming P and existing Zdinx and
    V (many V cases are invalid only on certain runtime configuration and
    "always invalid" detectable cases are rare, but not zero).

Differences to Jiawei's:
1.  Correct support for register groups (fixed in Gianluka's RFC PATCH v2).


Thanks,
Tsukasa




Tsukasa OI (1):
  RISC-V: Add support for 'Zacas' atomic CAS

 bfd/elfxx-riscv.c                       |  6 +++++
 gas/testsuite/gas/riscv/zacas-32-fail.d |  2 ++
 gas/testsuite/gas/riscv/zacas-32-fail.l |  9 +++++++
 gas/testsuite/gas/riscv/zacas-32-fail.s | 10 +++++++
 gas/testsuite/gas/riscv/zacas-32.d      | 17 ++++++++++++
 gas/testsuite/gas/riscv/zacas-32.s      |  9 +++++++
 gas/testsuite/gas/riscv/zacas-64-fail.d |  2 ++
 gas/testsuite/gas/riscv/zacas-64-fail.l |  9 +++++++
 gas/testsuite/gas/riscv/zacas-64-fail.s | 10 +++++++
 gas/testsuite/gas/riscv/zacas-64.d      | 17 ++++++++++++
 gas/testsuite/gas/riscv/zacas-64.s      |  9 +++++++
 include/opcode/riscv-opc.h              | 11 ++++++++
 include/opcode/riscv.h                  |  1 +
 opcodes/riscv-opc.c                     | 36 +++++++++++++++++++++++++
 14 files changed, 148 insertions(+)
 create mode 100644 gas/testsuite/gas/riscv/zacas-32-fail.d
 create mode 100644 gas/testsuite/gas/riscv/zacas-32-fail.l
 create mode 100644 gas/testsuite/gas/riscv/zacas-32-fail.s
 create mode 100644 gas/testsuite/gas/riscv/zacas-32.d
 create mode 100644 gas/testsuite/gas/riscv/zacas-32.s
 create mode 100644 gas/testsuite/gas/riscv/zacas-64-fail.d
 create mode 100644 gas/testsuite/gas/riscv/zacas-64-fail.l
 create mode 100644 gas/testsuite/gas/riscv/zacas-64-fail.s
 create mode 100644 gas/testsuite/gas/riscv/zacas-64.d
 create mode 100644 gas/testsuite/gas/riscv/zacas-64.s


base-commit: 0e17d3fc080f543d81e6c2520ba0bd8046ea3a95
-- 
2.42.0



More information about the Binutils mailing list