[PATCH] D108694: [RISCV] Add the zvl extension according to the v1.0 spec

Yueh-Ting Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 13 18:25:45 PST 2021


eopXD added inline comments.


================
Comment at: llvm/lib/Support/RISCVISAInfo.cpp:782
+    if (IsZvlExt) {
+      ExtName.consume_back("b");
+      unsigned ZvlLen;
----------------
craig.topper wrote:
> craig.topper wrote:
> > I think we should check the return value from consume_back and getAsInteger to make sure we really parsed what we think we parsed. That will prevent surprises if a new extension comes along that also starts with "zvl"
> This would match for "zvlsseg" right now wouldn't it?
> This would match for "zvlsseg" right now wouldn't it?

Yes, you have a point.

`IsZvlExt` should be `ExtName.consume_front("zvl") && ExtName.consume_back("b")`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108694/new/

https://reviews.llvm.org/D108694



More information about the cfe-commits mailing list