diff options
author | RĂ©mi Denis-Courmont <remi@remlab.net> | 2022-10-03 18:06:42 +0300 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2022-10-13 10:17:38 +0200 |
commit | 96a83ceea434911d825223eaafa0f999e2a9d1fa (patch) | |
tree | 42b07b034ab3cdd10b933c14c71b2300637f2d91 /libavutil | |
parent | 28ac2279adb860ea8b90d3073603912bf3eb6a83 (diff) | |
download | ffmpeg-96a83ceea434911d825223eaafa0f999e2a9d1fa.tar.gz |
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 'libavutil')
-rw-r--r-- | libavutil/riscv/float_dsp_rvv.S | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/riscv/float_dsp_rvv.S b/libavutil/riscv/float_dsp_rvv.S index 2bf8c6ee96..77961b7387 100644 --- a/libavutil/riscv/float_dsp_rvv.S +++ b/libavutil/riscv/float_dsp_rvv.S @@ -166,7 +166,7 @@ endfunc // a0 = (a0).(a1) [0..a2-1] func ff_scalarproduct_float_rvv, zve32f - vsetvli zero, zero, e32, m1, ta, ma + vsetivli zero, 1, e32, m1, ta, ma vmv.s.x v8, zero 1: vsetvli t0, a2, e32, m1, ta, ma |