@@ -385,7 +385,6 @@ class Filter {
385
385
const FilterChooser &Owner; // FilterChooser who owns this filter
386
386
unsigned StartBit; // the starting bit position
387
387
unsigned NumBits; // number of bits to filter
388
- bool Mixed; // a mixed region contains both set and unset bits
389
388
390
389
// Map of well-known segment value to the set of uid's with that value.
391
390
std::map<uint64_t , std::vector<EncodingIDAndOpcode>> FilteredInstructions;
@@ -404,8 +403,7 @@ class Filter {
404
403
405
404
public:
406
405
Filter (Filter &&f);
407
- Filter (const FilterChooser &owner, unsigned startBit, unsigned numBits,
408
- bool mixed);
406
+ Filter (const FilterChooser &owner, unsigned startBit, unsigned numBits);
409
407
410
408
~Filter () = default ;
411
409
@@ -614,7 +612,7 @@ class FilterChooser {
614
612
unsigned Opc) const ;
615
613
616
614
// Assign a single filter and run with it.
617
- void runSingleFilter (unsigned startBit, unsigned numBit, bool mixed );
615
+ void runSingleFilter (unsigned startBit, unsigned numBit);
618
616
619
617
// reportRegion is a helper function for filterProcessor to mark a region as
620
618
// eligible for use as a filter region.
@@ -646,15 +644,14 @@ class FilterChooser {
646
644
// /////////////////////////
647
645
648
646
Filter::Filter (Filter &&f)
649
- : Owner(f.Owner), StartBit(f.StartBit), NumBits(f.NumBits), Mixed(f.Mixed),
647
+ : Owner(f.Owner), StartBit(f.StartBit), NumBits(f.NumBits),
650
648
FilteredInstructions(std::move(f.FilteredInstructions)),
651
649
VariableInstructions(std::move(f.VariableInstructions)),
652
650
FilterChooserMap(std::move(f.FilterChooserMap)),
653
651
NumFiltered(f.NumFiltered), LastOpcFiltered(f.LastOpcFiltered) {}
654
652
655
- Filter::Filter (const FilterChooser &owner, unsigned startBit, unsigned numBits,
656
- bool mixed)
657
- : Owner(owner), StartBit(startBit), NumBits(numBits), Mixed(mixed) {
653
+ Filter::Filter (const FilterChooser &owner, unsigned startBit, unsigned numBits)
654
+ : Owner(owner), StartBit(startBit), NumBits(numBits) {
658
655
assert (StartBit + NumBits - 1 < Owner.BitWidth );
659
656
660
657
NumFiltered = 0 ;
@@ -1537,10 +1534,9 @@ void FilterChooser::emitSingletonTableEntry(DecoderTableInfo &TableInfo,
1537
1534
1538
1535
// Assign a single filter and run with it. Top level API client can initialize
1539
1536
// with a single filter to start the filtering process.
1540
- void FilterChooser::runSingleFilter (unsigned startBit, unsigned numBit,
1541
- bool mixed) {
1537
+ void FilterChooser::runSingleFilter (unsigned startBit, unsigned numBit) {
1542
1538
Filters.clear ();
1543
- Filters.emplace_back (*this , startBit, numBit, true );
1539
+ Filters.emplace_back (*this , startBit, numBit);
1544
1540
BestIndex = 0 ; // Sole Filter instance to choose from.
1545
1541
bestFilter ().recurse ();
1546
1542
}
@@ -1549,10 +1545,8 @@ void FilterChooser::runSingleFilter(unsigned startBit, unsigned numBit,
1549
1545
// eligible for use as a filter region.
1550
1546
void FilterChooser::reportRegion (bitAttr_t RA, unsigned StartBit,
1551
1547
unsigned BitIndex, bool AllowMixed) {
1552
- if (RA == ATTR_MIXED && AllowMixed)
1553
- Filters.emplace_back (*this , StartBit, BitIndex - StartBit, true );
1554
- else if (RA == ATTR_ALL_SET && !AllowMixed)
1555
- Filters.emplace_back (*this , StartBit, BitIndex - StartBit, false );
1548
+ if (AllowMixed ? RA == ATTR_MIXED : RA == ATTR_ALL_SET)
1549
+ Filters.emplace_back (*this , StartBit, BitIndex - StartBit);
1556
1550
}
1557
1551
1558
1552
// FilterProcessor scans the well-known encoding bits of the instructions and
@@ -1583,7 +1577,7 @@ bool FilterChooser::filterProcessor(bool AllowMixed, bool Greedy) {
1583
1577
// Look for islands of undecoded bits of any instruction.
1584
1578
if (getIslands (Islands, Insn) > 0 ) {
1585
1579
// Found an instruction with island(s). Now just assign a filter.
1586
- runSingleFilter (Islands[0 ].StartBit , Islands[0 ].NumBits , true );
1580
+ runSingleFilter (Islands[0 ].StartBit , Islands[0 ].NumBits );
1587
1581
return true ;
1588
1582
}
1589
1583
}
0 commit comments