public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Tsukasa OI <research_trasio@irq.a4lg.com>
To: Tsukasa OI <research_trasio@irq.a4lg.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Andrew Waterman <andrew@sifive.com>,
	Jim Wilson <jim.wilson.gcc@gmail.com>,
	Nelson Chu <nelson@rivosinc.com>,
	Kito Cheng <kito.cheng@sifive.com>
Cc: binutils@sourceware.org
Subject: [PATCH 0/1] RISC-V: Add 'Zicntr' and 'Zihpm' support with compatibility measures
Date: Sat, 21 Oct 2023 00:45:58 +0000	[thread overview]
Message-ID: <cover.1697849093.git.research_trasio@irq.a4lg.com> (raw)
In-Reply-To: <cover.1691464661.git.research_trasio@irq.a4lg.com>

Hi,

This patch adds support for two extensions, split from the RISC-V
Unprivileged ISA version 2.2:

1.  `Zicntr`
    Basic hardware performance counters
2.  `Zihpm`
    Platform-specific configurable hardware performance counters

but the compatibility is vital.  This patch set tries to deal with the
compatibility issues as possible.


RFC PATCH v1:
<https://sourceware.org/pipermail/binutils/2023-August/128895.html>


Unlike RFC PATCH v1, this (PATCH v1) tries to resolve most of compatibility
issues by following concepts:

1.  Implement 'Zicntr' and 'Zihpm' as in the latest RISC-V ISA Manual
    documentation (draft) except...
2.  even if a 'Zicntr' pseudoinstruction is used without that extension,
    generate a warning instead of an error.

This is much simpler than before (though increases differences in tests)
and almost completely ISA specification agnostic.  I hope this patch
resolves most of concerns raised by Nelson.

The hardest part was to move handling of *the ISA version 2.2* to
*the 'I' extension version 2.0 (or less)*.  If the 'I' extension version is
2.0 or less and its subset (e.g. 'Zicsr' or 'Zicntr') is being added, it
disables inferring the default version number.  If the ISA is either RV32E
or RV64E and 'I' 2.0 subsets (but 'I' itself) are explicitly specified, the
default handling is the same as 'I' >= 2.1 because non-draft 'E' extension
does not have 'I' 2.0 subsets.


Thanks,
Tsukasa




Tsukasa OI (1):
  RISC-V: Add 'Zicntr' and 'Zihpm' support with compatibility measures

 bfd/elfxx-riscv.c                             |  52 +++-
 gas/config/tc-riscv.c                         |  25 ++
 .../gas/riscv/csr-insns-pseudo-noalias.d      |   2 +-
 .../gas/riscv/csr-insns-pseudo-nozicntr.d     |  37 +++
 .../gas/riscv/csr-insns-pseudo-nozicntr.l     |   7 +
 .../gas/riscv/csr-insns-pseudo-zfinx.d        |   2 +-
 gas/testsuite/gas/riscv/csr-insns-pseudo.d    |   2 +-
 gas/testsuite/gas/riscv/csr-insns-pseudo.s    |   3 +-
 gas/testsuite/gas/riscv/csr-insns-read-only.d |   2 +-
 gas/testsuite/gas/riscv/csr-version-1p10.l    | 256 ++++++++++++++++++
 gas/testsuite/gas/riscv/csr-version-1p11.l    | 256 ++++++++++++++++++
 gas/testsuite/gas/riscv/csr-version-1p12.l    | 256 ++++++++++++++++++
 gas/testsuite/gas/riscv/csr-version-1p9p1.l   | 256 ++++++++++++++++++
 include/opcode/riscv-opc.h                    | 128 ++++-----
 include/opcode/riscv.h                        |   1 +
 opcodes/riscv-opc.c                           |  12 +-
 16 files changed, 1217 insertions(+), 80 deletions(-)
 create mode 100644 gas/testsuite/gas/riscv/csr-insns-pseudo-nozicntr.d
 create mode 100644 gas/testsuite/gas/riscv/csr-insns-pseudo-nozicntr.l


base-commit: 4a6daabb94982ccc17ea45ebb6f6e8efa8f86399
-- 
2.42.0


  parent reply	other threads:[~2023-10-21  0:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08  3:17 [RFC PATCH 0/2] " Tsukasa OI
2023-08-08  3:17 ` [RFC PATCH 1/2] RISC-V: Base for complex extension implications Tsukasa OI
2023-08-08  3:17 ` [RFC PATCH 2/2] RISC-V: Add 'Zicntr' and 'Zihpm' support with compatibility measures Tsukasa OI
2023-10-19  7:57 ` [PING^1][RFC PATCH 0/2] " Tsukasa OI
2023-10-19  8:33   ` Nelson Chu
2023-10-20  2:52     ` Tsukasa OI
2023-10-21  0:45 ` Tsukasa OI [this message]
2023-10-21  0:45   ` [PATCH 1/1] " Tsukasa OI
2023-10-21  2:17   ` [PATCH v2 0/1] " Tsukasa OI
2023-10-21  2:17     ` [PATCH v2 1/1] " Tsukasa OI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1697849093.git.research_trasio@irq.a4lg.com \
    --to=research_trasio@irq.a4lg.com \
    --cc=andrew@sifive.com \
    --cc=binutils@sourceware.org \
    --cc=jim.wilson.gcc@gmail.com \
    --cc=kito.cheng@sifive.com \
    --cc=nelson@rivosinc.com \
    --cc=palmer@dabbelt.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).