public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/3] RISC-V: Add stub support for existing extensions
@ 2023-08-12  2:57 Tsukasa OI
  2023-08-12  2:57 ` [PATCH 1/3] RISC-V: Add stub support for existing extensions (privileged) Tsukasa OI
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Tsukasa OI @ 2023-08-12  2:57 UTC (permalink / raw)
  To: Tsukasa OI, Kito Cheng, Palmer Dabbelt, Andrew Waterman,
	Jim Wilson, Jeff Law
  Cc: gcc-patches

Hello,

After commit c283c4774d1c ("RISC-V: Throw compilation error for unknown
extensions") changed how do we handle unknown extensions, we have no
guarantee that we can share the same architectural string with Binutils
(specifically, the assembler).

To avoid compilation errors on shared Assembler-C/C++ projects, GCC should
support almost all extensions that Binutils support, even if the GCC does
not touch a thing.

In this patch set, it adds stub extension support along with its
implications (for GCC preprocessor support).

The author excluded those extensions:

1.  'Zicntr' and 'Zihpm'
    (because additional compatibility measures are required)
2.  'Q' and "Zqinx"
    (because GCC does not support 'Q' and 'Zqinx' is not ratified)

and included following extensions not yet supported by Binutils:

*   'Zcmp', 'Zcmt' and 'Zce' extensions
    They are ratified and if we only need a stub support, it's relatively
    easy to implement.

This patch set consists of three patches:

1.  Privileged Extensions
    Unlikely to cause merge conflicts and easy to implement.
2.  Vendor Extension ('XVentanaCondOps')
    Unlikely to cause merge conflicts unless someone tries to merge
    optimization using 'Zicond' with 'XVentanaCondOps' (because 'Zicond' and
    'XVentanaCondOps' are pretty much the same except encodings).
3.  Standard Unprivileged Extensions
    Likely to cause merge conflicts depending on the order to apply patches.
    In that case, prefer others (because this patchset adds *stub* support
    for those extensions).

On this patch set, I focused on adding stub support for new extensions in
GCC (in the GCC perspective) and not all Binutils' contents are ported.

I'll submit separate patch set to port additional implications (e.g.
'M' -> 'Zmmul', 'Zve32x' -> 'Zicsr').

And despite that I implemented stub 'Zce' support, its implications are not
complete (e.g. 'Zce' + 'F' -> 'Zcf' is not implemented and planned for the
next patch set).

Thanks,
Tsukasa




Tsukasa OI (3):
  RISC-V: Add stub support for existing extensions (privileged)
  RISC-V: Add stub support for existing extensions (vendor)
  RISC-V: Add stub support for existing extensions (unprivileged)

 gcc/common/config/riscv/riscv-common.cc    | 45 ++++++++++++++++++++++
 gcc/testsuite/gcc.target/riscv/predef-29.c | 35 +++++++++++++++++
 gcc/testsuite/gcc.target/riscv/predef-30.c | 27 +++++++++++++
 gcc/testsuite/gcc.target/riscv/predef-31.c | 31 +++++++++++++++
 4 files changed, 138 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/riscv/predef-29.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/predef-30.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/predef-31.c


base-commit: 8be20733b38c200f375cacf698d6b85e76055bcd
-- 
2.41.0


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

end of thread, other threads:[~2023-08-29 13:42 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-12  2:57 [PATCH 0/3] RISC-V: Add stub support for existing extensions Tsukasa OI
2023-08-12  2:57 ` [PATCH 1/3] RISC-V: Add stub support for existing extensions (privileged) Tsukasa OI
2023-08-12  2:57 ` [PATCH 2/3] RISC-V: Add stub support for existing extensions (vendor) Tsukasa OI
2023-08-12  2:57 ` [PATCH 3/3] RISC-V: Add stub support for existing extensions (unprivileged) Tsukasa OI
2023-08-14  6:09 ` [PATCH v2 0/3] RISC-V: Add stub support for existing extensions Tsukasa OI
2023-08-14  6:09   ` [PATCH v2 1/3] RISC-V: Add stub support for existing extensions (privileged) Tsukasa OI
2023-08-14  6:09   ` [PATCH v2 2/3] RISC-V: Add stub support for existing extensions (vendor) Tsukasa OI
2023-08-14  6:09   ` [PATCH v2 3/3] RISC-V: Add stub support for existing extensions (unprivileged) Tsukasa OI
2023-08-29  1:42     ` Jeff Law
2023-08-29  3:14       ` Tsukasa OI
2023-08-14  6:17   ` [PATCH v2 0/3] RISC-V: Add stub support for existing extensions Tsukasa OI
2023-08-29  3:39   ` [PATCH v3 " Tsukasa OI
2023-08-29  3:39     ` [PATCH v3 1/3] RISC-V: Add stub support for existing extensions (privileged) Tsukasa OI
2023-08-29 13:41       ` Jeff Law
2023-08-29  3:39     ` [PATCH v3 2/3] RISC-V: Add stub support for existing extensions (vendor) Tsukasa OI
2023-08-29 13:42       ` Jeff Law
2023-08-29  3:39     ` [PATCH v3 3/3] RISC-V: Add stub support for existing extensions (unprivileged) Tsukasa OI
2023-08-29 13:42       ` Jeff Law

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