mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-18 20:57:00 +02:00
terminal draft1
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
e69dec8779
commit
cbfe8176e0
5 changed files with 59 additions and 63 deletions
|
|
@ -48,6 +48,7 @@ EmittedBlockInfo A32AddressSpace::Emit(IR::Block block) {
|
||||||
EmittedBlockInfo block_info = EmitPPC64(as, std::move(block), {
|
EmittedBlockInfo block_info = EmitPPC64(as, std::move(block), {
|
||||||
.enable_cycle_counting = conf.enable_cycle_counting,
|
.enable_cycle_counting = conf.enable_cycle_counting,
|
||||||
.always_little_endian = conf.always_little_endian,
|
.always_little_endian = conf.always_little_endian,
|
||||||
|
.a64_variant = false
|
||||||
});
|
});
|
||||||
Link(block_info);
|
Link(block_info);
|
||||||
return block_info;
|
return block_info;
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ EmittedBlockInfo A64AddressSpace::Emit(IR::Block block) {
|
||||||
EmittedBlockInfo block_info = EmitPPC64(as, std::move(block), {
|
EmittedBlockInfo block_info = EmitPPC64(as, std::move(block), {
|
||||||
.enable_cycle_counting = conf.enable_cycle_counting,
|
.enable_cycle_counting = conf.enable_cycle_counting,
|
||||||
.always_little_endian = true,
|
.always_little_endian = true,
|
||||||
|
.a64_variant = true
|
||||||
});
|
});
|
||||||
Link(block_info);
|
Link(block_info);
|
||||||
return block_info;
|
return block_info;
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
#include <mcl/bit/bit_field.hpp>
|
#include <mcl/bit/bit_field.hpp>
|
||||||
|
|
||||||
#include "dynarmic/backend/ppc64/a32_core.h"
|
#include "dynarmic/backend/ppc64/a32_core.h"
|
||||||
|
#include "dynarmic/backend/ppc64/a64_core.h"
|
||||||
#include "dynarmic/backend/ppc64/abi.h"
|
#include "dynarmic/backend/ppc64/abi.h"
|
||||||
#include "dynarmic/backend/ppc64/emit_context.h"
|
#include "dynarmic/backend/ppc64/emit_context.h"
|
||||||
#include "dynarmic/backend/ppc64/reg_alloc.h"
|
#include "dynarmic/backend/ppc64/reg_alloc.h"
|
||||||
|
|
@ -90,6 +91,57 @@ void EmitIR<IR::Opcode::NZCVFromPackedFlags>(powah::Context&, EmitContext&, IR::
|
||||||
ASSERT(false && "unimp");
|
ASSERT(false && "unimp");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
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) {
|
||||||
|
ASSERT(false && "unimp");
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmitTerminal(powah::Context& code, EmitContext& ctx, IR::Term::LinkBlock terminal, IR::LocationDescriptor initial_location, bool) {
|
||||||
|
powah::GPR const tmp = ctx.reg_alloc.ScratchGpr();
|
||||||
|
if (ctx.emit_conf.a64_variant) {
|
||||||
|
code.LI(tmp, terminal.next.Value());
|
||||||
|
code.STD(tmp, PPC64::RJIT, offsetof(A64JitState, pc));
|
||||||
|
} else {
|
||||||
|
code.LI(tmp, terminal.next.Value());
|
||||||
|
code.STW(tmp, PPC64::RJIT, offsetof(A32JitState, regs) + sizeof(u32) * 15);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmitTerminal(powah::Context& code, EmitContext& ctx, IR::Term::LinkBlockFast terminal, IR::LocationDescriptor initial_location, bool) {
|
||||||
|
ASSERT(false && "unimp");
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmitTerminal(powah::Context& code, EmitContext& ctx, IR::Term::PopRSBHint, IR::LocationDescriptor, bool) {
|
||||||
|
ASSERT(false && "unimp");
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmitTerminal(powah::Context& code, EmitContext& ctx, IR::Term::FastDispatchHint, IR::LocationDescriptor, bool) {
|
||||||
|
ASSERT(false && "unimp");
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmitTerminal(powah::Context& code, EmitContext& ctx, IR::Term::If terminal, IR::LocationDescriptor initial_location, bool is_single_step) {
|
||||||
|
ASSERT(false && "unimp");
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmitTerminal(powah::Context& code, EmitContext& ctx, IR::Term::CheckBit terminal, IR::LocationDescriptor initial_location, bool is_single_step) {
|
||||||
|
ASSERT(false && "unimp");
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmitTerminal(powah::Context& code, EmitContext& ctx, IR::Term::CheckHalt terminal, IR::LocationDescriptor initial_location, bool is_single_step) {
|
||||||
|
ASSERT(false && "unimp");
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmitTerminal(powah::Context& code, EmitContext& ctx, IR::Term::Terminal terminal, IR::LocationDescriptor initial_location, bool is_single_step) {
|
||||||
|
boost::apply_visitor([&](const auto& t) {
|
||||||
|
EmitTerminal(code, ctx, t, initial_location, is_single_step);
|
||||||
|
}, terminal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EmittedBlockInfo EmitPPC64(powah::Context& code, IR::Block block, const EmitConfig& emit_conf) {
|
EmittedBlockInfo EmitPPC64(powah::Context& code, IR::Block block, const EmitConfig& emit_conf) {
|
||||||
EmittedBlockInfo ebi;
|
EmittedBlockInfo ebi;
|
||||||
RegAlloc reg_alloc{code};
|
RegAlloc reg_alloc{code};
|
||||||
|
|
@ -128,7 +180,10 @@ EmittedBlockInfo EmitPPC64(powah::Context& code, IR::Block block, const EmitConf
|
||||||
}
|
}
|
||||||
|
|
||||||
// auto const cycles_to_add = block.CycleCount();
|
// auto const cycles_to_add = block.CycleCount();
|
||||||
// Xticks
|
|
||||||
|
auto const location{ctx.block.Location()};
|
||||||
|
auto const term = ctx.block.GetTerminal();
|
||||||
|
|
||||||
for (size_t i = 0; i < gpr_order.size(); ++i)
|
for (size_t i = 0; i < gpr_order.size(); ++i)
|
||||||
code.LD(powah::GPR{gpr_order[i]}, powah::R1, -(i * 8));
|
code.LD(powah::GPR{gpr_order[i]}, powah::R1, -(i * 8));
|
||||||
code.BLR();
|
code.BLR();
|
||||||
|
|
@ -144,8 +199,4 @@ EmittedBlockInfo EmitPPC64(powah::Context& code, IR::Block block, const EmitConf
|
||||||
return ebi;
|
return ebi;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitRelocation(powah::Context& code, EmitContext& ctx, LinkTarget link_target) {
|
|
||||||
ASSERT(false && "unimp");
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Dynarmic::Backend::RV64
|
} // namespace Dynarmic::Backend::RV64
|
||||||
|
|
|
||||||
|
|
@ -41,16 +41,13 @@ struct EmittedBlockInfo {
|
||||||
struct EmitConfig {
|
struct EmitConfig {
|
||||||
bool enable_cycle_counting;
|
bool enable_cycle_counting;
|
||||||
bool always_little_endian;
|
bool always_little_endian;
|
||||||
|
bool a64_variant;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct EmitContext;
|
struct EmitContext;
|
||||||
|
|
||||||
EmittedBlockInfo EmitPPC64(powah::Context& code, IR::Block block, const EmitConfig& emit_conf);
|
EmittedBlockInfo EmitPPC64(powah::Context& code, IR::Block block, const EmitConfig& emit_conf);
|
||||||
|
|
||||||
template<IR::Opcode op>
|
template<IR::Opcode op>
|
||||||
void EmitIR(powah::Context& code, EmitContext& ctx, IR::Inst* inst);
|
void EmitIR(powah::Context& code, EmitContext& ctx, IR::Inst* inst);
|
||||||
void EmitRelocation(powah::Context& code, EmitContext& ctx, LinkTarget link_target);
|
|
||||||
void EmitA32Cond(powah::Context& code, EmitContext& ctx, IR::Cond cond, powah::Label* label);
|
|
||||||
void EmitA32Terminal(powah::Context& code, EmitContext& ctx);
|
|
||||||
|
|
||||||
} // namespace Dynarmic::Backend::RV64
|
} // namespace Dynarmic::Backend::RV64
|
||||||
|
|
|
||||||
|
|
@ -16,60 +16,6 @@
|
||||||
|
|
||||||
namespace Dynarmic::Backend::PPC64 {
|
namespace Dynarmic::Backend::PPC64 {
|
||||||
|
|
||||||
void EmitA32Cond(powah::Context& code, EmitContext&, IR::Cond cond, powah::Label* label) {
|
|
||||||
ASSERT(false && "unimp");
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmitA32Terminal(powah::Context& code, EmitContext& ctx, IR::Term::Terminal terminal, IR::LocationDescriptor initial_location, bool is_single_step);
|
|
||||||
|
|
||||||
void EmitA32Terminal(powah::Context&, EmitContext&, IR::Term::Interpret, IR::LocationDescriptor, bool) {
|
|
||||||
ASSERT(false && "unimp");
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmitA32Terminal(powah::Context& code, EmitContext& ctx, IR::Term::ReturnToDispatch, IR::LocationDescriptor, bool) {
|
|
||||||
EmitRelocation(code, ctx, LinkTarget::ReturnFromRunCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmitSetUpperLocationDescriptor(powah::Context& code, EmitContext& ctx, IR::LocationDescriptor new_location, IR::LocationDescriptor old_location) {
|
|
||||||
ASSERT(false && "unimp");
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmitA32Terminal(powah::Context& code, EmitContext& ctx, IR::Term::LinkBlock terminal, IR::LocationDescriptor initial_location, bool) {
|
|
||||||
ASSERT(false && "unimp");
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmitA32Terminal(powah::Context& code, EmitContext& ctx, IR::Term::LinkBlockFast terminal, IR::LocationDescriptor initial_location, bool) {
|
|
||||||
ASSERT(false && "unimp");
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmitA32Terminal(powah::Context& code, EmitContext& ctx, IR::Term::PopRSBHint, IR::LocationDescriptor, bool) {
|
|
||||||
ASSERT(false && "unimp");
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmitA32Terminal(powah::Context& code, EmitContext& ctx, IR::Term::FastDispatchHint, IR::LocationDescriptor, bool) {
|
|
||||||
ASSERT(false && "unimp");
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmitA32Terminal(powah::Context& code, EmitContext& ctx, IR::Term::If terminal, IR::LocationDescriptor initial_location, bool is_single_step) {
|
|
||||||
ASSERT(false && "unimp");
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmitA32Terminal(powah::Context& code, EmitContext& ctx, IR::Term::CheckBit terminal, IR::LocationDescriptor initial_location, bool is_single_step) {
|
|
||||||
ASSERT(false && "unimp");
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmitA32Terminal(powah::Context& code, EmitContext& ctx, IR::Term::CheckHalt terminal, IR::LocationDescriptor initial_location, bool is_single_step) {
|
|
||||||
ASSERT(false && "unimp");
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmitA32Terminal(powah::Context& code, EmitContext& ctx, IR::Term::Terminal terminal, IR::LocationDescriptor initial_location, bool is_single_step) {
|
|
||||||
ASSERT(false && "unimp");
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmitA32Terminal(powah::Context& code, EmitContext& ctx) {
|
|
||||||
ASSERT(false && "unimp");
|
|
||||||
}
|
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
void EmitIR<IR::Opcode::A32SetCheckBit>(powah::Context&, EmitContext&, IR::Inst*) {
|
void EmitIR<IR::Opcode::A32SetCheckBit>(powah::Context&, EmitContext&, IR::Inst*) {
|
||||||
ASSERT(false && "unimp");
|
ASSERT(false && "unimp");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue