public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles
@ 2022-11-03 12:26 Tsukasa OI
  2022-11-03 12:26 ` [REVIEW ONLY 1/2] NEAR-RATIFICATION RISC-V: Add 'Ssstateen' extension and its CSRs Tsukasa OI
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Tsukasa OI @ 2022-11-03 12:26 UTC (permalink / raw)
  To: Tsukasa OI, Nelson Chu, Kito Cheng, Palmer Dabbelt; +Cc: binutils

Hello,

This patchset implements all extensions from RISC-V Profiles (but not
profile itself).  I'm not sure whether this patchset helps someone
implementing RISC-V Profiles but I hope so.

Thanks,
Tsukasa




Tsukasa OI (2):
  NEAR-RATIFICATION RISC-V: Add 'Ssstateen' extension and its CSRs
  NEAR-RATIFICATION RISC-V: Add platform property/capability extensions

 bfd/elfxx-riscv.c                           | 38 +++++++++++++++-
 gas/config/tc-riscv.c                       | 20 +++++----
 gas/testsuite/gas/riscv/csr-version-1p10.l  | 48 ++++++++++-----------
 gas/testsuite/gas/riscv/csr-version-1p11.l  | 48 ++++++++++-----------
 gas/testsuite/gas/riscv/csr-version-1p12.l  | 48 ++++++++++-----------
 gas/testsuite/gas/riscv/csr-version-1p9p1.l | 48 ++++++++++-----------
 gas/testsuite/gas/riscv/csr.s               |  2 +-
 gas/testsuite/gas/riscv/smstateen-csr-s.d   | 22 ++++++++++
 gas/testsuite/gas/riscv/ssstateen-csr.d     | 22 ++++++++++
 gas/testsuite/gas/riscv/ssstateen-csr.s     | 13 ++++++
 include/opcode/riscv-opc.h                  | 26 +++++------
 11 files changed, 215 insertions(+), 120 deletions(-)
 create mode 100644 gas/testsuite/gas/riscv/smstateen-csr-s.d
 create mode 100644 gas/testsuite/gas/riscv/ssstateen-csr.d
 create mode 100644 gas/testsuite/gas/riscv/ssstateen-csr.s


base-commit: ae1c45ead6b60ef0fd338bbeb6a4c5e5808c6e6a
-- 
2.37.2


^ permalink raw reply	[flat|nested] 17+ messages in thread
* [PATCH v2 0/8] RISC-V: Combined floating point enhancements
@ 2022-06-27  2:03 Tsukasa OI
  2022-06-27  2:03 ` [PATCH v2 5/8] RISC-V: Reorganize and enhance Zfinx tests Tsukasa OI
  0 siblings, 1 reply; 17+ messages in thread
From: Tsukasa OI @ 2022-06-27  2:03 UTC (permalink / raw)
  To: Tsukasa OI, Weiwei Li, Nelson Chu, Kito Cheng, Palmer Dabbelt; +Cc: binutils

Before combining patchsets:
<https://sourceware.org/pipermail/binutils/2022-May/120935.html> (Zfh/Zfhmin v2)
<https://sourceware.org/pipermail/binutils/2022-May/120940.html> (Zfinx v2)
Combined v1:
<https://sourceware.org/pipermail/binutils/2022-June/121138.html>
Combined CURRENT (GitHub):
<https://github.com/a4lg/binutils-gdb/tree/riscv-float-combined>




[Combined Enhancements / Fixes]

1.  Zfh/Zhinx refactoring / new Zfhmin/Zhinxmin support
    <https://sourceware.org/pipermail/binutils/2022-May/120935.html>
    <https://sourceware.org/pipermail/binutils/2022-May/120952.html>
2.  Zfinx fixes / test enhancements
    <https://sourceware.org/pipermail/binutils/2022-February/119570.html>
    <https://sourceware.org/pipermail/binutils/2022-February/119576.html>
    <https://sourceware.org/pipermail/binutils/2022-May/120940.html>

They are supposed to be separate but involves similar/same locations
that need to be modified.  To ease testing and integration to upstream,
I decided to merge those fixes in a single patchset.  Of course, I can
split it if requested.

Also in general, I squashed some of fixes/enhancements (spanned in
multiple patches) for simplicity.

As a result, it halved the number of patches.

Zfh/Zfhmin:         5 -> 3
Zfinx/Zdinx/Zqinx: 11 -> 5

