[FFmpeg-devel] [PATCH v2 2/2] libavutil/x86/cpu.c: add IceLake-AVX512 runtime check

Wu Jianhua jianhua.wu at intel.com
Wed Aug 18 09:41:31 EEST 2021


Signed-off-by: Wu Jianhua <jianhua.wu at intel.com>
---
 libavutil/x86/cpu.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c
index bcd41a50a2..9e6015cf31 100644
--- a/libavutil/x86/cpu.c
+++ b/libavutil/x86/cpu.c
@@ -148,11 +148,10 @@ int ff_get_cpu_flags_x86(void)
 #if HAVE_AVX2
         if ((rval & AV_CPU_FLAG_AVX) && (ebx & 0x00000020))
             rval |= AV_CPU_FLAG_AVX2;
-#if HAVE_AVX512 /* F, CD, BW, DQ, VL */
+#if HAVE_AVX512 /* F/CD/BW/DQ/VL/VNNI/IFMA/VBMI/VBMI2/VPOPCNTDQ/BITALG/GFNI/VAES/VPCLMULQDQ */
         if ((xcr0_lo & 0xe0) == 0xe0) { /* OPMASK/ZMM state */
-            if ((rval & AV_CPU_FLAG_AVX2) && (ebx & 0xd0030000) == 0xd0030000)
+            if ((rval & AV_CPU_FLAG_AVX2) && (ebx & 0xd0230000) == 0xd0230000 && (ecx & 0x5f42) == 0x5f42)
                 rval |= AV_CPU_FLAG_AVX512;
-
         }
 #endif /* HAVE_AVX512 */
 #endif /* HAVE_AVX2 */
-- 
2.25.1



More information about the ffmpeg-devel mailing list