PR #23804 opened by Zhao Zhili (quink)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23804
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23804.patch
The original implementation was a regression on Cortex-X925 (0.88x).
```
X925 clang X925 gcc A725 clang A725 gcc A510 clang
c: 891 1638 792 1475 8084
neon_original: 1015 (0.88x) 1016 (1.61x) 747 (1.06x) 747 (1.97x) 6126
(1.31x)
neon_new: 696 (1.28x) 696 (2.35x) 623 (1.27x) 623 (2.37x) 3697
(2.18x)
```
Signed-off-by: Zhao Zhili <[email protected]>
>From 881ffa458e19def23e17a9f00ad4d142af9ad273 Mon Sep 17 00:00:00 2001
From: Zhao Zhili <[email protected]>
Date: Mon, 13 Jul 2026 20:00:55 +0800
Subject: [PATCH] avcodec/aarch64: rewrite lfe_fir1 to remove faddp reduction
The original implementation was a regression on Cortex-X925 (0.88x).
X925 clang X925 gcc A725 clang A725 gcc A510 clang
c: 891 1638 792 1475 8084
neon_original: 1015 (0.88x) 1016 (1.61x) 747 (1.06x) 747 (1.97x) 6126
(1.31x)
neon_new: 696 (1.28x) 696 (2.35x) 623 (1.27x) 623 (2.37x) 3697
(2.18x)
Signed-off-by: Zhao Zhili <[email protected]>
---
libavcodec/aarch64/dcadsp_neon.S | 44 ++++++++++++++++++++------------
1 file changed, 28 insertions(+), 16 deletions(-)
diff --git a/libavcodec/aarch64/dcadsp_neon.S b/libavcodec/aarch64/dcadsp_neon.S
index af149767fd..2aee95f241 100644
--- a/libavcodec/aarch64/dcadsp_neon.S
+++ b/libavcodec/aarch64/dcadsp_neon.S
@@ -21,6 +21,10 @@
#include "libavutil/aarch64/asm.S"
+const lfe_fir1_rev_tbl
+ .byte 12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2, 3
+endconst
+
function ff_lfe_fir0_float_neon, export=1
lsr x3, x3, #1
sub x1, x1, #(7*4)
@@ -64,33 +68,41 @@ function ff_lfe_fir0_float_neon, export=1
endfunc
function ff_lfe_fir1_float_neon, export=1
+ movrel x9, lfe_fir1_rev_tbl
+ mov x10, #(-16*4)
lsr x3, x3, #2
sub x1, x1, #(3*4)
+ ldr q23, [x9]
.Louter1:
ld1 {v4.4s}, [x1]
scvtf v4.4s, v4.4s
- ext v5.16b, v4.16b, v4.16b, #8
- rev64 v5.4s, v5.4s
-
mov x4, x2
- add x5, x2, #(252*4)
+ add x5, x2, #((256-16)*4)
mov x6, x0
add x7, x0, #(64*4)
- mov w8, #64
+ mov w8, #16
.Linner1:
- ld1 {v0.4s}, [x4], #16
- ld1 {v16.4s}, [x5]
- sub x5, x5, #16
+ ld4 {v0.4s, v1.4s, v2.4s, v3.4s}, [x4], #64
+ ld4 {v18.4s, v19.4s, v20.4s, v21.4s}, [x5], x10
+
+ fmul v17.4s, v0.4s, v4.s[3]
+ fmla v17.4s, v1.4s, v4.s[2]
+ fmla v17.4s, v2.4s, v4.s[1]
+ fmla v17.4s, v3.4s, v4.s[0]
+
+ fmul v22.4s, v21.4s, v4.s[3]
+ fmla v22.4s, v20.4s, v4.s[2]
+ fmla v22.4s, v19.4s, v4.s[1]
+ fmla v22.4s, v18.4s, v4.s[0]
+
subs w8, w8, #1
- fmul v2.4s, v0.4s, v5.4s
- fmul v3.4s, v16.4s, v4.4s
- faddp v2.4s, v2.4s, v2.4s
- faddp v3.4s, v3.4s, v3.4s
- faddp s2, v2.2s
- faddp s3, v3.2s
- str s2, [x6], #4
- str s3, [x7], #4
+
+ tbl v22.16b, {v22.16b}, v23.16b
+
+ str q17, [x6], #16
+ str q22, [x7], #16
+
b.gt .Linner1
subs x3, x3, #1
--
2.52.0
_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]