[PATCH v4 1/3] RISC-V: Minimal support of scalar crypto extension
Kito Cheng
kito.cheng@sifive.com
Mon Feb 21 14:50:46 GMT 2022
Maybe hold a string for the canonical order? I think accepting those
extensions is kind of buggy.
My patch for this proposal:
https://sourceware.org/pipermail/binutils/2022-February/119827.html
On Mon, Feb 21, 2022 at 10:44 PM Tsukasa OI
<research_trasio@irq.a4lg.com> wrote:
>
>
>
> On 2022/02/21 23:16, Philipp Tomsich wrote:
> > On Mon, 21 Feb 2022 at 15:14, <jiawei@iscas.ac.cn> wrote:
> >>
> >>
> >>
> >>
> >> > -----原始邮件-----
> >> > 发件人: "Jan Beulich" <jbeulich@suse.com>
> >> > 发送时间: 2022-02-21 21:24:11 (星期一)
> >> > 收件人: jiawei <jiawei@iscas.ac.cn>
> >> > 抄送: kito.cheng@sifive.com, nelson.chu@sifive.com, jimw@sifive.com, philipp.tomsich@vrull.eu, mjos@pqshield.com, ben.marshall@pqshield.com, cmuellner@ventanamicro.com, palmer@dabbelt.com, andrew@sifive.com, lazyparser@gmail.com, siyu@isrc.iscas.ac.cn, schwab@linux-m68k.org, binutils@sourceware.org
> >> > 主题: Re: [PATCH v4 1/3] RISC-V: Minimal support of scalar crypto extension
> >> >
> >> > On 15.11.2021 04:03, jiawei wrote:
> >> > > Minimal support of scalar crypto extension, add "k" in riscv_supported_std_ext[] to make the order check right with "zk" behind "zb". "zbk*" is sub-extension for k-ext, so it added behind "zbs" in riscv_supported_std_z_ext[].
> >> > > ---
> >> > > bfd/elfxx-riscv.c | 28 ++++++++++++++++++++++++++++
> >> > > 1 file changed, 28 insertions(+)
> >> > >
> >> > > diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
> >> > > index 3ffbaad66dd..152fbe3d160 100644
> >> > > --- a/bfd/elfxx-riscv.c
> >> > > +++ b/bfd/elfxx-riscv.c
> >> > > @@ -1075,6 +1075,20 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
> >> > > {"q", "d", check_implicit_always},
> >> > > {"d", "f", check_implicit_always},
> >> > > {"f", "zicsr", check_implicit_always},
> >> > > + {"zk", "zkn", check_implicit_always},
> >> > > + {"zk", "zkr", check_implicit_always},
> >> > > + {"zk", "zkt", check_implicit_always},
> >> > > + {"zkn", "zbkb", check_implicit_always},
> >> > > + {"zkn", "zbkc", check_implicit_always},
> >> > > + {"zkn", "zbkx", check_implicit_always},
> >> > > + {"zkn", "zkne", check_implicit_always},
> >> > > + {"zkn", "zknd", check_implicit_always},
> >> > > + {"zkn", "zknh", check_implicit_always},
> >> > > + {"zks", "zbkb", check_implicit_always},
> >> > > + {"zks", "zbkc", check_implicit_always},
> >> > > + {"zks", "zbkx", check_implicit_always},
> >> > > + {"zks", "zksed", check_implicit_always},
> >> > > + {"zks", "zksh", check_implicit_always},
> >> > > {NULL, NULL, NULL}
> >> > > };
> >> > >
> >> > > @@ -1127,6 +1141,7 @@ static struct riscv_supported_ext riscv_supported_std_ext[] =
> >> > > {"c", ISA_SPEC_CLASS_20190608, 2, 0, 0 },
> >> > > {"c", ISA_SPEC_CLASS_2P2, 2, 0, 0 },
> >> > > {"b", ISA_SPEC_CLASS_NONE, RISCV_UNKNOWN_VERSION, RISCV_UNKNOWN_VERSION, 0 },
> >> > > + {"k", ISA_SPEC_CLASS_NONE, RISCV_UNKNOWN_VERSION, RISCV_UNKNOWN_VERSION, 0 },
> >> >
> >> > May I ask what purpose this addition serves? Without its use enabling
> >> > smaller scope extensions implicitly, I find it at best unhelpful that
> >> > ".option arch, +k" is accepted without having any effect.
> >> >
> >> > Jan
> >>
> >> It's same like bitmanip extension, add this will make k extension as a subextension
> >> and set it's canonical order as ISA spec defined.
> >
> > Let me point out that this is not the same as with the
> > bit-manipulation family of extensions.
> > Zb[abcs] are all standalone extensions, and there is no Zb.
> >
> > --Phil.
>
> I agree.
>
> But we cannot remove these now for a good reason.
>
> This is because riscv_supported_std_ext is used to determine canonical
> order of multi-letter extensions (starting with 'Z'). See
> riscv_init_ext_order function (bfd/elfxx-riscv.c) for details.
>
> Maybe we should make a marker (flag?) for "canonical order is determined
> by this but not an actual extension". This will apply to...
>
> - "L"
> - "B"
> - "K"
> - "J"
> - "T"
> - "P"
> - "N"
>
> Tsukasa
>
> >
> >>
> >> >
> >> > > @@ -1146,6 +1161,19 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] =
> >> > > {"zba", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
> >> > > {"zbc", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
> >> > > {"zbs", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
> >> > > + {"zbkb", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
> >> > > + {"zbkc", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
> >> > > + {"zbkx", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
> >> > > + {"zk", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
> >> > > + {"zkn", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
> >> > > + {"zknd", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
> >> > > + {"zkne", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
> >> > > + {"zknh", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
> >> > > + {"zkr", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
> >> > > + {"zks", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
> >> > > + {"zksed", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
> >> > > + {"zksh", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
> >> > > + {"zkt", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
> >> > > {NULL, 0, 0, 0, 0}
> >> > > };
> >> > >
> >> </jiawei@iscas.ac.cn></jbeulich@suse.com>
> >
More information about the Binutils
mailing list