Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Sean McGovern <gseanmcg@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 1/2] aarch64: Simplify the linux runtime cpu detection code
Date: Tue, 24 Oct 2023 08:40:12 -0400
Message-ID: <CAPBf_OnnATt3tkXjT9yFr2Hd6y4wkfRv6TJ=zjbnJBiguhDqJw@mail.gmail.com> (raw)
In-Reply-To: <20231024122258.210941-1-martin@martin.st>

On Tue, Oct 24, 2023, 08:23 Martin Storsjö <martin@martin.st> wrote:

> 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".
>

Good call, and LGTM.

-- Sean McGovern

>
_______________________________________________
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".

  parent reply	other threads:[~2023-10-24 12:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-31 10:23   ` Martin Storsjö
2023-10-24 12:40 ` Sean McGovern [this message]
2023-10-26 21:40   ` [FFmpeg-devel] [PATCH 1/2] aarch64: Simplify the linux runtime cpu detection code Sean McGovern
2023-10-26 21:42     ` Sean McGovern
2023-10-31 10:22   ` Martin Storsjö

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPBf_OnnATt3tkXjT9yFr2Hd6y4wkfRv6TJ=zjbnJBiguhDqJw@mail.gmail.com' \
    --to=gseanmcg@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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