[PATCH] D50784: [TableGen] Add Instruction custom byte sequence emission

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 16 12:04:33 PDT 2018


efriedma added inline comments.


================
Comment at: utils/TableGen/CodeBeadsGen.cpp:13-14
+/// defined for an instruction. They are used to pass very target specific
+/// binary information directly from a tablegen file, e.g. instruction
+/// encoding.
+///
----------------
lebedev.ri wrote:
> Ignorant question: but surely the problem of storing instruction encoding in tablegen has already arose?
> How does this solution differ from the existing practice?
Most other targets use CodeEmitterGen to generate a function getBinaryCodeForInstr.  This is nice, but it only works for targets with fixed-length instructions of length 4 or less.

x86 doesn't store instruction encodings in TableGen; instead, it uses a hand-written implementation of X86MCCodeEmitter::encodeInstruction, driven by flags in the instruction description.


Repository:
  rL LLVM

https://reviews.llvm.org/D50784





More information about the llvm-commits mailing list