1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
FFmpeg/libavutil/aarch64
Martin Storsjö e30369bc1c aarch64: Use regular hwcaps flags instead of HWCAP_CPUID for CPU feature detection on Linux
This makes the code much simpler (especially for adding support
for other instruction set extensions), avoids needing inline
assembly for this feature, and generally is more of the canonical
way to do this.

The CPU feature detection was added in
493fcde50a, using HWCAP_CPUID.

The argument for using that, was that HWCAP_CPUID was added much
earlier in the kernel (in Linux v4.11), while the HWCAP flags for
individual features always come later. This allows detecting support
for new CPU extensions before the kernel exposes information about
them via hwcap flags.

However in practice, there's probably quite little advantage in this.
E.g. HWCAP2_I8MM was added in Linux v5.10 - long after HWCAP_CPUID,
but there's probably very little practical cases where one would
run a kernel older than that on a CPU that supports those instructions.

Additionally, we provide our own definitions of the flag values to
check (as they are fixed constants anyway), with names not conflicting
with the ones from system headers. This reduces the number of ifdefs
needed, and allows detecting those features even if building with
userland headers that are lacking the definitions of those flags.

Also, slightly older versions of QEMU, e.g. 6.2 in Ubuntu 22.04,
do expose support for these features via HWCAP flags, but the
emulated cpuid registers are missing the bits for exposing e.g. I8MM.
(This issue is fixed in later versions of QEMU though.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-03-04 10:13:31 +02:00
..
asm.S aarch64: Only enable extensions in the intended files/regions 2023-10-24 14:46:20 +03:00
bswap.h
cpu.c aarch64: Use regular hwcaps flags instead of HWCAP_CPUID for CPU feature detection on Linux 2024-03-04 10:13:31 +02:00
cpu.h aarch64: Add cpu flags for the dotprod and i8mm extensions 2023-06-06 12:40:42 +03:00
float_dsp_init.c
float_dsp_neon.S aarch64: Consistently use lowercase for vector element specifiers 2023-10-21 23:25:18 +03:00
Makefile
neontest.h
timer.h
tx_float_init.c
tx_float_neon.S aarch64: Manually tweak vertical alignment/indentation in tx_float_neon.S 2023-10-21 23:25:39 +03:00