diff mbox series

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

Message ID 20210818064131.1706832-2-jianhua.wu@intel.com
State New
Headers show
Series [FFmpeg-devel,v2,1/2] configure: set IceLake-AVX512 as the minimum baseline
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Wu Jianhua Aug. 18, 2021, 6:41 a.m. UTC
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
---
 libavutil/x86/cpu.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Wu Jianhua Aug. 23, 2021, 7:59 a.m. UTC | #1
Ping.

> -----Original Message-----
> From: Wu, Jianhua <jianhua.wu@intel.com>
> Sent: Wednesday, August 18, 2021 2:42 PM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Wu, Jianhua <jianhua.wu@intel.com>
> Subject: [PATCH v2 2/2] libavutil/x86/cpu.c: add IceLake-AVX512 runtime
> check
> 
> Signed-off-by: Wu Jianhua <jianhua.wu@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/V
> AES/VPCLMULQD
> +Q */
>          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

Any update of review on this patchset?

Jianhua
diff mbox series

Patch

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 */