From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id D6E324C04B for ; Fri, 26 Jul 2024 10:58:48 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1808D68D653; Fri, 26 Jul 2024 13:58:46 +0300 (EEST) Received: from mail.comstyle.com (speedy.comstyle.com [206.51.28.2]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 927DD68BD13 for ; Fri, 26 Jul 2024 13:58:39 +0300 (EEST) Received: from mail.comstyle.com (localhost [127.0.0.1]) by mail.comstyle.com (Postfix) with ESMTP id 4WVl9T5bq4z8PbP for ; Fri, 26 Jul 2024 06:58:37 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=comstyle.com; h=date :from:to:subject:message-id:mime-version:content-type; s= default; bh=asufkXAMIgFFjoTffW/qAAfGUGu4dcWLkIoKShMueNA=; b=NWba Dg59a7GkMEdZmPA+EJMSWIwJA8k5cnWis7PD6tiNThTC77+WOip/dXX5VLVQN5kd QWTpcwxKdY0H3C+FjInJI3zb0HAIOA/feBDWigLvCyPEWRyip03fBihNMRhvcLE6 Q+7YckNA76xMrs6NTg5vI16CKXsP8Dr1EknPjRE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=comstyle.com; h=date:from:to :subject:message-id:mime-version:content-type; q=dns; s=default; b= XfMtbd0QE1lqKxZPbuuSSNd+RCuaX7+UnGkwwItSwKCZrpqR91vFlstJkwGxkhrV LMA3y9cEIJZ4c+zpS25dyu/eOA1RjTXaUL9Tbqwa8xakdYtuCklx5a22a0MSpbmU YR8PJym2ca90yDZN0NFEw72wVnYle5TGF7qlqOT75i0= Received: from humpty.home.comstyle.com (unknown [IPv6:2001:470:b050:3:5bfb:5b26:2fc1:adf8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (No client certificate requested) (Authenticated sender: brad) by mail.comstyle.com (Postfix) with ESMTPSA id 4WVl9T36Wmz8PbN for ; Fri, 26 Jul 2024 06:58:37 -0400 (EDT) Date: Fri, 26 Jul 2024 06:58:34 -0400 From: Brad Smith To: ffmpeg-devel@ffmpeg.org Message-ID: MIME-Version: 1.0 Content-Disposition: inline Subject: [FFmpeg-devel] aarch64: Implement support for elf_aux_info(3) on FreeBSD and OpenBSD X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: aarch64: Implement support for elf_aux_info(3) on FreeBSD and OpenBSD FreeBSD 12.0+, OpenBSD -current and what will be OpenBSD 7.6 support elf_aux_info(3). Signed-off-by: Brad Smith --- configure | 2 ++ libavutil/aarch64/cpu.c | 23 ++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/configure b/configure index f6f5c29fea..e80b549582 100755 --- a/configure +++ b/configure @@ -2366,6 +2366,7 @@ SYSTEM_FUNCS=" clock_gettime closesocket CommandLineToArgvW + elf_aux_info fcntl getaddrinfo getauxval @@ -6565,6 +6566,7 @@ check_func_headers mach/mach_time.h mach_absolute_time check_func_headers stdlib.h getenv check_func_headers sys/stat.h lstat check_func_headers sys/auxv.h getauxval +check_func_headers sys/auxv.h elf_aux_info check_func_headers sys/sysctl.h sysctlbyname check_func_headers windows.h GetModuleHandle diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c index cfa9306663..05272b4db4 100644 --- a/libavutil/aarch64/cpu.c +++ b/libavutil/aarch64/cpu.c @@ -42,6 +42,27 @@ static int detect_flags(void) return flags; } +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && HAVE_ELF_AUX_INFO +#include +#include + +static int detect_flags(void) +{ + int flags = 0; + + unsigned long hwcap = 0; + elf_aux_info(AT_HWCAP, &hwcap, sizeof hwcap); + unsigned long hwcap2 = 0; + elf_aux_info(AT_HWCAP2, &hwcap2, sizeof hwcap2); + + if (hwcap & HWCAP_ASIMDDP) + flags |= AV_CPU_FLAG_DOTPROD; + if (hwcap2 & HWCAP2_I8MM) + flags |= AV_CPU_FLAG_I8MM; + + return flags; +} + #elif defined(__APPLE__) && HAVE_SYSCTLBYNAME #include @@ -65,7 +86,7 @@ static int detect_flags(void) return flags; } -#elif defined(__OpenBSD__) +#elif defined(__OpenBSD__) && !HAVE_ELF_AUX_INFO #include #include #include -- 2.45.2 _______________________________________________ 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".