decoder/a64: Don't rearrange unrelated decoders

This commit is contained in:
MerryMage 2018-02-11 00:04:59 +00:00
parent faeb77e8c4
commit a455ff70c9
2 changed files with 6 additions and 3 deletions

View file

@ -30,8 +30,11 @@ std::vector<Matcher<Visitor>> GetDecodeTable() {
#undef INST
};
// If a matcher has more bits in its mask it is more specific, so it should come first.
std::stable_sort(table.begin(), table.end(), [](const auto& matcher1, const auto& matcher2) {
// If the matchers aren't related, keep their relative positions the same.
if ((matcher1.GetMask() & ~matcher2.GetMask()) && (~matcher1.GetMask() & matcher2.GetMask()))
return false;
// If a matcher has more bits in its mask it is more specific, so it should come first.
return Common::BitCount(matcher1.GetMask()) > Common::BitCount(matcher2.GetMask());
});

View file

@ -22,8 +22,8 @@ bool TranslatorVisitor::UnpredictableInstruction() {
}
bool TranslatorVisitor::DecodeError() {
// TODO: This is an internal error.
return UnallocatedEncoding();
UNREACHABLE();
return false;
}
bool TranslatorVisitor::ReservedValue() {