diff --git a/Utilities/sysinfo.cpp b/Utilities/sysinfo.cpp index 204cc405bc..421d7655c4 100644 --- a/Utilities/sysinfo.cpp +++ b/Utilities/sysinfo.cpp @@ -19,6 +19,12 @@ bool utils::has_avx() return g_value; } +bool utils::has_avx2() +{ + static const bool g_value = get_cpuid(0, 0)[0] >= 0x7 && get_cpuid(7, 0)[1] & 0x20; + return g_value; +} + bool utils::has_rtm() { // Check RTM and MPX extensions in order to filter out TSX on Haswell CPUs @@ -26,6 +32,13 @@ bool utils::has_rtm() return g_value; } +bool utils::has_512() +{ + // Check AVX512F, AVX512CD, AVX512DQ, AVX512BW, AVX512VL extensions (Skylake-X level support) + static const bool g_value = get_cpuid(0, 0)[0] >= 0x7 && (get_cpuid(7, 0)[1] & 0xd0030000) == 0xd0030000; + return g_value; +} + std::string utils::get_system_info() { std::string result; @@ -68,7 +81,17 @@ std::string utils::get_system_info() if (has_avx()) { - result += " | AVX+"; + result += " | AVX"; + + if (has_avx2()) + { + result += '+'; + } + + if (has_512()) + { + result += '+'; + } } if (has_rtm()) diff --git a/Utilities/sysinfo.h b/Utilities/sysinfo.h index 963c20df54..1ef041078c 100644 --- a/Utilities/sysinfo.h +++ b/Utilities/sysinfo.h @@ -8,11 +8,11 @@ namespace utils inline std::array get_cpuid(u32 func, u32 subfunc) { int regs[4]; -#ifdef _MSC_VER +#ifdef _MSC_VER __cpuidex(regs, func, subfunc); -#else +#else __asm__ volatile("cpuid" : "=a" (regs[0]), "=b" (regs[1]), "=c" (regs[2]), "=d" (regs[3]) : "a" (func), "c" (subfunc)); -#endif +#endif return {0u+regs[0], 0u+regs[1], 0u+regs[2], 0u+regs[3]}; } @@ -20,8 +20,12 @@ namespace utils bool has_avx(); + bool has_avx2(); + bool has_rtm(); + bool has_512(); + inline bool transaction_enter() { while (true) diff --git a/asmjit b/asmjit index 1370fe6a26..673dcefaa0 160000 --- a/asmjit +++ b/asmjit @@ -1 +1 @@ -Subproject commit 1370fe6a26a82f18500faedac66798953961a916 +Subproject commit 673dcefaa048c5f5a2bf8b85daf8f7b9978d018a diff --git a/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp index 6a1228466c..e6f96728dc 100644 --- a/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp @@ -113,6 +113,13 @@ void spu_recompiler::compile(spu_function_t& f) vec.at(i) = vec_vars.data() + i; } + compiler.alloc(vec_vars[0], asmjit::x86::xmm0); + compiler.alloc(vec_vars[1], asmjit::x86::xmm1); + compiler.alloc(vec_vars[2], asmjit::x86::xmm2); + compiler.alloc(vec_vars[3], asmjit::x86::xmm3); + compiler.alloc(vec_vars[4], asmjit::x86::xmm4); + compiler.alloc(vec_vars[5], asmjit::x86::xmm5); + // Initialize labels std::vector