Note that, this is a long-term fix to Zfinx/Zfhmin/Zhinxmin implementation.
As a result, this is incompatible with my quicker patchset:
<https://sourceware.org/pipermail/binutils/2022-June/121416.html>
... which I consider quicker one a backup plan when this patchset will not
make it into the GNU Binutils 2.39.




[Changed: v1 -> v2]

1.  i18n enablement (wrap some strings with the _() gettext macro)
2.  Removed original PATCH 01 (as it was merged independently)
    <https://sourceware.org/pipermail/binutils/2022-June/121342.html>




[Details of Changes (mostly duplicate of v1 but some are fixed)]

1.1.    Zfhmin/Zhinxmin subset extension support (PATCH 03)

This patch implements Zfhmin/Zhinxmin extension, conversion-only subset
of Zfh/Zhinx instruction set extensions, respectively.



1.2.    [minor] Refactoring for better integration (PATCH 01)

In particular, better integration with F, D and Q.  To do that, it
required moving certain macros and constants.  But there are no
functional changes.  The whole patchset would (and should) work without
this patch.



1.3.    [minor] DECLARE_INSN declarations (PATCH 02)

Zfh instructions did not have their own DECLARE_INSN declarations.
PATCH 02 resolves this problem (although not having those is harmless
on current design).



2.1.    Disassembler output with Zfinx + -M numeric option (PATCH 04)

Disassembling Zhinx/Zhinxmin/Zfinx/Zdinx/Zqinx instructions with -M
numeric option has an issue.  It used ABI names instead of numeric one.
This commit fixes that.



2.2.    Enhanced Zfinx/Zdinx/Zqinx testcases (PATCH 05)

I enhanced Zfinx/Zdinx/Zqinx testcases based on Jiawei's Zhinx support
patch.  I also...

-   Made indentation / coding style consistent and clean
-   Started to use valid register number (on Zqinx)
-   Started to use different register per operand



2.3.    Relaxed requirements to fmv.[sdq] instructions (PATCH 06)

On Zfinx/Zdinx/Zqinx, fmv instructions seem redundant but actually not.
On RV32_Z[dq]inx and RV64_Zqinx, it requires register pair.  That means,
single...

    fmv.d   x10, x12

is equivalent to 2 regular instructions on RV32_Zdinx (with 32b GPRs):

    mv      x10, x12
    mv      x11, x13

Since fsgnj.[sdq] (base instruction of fmv.[sdq]) are a part of
Z[fdq]inx extensions, it's safe to implement this pseudoinstructions.

PATCH 06 makes fmv.[sdq] available to Zfinx/Zdinx/Zqinx environments.



2.4.    Validate register pairs on Zdinx/Zqinx (PATCH 07, 08)

For RV32_Zdinx and RV64_Zqinx, all registers holding a FP64 value must
be even (x0, x2, x4... are valid, x1, x3, x5... are invalid).

For RV32_Zqinx, it would be all registers holding a FP128 value must be
a multiple of 4 (x0, x4, x8... are valid, x1, x2, x3, x5... are not).

On the other hand, current Binutils can generate invalid instructions
with odd register numbers (or register number x % 4 != 0).  PATCH 07
makes those invalid and PATCH 08 adds tests.

Due to complexity, this patch is relatively large.




