We're going to make changes that will required each helper to be
responsible for the 'vstart' management, i.e. we will relieve the
'vstart < vl' assumption that helpers have today.
Helpers are usually able to deal with vstart >= vl, i.e. doing nothing
aside from setting vstart = 0 at the end, but the tail update functions
will update the tail regardless of vstart being valid or not.
Unifying the tail update process in a single function that would handle
the vstart >= vl case isn't trivial. We have 2 functions that are used
to update tail: vext_set_tail_elems_1s() and vext_set_elems_1s(). The
latter is a more generic function that is also used to mask elements.
There's no easy way of making all callers using vext_set_tail_elems_1s()
because we're not encoding NF properly in all cases [1].
This patch takes a blunt approach: do an early exit in every single
vector helper if vstart >= vl. We can worry about unifying the tail
update process later.
[1]1590234b-0291-432a-a0fa-c5a6876097bc@linux.alibaba.com/">https://lore.kernel.org/qemu-riscv/1590234b-0291-432a-a0fa-c5a6876097bc@linux.alibaba.com/
Signed-off-by: Daniel Henrique Barboza<dbarboza@ventanamicro.com>
---
target/riscv/vcrypto_helper.c | 32 ++++++++++++
target/riscv/vector_helper.c | 90 +++++++++++++++++++++++++++++++++
target/riscv/vector_internals.c | 4 ++
target/riscv/vector_internals.h | 9 ++++
4 files changed, 135 insertions(+)