[PATCH] D112408: [RISCV][MC] Add the zve extension according to the v1.0 spec
Yueh-Ting Chen via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 17 09:56:29 PST 2022
eopXD added inline comments.
================
Comment at: clang/lib/Basic/Targets/RISCV.cpp:184
Builder.defineMacro("__riscv_v_min_vlen", Twine(MinVLen));
+ Builder.defineMacro("__riscv_v_max_eew", Twine(MaxEew));
+ Builder.defineMacro("__riscv_v_max_eew_fp", Twine(MaxEewFp));
----------------
eopXD wrote:
> craig.topper wrote:
> > eopXD wrote:
> > > craig.topper wrote:
> > > > khchen wrote:
> > > > > craig.topper wrote:
> > > > > > Would't ELEN be the correct term here? Not EEW.
> > > > > https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#182-zve-vector-extensions-for-embedded-processors shows zve* extensions have `Supported EEW`, I guess it's why the term is `EEW`.
> > > > >
> > > > >
> > > > Is that because that section talks about them as a set of values rather than a single maximum?
> > > I think Zve is restricting the EEW, not ELEN.
> > The spec defines ELEN as "The maximum size in bits of a vector element that any operation can produce or consume" That sounds like maximum EEW to me.
> >
> > This statement appears in section 3.4.2
> >
> > "For standard vector extensions with
> > ELEN=32, fractional LMULs of 1/2 and 1/4 must be supported. For standard vector extensions with ELEN=64, fractional
> > LMULs of 1/2, 1/4, and 1/8 must be supported."
> >
> > I take "standard vector extensions with ELEN=32" to mean Zve32x, Zve32f.
> >
> > And "standard vector extensions with ELEN=64" to mean Zve64x, Zve64f, Zve64d, and V.
> >
> > Am I interpreting that incorrectly?
> Yes I think you are correct. Maximum EEW is an alias of ELEN.
>
> I see that the discussion in https://github.com/riscv-non-isa/riscv-c-api-doc/pull/21 hasn't conclude on whether changing the name into `elen` and `elen_fp`.
>
> Should this patch pend until conclusions are drawn?
I see that the discussion has now concluded.
Thank you @craig.topper for pinging at the c-api PR.
Changing macro to `__riscv_v_elen` and `__riscv_v_elen_fp`
================
Comment at: llvm/include/llvm/Support/RISCVISAInfo.h:65
+ unsigned getMinVLen() const { return MinVLen; }
+ unsigned getMaxEew() const { return MaxEew; }
+ unsigned getMaxEewFp() const { return MaxEewFp; }
----------------
eopXD wrote:
> frasercrmck wrote:
> > Aside from the discussion about EEW vs. ELEN, something about the capitalization irks me. I realise we already have `XLen` but `Eew` looks... wrong. If other people disagree then that's fine.
> Hi Fraser,
> FYI, I think there is a discussion happening [here](https://github.com/riscv-non-isa/riscv-c-api-doc/pull/21#issuecomment-952307965).
>
Since we are changing to ELEN now I hope its less disturbing to you and I can resolve this ;)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112408/new/
https://reviews.llvm.org/D112408
More information about the cfe-commits
mailing list