OSDN Git Service

target/riscv/vector_helper.c: create vext_set_tail_elems_1s()
authorDaniel Henrique Barboza <dbarboza@ventanamicro.com>
Sun, 26 Feb 2023 17:05:13 +0000 (14:05 -0300)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 2 Mar 2023 02:09:44 +0000 (18:09 -0800)
commite130683ffbac5006e57b9f730bbc556044117222
tree256621d2e6bc09b21b0bacf2c8ccbc48804a2b47
parentd4ea71170432fef9e8394ab33eac3cdc3a9540d3
target/riscv/vector_helper.c: create vext_set_tail_elems_1s()

Commit 752614cab8e6 ("target/riscv: rvv: Add tail agnostic for vector
load / store instructions") added code to set the tail elements to 1 in
the end of vext_ldst_stride(), vext_ldst_us(), vext_ldst_index() and
vext_ldff(). Aside from a env->vl versus an evl value being used in the
first loop, the code is being repeated 4 times.

Create a helper to avoid code repetition in all those functions.
Arguments that are used in the callers (nf, esz and max_elems) are
passed as arguments. All other values are being derived inside the
helper.

Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Reviewed-by: Frank Chang <frank.chang@sifive.com>
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20230226170514.588071-2-dbarboza@ventanamicro.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
target/riscv/vector_helper.c