qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alistair Francis <alistair23@gmail.com>
To: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Cc: qemu-devel@nongnu.org, qemu-riscv@nongnu.org,
	alistair.francis@wdc.com,  bmeng@tinylab.org,
	liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com,
	 palmer@rivosinc.com, richard.henderson@linaro.org,
	max.chou@sifive.com
Subject: Re: [PATCH v3 12/13] trans_rvv.c.inc: use vext_get_vlmax() in trans_vrgather_v*()
Date: Mon, 22 Jan 2024 13:11:53 +1000	[thread overview]
Message-ID: <CAKmqyKMc6NSZQt61pwAsSM1Qt-wHBMKP3JmYZteX20u1Mi_f9A@mail.gmail.com> (raw)
In-Reply-To: <20240116205817.344178-13-dbarboza@ventanamicro.com>

On Wed, Jan 17, 2024 at 7:02 AM Daniel Henrique Barboza
<dbarboza@ventanamicro.com> wrote:
>
> Use the helper instead of calculating vlmax by hand.
>
> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  target/riscv/insn_trans/trans_rvv.c.inc | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc
> index b4663b6e1f..9e101ab434 100644
> --- a/target/riscv/insn_trans/trans_rvv.c.inc
> +++ b/target/riscv/insn_trans/trans_rvv.c.inc
> @@ -3535,8 +3535,7 @@ static bool trans_vrgather_vx(DisasContext *s, arg_rmrr *a)
>      }
>
>      if (a->vm && s->vl_eq_vlmax && !(s->vta && s->lmul < 0)) {
> -        int scale = s->lmul - (s->sew + 3);
> -        int vlmax = s->cfg_ptr->vlen >> -scale;
> +        int vlmax = vext_get_vlmax(s->cfg_ptr->vlenb, s->sew, s->lmul);
>          TCGv_i64 dest = tcg_temp_new_i64();
>
>          if (a->rs1 == 0) {
> @@ -3566,8 +3565,7 @@ static bool trans_vrgather_vi(DisasContext *s, arg_rmrr *a)
>      }
>
>      if (a->vm && s->vl_eq_vlmax && !(s->vta && s->lmul < 0)) {
> -        int scale = s->lmul - (s->sew + 3);
> -        int vlmax = s->cfg_ptr->vlen >> -scale;
> +        int vlmax = vext_get_vlmax(s->cfg_ptr->vlenb, s->sew, s->lmul);
>          if (a->rs1 >= vlmax) {
>              tcg_gen_gvec_dup_imm(MO_64, vreg_ofs(s, a->rd),
>                                   MAXSZ(s), MAXSZ(s), 0);
> --
> 2.43.0
>
>


  reply	other threads:[~2024-01-22  3:12 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 20:58 [PATCH v3 00/13] target/riscv: add 'cpu->cfg.vlenb', remove 'cpu->cfg.vlen' Daniel Henrique Barboza
2024-01-16 20:58 ` [PATCH v3 01/13] target/riscv: add 'vlenb' field in cpu->cfg Daniel Henrique Barboza
2024-01-22  2:38   ` Alistair Francis
2024-01-16 20:58 ` [PATCH v3 02/13] target/riscv/csr.c: use 'vlenb' instead of 'vlen' Daniel Henrique Barboza
2024-01-22  2:55   ` Alistair Francis
2024-01-16 20:58 ` [PATCH v3 03/13] target/riscv/gdbstub.c: use 'vlenb' instead of shifting 'vlen' Daniel Henrique Barboza
2024-01-22  2:55   ` Alistair Francis
2024-01-16 20:58 ` [PATCH v3 04/13] target/riscv/insn_trans/trans_rvbf16.c.inc: use cpu->cfg.vlenb Daniel Henrique Barboza
2024-01-22  2:56   ` Alistair Francis
2024-01-16 20:58 ` [PATCH v3 05/13] target/riscv/insn_trans/trans_rvv.c.inc: use 'vlenb' Daniel Henrique Barboza
2024-01-22  2:58   ` Alistair Francis
2024-01-16 20:58 ` [PATCH v3 06/13] target/riscv/insn_trans/trans_rvvk.c.inc: " Daniel Henrique Barboza
2024-01-22  2:59   ` Alistair Francis
2024-01-16 20:58 ` [PATCH v3 07/13] target/riscv/vector_helper.c: " Daniel Henrique Barboza
2024-01-22  2:59   ` Alistair Francis
2024-01-16 20:58 ` [PATCH v3 08/13] target/riscv/vector_helper.c: use vlenb in HELPER(vsetvl) Daniel Henrique Barboza
2024-01-22  3:00   ` Alistair Francis
2024-01-16 20:58 ` [PATCH v3 09/13] target/riscv/insn_trans/trans_rvv.c.inc: use 'vlenb' in MAXSZ() Daniel Henrique Barboza
2024-01-22  3:04   ` Alistair Francis
2024-01-16 20:58 ` [PATCH v3 10/13] target/riscv/cpu.h: use 'vlenb' in vext_get_vlmax() Daniel Henrique Barboza
2024-01-22  3:05   ` Alistair Francis
2024-01-16 20:58 ` [PATCH v3 11/13] target/riscv: change vext_get_vlmax() arguments Daniel Henrique Barboza
2024-01-22  3:09   ` Alistair Francis
2024-01-16 20:58 ` [PATCH v3 12/13] trans_rvv.c.inc: use vext_get_vlmax() in trans_vrgather_v*() Daniel Henrique Barboza
2024-01-22  3:11   ` Alistair Francis [this message]
2024-01-16 20:58 ` [PATCH v3 13/13] target/riscv/cpu.c: remove cpu->cfg.vlen Daniel Henrique Barboza
2024-01-22  3:14   ` Alistair Francis
2024-01-22  3:39 ` [PATCH v3 00/13] target/riscv: add 'cpu->cfg.vlenb', remove 'cpu->cfg.vlen' Alistair Francis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKmqyKMc6NSZQt61pwAsSM1Qt-wHBMKP3JmYZteX20u1Mi_f9A@mail.gmail.com \
    --to=alistair23@gmail.com \
    --cc=alistair.francis@wdc.com \
    --cc=bmeng@tinylab.org \
    --cc=dbarboza@ventanamicro.com \
    --cc=liwei1518@gmail.com \
    --cc=max.chou@sifive.com \
    --cc=palmer@rivosinc.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=zhiwei_liu@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).