[MPlayer-dev-eng] [PATCH] Fix CPU feature detection for fma3, avx512 and avx512icl

Zuxy Meng zuxy.meng at gmail.com
Sat Nov 11 03:01:29 EET 2023


On Fri, Nov 10, 2023 at 5:18 AM Reimar Döffinger
<Reimar.Doeffinger at gmx.de> wrote:
>
>
>
> > On 10 Nov 2023, at 08:40, Zuxy Meng <zuxy.meng at gmail.com> wrote:
> >
> > On Thu, Nov 9, 2023 at 10:24 PM Zuxy Meng <zuxy.meng at gmail.com> wrote:
> >
> >> Greetings! I have recently got my hands on a Zen 4 machine and found
> >> that configure's feature detection is broken for several features.
> >>
> >> The fma3 and assembly fix is probably less controversial, but would
> >> like to hear what you guys think about avx512 and avx512icl.
> >>
> >> I tried to make it equivalent to ffmpeg's internal logic (
> >>
> >> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20220223085735.70854-1-jianhua.wu@intel.com/#70640
> >> )
> >> but it has since become very wordy. Can we simplify it to check only
> >> one cpuinfo word for each feature based on
> >> https://en.wikipedia.org/wiki/AVX-512#CPUs_with_AVX-512? For example,
> >> check avx512dq for baseline and avx512_vnni for avx512icl. ffmpeg will
> >> do its own run time check anyway.
>
> Is there a point in checking for that? MPlayer has no AVX code, and not
> sure there's much point adding any, and FFmpeg always does runtime detection,
> so we only need to check assembler support and can ignore the cpuid stuff.

Make sense. Let's simplify it. cpuid check can still be helpful if one
doesn't even want to compile any AVX512 code

>
> > Unfortunately it breaks build because yasm doesn’t support these fancy new
> > instructions. Let me craft another patch to migrate us to nasm first.
>
> We already support nasm, but sure, can flip the default to it.

Thanks! I didn't know that. I'm happy about passing '--yasm=nasm' for now.
-- 
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure.diff
Type: application/octet-stream
Size: 1457 bytes
Desc: not available
URL: <https://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20231110/b3420707/attachment.obj>


More information about the MPlayer-dev-eng mailing list