From 1edd0125b2aace90378c67232a72e3688756c60f Mon Sep 17 00:00:00 2001 From: MerryMage Date: Wed, 25 Jul 2018 11:28:36 +0100 Subject: [PATCH] mp: rename mp.h to mp/function_info.h --- src/CMakeLists.txt | 2 +- src/backend_x64/devirtualize.h | 8 ++++---- src/backend_x64/emit_x64_vector.cpp | 3 ++- src/backend_x64/emit_x64_vector_floating_point.cpp | 3 ++- src/common/{mp.h => mp/function_info.h} | 4 ++-- src/frontend/decoder/decoder_detail.h | 4 ++-- 6 files changed, 13 insertions(+), 11 deletions(-) rename src/common/{mp.h => mp/function_info.h} (97%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e1b11f02..512e283f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -49,13 +49,13 @@ add_library(dynarmic common/math_util.h common/memory_pool.cpp common/memory_pool.h - common/mp.h common/mp/append.h common/mp/bind.h common/mp/cartesian_product.h common/mp/concat.h common/mp/fapply.h common/mp/fmap.h + common/mp/function_info.h common/mp/list.h common/mp/lut.h common/mp/to_tuple.h diff --git a/src/backend_x64/devirtualize.h b/src/backend_x64/devirtualize.h index 1fea1dc4..908f2651 100644 --- a/src/backend_x64/devirtualize.h +++ b/src/backend_x64/devirtualize.h @@ -13,7 +13,7 @@ #include "common/assert.h" #include "common/cast_util.h" #include "common/common_types.h" -#include "common/mp.h" +#include "common/mp/function_info.h" namespace Dynarmic { namespace BackendX64 { @@ -33,18 +33,18 @@ struct ThunkBuilder { } // namespace impl template -ArgCallback DevirtualizeGeneric(mp::class_type_t* this_) { +ArgCallback DevirtualizeGeneric(Common::mp::class_type_t* this_) { return ArgCallback{&impl::ThunkBuilder::Thunk, reinterpret_cast(this_)}; } template -ArgCallback DevirtualizeWindows(mp::class_type_t* this_) { +ArgCallback DevirtualizeWindows(Common::mp::class_type_t* this_) { static_assert(sizeof(mfp) == 8); return ArgCallback{Common::BitCast(mfp), reinterpret_cast(this_)}; } template -ArgCallback DevirtualizeItanium(mp::class_type_t* this_) { +ArgCallback DevirtualizeItanium(Common::mp::class_type_t* this_) { struct MemberFunctionPointer { /// For a non-virtual function, this is a simple function pointer. /// For a virtual function, it is (1 + virtual table offset in bytes). diff --git a/src/backend_x64/emit_x64_vector.cpp b/src/backend_x64/emit_x64_vector.cpp index ffb5a51d..206e3b74 100644 --- a/src/backend_x64/emit_x64_vector.cpp +++ b/src/backend_x64/emit_x64_vector.cpp @@ -14,7 +14,7 @@ #include "common/assert.h" #include "common/bit_util.h" #include "common/common_types.h" -#include "common/mp.h" +#include "common/mp/function_info.h" #include "frontend/ir/basic_block.h" #include "frontend/ir/microinstruction.h" #include "frontend/ir/opcodes.h" @@ -22,6 +22,7 @@ namespace Dynarmic::BackendX64 { using namespace Xbyak::util; +namespace mp = Common::mp; template static void EmitVectorOperation(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst, Function fn) { diff --git a/src/backend_x64/emit_x64_vector_floating_point.cpp b/src/backend_x64/emit_x64_vector_floating_point.cpp index 01687b16..c963bf83 100644 --- a/src/backend_x64/emit_x64_vector_floating_point.cpp +++ b/src/backend_x64/emit_x64_vector_floating_point.cpp @@ -13,13 +13,14 @@ #include "common/fp/fpcr.h" #include "common/fp/op.h" #include "common/fp/util.h" -#include "common/mp.h" +#include "common/mp/function_info.h" #include "frontend/ir/basic_block.h" #include "frontend/ir/microinstruction.h" namespace Dynarmic::BackendX64 { using namespace Xbyak::util; +namespace mp = Common::mp; template struct NaNWrapper; diff --git a/src/common/mp.h b/src/common/mp/function_info.h similarity index 97% rename from src/common/mp.h rename to src/common/mp/function_info.h index ec934b82..99aebadc 100644 --- a/src/common/mp.h +++ b/src/common/mp/function_info.h @@ -9,7 +9,7 @@ #include #include -namespace Dynarmic::mp { +namespace Dynarmic::Common::mp { /// Used to provide information about an arbitrary function. template @@ -91,4 +91,4 @@ using class_type_t = typename FunctionInfo::class_type; template using equivalent_function_type_t = typename FunctionInfo::equivalent_function_type; -} // namespace Dynarmic::mp +} // namespace Dynarmic::Common::mp diff --git a/src/frontend/decoder/decoder_detail.h b/src/frontend/decoder/decoder_detail.h index 99e3b0c4..7a59820a 100644 --- a/src/frontend/decoder/decoder_detail.h +++ b/src/frontend/decoder/decoder_detail.h @@ -12,7 +12,7 @@ #include "common/assert.h" #include "common/bit_util.h" -#include "common/mp.h" +#include "common/mp/function_info.h" namespace Dynarmic::Decoder { namespace detail { @@ -150,7 +150,7 @@ public: */ template static auto GetMatcher(FnT fn, const char* const name, const char* const bitstring) { - constexpr size_t args_count = mp::FunctionInfo::args_count; + constexpr size_t args_count = Common::mp::FunctionInfo::args_count; using Iota = std::make_index_sequence; const auto [mask, expect] = GetMaskAndExpect(bitstring);