summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorRĂ©mi Denis-Courmont <remi@remlab.net>2022-10-03 18:06:42 +0300
committerLynne <dev@lynne.ee>2022-10-13 10:17:38 +0200
commit96a83ceea434911d825223eaafa0f999e2a9d1fa (patch)
tree42b07b034ab3cdd10b933c14c71b2300637f2d91 /libavcodec
parent28ac2279adb860ea8b90d3073603912bf3eb6a83 (diff)
riscv: fix scalar product initialisation
VSETVLI xd, x0, ...' has rather nonobvious semantics: - If xd is x0, then it preserves the current vector length. - If xd is not x0, it sets the vector length to the supported maximum. Also somewhat confusingly, while VMV.X.S always does its thing regardless of the selected vector length, VMV.S.X does _nothing_ if the selected vector length is zero. So the current code breaks fails to initialise the accumulator if we are unlucky to have a selected vector length of zero on entry. Fix it by forcing the vector length to one.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/riscv/audiodsp_rvv.S2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/riscv/audiodsp_rvv.S b/libavcodec/riscv/audiodsp_rvv.S
index f4308f27c5..8e8bbd2058 100644
--- a/libavcodec/riscv/audiodsp_rvv.S
+++ b/libavcodec/riscv/audiodsp_rvv.S
@@ -21,7 +21,7 @@
#include "libavutil/riscv/asm.S"
func ff_scalarproduct_int16_rvv, zve32x
- vsetvli zero, zero, e16, m1, ta, ma
+ vsetivli zero, 1, e16, m1, ta, ma
vmv.s.x v8, zero
1:
vsetvli t0, a2, e16, m1, ta, ma