diff --git a/README.chromium b/README.chromium index 6d13097db..4c281834f 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: https://chromium.googlesource.com/libyuv/libyuv/ -Version: 1887 +Version: 1888 License: BSD License File: LICENSE Shipped: yes diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 30e6d1255..d3099004a 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 1887 +#define LIBYUV_VERSION 1888 #endif // INCLUDE_LIBYUV_VERSION_H_ diff --git a/source/cpu_id.cc b/source/cpu_id.cc index ad4246f55..bc61b092d 100644 --- a/source/cpu_id.cc +++ b/source/cpu_id.cc @@ -19,6 +19,12 @@ #include // For _xgetbv() #endif +// For AMX OS support detect +#if (defined(__i386__) || defined(__x86_64__)) && defined(__linux__) +#include +#include +#endif + // For ArmCpuCaps() but unittested on all platforms #include // For fopen() #include @@ -132,6 +138,18 @@ static int GetXCR0() { #pragma optimize("g", on) #endif +#if (defined(__i386__) || defined(__x86_64__)) && defined(__linux__) +#define ARCH_REQ_XCOMP_PERM 0x1023 +#define XFEATURE_XTILEDATA 18 +/* SetTileDataUse() - Invoke syscall to set ARCH_SET_STATE_USE */ +static bool SetTileDataUse(void) { + if (syscall(SYS_arch_prctl, ARCH_REQ_XCOMP_PERM, XFEATURE_XTILEDATA)) { + return false; + } + return true; +} +#endif + // Based on libvpx arm_cpudetect.c // For Arm, but public to allow testing on any CPU LIBYUV_API SAFEBUFFERS int ArmCpuCaps(const char* cpuinfo_name) { @@ -323,8 +341,12 @@ static SAFEBUFFERS int GetCpuFlags(void) { cpu_info |= (cpu_info7[2] & 0x00000800) ? kCpuHasAVX512VNNI : 0; cpu_info |= (cpu_info7[2] & 0x00001000) ? kCpuHasAVX512VBITALG : 0; cpu_info |= (cpu_einfo7[3] & 0x00080000) ? kCpuHasAVX10 : 0; + } +#if defined(__linux__) + if (SetTileDataUse()) { cpu_info |= (cpu_info7[3] & 0x02000000) ? kCpuHasAMXINT8 : 0; } +#endif } #endif #if defined(__mips__) && defined(__linux__)