* [PATCH] RISC-V: Add support for B standard extension
@ 2024-02-06 17:38 Edwin Lu
2024-02-06 17:41 ` Andrew Pinski
2024-02-13 16:16 ` Jeff Law
0 siblings, 2 replies; 3+ messages in thread
From: Edwin Lu @ 2024-02-06 17:38 UTC (permalink / raw)
To: gcc-patches; +Cc: gnu-toolchain, ved, patrick, Edwin Lu
This patch adds support for recognizing the B standard extension to be the
collection of Zba, Zbb, Zbs extensions for consistency and conciseness across
toolchains
* https://github.com/riscv/riscv-b/tags
gcc/ChangeLog:
* common/config/riscv/riscv-common.cc: Add imply rules for B extension
* config/riscv/arch-canonicalize: ditto
Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
---
gcc/common/config/riscv/riscv-common.cc | 7 +++++++
gcc/config/riscv/arch-canonicalize | 1 +
2 files changed, 8 insertions(+)
diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc
index 631ce8309a0..31117a7b0fd 100644
--- a/gcc/common/config/riscv/riscv-common.cc
+++ b/gcc/common/config/riscv/riscv-common.cc
@@ -77,6 +77,10 @@ static const riscv_implied_info_t riscv_implied_info[] =
{"f", "zicsr"},
{"d", "zicsr"},
+ {"b", "zba"},
+ {"b", "zbb"},
+ {"b", "zbs"},
+
{"zdinx", "zfinx"},
{"zfinx", "zicsr"},
{"zdinx", "zicsr"},
@@ -235,6 +239,8 @@ static const struct riscv_ext_version riscv_ext_version_table[] =
{"c", ISA_SPEC_CLASS_20190608, 2, 0},
{"c", ISA_SPEC_CLASS_2P2, 2, 0},
+ {"b", ISA_SPEC_CLASS_NONE, 1, 0},
+
{"h", ISA_SPEC_CLASS_NONE, 1, 0},
{"v", ISA_SPEC_CLASS_NONE, 1, 0},
@@ -388,6 +394,7 @@ static const struct riscv_ext_version riscv_ext_version_table[] =
/* Combine extensions defined in this table */
static const struct riscv_ext_version riscv_combine_info[] =
{
+ {"b", ISA_SPEC_CLASS_NONE, 1, 0},
{"zk", ISA_SPEC_CLASS_NONE, 1, 0},
{"zkn", ISA_SPEC_CLASS_NONE, 1, 0},
{"zks", ISA_SPEC_CLASS_NONE, 1, 0},
diff --git a/gcc/config/riscv/arch-canonicalize b/gcc/config/riscv/arch-canonicalize
index 629bed85347..dcfae732714 100755
--- a/gcc/config/riscv/arch-canonicalize
+++ b/gcc/config/riscv/arch-canonicalize
@@ -41,6 +41,7 @@ LONG_EXT_PREFIXES = ['z', 's', 'h', 'x']
IMPLIED_EXT = {
"d" : ["f", "zicsr"],
"f" : ["zicsr"],
+ "b" : ["zba", "zbb", "zbs"],
"zdinx" : ["zfinx", "zicsr"],
"zfinx" : ["zicsr"],
"zhinx" : ["zhinxmin", "zfinx", "zicsr"],
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RISC-V: Add support for B standard extension
2024-02-06 17:38 [PATCH] RISC-V: Add support for B standard extension Edwin Lu
@ 2024-02-06 17:41 ` Andrew Pinski
2024-02-13 16:16 ` Jeff Law
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Pinski @ 2024-02-06 17:41 UTC (permalink / raw)
To: Edwin Lu; +Cc: gcc-patches, gnu-toolchain, ved, patrick
On Tue, Feb 6, 2024 at 9:39 AM Edwin Lu <ewlu@rivosinc.com> wrote:
>
> This patch adds support for recognizing the B standard extension to be the
> collection of Zba, Zbb, Zbs extensions for consistency and conciseness across
> toolchains
>
> * https://github.com/riscv/riscv-b/tags
Note this is/was recorded as PR 106531.
Thanks,
Andrew Pinski
>
> gcc/ChangeLog:
>
> * common/config/riscv/riscv-common.cc: Add imply rules for B extension
> * config/riscv/arch-canonicalize: ditto
>
> Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
> ---
> gcc/common/config/riscv/riscv-common.cc | 7 +++++++
> gcc/config/riscv/arch-canonicalize | 1 +
> 2 files changed, 8 insertions(+)
>
> diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc
> index 631ce8309a0..31117a7b0fd 100644
> --- a/gcc/common/config/riscv/riscv-common.cc
> +++ b/gcc/common/config/riscv/riscv-common.cc
> @@ -77,6 +77,10 @@ static const riscv_implied_info_t riscv_implied_info[] =
> {"f", "zicsr"},
> {"d", "zicsr"},
>
> + {"b", "zba"},
> + {"b", "zbb"},
> + {"b", "zbs"},
> +
> {"zdinx", "zfinx"},
> {"zfinx", "zicsr"},
> {"zdinx", "zicsr"},
> @@ -235,6 +239,8 @@ static const struct riscv_ext_version riscv_ext_version_table[] =
> {"c", ISA_SPEC_CLASS_20190608, 2, 0},
> {"c", ISA_SPEC_CLASS_2P2, 2, 0},
>
> + {"b", ISA_SPEC_CLASS_NONE, 1, 0},
> +
> {"h", ISA_SPEC_CLASS_NONE, 1, 0},
>
> {"v", ISA_SPEC_CLASS_NONE, 1, 0},
> @@ -388,6 +394,7 @@ static const struct riscv_ext_version riscv_ext_version_table[] =
> /* Combine extensions defined in this table */
> static const struct riscv_ext_version riscv_combine_info[] =
> {
> + {"b", ISA_SPEC_CLASS_NONE, 1, 0},
> {"zk", ISA_SPEC_CLASS_NONE, 1, 0},
> {"zkn", ISA_SPEC_CLASS_NONE, 1, 0},
> {"zks", ISA_SPEC_CLASS_NONE, 1, 0},
> diff --git a/gcc/config/riscv/arch-canonicalize b/gcc/config/riscv/arch-canonicalize
> index 629bed85347..dcfae732714 100755
> --- a/gcc/config/riscv/arch-canonicalize
> +++ b/gcc/config/riscv/arch-canonicalize
> @@ -41,6 +41,7 @@ LONG_EXT_PREFIXES = ['z', 's', 'h', 'x']
> IMPLIED_EXT = {
> "d" : ["f", "zicsr"],
> "f" : ["zicsr"],
> + "b" : ["zba", "zbb", "zbs"],
> "zdinx" : ["zfinx", "zicsr"],
> "zfinx" : ["zicsr"],
> "zhinx" : ["zhinxmin", "zfinx", "zicsr"],
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RISC-V: Add support for B standard extension
2024-02-06 17:38 [PATCH] RISC-V: Add support for B standard extension Edwin Lu
2024-02-06 17:41 ` Andrew Pinski
@ 2024-02-13 16:16 ` Jeff Law
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Law @ 2024-02-13 16:16 UTC (permalink / raw)
To: Edwin Lu, gcc-patches; +Cc: gnu-toolchain, ved, patrick
On 2/6/24 10:38, Edwin Lu wrote:
> This patch adds support for recognizing the B standard extension to be the
> collection of Zba, Zbb, Zbs extensions for consistency and conciseness across
> toolchains
>
> * https://github.com/riscv/riscv-b/tags
>
> gcc/ChangeLog:
>
> * common/config/riscv/riscv-common.cc: Add imply rules for B extension
> * config/riscv/arch-canonicalize: ditto
So similar to Patrick's change, no major concerns here. We just need to
wait to see how the proposal moves through RVI before committing.
jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-13 16:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-06 17:38 [PATCH] RISC-V: Add support for B standard extension Edwin Lu
2024-02-06 17:41 ` Andrew Pinski
2024-02-13 16:16 ` 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).