summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2022-03-10 06:09:36 +0100
committerGitHub <noreply@github.com>2022-03-10 06:09:36 +0100
commit52f8f004344831dcfaf8ee72e737046165ea692b (patch)
tree34f21eea962c4ac36722c81558b08b65184dfebd
parentMerge pull request #7936 from Wunkolo/cpu_detect (diff)
parentcpu_detect: Revert `__cpuid{ex}` array-type argument (diff)
downloadyuzu-52f8f004344831dcfaf8ee72e737046165ea692b.tar
yuzu-52f8f004344831dcfaf8ee72e737046165ea692b.tar.gz
yuzu-52f8f004344831dcfaf8ee72e737046165ea692b.tar.bz2
yuzu-52f8f004344831dcfaf8ee72e737046165ea692b.tar.lz
yuzu-52f8f004344831dcfaf8ee72e737046165ea692b.tar.xz
yuzu-52f8f004344831dcfaf8ee72e737046165ea692b.tar.zst
yuzu-52f8f004344831dcfaf8ee72e737046165ea692b.zip
-rw-r--r--src/common/x64/cpu_detect.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/x64/cpu_detect.cpp b/src/common/x64/cpu_detect.cpp
index a95dc15a3..99d87f586 100644
--- a/src/common/x64/cpu_detect.cpp
+++ b/src/common/x64/cpu_detect.cpp
@@ -21,7 +21,7 @@
// clang-format on
#endif
-static inline void __cpuidex(const std::span<u32, 4> info, u32 function_id, u32 subfunction_id) {
+static inline void __cpuidex(int info[4], u32 function_id, u32 subfunction_id) {
#if defined(__DragonFly__) || defined(__FreeBSD__)
// Despite the name, this is just do_cpuid() with ECX as second input.
cpuid_count((u_int)function_id, (u_int)subfunction_id, (u_int*)info);
@@ -34,7 +34,7 @@ static inline void __cpuidex(const std::span<u32, 4> info, u32 function_id, u32
#endif
}
-static inline void __cpuid(const std::span<u32, 4> info, u32 function_id) {
+static inline void __cpuid(int info[4], u32 function_id) {
return __cpuidex(info, function_id, 0);
}
@@ -67,7 +67,7 @@ static CPUCaps Detect() {
// Assumes the CPU supports the CPUID instruction. Those that don't would likely not support
// yuzu at all anyway
- std::array<u32, 4> cpu_id;
+ int cpu_id[4];
// Detect CPU's CPUID capabilities and grab manufacturer string
__cpuid(cpu_id, 0x00000000);
@@ -128,11 +128,11 @@ static CPUCaps Detect() {
if (max_ex_fn >= 0x80000004) {
// Extract CPU model string
__cpuid(cpu_id, 0x80000002);
- std::memcpy(caps.cpu_string, cpu_id.data(), sizeof(cpu_id));
+ std::memcpy(caps.cpu_string, cpu_id, sizeof(cpu_id));
__cpuid(cpu_id, 0x80000003);
- std::memcpy(caps.cpu_string + 16, cpu_id.data(), sizeof(cpu_id));
+ std::memcpy(caps.cpu_string + 16, cpu_id, sizeof(cpu_id));
__cpuid(cpu_id, 0x80000004);
- std::memcpy(caps.cpu_string + 32, cpu_id.data(), sizeof(cpu_id));
+ std::memcpy(caps.cpu_string + 32, cpu_id, sizeof(cpu_id));
}
if (max_ex_fn >= 0x80000001) {