Skip to content

Commit

Permalink
Fix the tail handling in R-V V sad
Browse files Browse the repository at this point in the history
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
  • Loading branch information
sunyuechi authored and Rémi Denis-Courmont committed Jan 25, 2025
1 parent e20ee9f commit a0a89ef
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions libavcodec/riscv/h26x/asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,46 +20,46 @@

#include "libavutil/riscv/asm.S"

.macro vsetvlstatic w, vlen, en, mn1, mn2, mn3, mn4, mn5, mn6
.macro vsetvlstatic w, vlen, en, mn1, mn2, mn3, mn4, mn5, mn6, vta=ta
.if \w == 2 && \vlen == 128
vsetivli zero, \w, \en, \mn1, ta, ma
vsetivli zero, \w, \en, \mn1, \vta, ma
.elseif \w <= 4 && \vlen == 128
vsetivli zero, \w, \en, \mn2, ta, ma
vsetivli zero, \w, \en, \mn2, \vta, ma
.elseif \w <= 8 && \vlen == 128
vsetivli zero, \w, \en, \mn3, ta, ma
vsetivli zero, \w, \en, \mn3, \vta, ma
.elseif \w <= 16 && \vlen == 128
vsetivli zero, \w, \en, \mn4, ta, ma
vsetivli zero, \w, \en, \mn4, \vta, ma
.elseif \w <= 32 && \vlen == 128
li t0, \w
vsetvli zero, t0, \en, \mn5, ta, ma
vsetvli zero, t0, \en, \mn5, \vta, ma
.elseif \w <= 4 && \vlen == 256
vsetivli zero, \w, \en, \mn1, ta, ma
vsetivli zero, \w, \en, \mn1, \vta, ma
.elseif \w <= 8 && \vlen == 256
vsetivli zero, \w, \en, \mn2, ta, ma
vsetivli zero, \w, \en, \mn2, \vta, ma
.elseif \w <= 16 && \vlen == 256
vsetivli zero, \w, \en, \mn3, ta, ma
vsetivli zero, \w, \en, \mn3, \vta, ma
.elseif \w <= 32 && \vlen == 256
li t0, \w
vsetvli zero, t0, \en, \mn4, ta, ma
vsetvli zero, t0, \en, \mn4, \vta, ma
.elseif \w <= 64 && \vlen == 256
li t0, \w
vsetvli zero, t0, \en, \mn5, ta, ma
vsetvli zero, t0, \en, \mn5, \vta, ma
.else
li t0, \w
vsetvli zero, t0, \en, \mn6, ta, ma
vsetvli zero, t0, \en, \mn6, \vta, ma
.endif
.endm

.macro vsetvlstatic8 w, vlen
vsetvlstatic \w, \vlen, e8, mf8, mf4, mf2, m1, m2, m4
.macro vsetvlstatic8 w, vlen, vta
vsetvlstatic \w, \vlen, e8, mf8, mf4, mf2, m1, m2, m4, \vta
.endm

.macro vsetvlstatic16 w, vlen
vsetvlstatic \w, \vlen, e16, mf4, mf2, m1, m2, m4, m8
.macro vsetvlstatic16 w, vlen, vta
vsetvlstatic \w, \vlen, e16, mf4, mf2, m1, m2, m4, m8, \vta
.endm

.macro vsetvlstatic32 w, vlen
vsetvlstatic \w, \vlen, e32, mf2, m1, m2, m4, m8, m8
.macro vsetvlstatic32 w, vlen, vta
vsetvlstatic \w, \vlen, e32, mf2, m1, m2, m4, m8, m8, \vta
.endm

.macro POW2_JMP_TABLE id, vlen
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/riscv/vvc/sad_rvv.S
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ SADVSET\vlen\w:
vsetvlstatic32 \w, \vlen
vmv.v.i v0, 0
vmv.s.x v24, zero
vsetvlstatic16 \w, \vlen
vsetvlstatic16 \w, \vlen, tu
SAD\vlen\w:
addi a5, a5, -2
vle16.v v8, (a0)
Expand Down

0 comments on commit a0a89ef

Please sign in to comment.