Skip to content

Commit a4624de

Browse files
committed
Add a few comments
1 parent de4185f commit a4624de

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/utils/TableGen/DecoderEmitter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,9 @@ void DecoderTableBuilder::emitBinaryParser(raw_ostream &OS, indent Indent,
11271127
if (IgnoreNonDecodableOperands)
11281128
return;
11291129
assert(!OpInfo.Decoder.empty());
1130+
// The operand has no encoding, so the corresponding argument is omitted.
1131+
// This avoids confusion and allows the function to be overloaded if the
1132+
// operand does have an encoding in other instructions.
11301133
OS << Indent << "if (!Check(S, " << OpInfo.Decoder << "(MI, Decoder)))\n"
11311134
<< Indent << " return MCDisassembler::Fail;\n";
11321135
return;
@@ -1135,6 +1138,8 @@ void DecoderTableBuilder::emitBinaryParser(raw_ostream &OS, indent Indent,
11351138
if (OpInfo.Fields.empty() && OpInfo.InitValue && IgnoreFullyDefinedOperands)
11361139
return;
11371140

1141+
// We need to construct the encoding of the operand from pieces if it is not
1142+
// encoded sequentially or has a non-zero constant part in the encoding.
11381143
bool UseInsertBits = OpInfo.numFields() > 1 || OpInfo.InitValue.value_or(0);
11391144

11401145
if (UseInsertBits) {

0 commit comments

Comments
 (0)