[PATCH] D108602: [RISCV] Initial support .insn directive for the assembler.

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 10 17:03:35 PDT 2021


jrtc27 added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.td:926
+                        AnyReg:$rs1, AnyReg:$rs2, AnyReg:$rs3)>;
+def : InstAlias<".insn_r4 $opcode, $funct3, $funct7, $rd, $rs1, $rs2, $rs3",
+                (InsnR4 AnyReg:$rd, uimm7:$opcode, uimm3:$funct3, uimm7:$funct7,
----------------
craig.topper wrote:
> MaskRay wrote:
> > Does binutils have these `.insn_*` aliases? I cannot find them.
> No. This was a hack to allow tablegen to have a mnemonic to key the lookup need for tryCustomParseOperand. Anything starting with a . is treated as a directive so will never be parsed as an instruction. There's code in the .insn handling to make this fake mnemonic.
No, but see previous discussions. These are internal aliases (which, given they start with a dot, get parsed as directives and thus don't end up checking the match tables, so cannot be used in assembly; see inso-invalid.s for a test of this) to work around TableGen's asm matcher assumption that the mnemonic plus the first argument is enough to disambiguate which instruction to try matching against (there's no way to backtrack, nor to try multiple in parallel).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108602



More information about the llvm-commits mailing list