Fix TableGen -gen-disassembler output for bit fields with an offset.

This fixes bit assignments like this
Inst{7-0} = Foo{9-2}

Patch by Steve King.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218560 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper
2014-09-27 04:38:02 +00:00
parent 676af35b38
commit 00bc445d75
2 changed files with 79 additions and 1 deletions

View File

@ -1051,7 +1051,11 @@ void FilterChooser::emitBinaryParser(raw_ostream &o, unsigned &Indentation,
OperandInfo::const_iterator OI = OpInfo.begin();
o.indent(Indentation) << "tmp = fieldFromInstruction"
<< "(insn, " << OI->Base << ", " << OI->Width
<< ");\n";
<< ")";
if (OI->Offset)
o << " << " << OI->Offset;
o << ";\n";
} else {
o.indent(Indentation) << "tmp = 0;\n";
for (OperandInfo::const_iterator OI = OpInfo.begin(), OE = OpInfo.end();