diff --git a/src/frontend/A64/decoder/a64.h b/src/frontend/A64/decoder/a64.h index 8f10b541..8aeb613e 100644 --- a/src/frontend/A64/decoder/a64.h +++ b/src/frontend/A64/decoder/a64.h @@ -30,8 +30,11 @@ std::vector> 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()); }); diff --git a/src/frontend/A64/translate/impl/impl.cpp b/src/frontend/A64/translate/impl/impl.cpp index 3c1deadb..92e7e079 100644 --- a/src/frontend/A64/translate/impl/impl.cpp +++ b/src/frontend/A64/translate/impl/impl.cpp @@ -22,8 +22,8 @@ bool TranslatorVisitor::UnpredictableInstruction() { } bool TranslatorVisitor::DecodeError() { - // TODO: This is an internal error. - return UnallocatedEncoding(); + UNREACHABLE(); + return false; } bool TranslatorVisitor::ReservedValue() {