@@ -319,8 +319,8 @@ static raw_ostream &operator<<(raw_ostream &OS, const EncodingAndInst &Value) {
319
319
}
320
320
321
321
// Prints the bit value for each position.
322
- static void dumpBits (raw_ostream &OS, const BitsInit &Bits) {
323
- for (const Init *Bit : reverse (Bits.getBits ()))
322
+ static void dumpBits (raw_ostream &OS, const BitsInit &Bits, unsigned BitWidth ) {
323
+ for (const Init *Bit : reverse (Bits.getBits (). take_front (BitWidth) ))
324
324
OS << BitValue (Bit);
325
325
}
326
326
@@ -389,16 +389,16 @@ class FilterChooser;
389
389
// /
390
390
// / An example of a conflict is
391
391
// /
392
- // / Conflict:
393
- // / 111101000.00 ........00010000 ....
394
- // / 111101000.00 ........0001 ........
395
- // / 1111010...00 ........0001 ........
396
- // / 1111010...00....................
397
- // / 1111010................. ........
398
- // / 1111. ................... ........
399
- // / . ........................... ....
400
- // / VST4q8a 111101000_00________00010000____
401
- // / VST4q8b 111101000_00________00010000____
392
+ // / Decoding Conflict:
393
+ // / . ........................... ....
394
+ // / 1111. ................... ........
395
+ // / 1111010................. ........
396
+ // / 1111010...00....................
397
+ // / 1111010...00 ........0001 ........
398
+ // / 111101000.00 ........0001 ........
399
+ // / 111101000.00 ........00010000 ....
400
+ // / 111101000_00________00010000____ VST4q8a
401
+ // / 111101000_00________00010000____ VST4q8b
402
402
// /
403
403
// / The Debug output shows the path that the decoding tree follows to reach the
404
404
// / the conclusion that there is a conflict. VST4q8a is a vst4 to double-spaced
@@ -582,7 +582,7 @@ class FilterChooser {
582
582
583
583
// / dumpStack - dumpStack traverses the filter chooser chain and calls
584
584
// / dumpFilterArray on each filter chooser up to the top level one.
585
- void dumpStack (raw_ostream &OS, const char *prefix ) const ;
585
+ void dumpStack (raw_ostream &OS, indent Indent ) const ;
586
586
587
587
bool PositionFiltered (unsigned Idx) const {
588
588
return FilterBitValues[Idx].isSet ();
@@ -701,9 +701,8 @@ void Filter::recurse() {
701
701
std::vector<BitValue> BitValueArray (Owner.FilterBitValues );
702
702
703
703
if (!VariableInstructions.empty ()) {
704
- // Conservatively marks each segment position as BIT_UNSET.
705
704
for (unsigned bitIndex = 0 ; bitIndex < NumBits; ++bitIndex)
706
- BitValueArray[StartBit + bitIndex] = BitValue::BIT_UNSET ;
705
+ BitValueArray[StartBit + bitIndex] = BitValue::BIT_UNFILTERED ;
707
706
708
707
// Delegates to an inferior filter chooser for further processing on this
709
708
// group of instructions whose segment values are variable.
@@ -1118,15 +1117,12 @@ void FilterChooser::dumpFilterArray(raw_ostream &OS,
1118
1117
1119
1118
// / dumpStack - dumpStack traverses the filter chooser chain and calls
1120
1119
// / dumpFilterArray on each filter chooser up to the top level one.
1121
- void FilterChooser::dumpStack (raw_ostream &OS, const char *prefix) const {
1122
- const FilterChooser *current = this ;
1123
-
1124
- while (current) {
1125
- OS << prefix;
1126
- dumpFilterArray (OS, current->FilterBitValues );
1127
- OS << ' \n ' ;
1128
- current = current->Parent ;
1129
- }
1120
+ void FilterChooser::dumpStack (raw_ostream &OS, indent Indent) const {
1121
+ if (Parent)
1122
+ Parent->dumpStack (OS, Indent);
1123
+ OS << Indent;
1124
+ dumpFilterArray (OS, FilterBitValues);
1125
+ OS << ' \n ' ;
1130
1126
}
1131
1127
1132
1128
// Calculates the island(s) needed to decode the instruction.
@@ -1765,13 +1761,16 @@ void FilterChooser::doFilter() {
1765
1761
// Print out useful conflict information for postmortem analysis.
1766
1762
errs () << " Decoding Conflict:\n " ;
1767
1763
1768
- dumpStack (errs (), " \t\t " );
1764
+ // Dump filters.
1765
+ indent Indent (4 );
1766
+ dumpStack (errs (), Indent);
1769
1767
1770
- for (auto Opcode : Opcodes) {
1768
+ // Dump encodings.
1769
+ for (EncodingIDAndOpcode Opcode : Opcodes) {
1771
1770
const EncodingAndInst &Enc = AllInstructions[Opcode.EncodingID ];
1772
- errs () << ' \t ' << Enc << ' ' ;
1773
- dumpBits (errs (), getBitsField (*Enc.EncodingDef , " Inst" ));
1774
- errs () << ' \n ' ;
1771
+ errs () << Indent ;
1772
+ dumpBits (errs (), getBitsField (*Enc.EncodingDef , " Inst" ), BitWidth );
1773
+ errs () << " " << Enc << ' \n ' ;
1775
1774
}
1776
1775
PrintFatalError (" Decoding conflict encountered" );
1777
1776
}
0 commit comments