diff --git a/include/dynarmic/A64/a64.h b/include/dynarmic/A64/a64.h index 52946b1d..73a19706 100644 --- a/include/dynarmic/A64/a64.h +++ b/include/dynarmic/A64/a64.h @@ -74,9 +74,6 @@ public: /// Modify all general-purpose registers. void SetRegisters(const std::array& value); - using Vector = std::array; - static_assert(sizeof(Vector) == sizeof(std::uint64_t) * 2, "Vector must be 128 bits in size"); - /// Read floating point and SIMD register. Vector GetVector(std::size_t index) const; /// Modify floating point and SIMD register. diff --git a/include/dynarmic/A64/config.h b/include/dynarmic/A64/config.h index 5a3bc1c5..a2ab289b 100644 --- a/include/dynarmic/A64/config.h +++ b/include/dynarmic/A64/config.h @@ -16,6 +16,9 @@ namespace A64 { using VAddr = std::uint64_t; +using Vector = std::array; +static_assert(sizeof(Vector) == sizeof(std::uint64_t) * 2, "Vector must be 128 bits in size"); + enum class Exception { /// An UndefinedFault occured due to executing instruction with an unallocated encoding UnallocatedEncoding, diff --git a/src/backend_x64/a64_interface.cpp b/src/backend_x64/a64_interface.cpp index f5fed7c1..b5a88bb3 100644 --- a/src/backend_x64/a64_interface.cpp +++ b/src/backend_x64/a64_interface.cpp @@ -122,14 +122,14 @@ public: jit_state.vec.at(index * 2 + 1) = value[1]; } - std::array GetVectors() const { - std::array ret; + std::array GetVectors() const { + std::array ret; static_assert(sizeof(ret) == sizeof(jit_state.vec)); std::memcpy(ret.data(), jit_state.vec.data(), sizeof(jit_state.vec)); return ret; } - void SetVectors(const std::array& value) { + void SetVectors(const std::array& value) { static_assert(sizeof(value) == sizeof(jit_state.vec)); std::memcpy(jit_state.vec.data(), value.data(), sizeof(jit_state.vec)); } @@ -275,7 +275,7 @@ void Jit::SetRegisters(const std::array& value) { impl->SetRegisters(value); } -Jit::Vector Jit::GetVector(size_t index) const { +Vector Jit::GetVector(size_t index) const { return impl->GetVector(index); } @@ -283,11 +283,11 @@ void Jit::SetVector(size_t index, Vector value) { impl->SetVector(index, value); } -std::array Jit::GetVectors() const { +std::array Jit::GetVectors() const { return impl->GetVectors(); } -void Jit::SetVectors(const std::array& value) { +void Jit::SetVectors(const std::array& value) { impl->SetVectors(value); } diff --git a/tests/A64/fuzz_with_unicorn.cpp b/tests/A64/fuzz_with_unicorn.cpp index 4d6881a1..e4dc5fc7 100644 --- a/tests/A64/fuzz_with_unicorn.cpp +++ b/tests/A64/fuzz_with_unicorn.cpp @@ -17,7 +17,6 @@ #include "unicorn_emu/unicorn.h" using namespace Dynarmic; -using Vector = Dynarmic::A64::Jit::Vector; static Vector RandomVector() { return {RandInt(0, ~u64(0)), RandInt(0, ~u64(0))}; diff --git a/tests/A64/testenv.h b/tests/A64/testenv.h index ba9bb46b..e5f67c82 100644 --- a/tests/A64/testenv.h +++ b/tests/A64/testenv.h @@ -15,6 +15,8 @@ #include "common/assert.h" #include "common/common_types.h" +using Vector = Dynarmic::A64::Vector; + class TestEnv final : public Dynarmic::A64::UserCallbacks { public: u64 ticks_left = 0;