[PATCH] D142079: [TableGen] Support custom decoders for variable length instructions

Sergei Barannikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 21 12:44:50 PST 2023


barannikov88 added a comment.

I'm not very familiar with varlen decoder, hence only general notes.



================
Comment at: llvm/include/llvm/Target/Target.td:806-807
+/// doesn't matter.
+/// Note that currently we cannot assign different decoders in the same
+/// (instruction) operand.
 def encoder;
----------------
myhsu wrote:
> 0x59616e wrote:
> > Under what circumstances will we need different decoders for the same operand ?
> I figure it's probably rare but for instance, the binary encoding of an operand was separated in two different places so the decoder has to puzzle them back.
Is it diagnosed somewhere?


================
Comment at: llvm/utils/TableGen/VarLenCodeEmitterGen.cpp:89
+// Returns `{encoder name, decoder name}`.
+std::pair<StringRef, StringRef> getCustomCoders(ArrayRef<Init *> Args) {
+  std::pair<StringRef, StringRef> Result;
----------------
* The guideline is to limit anonymous namespaces to class declarations and use `static` everywhere else.
* The function does not protect against users, it needs proper error checking.



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

https://reviews.llvm.org/D142079



More information about the llvm-commits mailing list