Tsukasa OI (8):
  RISC-V: Refactor Zfh/Zhinx-related constants
  RISC-V: Add instruction declaration for Zfh/Zhinx
  RISC-V: Add Zfhmin/Zhinxmin (with refactoring)
  RISC-V: Fix disassembling Zfinx with -M numeric
  RISC-V: Reorganize and enhance Zfinx tests
  RISC-V: Relax `fmv.[sdq]' requirements
  RISC-V: Validate Zdinx/Zqinx register pairs
  RISC-V: Add testcases for Z[dq]inx register pairs

 bfd/elfxx-riscv.c                             |  87 ++-
 gas/config/tc-riscv.c                         |  40 +-
 .../gas/riscv/zdinx-32-regpair-dis.d          |  11 +
 .../gas/riscv/zdinx-32-regpair-dis.s          |   5 +
 .../gas/riscv/zdinx-32-regpair-fail.d         |   3 +
 .../gas/riscv/zdinx-32-regpair-fail.l         | 111 +++
 .../gas/riscv/zdinx-32-regpair-fail.s         | 116 +++
 gas/testsuite/gas/riscv/zdinx-32-regpair.d    |  65 ++
 gas/testsuite/gas/riscv/zdinx-32-regpair.s    |  62 ++
 gas/testsuite/gas/riscv/zdinx.d               |  27 +-
 gas/testsuite/gas/riscv/zdinx.s               |  46 +-
 .../gas/riscv/zfhmin-d-insn-class-fail-1.d    |   3 +
 .../gas/riscv/zfhmin-d-insn-class-fail-1.l    |   2 +
 .../gas/riscv/zfhmin-d-insn-class-fail-2.d    |   3 +
 .../gas/riscv/zfhmin-d-insn-class-fail-2.l    |   2 +
 .../gas/riscv/zfhmin-d-insn-class-fail-3.d    |   3 +
 .../gas/riscv/zfhmin-d-insn-class-fail-3.l    |   2 +
 .../gas/riscv/zfhmin-d-insn-class-fail-4.d    |   3 +
 .../gas/riscv/zfhmin-d-insn-class-fail-4.l    |   2 +
 .../gas/riscv/zfhmin-d-insn-class-fail-5.d    |   3 +
 .../gas/riscv/zfhmin-d-insn-class-fail-5.l    |   2 +
 .../gas/riscv/zfhmin-d-insn-class-fail.s      |   4 +
 gas/testsuite/gas/riscv/zfinx-dis-numeric.d   |  10 +
 gas/testsuite/gas/riscv/zfinx-dis-numeric.s   |   2 +
 gas/testsuite/gas/riscv/zfinx.d               |  24 +-
 gas/testsuite/gas/riscv/zfinx.s               |  42 +-
 .../gas/riscv/{fp-zhinx-insns.d => zhinx.d}   |  37 +-
 .../gas/riscv/{fp-zhinx-insns.s => zhinx.s}   |  32 +-
 .../gas/riscv/zqinx-32-regpair-dis.d          |  12 +
 .../gas/riscv/zqinx-32-regpair-dis.s          |   7 +
 .../gas/riscv/zqinx-32-regpair-fail.d         |   3 +
 .../gas/riscv/zqinx-32-regpair-fail.l         | 212 ++++++
 .../gas/riscv/zqinx-32-regpair-fail.s         | 218 ++++++
 gas/testsuite/gas/riscv/zqinx-32-regpair.d    |  66 ++
 gas/testsuite/gas/riscv/zqinx-32-regpair.s    |  64 ++
 .../gas/riscv/zqinx-64-regpair-dis.d          |  11 +
 .../gas/riscv/zqinx-64-regpair-dis.s          |   5 +
 .../gas/riscv/zqinx-64-regpair-fail.d         |   3 +
 .../gas/riscv/zqinx-64-regpair-fail.l         | 133 ++++
 .../gas/riscv/zqinx-64-regpair-fail.s         | 138 ++++
 gas/testsuite/gas/riscv/zqinx-64-regpair.d    |  87 +++
 gas/testsuite/gas/riscv/zqinx-64-regpair.s    |  84 +++
 gas/testsuite/gas/riscv/zqinx.d               |  86 ++-
 gas/testsuite/gas/riscv/zqinx.s               |  89 ++-
 include/opcode/riscv-opc.h                    | 180 +++--
 include/opcode/riscv.h                        |  21 +-
 opcodes/riscv-dis.c                           |   2 +-
 opcodes/riscv-opc.c                           | 667 +++++++++++++-----
 48 files changed, 2419 insertions(+), 418 deletions(-)
 create mode 100644 gas/testsuite/gas/riscv/zdinx-32-regpair-dis.d
 create mode 100644 gas/testsuite/gas/riscv/zdinx-32-regpair-dis.s
 create mode 100644 gas/testsuite/gas/riscv/zdinx-32-regpair-fail.d
 create mode 100644 gas/testsuite/gas/riscv/zdinx-32-regpair-fail.l
 create mode 100644 gas/testsuite/gas/riscv/zdinx-32-regpair-fail.s
 create mode 100644 gas/testsuite/gas/riscv/zdinx-32-regpair.d
 create mode 100644 gas/testsuite/gas/riscv/zdinx-32-regpair.s
 create mode 100644 gas/testsuite/gas/riscv/zfhmin-d-insn-class-fail-1.d
 create mode 100644 gas/testsuite/gas/riscv/zfhmin-d-insn-class-fail-1.l
 create mode 100644 gas/testsuite/gas/riscv/zfhmin-d-insn-class-fail-2.d
 create mode 100644 gas/testsuite/gas/riscv/zfhmin-d-insn-class-fail-2.l
 create mode 100644 gas/testsuite/gas/riscv/zfhmin-d-insn-class-fail-3.d
 create mode 100644 gas/testsuite/gas/riscv/zfhmin-d-insn-class-fail-3.l
 create mode 100644 gas/testsuite/gas/riscv/zfhmin-d-insn-class-fail-4.d
 create mode 100644 gas/testsuite/gas/riscv/zfhmin-d-insn-class-fail-4.l
 create mode 100644 gas/testsuite/gas/riscv/zfhmin-d-insn-class-fail-5.d
 create mode 100644 gas/testsuite/gas/riscv/zfhmin-d-insn-class-fail-5.l
 create mode 100644 gas/testsuite/gas/riscv/zfhmin-d-insn-class-fail.s
 create mode 100644 gas/testsuite/gas/riscv/zfinx-dis-numeric.d
 create mode 100644 gas/testsuite/gas/riscv/zfinx-dis-numeric.s
 rename gas/testsuite/gas/riscv/{fp-zhinx-insns.d => zhinx.d} (81%)
 rename gas/testsuite/gas/riscv/{fp-zhinx-insns.s => zhinx.s} (85%)
 create mode 100644 gas/testsuite/gas/riscv/zqinx-32-regpair-dis.d
 create mode 100644 gas/testsuite/gas/riscv/zqinx-32-regpair-dis.s
 create mode 100644 gas/testsuite/gas/riscv/zqinx-32-regpair-fail.d
 create mode 100644 gas/testsuite/gas/riscv/zqinx-32-regpair-fail.l
 create mode 100644 gas/testsuite/gas/riscv/zqinx-32-regpair-fail.s
 create mode 100644 gas/testsuite/gas/riscv/zqinx-32-regpair.d
 create mode 100644 gas/testsuite/gas/riscv/zqinx-32-regpair.s
 create mode 100644 gas/testsuite/gas/riscv/zqinx-64-regpair-dis.d
 create mode 100644 gas/testsuite/gas/riscv/zqinx-64-regpair-dis.s
 create mode 100644 gas/testsuite/gas/riscv/zqinx-64-regpair-fail.d
 create mode 100644 gas/testsuite/gas/riscv/zqinx-64-regpair-fail.l
 create mode 100644 gas/testsuite/gas/riscv/zqinx-64-regpair-fail.s
 create mode 100644 gas/testsuite/gas/riscv/zqinx-64-regpair.d
 create mode 100644 gas/testsuite/gas/riscv/zqinx-64-regpair.s


base-commit: b4eb841afe9306fd7a6df95efcde120bfaa71e32
-- 
2.25.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-07-31  2:56 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-03 12:26 [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
2022-11-03 12:26 ` [REVIEW ONLY 1/2] NEAR-RATIFICATION RISC-V: Add 'Ssstateen' extension and its CSRs Tsukasa OI
2022-11-03 12:26 ` [REVIEW ONLY 2/2] NEAR-RATIFICATION RISC-V: Add platform property/capability extensions Tsukasa OI
2022-11-03 13:11 ` [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles Nelson Chu
2022-11-03 13:20   ` Tsukasa OI
2022-11-19  2:56   ` Tsukasa OI
2023-01-30  6:35 ` [PATCH v2 0/1] " Tsukasa OI
2023-01-30  6:35   ` [PATCH v2 1/1] RISC-V: Add platform property/capability extensions Tsukasa OI
2023-01-30  7:11   ` [PATCH v3 0/1] RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
2023-01-30  7:11     ` [PATCH v3 1/1] RISC-V: Add platform property/capability extensions Tsukasa OI
2023-07-26  0:05     ` [PATCH v4 0/1] RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
2023-07-26  0:05       ` [PATCH v4 1/1] RISC-V: Add platform property/capability extensions Tsukasa OI
2023-07-26  0:47         ` Palmer Dabbelt
2023-07-26  1:02           ` Tsukasa OI
2023-07-31  2:56           ` Tsukasa OI
2023-01-31  4:46   ` [PATCH v2 0/1] RISC-V: Extensions from the RISC-V Profiles Nelson Chu
  -- strict thread matches above, loose matches on Subject: below --
2022-06-27  2:03 [PATCH v2 0/8] RISC-V: Combined floating point enhancements Tsukasa OI
2022-06-27  2:03 ` [PATCH v2 5/8] RISC-V: Reorganize and enhance Zfinx tests Tsukasa OI
2022-11-29  6:35   ` [REVIEW ONLY 2/2] NEAR-RATIFICATION RISC-V: Add platform property/capability extensions jiawei

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).