[llvm] [TableGen] Add support for DefaultMode in per-HwMode encode/decode. (PR #83029)

James Y Knight via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 26 11:41:11 PST 2024


https://github.com/jyknight commented:

This comment isn't exactly related to this patch, but, I'm wondering what you are intending to use this feature for, and what the long-term strategy for EncodingByHwMode is.

I had actually been considering proposing to _remove_ it entirely, because it seems pretty incompatible with how tablegen instruction specification normally works.

In particular, an instruction encoding is generally shared between instructions which use a constant value for a given field, and those which use it as an operand. E.g. take RISCV's "RVInstR", which defines rs1, rs2, and rd fields. In different subtypes, it might be populated via an instruction operand, or e.g. via "let rd = 0".

But with the EncodingByHwMode, the constant "let" stops working, because the encoding's named fields are no longer part of the tablegen record for the instruction.

Any thoughts?

https://github.com/llvm/llvm-project/pull/83029


More information about the llvm-commits mailing list