mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-14 17:16:58 +02:00
[dynarmic] get rid of mcl intrusive list
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
08232ce642
commit
3afff30dab
5 changed files with 17 additions and 28 deletions
|
|
@ -57,7 +57,7 @@ Block::iterator Block::PrependNewInst(iterator insertion_point, Opcode opcode, s
|
||||||
inst->SetArg(index, arg);
|
inst->SetArg(index, arg);
|
||||||
index++;
|
index++;
|
||||||
});
|
});
|
||||||
return instructions.insert_before(insertion_point, inst);
|
return instructions.insert(insertion_point, *inst);;
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::string TerminalToString(const Terminal& terminal_variant) noexcept {
|
static std::string TerminalToString(const Terminal& terminal_variant) noexcept {
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,12 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <boost/intrusive/list.hpp>
|
||||||
|
|
||||||
#include <boost/container/container_fwd.hpp>
|
#include <boost/container/container_fwd.hpp>
|
||||||
#include <boost/container/static_vector.hpp>
|
#include <boost/container/static_vector.hpp>
|
||||||
#include <boost/container/stable_vector.hpp>
|
#include <boost/container/stable_vector.hpp>
|
||||||
#include <mcl/container/intrusive_list.hpp>
|
|
||||||
#include "dynarmic/common/common_types.h"
|
#include "dynarmic/common/common_types.h"
|
||||||
|
|
||||||
#include "dynarmic/ir/location_descriptor.h"
|
#include "dynarmic/ir/location_descriptor.h"
|
||||||
#include "dynarmic/ir/microinstruction.h"
|
#include "dynarmic/ir/microinstruction.h"
|
||||||
#include "dynarmic/ir/terminal.h"
|
#include "dynarmic/ir/terminal.h"
|
||||||
|
|
@ -36,7 +35,7 @@ enum class Opcode;
|
||||||
class alignas(4096) Block final {
|
class alignas(4096) Block final {
|
||||||
public:
|
public:
|
||||||
//using instruction_list_type = dense_list<Inst>;
|
//using instruction_list_type = dense_list<Inst>;
|
||||||
using instruction_list_type = mcl::intrusive_list<Inst>;
|
using instruction_list_type = boost::intrusive::list<Inst>;
|
||||||
using size_type = instruction_list_type::size_type;
|
using size_type = instruction_list_type::size_type;
|
||||||
using iterator = instruction_list_type::iterator;
|
using iterator = instruction_list_type::iterator;
|
||||||
using const_iterator = instruction_list_type::const_iterator;
|
using const_iterator = instruction_list_type::const_iterator;
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,10 @@
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "dynarmic/common/common_types.h"
|
|
||||||
#include "dynarmic/common/assert.h"
|
|
||||||
#include <mcl/bit_cast.hpp>
|
#include <mcl/bit_cast.hpp>
|
||||||
|
|
||||||
|
#include "dynarmic/common/common_types.h"
|
||||||
|
#include "dynarmic/common/assert.h"
|
||||||
#include "dynarmic/ir/opcodes.h"
|
#include "dynarmic/ir/opcodes.h"
|
||||||
#include "dynarmic/ir/acc_type.h"
|
#include "dynarmic/ir/acc_type.h"
|
||||||
#include "dynarmic/ir/basic_block.h"
|
#include "dynarmic/ir/basic_block.h"
|
||||||
|
|
@ -2947,19 +2947,10 @@ public:
|
||||||
block.SetTerminal(terminal);
|
block.SetTerminal(terminal);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetInsertionPointBefore(IR::Inst* new_insertion_point) {
|
|
||||||
insertion_point = IR::Block::iterator{*new_insertion_point};
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetInsertionPointBefore(IR::Block::iterator new_insertion_point) {
|
void SetInsertionPointBefore(IR::Block::iterator new_insertion_point) {
|
||||||
insertion_point = new_insertion_point;
|
insertion_point = new_insertion_point;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetInsertionPointAfter(IR::Inst* new_insertion_point) {
|
|
||||||
insertion_point = IR::Block::iterator{*new_insertion_point};
|
|
||||||
++insertion_point;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetInsertionPointAfter(IR::Block::iterator new_insertion_point) {
|
void SetInsertionPointAfter(IR::Block::iterator new_insertion_point) {
|
||||||
insertion_point = new_insertion_point;
|
insertion_point = new_insertion_point;
|
||||||
++insertion_point;
|
++insertion_point;
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <boost/intrusive/list.hpp>
|
||||||
|
|
||||||
#include <mcl/container/intrusive_list.hpp>
|
|
||||||
#include "dynarmic/common/common_types.h"
|
#include "dynarmic/common/common_types.h"
|
||||||
|
|
||||||
#include "dynarmic/ir/value.h"
|
#include "dynarmic/ir/value.h"
|
||||||
#include "dynarmic/ir/opcodes.h"
|
#include "dynarmic/ir/opcodes.h"
|
||||||
|
|
||||||
|
|
@ -26,7 +25,7 @@ constexpr size_t max_arg_count = 4;
|
||||||
/// A representation of a microinstruction. A single ARM/Thumb instruction may be
|
/// A representation of a microinstruction. A single ARM/Thumb instruction may be
|
||||||
/// converted into zero or more microinstructions.
|
/// converted into zero or more microinstructions.
|
||||||
//class Inst final {
|
//class Inst final {
|
||||||
class Inst final : public mcl::intrusive_list_node<Inst> {
|
class Inst final : public boost::intrusive::list_base_hook<> {
|
||||||
public:
|
public:
|
||||||
explicit Inst(Opcode op) : op(op) {}
|
explicit Inst(Opcode op) : op(op) {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,12 +86,10 @@ static void ConstantMemoryReads(IR::Block& block, A32::UserCallbacks* cb) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FlagsPass(IR::Block& block) {
|
static void FlagsPass(IR::Block& block) {
|
||||||
using Iterator = typename std::reverse_iterator<IR::Block::iterator>;
|
|
||||||
|
|
||||||
struct FlagInfo {
|
struct FlagInfo {
|
||||||
bool set_not_required = false;
|
bool set_not_required = false;
|
||||||
bool has_value_request = false;
|
bool has_value_request = false;
|
||||||
Iterator value_request = {};
|
IR::Block::reverse_iterator value_request = {};
|
||||||
};
|
};
|
||||||
struct ValuelessFlagInfo {
|
struct ValuelessFlagInfo {
|
||||||
bool set_not_required = false;
|
bool set_not_required = false;
|
||||||
|
|
@ -102,7 +100,7 @@ static void FlagsPass(IR::Block& block) {
|
||||||
FlagInfo c_flag;
|
FlagInfo c_flag;
|
||||||
FlagInfo ge;
|
FlagInfo ge;
|
||||||
|
|
||||||
auto do_set = [&](FlagInfo& info, IR::Value value, Iterator inst) {
|
auto do_set = [&](FlagInfo& info, IR::Value value, IR::Block::reverse_iterator const inst) {
|
||||||
if (info.has_value_request) {
|
if (info.has_value_request) {
|
||||||
info.value_request->ReplaceUsesWith(value);
|
info.value_request->ReplaceUsesWith(value);
|
||||||
}
|
}
|
||||||
|
|
@ -114,14 +112,14 @@ static void FlagsPass(IR::Block& block) {
|
||||||
info.set_not_required = true;
|
info.set_not_required = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto do_set_valueless = [&](ValuelessFlagInfo& info, Iterator inst) {
|
auto do_set_valueless = [&](ValuelessFlagInfo& info, IR::Block::reverse_iterator const inst) {
|
||||||
if (info.set_not_required) {
|
if (info.set_not_required) {
|
||||||
inst->Invalidate();
|
inst->Invalidate();
|
||||||
}
|
}
|
||||||
info.set_not_required = true;
|
info.set_not_required = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto do_get = [](FlagInfo& info, Iterator inst) {
|
auto do_get = [](FlagInfo& info, IR::Block::reverse_iterator const inst) {
|
||||||
if (info.has_value_request) {
|
if (info.has_value_request) {
|
||||||
info.value_request->ReplaceUsesWith(IR::Value{&*inst});
|
info.value_request->ReplaceUsesWith(IR::Value{&*inst});
|
||||||
}
|
}
|
||||||
|
|
@ -448,7 +446,8 @@ static void A64CallbackConfigPass(IR::Block& block, const A64::UserConfig& conf)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& inst : block.instructions) {
|
for (auto it = block.instructions.begin(); it != block.instructions.end(); it++) {
|
||||||
|
auto& inst = *it;
|
||||||
if (inst.GetOpcode() != IR::Opcode::A64DataCacheOperationRaised) {
|
if (inst.GetOpcode() != IR::Opcode::A64DataCacheOperationRaised) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -457,7 +456,7 @@ static void A64CallbackConfigPass(IR::Block& block, const A64::UserConfig& conf)
|
||||||
if (op == A64::DataCacheOperation::ZeroByVA) {
|
if (op == A64::DataCacheOperation::ZeroByVA) {
|
||||||
A64::IREmitter ir{block};
|
A64::IREmitter ir{block};
|
||||||
ir.current_location = A64::LocationDescriptor{IR::LocationDescriptor{inst.GetArg(0).GetU64()}};
|
ir.current_location = A64::LocationDescriptor{IR::LocationDescriptor{inst.GetArg(0).GetU64()}};
|
||||||
ir.SetInsertionPointBefore(&inst);
|
ir.SetInsertionPointBefore(it);
|
||||||
|
|
||||||
size_t bytes = 4 << static_cast<size_t>(conf.dczid_el0 & 0b1111);
|
size_t bytes = 4 << static_cast<size_t>(conf.dczid_el0 & 0b1111);
|
||||||
IR::U64 addr{inst.GetArg(2)};
|
IR::U64 addr{inst.GetArg(2)};
|
||||||
|
|
@ -1397,8 +1396,9 @@ static void PolyfillPass(IR::Block& block, const PolyfillOptions& polyfill) {
|
||||||
|
|
||||||
IR::IREmitter ir{block};
|
IR::IREmitter ir{block};
|
||||||
|
|
||||||
for (auto& inst : block.instructions) {
|
for (auto it = block.instructions.begin(); it != block.instructions.end(); it++) {
|
||||||
ir.SetInsertionPointBefore(&inst);
|
auto& inst = *it;
|
||||||
|
ir.SetInsertionPointBefore(it);
|
||||||
|
|
||||||
switch (inst.GetOpcode()) {
|
switch (inst.GetOpcode()) {
|
||||||
case IR::Opcode::SHA256MessageSchedule0:
|
case IR::Opcode::SHA256MessageSchedule0:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue