mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-23 05:38:59 +02:00
[dynarmic] restore proper backtraces for A64
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
9a3af3a6a3
commit
5b23d5766c
2 changed files with 14 additions and 7 deletions
|
|
@ -70,14 +70,15 @@ constexpr DecodeTable<V> GetDecodeTable() {
|
||||||
|
|
||||||
/// In practice it must always suceed, otherwise something else unrelated would have gone awry
|
/// In practice it must always suceed, otherwise something else unrelated would have gone awry
|
||||||
template<typename V>
|
template<typename V>
|
||||||
std::reference_wrapper<const Matcher<V>> Decode(u32 instruction) {
|
std::optional<std::reference_wrapper<const Matcher<V>>> Decode(u32 instruction) {
|
||||||
alignas(64) static const auto table = GetDecodeTable<V>();
|
alignas(64) static const auto table = GetDecodeTable<V>();
|
||||||
const auto& subtable = table[detail::ToFastLookupIndex(instruction)];
|
const auto& subtable = table[detail::ToFastLookupIndex(instruction)];
|
||||||
auto iter = std::find_if(subtable.begin(), subtable.end(), [instruction](const auto& matcher) {
|
auto iter = std::find_if(subtable.begin(), subtable.end(), [instruction](const auto& matcher) {
|
||||||
return matcher.Matches(instruction);
|
return matcher.Matches(instruction);
|
||||||
});
|
});
|
||||||
DEBUG_ASSERT(iter != subtable.end());
|
return iter != subtable.end()
|
||||||
return std::reference_wrapper<const Matcher<V>>(*iter);
|
? std::optional{ std::reference_wrapper<const Matcher<V>>(*iter) }
|
||||||
|
: std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename V>
|
template<typename V>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,11 @@ void Translate(IR::Block& block, LocationDescriptor descriptor, MemoryReadCodeFu
|
||||||
const u64 pc = visitor.ir.current_location->PC();
|
const u64 pc = visitor.ir.current_location->PC();
|
||||||
if (const auto instruction = memory_read_code(pc)) {
|
if (const auto instruction = memory_read_code(pc)) {
|
||||||
auto decoder = Decode<TranslatorVisitor>(*instruction);
|
auto decoder = Decode<TranslatorVisitor>(*instruction);
|
||||||
should_continue = decoder.get().call(visitor, *instruction);
|
if (decoder) {
|
||||||
|
should_continue = decoder->get().call(visitor, *instruction);
|
||||||
|
} else {
|
||||||
|
should_continue = visitor.RaiseException(Exception::UnallocatedEncoding);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
should_continue = visitor.RaiseException(Exception::NoExecuteFault);
|
should_continue = visitor.RaiseException(Exception::NoExecuteFault);
|
||||||
}
|
}
|
||||||
|
|
@ -45,13 +49,15 @@ bool TranslateSingleInstruction(IR::Block& block, LocationDescriptor descriptor,
|
||||||
|
|
||||||
bool should_continue = true;
|
bool should_continue = true;
|
||||||
auto const decoder = Decode<TranslatorVisitor>(instruction);
|
auto const decoder = Decode<TranslatorVisitor>(instruction);
|
||||||
should_continue = decoder.get().call(visitor, instruction);
|
if (decoder) {
|
||||||
|
should_continue = decoder->get().call(visitor, instruction);
|
||||||
|
} else {
|
||||||
|
should_continue = false;
|
||||||
|
}
|
||||||
|
|
||||||
visitor.ir.current_location = visitor.ir.current_location->AdvancePC(4);
|
visitor.ir.current_location = visitor.ir.current_location->AdvancePC(4);
|
||||||
block.CycleCount()++;
|
block.CycleCount()++;
|
||||||
|
|
||||||
block.SetEndLocation(*visitor.ir.current_location);
|
block.SetEndLocation(*visitor.ir.current_location);
|
||||||
|
|
||||||
return should_continue;
|
return should_continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue