[llvm] [TableGen][DecoderEmitter] Add option to emit type-specialized `decodeToMCInst` (PR #146593)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 1 18:05:40 PDT 2025
topperc wrote:
> > > Many backends seems to choose the same type (for example uint64_t) for all their 16/32/48/64 bit insts.
> >
> >
> > I'm probably going to change to uint64_t for RISC-V. The 48-bit instructions are only used by one vendor and are relatively recent additions. I think the duplication cost just wasn't considered when they were added.
> > I agree adding to the Inst class might be too invasive. I still think it should be in .td files somehow. Needing to change a CMake file and replicating to GN and the other build systems when a new instruction width is added seems bad.
>
> Right, is the option #3 above palatable? We essentially encode it as a standalone record that the DecoderEmitter will look for.
Maybe it should be stored in the `InstrInfo` class like `isLittleEndianEncoding` or the `Target` class?
https://github.com/llvm/llvm-project/pull/146593
More information about the llvm-commits
mailing list