mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-25 15:27:02 +02:00
update to newer dynarmic changes
This commit is contained in:
parent
3ee97bb76a
commit
ea759d3f5a
3 changed files with 11 additions and 9 deletions
|
|
@ -10,6 +10,7 @@
|
||||||
#include "dynarmic/common/common_types.h"
|
#include "dynarmic/common/common_types.h"
|
||||||
#include "dynarmic/frontend/A32/a32_location_descriptor.h"
|
#include "dynarmic/frontend/A32/a32_location_descriptor.h"
|
||||||
#include "dynarmic/frontend/A32/translate/a32_translate.h"
|
#include "dynarmic/frontend/A32/translate/a32_translate.h"
|
||||||
|
#include "dynarmic/frontend/A32/FPSCR.h"
|
||||||
#include "dynarmic/interface/A32/config.h"
|
#include "dynarmic/interface/A32/config.h"
|
||||||
#include "dynarmic/backend/ppc64/a32_core.h"
|
#include "dynarmic/backend/ppc64/a32_core.h"
|
||||||
#include "dynarmic/common/atomic.h"
|
#include "dynarmic/common/atomic.h"
|
||||||
|
|
@ -33,7 +34,8 @@ struct A32AddressSpace final {
|
||||||
if (auto const it = block_entries.find(desc.Value()); it != block_entries.end())
|
if (auto const it = block_entries.find(desc.Value()); it != block_entries.end())
|
||||||
return it->second;
|
return it->second;
|
||||||
|
|
||||||
IR::Block ir_block = A32::Translate(A32::LocationDescriptor{desc}, conf.callbacks, {conf.arch_version, conf.define_unpredictable_behaviour, conf.hook_hint_instructions});
|
ir_block.Reset(A32::LocationDescriptor{desc});
|
||||||
|
A32::Translate(ir_block, A32::LocationDescriptor{desc}, conf.callbacks, {conf.arch_version, conf.define_unpredictable_behaviour, conf.hook_hint_instructions});
|
||||||
Optimization::Optimize(ir_block, conf, {});
|
Optimization::Optimize(ir_block, conf, {});
|
||||||
const EmittedBlockInfo block_info = Emit(std::move(ir_block));
|
const EmittedBlockInfo block_info = Emit(std::move(ir_block));
|
||||||
|
|
||||||
|
|
@ -61,6 +63,7 @@ struct A32AddressSpace final {
|
||||||
//UNREACHABLE();
|
//UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IR::Block ir_block = {LocationDescriptor(0, PSR(0), FPSCR(0), false)};
|
||||||
const A32::UserConfig conf;
|
const A32::UserConfig conf;
|
||||||
CodeBlock cb;
|
CodeBlock cb;
|
||||||
powah::Context as;
|
powah::Context as;
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,8 @@ struct A64AddressSpace final {
|
||||||
explicit A64AddressSpace(const A64::UserConfig& conf)
|
explicit A64AddressSpace(const A64::UserConfig& conf)
|
||||||
: conf(conf)
|
: conf(conf)
|
||||||
, cb(conf.code_cache_size)
|
, cb(conf.code_cache_size)
|
||||||
, as(cb.ptr<u8*>(), conf.code_cache_size) {
|
, as(cb.ptr<u8*>(), conf.code_cache_size)
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -35,7 +36,8 @@ struct A64AddressSpace final {
|
||||||
auto const get_code = [this](u64 vaddr) {
|
auto const get_code = [this](u64 vaddr) {
|
||||||
return conf.callbacks->MemoryReadCode(vaddr);
|
return conf.callbacks->MemoryReadCode(vaddr);
|
||||||
};
|
};
|
||||||
IR::Block ir_block = A64::Translate(A64::LocationDescriptor{desc}, get_code, {conf.define_unpredictable_behaviour, conf.wall_clock_cntpct});
|
ir_block.Reset(A64::LocationDescriptor{desc});
|
||||||
|
A64::Translate(ir_block, A64::LocationDescriptor{desc}, get_code, {conf.define_unpredictable_behaviour, conf.wall_clock_cntpct});
|
||||||
Optimization::Optimize(ir_block, conf, {});
|
Optimization::Optimize(ir_block, conf, {});
|
||||||
fmt::print("IR:\n{}\n", IR::DumpBlock(ir_block));
|
fmt::print("IR:\n{}\n", IR::DumpBlock(ir_block));
|
||||||
const EmittedBlockInfo block_info = Emit(std::move(ir_block));
|
const EmittedBlockInfo block_info = Emit(std::move(ir_block));
|
||||||
|
|
@ -64,6 +66,7 @@ struct A64AddressSpace final {
|
||||||
// UNREACHABLE();
|
// UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IR::Block ir_block = {LocationDescriptor(0, FP::FPCR(0), false)};
|
||||||
const A64::UserConfig conf;
|
const A64::UserConfig conf;
|
||||||
CodeBlock cb;
|
CodeBlock cb;
|
||||||
powah::Context as;
|
powah::Context as;
|
||||||
|
|
|
||||||
|
|
@ -146,10 +146,6 @@ void EmitIR<IR::Opcode::NZCVFromPackedFlags>(powah::Context&, EmitContext&, IR::
|
||||||
namespace {
|
namespace {
|
||||||
void EmitTerminal(powah::Context& code, EmitContext& ctx, IR::Term::Terminal terminal, IR::LocationDescriptor initial_location, bool is_single_step);
|
void EmitTerminal(powah::Context& code, EmitContext& ctx, IR::Term::Terminal terminal, IR::LocationDescriptor initial_location, bool is_single_step);
|
||||||
|
|
||||||
void EmitTerminal(powah::Context&, EmitContext&, IR::Term::Interpret, IR::LocationDescriptor, bool) {
|
|
||||||
ASSERT(false && "unimp");
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmitTerminal(powah::Context& code, EmitContext& ctx, IR::Term::ReturnToDispatch, IR::LocationDescriptor, bool) {
|
void EmitTerminal(powah::Context& code, EmitContext& ctx, IR::Term::ReturnToDispatch, IR::LocationDescriptor, bool) {
|
||||||
ASSERT(false && "unimp");
|
ASSERT(false && "unimp");
|
||||||
}
|
}
|
||||||
|
|
@ -223,7 +219,7 @@ EmittedBlockInfo EmitPPC64(powah::Context& code, IR::Block block, const EmitConf
|
||||||
size_t const stack_size = 112 + ABI_CALLEE_SAVED.size() * 8;
|
size_t const stack_size = 112 + ABI_CALLEE_SAVED.size() * 8;
|
||||||
auto const start_offset = code.offset;
|
auto const start_offset = code.offset;
|
||||||
ebi.entry_point = &code.base[start_offset];
|
ebi.entry_point = &code.base[start_offset];
|
||||||
if (!block.empty()) {
|
if (!block.instructions.empty()) {
|
||||||
code.MFLR(powah::R0);
|
code.MFLR(powah::R0);
|
||||||
code.STD(powah::R0, powah::R1, 16);
|
code.STD(powah::R0, powah::R1, 16);
|
||||||
// Non-volatile saves
|
// Non-volatile saves
|
||||||
|
|
@ -233,7 +229,7 @@ EmittedBlockInfo EmitPPC64(powah::Context& code, IR::Block block, const EmitConf
|
||||||
code.STDU(powah::R1, powah::R1, uint32_t(-stack_size));
|
code.STDU(powah::R1, powah::R1, uint32_t(-stack_size));
|
||||||
code.STD(powah::R2, powah::R1, 40);
|
code.STD(powah::R2, powah::R1, 40);
|
||||||
|
|
||||||
for (auto iter = block.begin(); iter != block.end(); ++iter) {
|
for (auto iter = block.instructions.begin(); iter != block.instructions.end(); ++iter) {
|
||||||
IR::Inst* inst = &*iter;
|
IR::Inst* inst = &*iter;
|
||||||
switch (inst->GetOpcode()) {
|
switch (inst->GetOpcode()) {
|
||||||
#define OPCODE(name, type, ...) \
|
#define OPCODE(name, type, ...) \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue