summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorGravatar Morph2020-05-16 07:24:57 -0400
committerGravatar Morph2020-06-20 00:31:37 -0400
commitd6474b4aca7f054d00df350c716709475ef0f49b (patch)
tree350f48b2963f2d82b0575865145a386ee61e6988 /src/common
parentMerge pull request #4099 from MerryMage/macOS-build (diff)
downloadyuzu-d6474b4aca7f054d00df350c716709475ef0f49b.tar.gz
yuzu-d6474b4aca7f054d00df350c716709475ef0f49b.tar.xz
yuzu-d6474b4aca7f054d00df350c716709475ef0f49b.zip
common/cpu_detect: Add AVX512 detection
Diffstat (limited to 'src/common')
-rw-r--r--src/common/x64/cpu_detect.cpp5
-rw-r--r--src/common/x64/cpu_detect.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/common/x64/cpu_detect.cpp b/src/common/x64/cpu_detect.cpp
index c9349a6b4..f35dcb498 100644
--- a/src/common/x64/cpu_detect.cpp
+++ b/src/common/x64/cpu_detect.cpp
@@ -110,6 +110,11 @@ static CPUCaps Detect() {
110 caps.bmi1 = true; 110 caps.bmi1 = true;
111 if ((cpu_id[1] >> 8) & 1) 111 if ((cpu_id[1] >> 8) & 1)
112 caps.bmi2 = true; 112 caps.bmi2 = true;
113 // Checks for AVX512F, AVX512CD, AVX512VL, AVX512DQ, AVX512BW (Intel Skylake-X/SP)
114 if ((cpu_id[1] >> 16) & 1 && (cpu_id[1] >> 28) & 1 && (cpu_id[1] >> 31) & 1 &&
115 (cpu_id[1] >> 17) & 1 && (cpu_id[1] >> 30) & 1) {
116 caps.avx512 = caps.avx2;
117 }
113 } 118 }
114 } 119 }
115 120
diff --git a/src/common/x64/cpu_detect.h b/src/common/x64/cpu_detect.h
index 20f2ba234..7606c3f7b 100644
--- a/src/common/x64/cpu_detect.h
+++ b/src/common/x64/cpu_detect.h
@@ -19,6 +19,7 @@ struct CPUCaps {
19 bool lzcnt; 19 bool lzcnt;
20 bool avx; 20 bool avx;
21 bool avx2; 21 bool avx2;
22 bool avx512;
22 bool bmi1; 23 bool bmi1;
23 bool bmi2; 24 bool bmi2;
24 bool fma; 25 bool fma;