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

Zuxy Meng zuxy.meng at gmail.com
Mon Nov 13 03:22:06 EET 2023


On Sun, Nov 12, 2023 at 1:59 AM Reimar Döffinger
<Reimar.Doeffinger at gmx.de> wrote:
>
> Hi!
>
> > On 11 Nov 2023, at 02:01, Zuxy Meng <zuxy.meng at gmail.com> wrote:
> >
> > On Fri, Nov 10, 2023 at 5:18 AM Reimar Döffinger
> > <Reimar.Doeffinger at gmx.de> wrote:
> [...]
> >>>> 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
>
> I expect the savings would be so little no-one will care.
> But I guess in theory you are right.
> The patch seems ok to me, though I've not carefully reviewed/tested.

Thanks! Applied.

>
> >>> 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.
>
> I think it would make sense to change the default...
> It actually used to be the default along time ago until FFmpeg
> started requiring yasm features. Seems it has flipped again...

Yes it happened several years ago. But yasm went out of maintenance
even before that. Anyway committed a patch to change the default to
nasm.

-- 
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6


More information about the MPlayer-dev-eng mailing list