Compare commits

..

3 Commits

Author SHA1 Message Date
lizzie c6799d6921 Trigger Build 2026-09-06 19:19:46 +00:00
lizzie d5166fed93 Trigger Build 2026-09-05 22:02:30 +00:00
lizzie 97b1d1b472 2026-09-05 17:27:43
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2026-09-05 21:51:22 +00:00
3 changed files with 15 additions and 5 deletions
-1
View File
@@ -117,7 +117,6 @@ template <typename T>
static void GetFuncAddress(Common::DynamicLibrary& dll, const char* name, T& pfn) { static void GetFuncAddress(Common::DynamicLibrary& dll, const char* name, T& pfn) {
if (!dll.GetSymbol(name, &pfn)) { if (!dll.GetSymbol(name, &pfn)) {
LOG_CRITICAL(HW_Memory, "Failed to load {}", name); LOG_CRITICAL(HW_Memory, "Failed to load {}", name);
throw std::bad_alloc{};
} }
} }
+11 -2
View File
@@ -39,8 +39,16 @@ Block::iterator Block::PrependNewInst(iterator insertion_point, Opcode opcode, s
// just pool it!!! - reason why there is an inline buffer is because many small blocks are created // just pool it!!! - reason why there is an inline buffer is because many small blocks are created
// with few instructions due to subpar optimisations on other passes... plus branch-heavy code will // with few instructions due to subpar optimisations on other passes... plus branch-heavy code will
// hugely benefit from the coherency of faster allocations... // hugely benefit from the coherency of faster allocations...
inlined_inst.emplace_back(opcode); IR::Inst* inst;
auto* inst = &inlined_inst[inlined_inst.size() - 1]; if (inlined_inst.size() < inlined_inst.max_size()) {
inlined_inst.emplace_back(opcode);
inst = &inlined_inst[inlined_inst.size() - 1];
} else {
if (pooled_inst.empty() || pooled_inst.back().size() == pooled_inst.back().max_size())
pooled_inst.emplace_back();
pooled_inst.back().emplace_back(opcode);
inst = &pooled_inst.back()[pooled_inst.back().size() - 1];
}
DEBUG_ASSERT(args.size() == inst->NumArgs()); DEBUG_ASSERT(args.size() == inst->NumArgs());
std::for_each(args.begin(), args.end(), [&inst, index = size_t(0)](const auto& arg) mutable { std::for_each(args.begin(), args.end(), [&inst, index = size_t(0)](const auto& arg) mutable {
inst->SetArg(index, arg); inst->SetArg(index, arg);
@@ -53,6 +61,7 @@ void Block::Reset(LocationDescriptor location_) noexcept {
mcl::intrusive_list<IR::Inst> tmp = {}; mcl::intrusive_list<IR::Inst> tmp = {};
instructions.swap(tmp); instructions.swap(tmp);
inlined_inst.clear(); inlined_inst.clear();
pooled_inst.clear();
cond_failed.reset(); cond_failed.reset();
location = location_; location = location_;
end_location = location_; end_location = location_;
+4 -2
View File
@@ -142,9 +142,11 @@ public:
} }
/// "Hot cache" for small blocks so we don't call global allocator /// "Hot cache" for small blocks so we don't call global allocator
boost::container::static_vector<Inst, 4096> inlined_inst = {}; boost::container::static_vector<Inst, 30> inlined_inst;
/// List of instructions in this block. /// List of instructions in this block.
instruction_list_type instructions; instruction_list_type instructions;
/// "Long/far" memory pool
boost::container::stable_vector<boost::container::static_vector<Inst, 32>> pooled_inst;
/// Block to execute next if `cond` did not pass. /// Block to execute next if `cond` did not pass.
std::optional<LocationDescriptor> cond_failed = {}; std::optional<LocationDescriptor> cond_failed = {};
/// Description of the starting location of this block /// Description of the starting location of this block
@@ -160,7 +162,7 @@ public:
/// Number of cycles this block takes to execute. /// Number of cycles this block takes to execute.
size_t cycle_count = 0; size_t cycle_count = 0;
}; };
//static_assert(sizeof(Block) == 4096); static_assert(sizeof(Block) == 4096);
/// Returns a string representation of the contents of block. Intended for debugging. /// Returns a string representation of the contents of block. Intended for debugging.
std::string DumpBlock(const IR::Block& block) noexcept; std::string DumpBlock(const IR::Block& block) noexcept;