[PATCH] D115133: [RISCV] Support immediate vtype of VSETVLI/VSETIVLI in asm parser

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 15 13:01:00 PST 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp:422
 
-  bool isVTypeI() const { return isVType(); }
+  template <int N> bool isVTypeImm() const {
+    int64_t Imm;
----------------
This doesn't need to be a template. Just pass the bitwidth and use isUIntN instead of isUint


================
Comment at: llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp:926
+    if (Kind == KindTy::Immediate) {
+      auto CE = dyn_cast<MCConstantExpr>(getImm());
+      Imm = CE->getValue();
----------------
`auto *CE` Don't hide the * with auto.


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

https://reviews.llvm.org/D115133



More information about the llvm-commits mailing list