Index: include/llvm/Target/Target.td =================================================================== --- include/llvm/Target/Target.td +++ include/llvm/Target/Target.td @@ -580,6 +580,12 @@ /// instruction selection predicates. FastISel cannot handle such cases, but /// SelectionDAG can. bit FastISelShouldIgnore = 0; + + /// Normally a "dummy" 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 a dummy operand. + bit hasDummyOperands = 0; } /// PseudoInstExpansion - Expansion information for a pseudo-instruction. Index: utils/TableGen/FixedLenDecoderEmitter.cpp =================================================================== --- utils/TableGen/FixedLenDecoderEmitter.cpp +++ utils/TableGen/FixedLenDecoderEmitter.cpp @@ -2016,7 +2016,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 + // hasDummyOperands is true. + if (OpInfo.numFields() > 0 || Def.getValueAsBit("hasDummyOperands")) InsnOperands.push_back(OpInfo); }