interface: Move Vector typedef to config.h

This commit is contained in:
MerryMage 2018-01-24 15:52:49 +00:00
parent 33bba6028c
commit 1749780929
5 changed files with 11 additions and 10 deletions

View file

@ -74,9 +74,6 @@ public:
/// Modify all general-purpose registers. /// Modify all general-purpose registers.
void SetRegisters(const std::array<std::uint64_t, 31>& value); void SetRegisters(const std::array<std::uint64_t, 31>& value);
using Vector = std::array<std::uint64_t, 2>;
static_assert(sizeof(Vector) == sizeof(std::uint64_t) * 2, "Vector must be 128 bits in size");
/// Read floating point and SIMD register. /// Read floating point and SIMD register.
Vector GetVector(std::size_t index) const; Vector GetVector(std::size_t index) const;
/// Modify floating point and SIMD register. /// Modify floating point and SIMD register.

View file

@ -16,6 +16,9 @@ namespace A64 {
using VAddr = std::uint64_t; using VAddr = std::uint64_t;
using Vector = std::array<std::uint64_t, 2>;
static_assert(sizeof(Vector) == sizeof(std::uint64_t) * 2, "Vector must be 128 bits in size");
enum class Exception { enum class Exception {
/// An UndefinedFault occured due to executing instruction with an unallocated encoding /// An UndefinedFault occured due to executing instruction with an unallocated encoding
UnallocatedEncoding, UnallocatedEncoding,

View file

@ -122,14 +122,14 @@ public:
jit_state.vec.at(index * 2 + 1) = value[1]; jit_state.vec.at(index * 2 + 1) = value[1];
} }
std::array<Jit::Vector, 32> GetVectors() const { std::array<Vector, 32> GetVectors() const {
std::array<Jit::Vector, 32> ret; std::array<Vector, 32> ret;
static_assert(sizeof(ret) == sizeof(jit_state.vec)); static_assert(sizeof(ret) == sizeof(jit_state.vec));
std::memcpy(ret.data(), jit_state.vec.data(), sizeof(jit_state.vec)); std::memcpy(ret.data(), jit_state.vec.data(), sizeof(jit_state.vec));
return ret; return ret;
} }
void SetVectors(const std::array<Jit::Vector, 32>& value) { void SetVectors(const std::array<Vector, 32>& value) {
static_assert(sizeof(value) == sizeof(jit_state.vec)); static_assert(sizeof(value) == sizeof(jit_state.vec));
std::memcpy(jit_state.vec.data(), value.data(), 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<u64, 31>& value) {
impl->SetRegisters(value); impl->SetRegisters(value);
} }
Jit::Vector Jit::GetVector(size_t index) const { Vector Jit::GetVector(size_t index) const {
return impl->GetVector(index); return impl->GetVector(index);
} }
@ -283,11 +283,11 @@ void Jit::SetVector(size_t index, Vector value) {
impl->SetVector(index, value); impl->SetVector(index, value);
} }
std::array<Jit::Vector, 32> Jit::GetVectors() const { std::array<Vector, 32> Jit::GetVectors() const {
return impl->GetVectors(); return impl->GetVectors();
} }
void Jit::SetVectors(const std::array<Jit::Vector, 32>& value) { void Jit::SetVectors(const std::array<Vector, 32>& value) {
impl->SetVectors(value); impl->SetVectors(value);
} }

View file

@ -17,7 +17,6 @@
#include "unicorn_emu/unicorn.h" #include "unicorn_emu/unicorn.h"
using namespace Dynarmic; using namespace Dynarmic;
using Vector = Dynarmic::A64::Jit::Vector;
static Vector RandomVector() { static Vector RandomVector() {
return {RandInt<u64>(0, ~u64(0)), RandInt<u64>(0, ~u64(0))}; return {RandInt<u64>(0, ~u64(0)), RandInt<u64>(0, ~u64(0))};

View file

@ -15,6 +15,8 @@
#include "common/assert.h" #include "common/assert.h"
#include "common/common_types.h" #include "common/common_types.h"
using Vector = Dynarmic::A64::Vector;
class TestEnv final : public Dynarmic::A64::UserCallbacks { class TestEnv final : public Dynarmic::A64::UserCallbacks {
public: public:
u64 ticks_left = 0; u64 ticks_left = 0;