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 589614A934 for ; Mon, 24 Jun 2024 08:15:49 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 11A0F68D605; Mon, 24 Jun 2024 11:15:46 +0300 (EEST) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3A40068D4CF for ; Mon, 24 Jun 2024 11:15:38 +0300 (EEST) Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2ebec2f11b7so43939741fa.2 for ; Mon, 24 Jun 2024 01:15:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20230601.gappssmtp.com; s=20230601; t=1719216938; x=1719821738; darn=ffmpeg.org; h=mime-version:references:message-id:in-reply-to:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=CVzAXYsMlnQAtJ3lnGfzm1XdgfceQMUAdKOdHZ7pc7I=; b=r3J7iIUjRu9v/rCWuVt+IK+V8XDxV5eCMuttGfI4Y+KdQqukFO52MlbkvlBBmdUIJT qiNypgv1AyrScNatYwLb3vgmcHgQzH0iKG7vkYy7hbvfUE4RgZcDVIrPHkM/gBjO9Hvf 1q0q6UasfWE4ZOQ5tpj677WTu7Yp0Y7EetdprkkFRbAQgBATI5mPcj0UUpkoFS3ZUsga g3l/mofhhxYnvUKT0jkiwTRNUB8xslH8Z7AK0ur8IRuVuiKnLzEY2IHyhMwAfIMefaub XyokE0AEvPfcaYpu1fG3a30EITO75QsydzEtZwhCu8wfF8BNhCspPY5mgA6zTYsTTj1i 9tkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719216938; x=1719821738; h=mime-version:references:message-id:in-reply-to:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CVzAXYsMlnQAtJ3lnGfzm1XdgfceQMUAdKOdHZ7pc7I=; b=icwWs5rfP0SKRo4zWFy9bJb2Gis0725Bm3uOiHB/rPa4dELpeQ1WarDoA6gEMhT/xf eEix2CDyBsmoejrST9riAeKgpxm9eXvxm8UW8qfijllWOxORuqj14FD/v7lfW0QstStu /fPDHgoWoAtUuQbKGEyYXoX1Efoqfe5O3CZRJMj72d+f3Q0pO4AAlByXiRKEvQqDmXD/ BENlsxh0LjnpU5fumLMRg7EfVz5mj+Fg2XdSOfXtN8o0gLotejf234u9pVpiwg+Rl2Mq bERwlnrs5wqED3bdXtOJ70dV1I6liKSCEnOGrY8iPZmSGekzdHtHwHik/IeE+O5+SryL PV9Q== X-Gm-Message-State: AOJu0YwjfhEcsYwLRmDIaUO9NoB/otPNkunsfdyptu7B/+Bwj2pC2MHU mHO4jptvrOHwvv+thKmMkx2YgnhYwqg77dT4kNAGPAksN8wVEx6hAGCEs/nyvCBeYHIqk0gz2aK WUA== X-Google-Smtp-Source: AGHT+IG2UCubaKSiwL1gAA8UBWvGpwiwhjc1bfn6HHgh2BlO839dXb0wD3sdRRQv25SAnUG/IUEQBA== X-Received: by 2002:a05:6512:1cd:b0:52c:dc57:868b with SMTP id 2adb3069b0e04-52ce18324ebmr2391287e87.13.1719216937688; Mon, 24 Jun 2024 01:15:37 -0700 (PDT) Received: from tunnel335574-pt.tunnel.tserv24.sto1.ipv6.he.net (tunnel335574-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:11::2]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52cdfb67e9dsm519961e87.181.2024.06.24.01.15.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 01:15:37 -0700 (PDT) Date: Mon, 24 Jun 2024 11:15:33 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: FFmpeg development discussions and patches In-Reply-To: Message-ID: References: MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] aarch64: Add OpenBSD runtime detection of dotprod and i8mm using sysctl 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Sat, 22 Jun 2024, Brad Smith wrote: > [PATCH] aarch64: Add OpenBSD runtime detection of dotprod and i8mm using sysctl > > Signed-off-by: Brad Smith > --- > libavutil/aarch64/cpu.c | 35 +++++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) > > diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c > index 196bdaf6b0..40fcc8d1ff 100644 > --- a/libavutil/aarch64/cpu.c > +++ b/libavutil/aarch64/cpu.c > @@ -65,6 +65,41 @@ static int detect_flags(void) > return flags; > } > > +#elif defined(__OpenBSD__) > +#include > +#include > +#include > +#include > + > +static int detect_flags(void) > +{ > + int flags = 0; > + int mib[2]; > + uint64_t isar0; > + uint64_t isar1; > + size_t len; > + > + mib[0] = CTL_MACHDEP; > + mib[1] = CPU_ID_AA64ISAR0; > + len = sizeof(isar0); > + if (sysctl(mib, 2, &isar0, &len, NULL, 0) != -1) { > + if (ID_AA64ISAR0_DP(isar0) >= ID_AA64ISAR0_DP_IMPL) > + flags |= AV_CPU_FLAG_DOTPROD; > + } > + > + mib[0] = CTL_MACHDEP; > + mib[1] = CPU_ID_AA64ISAR1; > + len = sizeof(isar1); > + if (sysctl(mib, 2, &isar1, &len, NULL, 0) != -1) { > +#ifdef ID_AA64ISAR1_I8MM_IMPL > + if (ID_AA64ISAR1_I8MM(isar1) >= ID_AA64ISAR1_I8MM_IMPL) > + flags |= AV_CPU_FLAG_I8MM; > +#endif > + } > + > + return flags; > +} > + > #elif defined(_WIN32) > #include This LGTM. Although, in https://code.videolan.org/videolan/dav1d/-/merge_requests/1673 you wrapped most of this in an #ifdef CPU_ID_AA64ISAR0, so would that be useful here too? Feel free to push either with or without that. // Martin _______________________________________________ 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".