From: Max Chou <max.chou@sifive.com>
To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org
Cc: Palmer Dabbelt <palmer@dabbelt.com>,
Alistair Francis <alistair.francis@wdc.com>,
Weiwei Li <liwei1518@gmail.com>,
Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
Liu Zhiwei <zhiwei_liu@linux.alibaba.com>,
Anton Blanchard <antonb@tenstorrent.com>,
Nutty Liu <liujingqi@lanxincomputing.com>,
Max Chou <max.chou@sifive.com>
Subject: [PATCH v3 2/3] target/riscv: rvv: Apply vext_check_input_eew to vector reduction instructions
Date: Fri, 14 Nov 2025 01:16:03 +0800 [thread overview]
Message-ID: <20251113171604.3034161-3-max.chou@sifive.com> (raw)
In-Reply-To: <20251113171604.3034161-1-max.chou@sifive.com>
From: Anton Blanchard <antonb@tenstorrent.com>
Handle the overlap of source registers with different EEWs for vector
reduction instructions.
Signed-off-by: Anton Blanchard <antonb@tenstorrent.com>
Reviewed-by: Nutty Liu <liujingqi@lanxincomputing.com>
Signed-off-by: Max Chou <max.chou@sifive.com>
---
target/riscv/insn_trans/trans_rvv.c.inc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc
index 422e1a21185..2d9cf27ef76 100644
--- a/target/riscv/insn_trans/trans_rvv.c.inc
+++ b/target/riscv/insn_trans/trans_rvv.c.inc
@@ -3076,6 +3076,7 @@ static bool reduction_check(DisasContext *s, arg_rmrr *a)
{
return require_rvv(s) &&
vext_check_isa_ill(s) &&
+ vext_check_input_eew(s, a->rs1, s->sew, a->rs2, s->sew, a->vm) &&
vext_check_reduction(s, a->rs2);
}
@@ -3092,7 +3093,8 @@ GEN_OPIVV_TRANS(vredxor_vs, reduction_check)
static bool reduction_widen_check(DisasContext *s, arg_rmrr *a)
{
return reduction_check(s, a) && (s->sew < MO_64) &&
- ((s->sew + 1) <= (s->cfg_ptr->elen >> 4));
+ ((s->sew + 1) <= (s->cfg_ptr->elen >> 4)) &&
+ vext_check_input_eew(s, a->rs1, s->sew, a->rs2, s->sew + 1, a->vm);
}
GEN_OPIVV_WIDEN_TRANS(vwredsum_vs, reduction_widen_check)
--
2.43.0
next prev parent reply other threads:[~2025-11-13 17:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-13 17:16 [PATCH v3 0/3] Fix some more RVV source overlap issues Max Chou
2025-11-13 17:16 ` [PATCH v3 1/3] target/riscv: rvv: Apply vext_check_input_eew to vector int/fp compare instructions Max Chou
2025-11-13 17:16 ` Max Chou [this message]
2025-11-13 17:16 ` [PATCH v3 3/3] target/riscv: vadc and vsbc are vm=0 instructions Max Chou
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=20251113171604.3034161-3-max.chou@sifive.com \
--to=max.chou@sifive.com \
--cc=alistair.francis@wdc.com \
--cc=antonb@tenstorrent.com \
--cc=dbarboza@ventanamicro.com \
--cc=liujingqi@lanxincomputing.com \
--cc=liwei1518@gmail.com \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.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).