util/u_cpu_detect: Detect clflushopt support
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22379>
This commit is contained in:
@@ -878,9 +878,11 @@ _util_cpu_detect_once(void)
|
||||
if (cacheline > 0)
|
||||
util_cpu_caps.cacheline = cacheline;
|
||||
}
|
||||
if (util_cpu_caps.has_avx && regs[0] >= 0x00000007) {
|
||||
if (regs[0] >= 0x00000007) {
|
||||
uint32_t regs7[4];
|
||||
cpuid_count(0x00000007, 0x00000000, regs7);
|
||||
util_cpu_caps.has_clflushopt = (regs7[1] >> 23) & 1;
|
||||
if (util_cpu_caps.has_avx) {
|
||||
util_cpu_caps.has_avx2 = (regs7[1] >> 5) & 1;
|
||||
|
||||
// check for avx512
|
||||
@@ -896,6 +898,7 @@ _util_cpu_detect_once(void)
|
||||
util_cpu_caps.has_avx512vbmi = (regs7[2] >> 1) & 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (regs[1] == 0x756e6547 && regs[2] == 0x6c65746e && regs[3] == 0x49656e69) {
|
||||
/* GenuineIntel */
|
||||
@@ -986,6 +989,7 @@ _util_cpu_detect_once(void)
|
||||
printf("util_cpu_caps.has_avx512bw = %u\n", util_cpu_caps.has_avx512bw);
|
||||
printf("util_cpu_caps.has_avx512vl = %u\n", util_cpu_caps.has_avx512vl);
|
||||
printf("util_cpu_caps.has_avx512vbmi = %u\n", util_cpu_caps.has_avx512vbmi);
|
||||
printf("util_cpu_caps.has_clflushopt = %u\n", util_cpu_caps.has_clflushopt);
|
||||
printf("util_cpu_caps.num_L3_caches = %u\n", util_cpu_caps.num_L3_caches);
|
||||
printf("util_cpu_caps.num_cpu_mask_bits = %u\n", util_cpu_caps.num_cpu_mask_bits);
|
||||
}
|
||||
|
@@ -120,7 +120,7 @@ struct util_cpu_caps_t {
|
||||
unsigned has_avx512vl:1;
|
||||
unsigned has_avx512vbmi:1;
|
||||
|
||||
unsigned unused:1;
|
||||
unsigned has_clflushopt:1;
|
||||
|
||||
unsigned num_L3_caches;
|
||||
unsigned num_cpu_mask_bits;
|
||||
|
Reference in New Issue
Block a user