Ignore:
Timestamp:
Jul 28, 2017 2:51:44 AM (7 years ago)
Author:
nanang
Message:

Re #2004: Update libyuv version from libyuv git master repo dated 27 July 2017, the compile errors on old gcc versions issue persists though.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/third_party/yuv/include/libyuv/cpu_id.h

    r5358 r5633  
    99 */ 
    1010 
    11 #ifndef INCLUDE_LIBYUV_CPU_ID_H_  // NOLINT 
     11#ifndef INCLUDE_LIBYUV_CPU_ID_H_ 
    1212#define INCLUDE_LIBYUV_CPU_ID_H_ 
    1313 
     
    3232static const int kCpuHasSSSE3 = 0x40; 
    3333static const int kCpuHasSSE41 = 0x80; 
    34 static const int kCpuHasSSE42 = 0x100; 
     34static const int kCpuHasSSE42 = 0x100;  // unused at this time. 
    3535static const int kCpuHasAVX = 0x200; 
    3636static const int kCpuHasAVX2 = 0x400; 
     
    3838static const int kCpuHasFMA3 = 0x1000; 
    3939static const int kCpuHasAVX3 = 0x2000; 
    40 // 0x2000, 0x4000, 0x8000 reserved for future X86 flags. 
     40static const int kCpuHasF16C = 0x4000; 
     41 
     42// 0x8000 reserved for future X86 flags. 
    4143 
    4244// These flags are only valid on MIPS processors. 
    4345static const int kCpuHasMIPS = 0x10000; 
    4446static const int kCpuHasDSPR2 = 0x20000; 
     47static const int kCpuHasMSA = 0x40000; 
    4548 
    46 // Internal function used to auto-init. 
     49// Optional init function. TestCpuFlag does an auto-init. 
     50// Returns cpu_info flags. 
    4751LIBYUV_API 
    4852int InitCpuFlags(void); 
     53 
     54// Detect CPU has SSE2 etc. 
     55// Test_flag parameter should be one of kCpuHas constants above. 
     56// Returns non-zero if instruction set is detected 
     57static __inline int TestCpuFlag(int test_flag) { 
     58  LIBYUV_API extern int cpu_info_; 
     59#ifdef __ATOMIC_RELAXED 
     60  int cpu_info = __atomic_load_n(&cpu_info_, __ATOMIC_RELAXED); 
     61#else 
     62  int cpu_info = cpu_info_; 
     63#endif 
     64  return (!cpu_info ? InitCpuFlags() : cpu_info) & test_flag; 
     65} 
    4966 
    5067// Internal function for parsing /proc/cpuinfo. 
     
    5269int ArmCpuCaps(const char* cpuinfo_name); 
    5370 
    54 // Detect CPU has SSE2 etc. 
    55 // Test_flag parameter should be one of kCpuHas constants above. 
    56 // returns non-zero if instruction set is detected 
    57 static __inline int TestCpuFlag(int test_flag) { 
    58   LIBYUV_API extern int cpu_info_; 
    59   return (!cpu_info_ ? InitCpuFlags() : cpu_info_) & test_flag; 
    60 } 
    61  
    6271// For testing, allow CPU flags to be disabled. 
    6372// ie MaskCpuFlags(~kCpuHasSSSE3) to disable SSSE3. 
    6473// MaskCpuFlags(-1) to enable all cpu specific optimizations. 
    6574// MaskCpuFlags(1) to disable all cpu specific optimizations. 
     75// MaskCpuFlags(0) to reset state so next call will auto init. 
     76// Returns cpu_info flags. 
    6677LIBYUV_API 
    67 void MaskCpuFlags(int enable_flags); 
     78int MaskCpuFlags(int enable_flags); 
    6879 
    6980// Low level cpuid for X86. Returns zeros on other CPUs. 
     
    7182// ecx is typically the cpu number, and should normally be zero. 
    7283LIBYUV_API 
    73 void CpuId(uint32 eax, uint32 ecx, uint32* cpu_info); 
     84void CpuId(int eax, int ecx, int* cpu_info); 
    7485 
    7586#ifdef __cplusplus 
     
    7889#endif 
    7990 
    80 #endif  // INCLUDE_LIBYUV_CPU_ID_H_  NOLINT 
     91#endif  // INCLUDE_LIBYUV_CPU_ID_H_ 
Note: See TracChangeset for help on using the changeset viewer.