util: (trivial) add has_popcnt field
authorRoland Scheidegger <sroland@vmware.com>
Wed, 19 Jun 2013 21:46:15 +0000 (23:46 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Wed, 19 Jun 2013 21:47:36 +0000 (23:47 +0200)
Not used yet but there's a couple of places in llvmpipe which should use this
(occlusion count is currently very inefficent if there's no cpu popcnt
instruction).

src/gallium/auxiliary/util/u_cpu_detect.c
src/gallium/auxiliary/util/u_cpu_detect.h

index 763b5cc220f87f6ec9b8832fc431cc11372810c0..b118fc8ae360dbb446e80b3fcd0596386baedd2e 100644 (file)
@@ -283,6 +283,7 @@ util_cpu_detect(void)
          util_cpu_caps.has_ssse3  = (regs2[2] >>  9) & 1; /* 0x0000020 */
          util_cpu_caps.has_sse4_1 = (regs2[2] >> 19) & 1;
          util_cpu_caps.has_sse4_2 = (regs2[2] >> 20) & 1;
+         util_cpu_caps.has_popcnt = (regs2[2] >> 23) & 1;
          util_cpu_caps.has_avx    = (regs2[2] >> 28) & 1;
          util_cpu_caps.has_f16c   = (regs2[2] >> 29) & 1;
          util_cpu_caps.has_mmx2   = util_cpu_caps.has_sse; /* SSE cpus supports mmxext too */
index 21c2f048ff443bde91036f0ed5245f85a4abfb20..f9cd6475e456622e99c96eeea65c251644466336 100644 (file)
@@ -62,6 +62,7 @@ struct util_cpu_caps {
    unsigned has_ssse3:1;
    unsigned has_sse4_1:1;
    unsigned has_sse4_2:1;
+   unsigned has_popcnt:1;
    unsigned has_avx:1;
    unsigned has_f16c:1;
    unsigned has_3dnow:1;