diff --git a/build_tools b/build_tools index 7c9845040..e28427bd7 160000 --- a/build_tools +++ b/build_tools @@ -1 +1 @@ -Subproject commit 7c9845040311ae8a1964f6d4f6a4eef3530bb3d7 +Subproject commit e28427bd7d2eb82f630d22914eefebf430f6fff6 diff --git a/src/xenia/cpu/backend/x64/x64_backend.cc b/src/xenia/cpu/backend/x64/x64_backend.cc index 21e992ba1..c5b2a239f 100644 --- a/src/xenia/cpu/backend/x64/x64_backend.cc +++ b/src/xenia/cpu/backend/x64/x64_backend.cc @@ -61,14 +61,18 @@ bool X64Backend::Initialize() { machine_info_.supports_extended_load_store = false; } - machine_info_.register_sets[0] = (MachineInfo::RegisterSet){ - 0, "gpr", MachineInfo::RegisterSet::INT_TYPES, X64Emitter::GPR_COUNT, - }; - machine_info_.register_sets[1] = (MachineInfo::RegisterSet){ - 1, "xmm", MachineInfo::RegisterSet::FLOAT_TYPES | - MachineInfo::RegisterSet::VEC_TYPES, - X64Emitter::XMM_COUNT, - }; + auto& gprs = machine_info_.register_sets[0]; + gprs.id = 0; + std::strcpy(gprs.name, "gpr"); + gprs.types = MachineInfo::RegisterSet::INT_TYPES; + gprs.count = X64Emitter::GPR_COUNT; + + auto& xmms = machine_info_.register_sets[1]; + xmms.id = 1; + std::strcpy(xmms.name, "xmm"); + xmms.types = MachineInfo::RegisterSet::FLOAT_TYPES | + MachineInfo::RegisterSet::VEC_TYPES; + xmms.count = X64Emitter::XMM_COUNT; code_cache_ = X64CodeCache::Create(); Backend::code_cache_ = code_cache_.get(); diff --git a/src/xenia/cpu/thread_state.cc b/src/xenia/cpu/thread_state.cc index 92260de07..3f99b2f9d 100644 --- a/src/xenia/cpu/thread_state.cc +++ b/src/xenia/cpu/thread_state.cc @@ -84,9 +84,15 @@ ThreadState::ThreadState(Processor* processor, uint32_t thread_id, } assert_not_zero(stack_address_); - // Allocate with 64b alignment. - context_ = - reinterpret_cast(aligned_alloc(64, sizeof(PPCContext))); +// Allocate with 64b alignment. +#if __STDC_VERSION__ >= 201112L + void* context_ptr = aligned_alloc(64, sizeof(PPCContext)); +#elif XE_COMPILER_MSVC + void* context_ptr = _aligned_malloc(sizeof(PPCContext), 64); +#else +#error No aligned alloc. +#endif + context_ = reinterpret_cast(context_ptr); assert_true(((uint64_t)context_ & 0x3F) == 0); std::memset(context_, 0, sizeof(PPCContext)); @@ -111,7 +117,13 @@ ThreadState::~ThreadState() { thread_state_ = nullptr; } +#if __STDC_VERSION__ >= 201112L free(context_); +#elif XE_COMPILER_MSVC + _aligned_free(context_); +#else +#error No aligned alloc. +#endif if (stack_allocated_) { memory()->LookupHeap(stack_address_)->Decommit(stack_address_, stack_size_); } diff --git a/third_party/capstone.lua b/third_party/capstone.lua index c8378e3a5..cf7faa86e 100644 --- a/third_party/capstone.lua +++ b/third_party/capstone.lua @@ -50,3 +50,4 @@ project("capstone") "-Wno-deprecated", "-w", }) + filter({})