[PATCH] D49027: [TableGen] FixedLenDecoderEmitter: allow for dummy operand in MCInst

Tim Renouf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 17 08:38:00 PDT 2018


tpr updated this revision to Diff 155894.
tpr added a comment.

V2: Renamed to UseUnencodedOperands.


Repository:
  rL LLVM

https://reviews.llvm.org/D49027

Files:
  include/llvm/Target/Target.td
  utils/TableGen/FixedLenDecoderEmitter.cpp


Index: utils/TableGen/FixedLenDecoderEmitter.cpp
===================================================================
--- utils/TableGen/FixedLenDecoderEmitter.cpp
+++ utils/TableGen/FixedLenDecoderEmitter.cpp
@@ -2034,7 +2034,9 @@
     if (Base != ~0U)
       OpInfo.addField(Base, Width, Offset);
 
-    if (OpInfo.numFields() > 0)
+    // For an operand with no bits in the instruction encoding, push it only if
+    // IncludeUnencodedOperands is true.
+    if (OpInfo.numFields() > 0 || Def.getValueAsBit("IncludeUnencodedOperands"))
       InsnOperands.push_back(OpInfo);
   }
 
Index: include/llvm/Target/Target.td
===================================================================
--- include/llvm/Target/Target.td
+++ include/llvm/Target/Target.td
@@ -581,6 +581,12 @@
   /// instruction selection predicates. FastISel cannot handle such cases, but
   /// SelectionDAG can.
   bit FastISelShouldIgnore = 0;
+
+  /// Normally an unencoded operand (an operand named in InOperandList or
+  /// OutOperandList but not appearing in the instruction encoding) does not
+  /// appear in the MCInst. Setting this to 1 means that the disassembler
+  /// pushes an immediate 0 operand onto the MCInst for such an operand.
+  bit IncludeUnencodedOperands = 0;
 }
 
 /// PseudoInstExpansion - Expansion information for a pseudo-instruction.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49027.155894.patch
Type: text/x-patch
Size: 1337 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180717/ccec3f49/attachment.bin>


More information about the llvm-commits mailing list