From: "Martin Storsjö" <martin@martin.st>
To: "Pop, Sebastian" <spop@amazon.com>
Cc: "Swinney, Jonathan" <jswinney@amazon.com>,
"Clément Bœsch" <u@pkh.me>,
"ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] lavc/aarch64: add some neon pix_abs functions
Date: Tue, 15 Mar 2022 00:39:34 +0200 (EET)
Message-ID: <8620d92-679d-7929-1d3a-1439a410395d@martin.st> (raw)
In-Reply-To: <1646667914236.71807@amazon.com>
On Mon, 7 Mar 2022, Pop, Sebastian wrote:
> Here are a few suggestions:
>
>> + add d18, d17, d18 // add to the end result register
>> [...]
>> + mov w0, v18.S[0] // copy result to general purpose register
>
> I think you can use 32-bit register s18 instead of d18.
> The mov with indexed vector is more expensive than fmov.
Oh, I hadn't considered that. In a tight loop, I can indeed measure a
quite significant difference between those.
> add s18, s18, s17
> fmov w0, s18
>
>> + subs w4, w4, #1 // decrement h and set flags for branch below
>> [...]
>> + b.ne 2b // branch based on subs instruction above
>
> Please avoid the flags register to branch.
> Instead you could do:
>
> sub w4, w4, #1
> cbnz w4, 2b
If there are other instructions between the sub and the b.ne, does this
make any difference? (In most cases one can move the decrement into a
suitable gap early in the loop anyway.) I.e. if the flags register already
is set since long ago, naively I'd expect that b.ne would be faster (or at
least not slower) than cbnz.
Some benchmarking on Cortex A53, A72 and A73 seems to agree with my
expectations too. (It'd be good if we'd have the patch at hand hooked up
in checkasm, so that we could measure and compare exactly the function at
hand.)
// 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".
next prev parent reply other threads:[~2022-03-14 22:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-04 22:52 Swinney, Jonathan
[not found] ` <1646667914236.71807@amazon.com>
2022-03-14 22:39 ` Martin Storsjö [this message]
2022-03-07 20:40 Swinney, Jonathan
2022-03-14 22:28 ` 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=8620d92-679d-7929-1d3a-1439a410395d@martin.st \
--to=martin@martin.st \
--cc=ffmpeg-devel@ffmpeg.org \
--cc=jswinney@amazon.com \
--cc=spop@amazon.com \
--cc=u@pkh.me \
/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