Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Krzysztof Pyrkosz via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Krzysztof Pyrkosz <ffmpeg@szaka.eu>
Subject: [FFmpeg-devel] [PATCH] avutil/aarch64/float_dsp_neon: Refactor ff_vector_fmul_add_neon
Date: Sun, 19 Jan 2025 18:33:00 +0100
Message-ID: <20250119173259.1533-2-ffmpeg@szaka.eu> (raw)

Removed a branch, unrolled loop. Speed increase bumped from 3.95 to 5.60.

Krzysztof

---
 libavutil/aarch64/float_dsp_neon.S | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/libavutil/aarch64/float_dsp_neon.S b/libavutil/aarch64/float_dsp_neon.S
index 35e2715b87..0ee5c67b91 100644
--- a/libavutil/aarch64/float_dsp_neon.S
+++ b/libavutil/aarch64/float_dsp_neon.S
@@ -138,19 +138,21 @@ function ff_vector_fmul_window_neon, export=1
 endfunc
 
 function ff_vector_fmul_add_neon, export=1
-        ld1             {v0.4s, v1.4s},  [x1], #32
-        ld1             {v2.4s, v3.4s},  [x2], #32
-        ld1             {v4.4s, v5.4s},  [x3], #32
-1:      subs            w4,  w4,  #8
-        fmla            v4.4s,  v0.4s,  v2.4s
-        fmla            v5.4s,  v1.4s,  v3.4s
-        b.eq            2f
-        ld1             {v0.4s, v1.4s},  [x1], #32
-        ld1             {v2.4s, v3.4s},  [x2], #32
-        st1             {v4.4s, v5.4s},  [x0], #32
-        ld1             {v4.4s, v5.4s},  [x3], #32
-        b               1b
-2:      st1             {v4.4s, v5.4s},  [x0], #32
+1:
+        ldp            q0, q1, [x1], #32
+        ldp            q2, q3, [x2], #32
+        ldp            q4, q5, [x3], #32
+        fmla           v4.4s, v0.4s, v2.4s
+        fmla           v5.4s, v1.4s, v3.4s
+        stp            q4, q5, [x0], #32
+        ldp            q0, q1, [x1], #32
+        ldp            q2, q3, [x2], #32
+        ldp            q4, q5, [x3], #32
+        fmla           v4.4s, v0.4s, v2.4s
+        fmla           v5.4s, v1.4s, v3.4s
+        stp            q4, q5, [x0], #32
+        sub            w4, w4, #16
+        cbnz           w4, 1b
         ret
 endfunc
 
-- 
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".

             reply	other threads:[~2025-01-19 17:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-19 17:33 Krzysztof Pyrkosz via ffmpeg-devel [this message]
2025-01-19 20:57 ` Martin Storsjö
2025-01-23 21:31   ` Krzysztof Pyrkosz via ffmpeg-devel

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=20250119173259.1533-2-ffmpeg@szaka.eu \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=ffmpeg@szaka.eu \
    /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