diff mbox series

[FFmpeg-devel,2/3] libavutil/aarch64/cpu.c: HWCAPS requires inline asm support.

Message ID 20231029175657.46386-2-Reimar.Doeffinger@gmx.de
State New
Headers show
Series [FFmpeg-devel,1/3] configure: fix _Pragma check. | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Reimar Döffinger Oct. 29, 2023, 5:56 p.m. UTC
From: Reimar Döffinger <Reimar.Doeffinger@gmx.de>

Fixes compilation with tcc, which does not have aarch64
inline asm support.
---
 libavutil/aarch64/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin Storsjö Oct. 29, 2023, 8:49 p.m. UTC | #1
On Sun, 29 Oct 2023, Reimar.Doeffinger@gmx.de wrote:

> From: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
>
> Fixes compilation with tcc, which does not have aarch64
> inline asm support.
> ---
> libavutil/aarch64/cpu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c
> index bd780e8591..0d7c1e268d 100644
> --- a/libavutil/aarch64/cpu.c
> +++ b/libavutil/aarch64/cpu.c
> @@ -34,7 +34,7 @@ static int detect_flags(void)
>
>     hwcap = getauxval(AT_HWCAP);
> 
> -#if defined(HWCAP_CPUID)
> +#if defined(HWCAP_CPUID) && HAVE_INLINE_ASM
>     // We can check for DOTPROD and I8MM using HWCAP_ASIMDDP and
>     // HWCAP2_I8MM too, avoiding to read the CPUID registers (which triggers
>     // a trap, handled by the kernel). However the HWCAP_* defines for these
> -- 
> 2.39.3 (Apple Git-145)

LGTM, thanks!

// Martin
diff mbox series

Patch

diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c
index bd780e8591..0d7c1e268d 100644
--- a/libavutil/aarch64/cpu.c
+++ b/libavutil/aarch64/cpu.c
@@ -34,7 +34,7 @@  static int detect_flags(void)
 
     hwcap = getauxval(AT_HWCAP);
 
-#if defined(HWCAP_CPUID)
+#if defined(HWCAP_CPUID) && HAVE_INLINE_ASM
     // We can check for DOTPROD and I8MM using HWCAP_ASIMDDP and
     // HWCAP2_I8MM too, avoiding to read the CPUID registers (which triggers
     // a trap, handled by the kernel). However the HWCAP_* defines for these