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/tx_float_neon.S: clean up FFT4_X2
Date: Tue, 25 Feb 2025 21:45:56 +0100
Message-ID: <20250225204555.2372-2-ffmpeg@szaka.eu> (raw)

---
This patch rids the code from two tbl instructions and the shuffle
table. There's no fneg v0.s[3] instruction unfortunately, so I negate
the whole vector and copy the last element only.

It's tricky to benchmark this little change but on average it seems to
be beneficial.

Krzysztof

 libavutil/aarch64/tx_float_neon.S | 32 ++++++++-----------------------
 1 file changed, 8 insertions(+), 24 deletions(-)

diff --git a/libavutil/aarch64/tx_float_neon.S b/libavutil/aarch64/tx_float_neon.S
index 78e4876d6c..d00b3f9684 100644
--- a/libavutil/aarch64/tx_float_neon.S
+++ b/libavutil/aarch64/tx_float_neon.S
@@ -119,13 +119,6 @@ endconst
 .endif
 .endm
 
-const shuf_4pt_x2, align=4
-        .byte   24, 25, 26, 27 // reg2, 3
-        .byte   12, 13, 14, 15 // reg1, 4
-        .byte    8,  9, 10, 11 // reg1, 3
-        .byte   28, 29, 30, 31 // reg2, 4
-endconst
-
 // Identical to FFT4, but does 2 transforms in parallel, with no deinterleaving
 .macro FFT4_X2 e0, o0, e1, o1, \
                t0=v16, t1=v17, t2=v18, t3=v19, t4=v20, t5=v21, t6=v22
@@ -135,18 +128,17 @@ endconst
         fsub            \e0\().4s, \e0\().4s, \o0\().4s                     // t1234
         fsub            \e1\().4s, \e1\().4s, \o1\().4s                     // t1234
 
-        movrel          x5, shuf_4pt_x2
-
         rev64           \t4\().4s, \e0\().4s
         rev64           \t5\().4s, \e1\().4s
 
-        zip2            \o0\().2d, \t0\().2d, \e0\().2d                     // t3,4 r3,4
-        zip2            \o1\().2d, \t2\().2d, \e1\().2d                     // t3,4 r3,4
+        zip2            \o0\().2d, \t0\().2d, \t4\().2d                     // t3,4 r3,4
+        zip2            \o1\().2d, \t2\().2d, \t5\().2d                     // t3,4 r3,4
 
-        ld1             { \t6\().16b }, [x5]
+        fneg            \t3\().4s, \t4\().4s
+        fneg            \t4\().4s, \t5\().4s
 
-        mov             \o0\().d[1], \t4\().d[1]
-        mov             \o1\().d[1], \t5\().d[1]
+        mov             \o0\().s[3], \t3\().s[3]
+        mov             \o1\().s[3], \t4\().s[3]
 
         zip1            \t1\().2d, \t0\().2d, \e0\().2d                     // t1,2 r1,2
         zip1            \t3\().2d, \t2\().2d, \e1\().2d                     // t1,2 r1,2
@@ -156,18 +148,10 @@ endconst
         fsub            \t2\().4s, \t3\().4s, \o1\().4s                     // a34 b32
         fadd            \t3\().4s, \t3\().4s, \o1\().4s                     // a12 b14
 
-        // TODO: experiment with movs instead of tables here
-        tbl             \o0\().16b, { \t4\().16b, \t5\().16b }, \t6\().16b  // b1234
-        tbl             \o1\().16b, { \t2\().16b, \t3\().16b }, \t6\().16b  // b1234
-
         zip1            \e0\().2d, \t5\().2d, \t4\().2d                     // a1234
-//        zip2            \o0\().2d, \t5\().2d, \t4\().2d                     // b1432
+        zip2            \o0\().2d, \t5\().2d, \t4\().2d                     // b1432
         zip1            \e1\().2d, \t3\().2d, \t2\().2d                     // a1234
-//        zip2            \o1\().2d, \t3\().2d, \t2\().2d                     // b1432
-//        rev64           \o0\().4s, \o0\().4s                                // b4123
-//        rev64           \o1\().4s, \o1\().4s                                // b4123
-//        ext             \o0\().16b, \o0\().16b, \o0\().16b, #4              // b1234
-//        ext             \o1\().16b, \o1\().16b, \o1\().16b, #4              // b1234
+        zip2            \o1\().2d, \t3\().2d, \t2\().2d                     // b1432
 .endm
 
 const tab_8pt, align=4
-- 
2.47.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-02-25 20:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20250225204555.2372-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