[FFmpeg-devel] [PATCH] avutil/aarch64/tx_float_neon.S: clean up FFT4_X2

Lynne dev at lynne.ee
Fri Feb 28 14:43:15 EET 2025


On 25/02/2025 21:45, Krzysztof Pyrkosz via ffmpeg-devel wrote:
> ---
> 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

Thanks, pushed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xA2FEA5F03F034464.asc
Type: application/pgp-keys
Size: 624 bytes
Desc: OpenPGP public key
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250228/95548c91/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250228/95548c91/attachment.sig>


More information about the ffmpeg-devel mailing list