Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/2] aarch64: Simplify the linux runtime cpu detection code
@ 2023-10-24 12:22 Martin Storsjö
  2023-10-24 12:22 ` [FFmpeg-devel] [PATCH 2/2] configure: Improve aarch64 feature detection on older, broken Clang versions Martin Storsjö
  2023-10-24 12:40 ` [FFmpeg-devel] [PATCH 1/2] aarch64: Simplify the linux runtime cpu detection code Sean McGovern
  0 siblings, 2 replies; 7+ messages in thread
From: Martin Storsjö @ 2023-10-24 12:22 UTC (permalink / raw)
  To: ffmpeg-devel

Skip doing the whole getauxval(AT_HWCAP) if HWCAP_CPUID isn't
defined.
---
 libavutil/aarch64/cpu.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c
index bd780e8591..2b50c426bc 100644
--- a/libavutil/aarch64/cpu.c
+++ b/libavutil/aarch64/cpu.c
@@ -30,11 +30,9 @@
 static int detect_flags(void)
 {
     int flags = 0;
-    unsigned long hwcap;
-
-    hwcap = getauxval(AT_HWCAP);
 
 #if defined(HWCAP_CPUID)
+    unsigned long hwcap = getauxval(AT_HWCAP);
     // 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
@@ -53,8 +51,6 @@ static int detect_flags(void)
         if (((tmp >> 52) & 0xf) == 0x1)
             flags |= AV_CPU_FLAG_I8MM;
     }
-#else
-    (void)hwcap;
 #endif
 
     return flags;
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-10-31 10:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-24 12:22 [FFmpeg-devel] [PATCH 1/2] aarch64: Simplify the linux runtime cpu detection code Martin Storsjö
2023-10-24 12:22 ` [FFmpeg-devel] [PATCH 2/2] configure: Improve aarch64 feature detection on older, broken Clang versions Martin Storsjö
2023-10-31 10:23   ` Martin Storsjö
2023-10-24 12:40 ` [FFmpeg-devel] [PATCH 1/2] aarch64: Simplify the linux runtime cpu detection code Sean McGovern
2023-10-26 21:40   ` Sean McGovern
2023-10-26 21:42     ` Sean McGovern
2023-10-31 10:22   ` Martin Storsjö

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git