Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

[dynarmic] remove MCL_ARCHITECTURE macros; fix unreachable macro builtin (#2889)

lizziea1930d106350
diff --git a/src/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp b/src/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp
index 85a3cdf7b8..9f508f72e5 100644
--- a/src/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp
+++ b/src/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp
@@ -188,15 +188,15 @@ private:
ExceptionHandler::ExceptionHandler() = default;
ExceptionHandler::~ExceptionHandler() = default;
-#if defined(MCL_ARCHITECTURE_X86_64)
+#if defined(ARCHITECTURE_x86_64)
void ExceptionHandler::Register(X64::BlockOfCode& code) {
impl = std::make_unique<Impl>(std::bit_cast<u64>(code.getCode()), code.GetTotalCodeSize());
}
-#elif defined(MCL_ARCHITECTURE_ARM64)
+#elif defined(ARCHITECTURE_arm64)
void ExceptionHandler::Register(oaknut::CodeBlock& mem, std::size_t size) {
impl = std::make_unique<Impl>(std::bit_cast<u64>(mem.ptr()), size);
}
-#elif defined(MCL_ARCHITECTURE_RISCV)
+#elif defined(ARCHITECTURE_riscv64)
void ExceptionHandler::Register(RV64::CodeBlock& mem, std::size_t size) {
impl = std::make_unique<Impl>(std::bit_cast<u64>(mem.ptr<u64>()), size);
}
diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_floating_point.cpp b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_floating_point.cpp
index d9bb254e9b..67d0e06808 100644
--- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_floating_point.cpp
+++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_floating_point.cpp
@@ -36,22 +36,8 @@
#include "dynarmic/ir/basic_block.h"
#include "dynarmic/ir/microinstruction.h"
-#define FCODE(NAME) \
- [&code](auto... args) { \
- if constexpr (fsize == 32) { \
- code.NAME##s(args...); \
- } else { \
- code.NAME##d(args...); \
- } \
- }
-#define ICODE(NAME) \
- [&code](auto... args) { \
- if constexpr (fsize == 32) { \
- code.NAME##d(args...); \
- } else { \
- code.NAME##q(args...); \
- } \
- }
+#define FCODE(NAME) [&](auto... args) { if (fsize == 32) code.NAME##s(args...); else code.NAME##d(args...); }
+#define ICODE(NAME) [&](auto... args) { if (fsize == 32) code.NAME##d(args...); else code.NAME##q(args...); }
namespace Dynarmic::Backend::X64 {
diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp
index 66a179a481..0c93b517c1 100644
--- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp
+++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp
@@ -36,22 +36,8 @@
#include "dynarmic/ir/basic_block.h"
#include "dynarmic/ir/microinstruction.h"
-#define FCODE(NAME) \
- [&code](auto... args) { \
- if constexpr (fsize == 32) { \
- code.NAME##s(args...); \
- } else { \
- code.NAME##d(args...); \
- } \
- }
-#define ICODE(NAME) \
- [&code](auto... args) { \
- if constexpr (fsize == 32) { \
- code.NAME##d(args...); \
- } else { \
- code.NAME##q(args...); \
- } \
- }
+#define FCODE(NAME) [&](auto... args) { if (fsize == 32) code.NAME##s(args...); else code.NAME##d(args...); }
+#define ICODE(NAME) [&](auto... args) { if (fsize == 32) code.NAME##d(args...); else code.NAME##q(args...); }
namespace Dynarmic::Backend::X64 {
diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_saturation.cpp b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_saturation.cpp
index 580a32dec8..412bb2bfaa 100644
--- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_saturation.cpp
+++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_saturation.cpp
@@ -14,23 +14,8 @@
#include "dynarmic/ir/microinstruction.h"
#include "dynarmic/ir/opcodes.h"
-#define FCODE(NAME) \
- [&code](auto... args) { \
- if constexpr (esize == 32) { \
- code.NAME##s(args...); \
- } else { \
- code.NAME##d(args...); \
- } \
- }
-
-#define ICODE(NAME) \
- [&code](auto... args) { \
- if constexpr (esize == 32) { \
- code.NAME##d(args...); \
- } else { \
- code.NAME##q(args...); \
- } \
- }
+#define FCODE(NAME) [&](auto... args) { if (esize == 32) code.NAME##s(args...); else code.NAME##d(args...); }
+#define ICODE(NAME) [&](auto... args) { if (esize == 32) code.NAME##d(args...); else code.NAME##q(args...); }
namespace Dynarmic::Backend::X64 {