Ignore:
Timestamp:
Nov 21, 2017 9:25:11 AM (6 years ago)
Author:
riza
Message:

Close #2065: Update libyuv to fix linker error when building libyuv as dll on Visual Studio 2015.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/third_party/yuv/source/cpu_id.cc

    r5633 r5699  
    125125  int xcr0 = 0; 
    126126#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 
    128128#elif defined(__i386__) || defined(__x86_64__) 
    129129  asm(".byte 0x0f, 0x01, 0xd0" : "=a"(xcr0) : "c"(0) : "%edx"); 
     
    243243    // Detect AVX512bw 
    244244    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 
    249256  // Environment variable overrides for testing. 
    250257  if (TestEnv("LIBYUV_DISABLE_X86")) { 
     
    275282    cpu_info &= ~kCpuHasFMA3; 
    276283  } 
    277   if (TestEnv("LIBYUV_DISABLE_AVX3")) { 
    278     cpu_info &= ~kCpuHasAVX3; 
    279   } 
    280284  if (TestEnv("LIBYUV_DISABLE_F16C")) { 
    281285    cpu_info &= ~kCpuHasF16C; 
     286  } 
     287  if (TestEnv("LIBYUV_DISABLE_AVX512BW")) { 
     288    cpu_info &= ~kCpuHasAVX512BW; 
    282289  } 
    283290 
Note: See TracChangeset for help on using the changeset viewer.