mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-13 00:08:39 +02:00
fix mk8d
This commit is contained in:
parent
233466cd9c
commit
7b4df96ba5
6 changed files with 9 additions and 16 deletions
|
|
@ -59,7 +59,7 @@ static Xbyak::Address MJitStateExtReg(A32::ExtReg reg) {
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
A32EmitContext::A32EmitContext(const A32::UserConfig& conf, RegAlloc& reg_alloc, IR::Block& block, std::vector<Xbyak::Label>& shared_labels)
|
A32EmitContext::A32EmitContext(const A32::UserConfig& conf, RegAlloc& reg_alloc, IR::Block& block, boost::container::stable_vector<Xbyak::Label>& shared_labels)
|
||||||
: EmitContext(reg_alloc, block, shared_labels)
|
: EmitContext(reg_alloc, block, shared_labels)
|
||||||
, conf(conf)
|
, conf(conf)
|
||||||
{}
|
{}
|
||||||
|
|
@ -112,9 +112,6 @@ A32EmitX64::BlockDescriptor A32EmitX64::Emit(IR::Block& block) {
|
||||||
return gprs;
|
return gprs;
|
||||||
}(), any_xmm);
|
}(), any_xmm);
|
||||||
|
|
||||||
// up to 2 labels per insn
|
|
||||||
if (auto const inst_count = block.instructions.size(); inst_count > shared_labels.capacity())
|
|
||||||
shared_labels.reserve(inst_count * 16);
|
|
||||||
A32EmitContext ctx{conf, reg_alloc, block, shared_labels};
|
A32EmitContext ctx{conf, reg_alloc, block, shared_labels};
|
||||||
|
|
||||||
// Start emitting.
|
// Start emitting.
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ namespace Dynarmic::Backend::X64 {
|
||||||
class RegAlloc;
|
class RegAlloc;
|
||||||
|
|
||||||
struct A32EmitContext final : public EmitContext {
|
struct A32EmitContext final : public EmitContext {
|
||||||
A32EmitContext(const A32::UserConfig& conf, RegAlloc& reg_alloc, IR::Block& block, std::vector<Xbyak::Label>& shared_labels);
|
A32EmitContext(const A32::UserConfig& conf, RegAlloc& reg_alloc, IR::Block& block, boost::container::stable_vector<Xbyak::Label>& shared_labels);
|
||||||
|
|
||||||
A32::LocationDescriptor Location() const;
|
A32::LocationDescriptor Location() const;
|
||||||
A32::LocationDescriptor EndLocation() const;
|
A32::LocationDescriptor EndLocation() const;
|
||||||
|
|
@ -130,7 +130,7 @@ public:
|
||||||
ankerl::unordered_dense::map<std::tuple<bool, size_t, int, int>, void (*)()> write_fallbacks;
|
ankerl::unordered_dense::map<std::tuple<bool, size_t, int, int>, void (*)()> write_fallbacks;
|
||||||
ankerl::unordered_dense::map<std::tuple<bool, size_t, int, int>, void (*)()> exclusive_write_fallbacks;
|
ankerl::unordered_dense::map<std::tuple<bool, size_t, int, int>, void (*)()> exclusive_write_fallbacks;
|
||||||
ankerl::unordered_dense::set<DoNotFastmemMarker> do_not_fastmem;
|
ankerl::unordered_dense::set<DoNotFastmemMarker> do_not_fastmem;
|
||||||
std::vector<Xbyak::Label> shared_labels;
|
boost::container::stable_vector<Xbyak::Label> shared_labels;
|
||||||
void (*memory_read_128)() = nullptr; // Dummy
|
void (*memory_read_128)() = nullptr; // Dummy
|
||||||
void (*memory_write_128)() = nullptr; // Dummy
|
void (*memory_write_128)() = nullptr; // Dummy
|
||||||
const void* terminal_handler_pop_rsb_hint;
|
const void* terminal_handler_pop_rsb_hint;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ namespace Dynarmic::Backend::X64 {
|
||||||
|
|
||||||
using namespace Xbyak::util;
|
using namespace Xbyak::util;
|
||||||
|
|
||||||
A64EmitContext::A64EmitContext(const A64::UserConfig& conf, RegAlloc& reg_alloc, IR::Block& block, std::vector<Xbyak::Label>& shared_labels)
|
A64EmitContext::A64EmitContext(const A64::UserConfig& conf, RegAlloc& reg_alloc, IR::Block& block, boost::container::stable_vector<Xbyak::Label>& shared_labels)
|
||||||
: EmitContext(reg_alloc, block, shared_labels)
|
: EmitContext(reg_alloc, block, shared_labels)
|
||||||
, conf(conf)
|
, conf(conf)
|
||||||
{}
|
{}
|
||||||
|
|
@ -86,9 +86,6 @@ A64EmitX64::BlockDescriptor A64EmitX64::Emit(IR::Block& block) noexcept {
|
||||||
return gprs;
|
return gprs;
|
||||||
}(), any_xmm};
|
}(), any_xmm};
|
||||||
|
|
||||||
// up to 2 labels per insn
|
|
||||||
if (auto const inst_count = block.instructions.size(); inst_count > shared_labels.capacity())
|
|
||||||
shared_labels.reserve(inst_count * 16);
|
|
||||||
A64EmitContext ctx{conf, reg_alloc, block, shared_labels};
|
A64EmitContext ctx{conf, reg_alloc, block, shared_labels};
|
||||||
|
|
||||||
// Start emitting.
|
// Start emitting.
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
namespace Dynarmic::Backend::X64 {
|
namespace Dynarmic::Backend::X64 {
|
||||||
|
|
||||||
struct A64EmitContext final : public EmitContext {
|
struct A64EmitContext final : public EmitContext {
|
||||||
A64EmitContext(const A64::UserConfig& conf, RegAlloc& reg_alloc, IR::Block& block, std::vector<Xbyak::Label>& shared_labels);
|
A64EmitContext(const A64::UserConfig& conf, RegAlloc& reg_alloc, IR::Block& block, boost::container::stable_vector<Xbyak::Label>& shared_labels);
|
||||||
|
|
||||||
A64::LocationDescriptor Location() const;
|
A64::LocationDescriptor Location() const;
|
||||||
bool IsSingleStep() const;
|
bool IsSingleStep() const;
|
||||||
|
|
@ -126,7 +126,7 @@ public:
|
||||||
ankerl::unordered_dense::map<std::tuple<bool, size_t, int, int>, void (*)()> write_fallbacks;
|
ankerl::unordered_dense::map<std::tuple<bool, size_t, int, int>, void (*)()> write_fallbacks;
|
||||||
ankerl::unordered_dense::map<std::tuple<bool, size_t, int, int>, void (*)()> exclusive_write_fallbacks;
|
ankerl::unordered_dense::map<std::tuple<bool, size_t, int, int>, void (*)()> exclusive_write_fallbacks;
|
||||||
ankerl::unordered_dense::set<DoNotFastmemMarker> do_not_fastmem;
|
ankerl::unordered_dense::set<DoNotFastmemMarker> do_not_fastmem;
|
||||||
std::vector<Xbyak::Label> shared_labels;
|
boost::container::stable_vector<Xbyak::Label> shared_labels;
|
||||||
const void* terminal_handler_pop_rsb_hint = nullptr;
|
const void* terminal_handler_pop_rsb_hint = nullptr;
|
||||||
const void* terminal_handler_fast_dispatch_hint = nullptr;
|
const void* terminal_handler_fast_dispatch_hint = nullptr;
|
||||||
FastDispatchEntry& (*fast_dispatch_table_lookup)(u64) = nullptr;
|
FastDispatchEntry& (*fast_dispatch_table_lookup)(u64) = nullptr;
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ namespace Dynarmic::Backend::X64 {
|
||||||
|
|
||||||
using namespace Xbyak::util;
|
using namespace Xbyak::util;
|
||||||
|
|
||||||
EmitContext::EmitContext(RegAlloc& reg_alloc, IR::Block& block, std::vector<Xbyak::Label>& shared_labels)
|
EmitContext::EmitContext(RegAlloc& reg_alloc, IR::Block& block, boost::container::stable_vector<Xbyak::Label>& shared_labels)
|
||||||
: reg_alloc(reg_alloc)
|
: reg_alloc(reg_alloc)
|
||||||
, block(block)
|
, block(block)
|
||||||
, shared_labels(shared_labels)
|
, shared_labels(shared_labels)
|
||||||
|
|
|
||||||
|
|
@ -55,20 +55,19 @@ using HalfVectorArray = std::array<T, A64FullVectorWidth::value / mcl::bitsizeof
|
||||||
|
|
||||||
using SharedLabel = Xbyak::Label*;
|
using SharedLabel = Xbyak::Label*;
|
||||||
struct EmitContext {
|
struct EmitContext {
|
||||||
EmitContext(RegAlloc& reg_alloc, IR::Block& block, std::vector<Xbyak::Label>& shared_labels);
|
EmitContext(RegAlloc& reg_alloc, IR::Block& block, boost::container::stable_vector<Xbyak::Label>& shared_labels);
|
||||||
virtual ~EmitContext();
|
virtual ~EmitContext();
|
||||||
virtual FP::FPCR FPCR(bool fpcr_controlled = true) const = 0;
|
virtual FP::FPCR FPCR(bool fpcr_controlled = true) const = 0;
|
||||||
virtual bool HasOptimization(OptimizationFlag flag) const = 0;
|
virtual bool HasOptimization(OptimizationFlag flag) const = 0;
|
||||||
|
|
||||||
[[nodiscard]] inline Xbyak::Label* GenSharedLabel() noexcept {
|
[[nodiscard]] inline Xbyak::Label* GenSharedLabel() noexcept {
|
||||||
DEBUG_ASSERT(shared_labels.size() + 1 <= shared_labels.capacity());
|
|
||||||
return &shared_labels.emplace_back();
|
return &shared_labels.emplace_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::function<void()>> deferred_emits;
|
std::vector<std::function<void()>> deferred_emits;
|
||||||
RegAlloc& reg_alloc;
|
RegAlloc& reg_alloc;
|
||||||
IR::Block& block;
|
IR::Block& block;
|
||||||
std::vector<Xbyak::Label>& shared_labels;
|
boost::container::stable_vector<Xbyak::Label>& shared_labels;
|
||||||
};
|
};
|
||||||
|
|
||||||
class EmitX64 {
|
class EmitX64 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue