Changeset 5699 for pjproject/trunk/third_party/yuv/source/cpu_id.cc
- Timestamp:
- Nov 21, 2017 9:25:11 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/third_party/yuv/source/cpu_id.cc
r5633 r5699 125 125 int xcr0 = 0; 126 126 #if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 160040219) 127 xcr0 = _xgetbv(0); // VS2010 SP1 required.127 xcr0 = (int)_xgetbv(0); // VS2010 SP1 required. NOLINT 128 128 #elif defined(__i386__) || defined(__x86_64__) 129 129 asm(".byte 0x0f, 0x01, 0xd0" : "=a"(xcr0) : "c"(0) : "%edx"); … … 243 243 // Detect AVX512bw 244 244 if ((GetXCR0() & 0xe0) == 0xe0) { 245 cpu_info |= (cpu_info7[1] & 0x40000000) ? kCpuHasAVX3 : 0; 246 } 247 } 248 245 cpu_info |= (cpu_info7[1] & 0x40000000) ? kCpuHasAVX512BW : 0; 246 cpu_info |= (cpu_info7[1] & 0x80000000) ? kCpuHasAVX512VL : 0; 247 cpu_info |= (cpu_info7[2] & 0x00000002) ? kCpuHasAVX512VBMI : 0; 248 cpu_info |= (cpu_info7[2] & 0x00000040) ? kCpuHasAVX512VBMI2 : 0; 249 cpu_info |= (cpu_info7[2] & 0x00001000) ? kCpuHasAVX512VBITALG : 0; 250 cpu_info |= (cpu_info7[2] & 0x00004000) ? kCpuHasAVX512VPOPCNTDQ : 0; 251 cpu_info |= (cpu_info7[2] & 0x00000100) ? kCpuHasGFNI : 0; 252 } 253 } 254 255 // TODO(fbarchard): Consider moving these to gtest 249 256 // Environment variable overrides for testing. 250 257 if (TestEnv("LIBYUV_DISABLE_X86")) { … … 275 282 cpu_info &= ~kCpuHasFMA3; 276 283 } 277 if (TestEnv("LIBYUV_DISABLE_AVX3")) {278 cpu_info &= ~kCpuHasAVX3;279 }280 284 if (TestEnv("LIBYUV_DISABLE_F16C")) { 281 285 cpu_info &= ~kCpuHasF16C; 286 } 287 if (TestEnv("LIBYUV_DISABLE_AVX512BW")) { 288 cpu_info &= ~kCpuHasAVX512BW; 282 289 } 283 290
Note: See TracChangeset
for help on using the changeset viewer.