[ffmpeg] branch master updated (335ca9c4f4 -> aa483bc422)
This is an automated email from the git hooks/post-receive script. Git pushed a change to branch master in repository ffmpeg. from 335ca9c4f4 tests/checkasm: Fix whitespace cosmetics new 3e6fa5153e avcodec/x86/bswapdsp: Avoid register copies new 55afe49dd0 avcodec/x86/bswapdsp: combine shifting, avoid check for AVX2 new aa483bc422 avcodec/x86/bswapdsp: Avoid aligned vs unaligned codepaths for AVX2 The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: libavcodec/x86/bswapdsp.asm | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-)
This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg. commit 3e6fa5153e70e01dcb73556f60005da1c46a064e Author: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> AuthorDate: Fri Feb 27 13:19:47 2026 +0100 Commit: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> CommitDate: Fri Feb 27 18:25:01 2026 +0100 avcodec/x86/bswapdsp: Avoid register copies No change in benchmarks here. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/x86/bswapdsp.asm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libavcodec/x86/bswapdsp.asm b/libavcodec/x86/bswapdsp.asm index 31c6c48a21..12fd494ffe 100644 --- a/libavcodec/x86/bswapdsp.asm +++ b/libavcodec/x86/bswapdsp.asm @@ -33,10 +33,10 @@ SECTION .text ; %1 = aligned/unaligned %macro BSWAP_LOOPS 1 mov r3d, r2d - sar r2d, 3 + sar r3d, 3 jz .left4_%1 %if cpuflag(avx2) - sar r2d, 1 + sar r3d, 1 jz .left8_%1 %endif .loop8_%1: @@ -65,12 +65,11 @@ SECTION .text %endif add r0, mmsize*2 add r1, mmsize*2 - dec r2d + dec r3d jnz .loop8_%1 %if cpuflag(avx2) .left8_%1: - mov r2d, r3d - test r3d, 8 + test r2d, 8 jz .left4_%1 mov%1 m0, [r1] pshufb m0, m2 @@ -79,8 +78,7 @@ SECTION .text add r0, mmsize %endif .left4_%1: - mov r2d, r3d - test r3d, 4 + test r2d, 4 jz .left mov%1 xm0, [r1] %if cpuflag(ssse3)
This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg. commit 55afe49dd022ee391a7804793544d8617957fece Author: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> AuthorDate: Fri Feb 27 13:24:04 2026 +0100 Commit: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> CommitDate: Fri Feb 27 18:25:31 2026 +0100 avcodec/x86/bswapdsp: combine shifting, avoid check for AVX2 This avoids a check and a shift if >=8 elements are processed; it adds a check if < 8 elements are processed (which should be rare). No change in benchmarks here. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/x86/bswapdsp.asm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/x86/bswapdsp.asm b/libavcodec/x86/bswapdsp.asm index 12fd494ffe..f89ca76cf1 100644 --- a/libavcodec/x86/bswapdsp.asm +++ b/libavcodec/x86/bswapdsp.asm @@ -33,11 +33,12 @@ SECTION .text ; %1 = aligned/unaligned %macro BSWAP_LOOPS 1 mov r3d, r2d - sar r3d, 3 - jz .left4_%1 %if cpuflag(avx2) - sar r3d, 1 + sar r3d, 4 jz .left8_%1 +%else + sar r3d, 3 + jz .left4_%1 %endif .loop8_%1: mov%1 m0, [r1 + 0]
This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg. commit aa483bc42201e673cf7172be5205c14ada26bdbd Author: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> AuthorDate: Fri Feb 27 13:54:21 2026 +0100 Commit: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> CommitDate: Fri Feb 27 18:25:43 2026 +0100 avcodec/x86/bswapdsp: Avoid aligned vs unaligned codepaths for AVX2 For modern cpus (like those supporting AVX2) loads and stores using the unaligned versions of instructions are as fast as aligned ones if the address is aligned, so remove the aligned AVX2 version (and the alignment check) and just use the unaligned one. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/x86/bswapdsp.asm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libavcodec/x86/bswapdsp.asm b/libavcodec/x86/bswapdsp.asm index f89ca76cf1..06f77c5921 100644 --- a/libavcodec/x86/bswapdsp.asm +++ b/libavcodec/x86/bswapdsp.asm @@ -100,10 +100,15 @@ SECTION .text ; void ff_bswap_buf(uint32_t *dst, const uint32_t *src, int w); %macro BSWAP32_BUF 0 -%if cpuflag(ssse3)||cpuflag(avx2) +%if cpuflag(avx2) cglobal bswap32_buf, 3,4,3 + vbroadcasti128 m2, [pb_bswap32] + BSWAP_LOOPS u +%else +%if cpuflag(ssse3) +cglobal bswap32_buf, 3,4,3 + mova m2, [pb_bswap32] mov r3, r1 - VBROADCASTI128 m2, [pb_bswap32] %else cglobal bswap32_buf, 3,4,5 mov r3, r1 @@ -115,6 +120,7 @@ cglobal bswap32_buf, 3,4,5 jmp .left .start_align: BSWAP_LOOPS a +%endif .left: %if cpuflag(ssse3) test r2d, 2
participants (2)
-
Andreas Rheinhardt -
ffmpeg-git