[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 29/78] target/riscv: rvv-1.0: count population in mask ins
From: |
Alistair Francis |
Subject: |
Re: [PATCH v8 29/78] target/riscv: rvv-1.0: count population in mask instruction |
Date: |
Mon, 18 Oct 2021 15:46:13 +1000 |
On Fri, Oct 15, 2021 at 6:22 PM <frank.chang@sifive.com> wrote:
>
> From: Frank Chang <frank.chang@sifive.com>
>
> Signed-off-by: Frank Chang <frank.chang@sifive.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> target/riscv/helper.h | 2 +-
> target/riscv/insn32.decode | 2 +-
> target/riscv/insn_trans/trans_rvv.c.inc | 7 ++++---
> target/riscv/vector_helper.c | 6 +++---
> 4 files changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/target/riscv/helper.h b/target/riscv/helper.h
> index b8894d61510..3f30882aec4 100644
> --- a/target/riscv/helper.h
> +++ b/target/riscv/helper.h
> @@ -1020,7 +1020,7 @@ DEF_HELPER_6(vmnor_mm, void, ptr, ptr, ptr, ptr, env,
> i32)
> DEF_HELPER_6(vmornot_mm, void, ptr, ptr, ptr, ptr, env, i32)
> DEF_HELPER_6(vmxnor_mm, void, ptr, ptr, ptr, ptr, env, i32)
>
> -DEF_HELPER_4(vmpopc_m, tl, ptr, ptr, env, i32)
> +DEF_HELPER_4(vcpop_m, tl, ptr, ptr, env, i32)
>
> DEF_HELPER_4(vmfirst_m, tl, ptr, ptr, env, i32)
>
> diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode
> index f61eaf7c6ba..e748f7ca714 100644
> --- a/target/riscv/insn32.decode
> +++ b/target/riscv/insn32.decode
> @@ -627,7 +627,7 @@ vmor_mm 011010 - ..... ..... 010 ..... 1010111 @r
> vmnor_mm 011110 - ..... ..... 010 ..... 1010111 @r
> vmornot_mm 011100 - ..... ..... 010 ..... 1010111 @r
> vmxnor_mm 011111 - ..... ..... 010 ..... 1010111 @r
> -vmpopc_m 010100 . ..... ----- 010 ..... 1010111 @r2_vm
> +vcpop_m 010000 . ..... 10000 010 ..... 1010111 @r2_vm
> vmfirst_m 010101 . ..... ----- 010 ..... 1010111 @r2_vm
> vmsbf_m 010110 . ..... 00001 010 ..... 1010111 @r2_vm
> vmsif_m 010110 . ..... 00011 010 ..... 1010111 @r2_vm
> diff --git a/target/riscv/insn_trans/trans_rvv.c.inc
> b/target/riscv/insn_trans/trans_rvv.c.inc
> index 3ba74cdc403..fc17e57d0f7 100644
> --- a/target/riscv/insn_trans/trans_rvv.c.inc
> +++ b/target/riscv/insn_trans/trans_rvv.c.inc
> @@ -2663,8 +2663,8 @@ GEN_MM_TRANS(vmnor_mm)
> GEN_MM_TRANS(vmornot_mm)
> GEN_MM_TRANS(vmxnor_mm)
>
> -/* Vector mask population count vmpopc */
> -static bool trans_vmpopc_m(DisasContext *s, arg_rmr *a)
> +/* Vector count population in mask vcpop */
> +static bool trans_vcpop_m(DisasContext *s, arg_rmr *a)
> {
> if (require_rvv(s) &&
> vext_check_isa_ill(s)) {
> @@ -2683,11 +2683,12 @@ static bool trans_vmpopc_m(DisasContext *s, arg_rmr
> *a)
> tcg_gen_addi_ptr(src2, cpu_env, vreg_ofs(s, a->rs2));
> tcg_gen_addi_ptr(mask, cpu_env, vreg_ofs(s, 0));
>
> - gen_helper_vmpopc_m(dst, mask, src2, cpu_env, desc);
> + gen_helper_vcpop_m(dst, mask, src2, cpu_env, desc);
> gen_set_gpr(s, a->rd, dst);
>
> tcg_temp_free_ptr(mask);
> tcg_temp_free_ptr(src2);
> +
> return true;
> }
> return false;
> diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c
> index f9919273dca..9451112b3da 100644
> --- a/target/riscv/vector_helper.c
> +++ b/target/riscv/vector_helper.c
> @@ -4214,9 +4214,9 @@ GEN_VEXT_MASK_VV(vmnor_mm, DO_NOR)
> GEN_VEXT_MASK_VV(vmornot_mm, DO_ORNOT)
> GEN_VEXT_MASK_VV(vmxnor_mm, DO_XNOR)
>
> -/* Vector mask population count vmpopc */
> -target_ulong HELPER(vmpopc_m)(void *v0, void *vs2, CPURISCVState *env,
> - uint32_t desc)
> +/* Vector count population in mask vcpop */
> +target_ulong HELPER(vcpop_m)(void *v0, void *vs2, CPURISCVState *env,
> + uint32_t desc)
> {
> target_ulong cnt = 0;
> uint32_t vm = vext_vm(desc);
> --
> 2.25.1
>
>
- [PATCH v8 22/78] target/riscv: rvv-1.0: fix address index overflow bug of indexed load/store insns, (continued)
- [PATCH v8 22/78] target/riscv: rvv-1.0: fix address index overflow bug of indexed load/store insns, frank . chang, 2021/10/15
- [PATCH v8 21/78] target/riscv: rvv-1.0: index load and store instructions, frank . chang, 2021/10/15
- [PATCH 23/76] target/riscv: rvv-1.0: amo operations, frank . chang, 2021/10/15
- [PATCH v8 23/78] target/riscv: rvv-1.0: fault-only-first unit stride load, frank . chang, 2021/10/15
- [PATCH v8 24/78] target/riscv: rvv-1.0: load/store whole register instructions, frank . chang, 2021/10/15
- [PATCH v8 25/78] target/riscv: rvv-1.0: update vext_max_elems() for load/store insns, frank . chang, 2021/10/15
- [PATCH v8 27/78] target/riscv: rvv-1.0: floating-point square-root instruction, frank . chang, 2021/10/15
- [PATCH v8 26/78] target/riscv: rvv-1.0: take fractional LMUL into vector max elements calculation, frank . chang, 2021/10/15
- [PATCH v8 28/78] target/riscv: rvv-1.0: floating-point classify instructions, frank . chang, 2021/10/15
- [PATCH v8 29/78] target/riscv: rvv-1.0: count population in mask instruction, frank . chang, 2021/10/15
- Re: [PATCH v8 29/78] target/riscv: rvv-1.0: count population in mask instruction,
Alistair Francis <=
- [PATCH 29/76] target/riscv: rvv-1.0: mask population count instruction, frank . chang, 2021/10/15
- [PATCH v8 30/78] target/riscv: rvv-1.0: find-first-set mask bit instruction, frank . chang, 2021/10/15
- [PATCH v8 31/78] target/riscv: rvv-1.0: set-X-first mask bit instructions, frank . chang, 2021/10/15
- [PATCH v8 32/78] target/riscv: rvv-1.0: iota instruction, frank . chang, 2021/10/15
- [PATCH v8 33/78] target/riscv: rvv-1.0: element index instruction, frank . chang, 2021/10/15
- [PATCH v8 34/78] target/riscv: rvv-1.0: allow load element with sign-extended, frank . chang, 2021/10/15