From: Alistair Francis <alistair23@gmail.com>
To: Weiwei Li <liweiwei@iscas.ac.cn>
Cc: "Wei Wu (吴伟)" <lazyparser@gmail.com>,
"open list:RISC-V" <qemu-riscv@nongnu.org>,
wangjunqiang <wangjunqiang@iscas.ac.cn>,
"Bin Meng" <bin.meng@windriver.com>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
"Alistair Francis" <alistair.francis@wdc.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>
Subject: Re: [RESEND PATCH] target/riscv: fix start byte for vmv<nf>r.v when vstart != 0
Date: Thu, 7 Apr 2022 09:07:16 +1000 [thread overview]
Message-ID: <CAKmqyKMB4b_aY2d+QJa2R14gsT8o7uNVKSQjecRHbsRHTcz2Dw@mail.gmail.com> (raw)
In-Reply-To: <20220330021316.18223-1-liweiwei@iscas.ac.cn>
On Wed, Mar 30, 2022 at 12:14 PM Weiwei Li <liweiwei@iscas.ac.cn> wrote:
>
> The spec for vmv<nf>r.v says: 'the instructions operate as if EEW=SEW,
> EMUL = NREG, effective length evl= EMUL * VLEN/SEW.'
>
> So the start byte for vstart != 0 should take sew into account
>
> Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn>
> Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn>
Thanks!
Applied to riscv-to-apply.next
Alistair
> ---
> target/riscv/vector_helper.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c
> index 1d4982ef7f..b5fbdabbb1 100644
> --- a/target/riscv/vector_helper.c
> +++ b/target/riscv/vector_helper.c
> @@ -4890,13 +4890,15 @@ GEN_VEXT_VCOMPRESS_VM(vcompress_vm_d, uint64_t, H8)
> /* Vector Whole Register Move */
> void HELPER(vmvr_v)(void *vd, void *vs2, CPURISCVState *env, uint32_t desc)
> {
> - /* EEW = 8 */
> + /* EEW = SEW */
> uint32_t maxsz = simd_maxsz(desc);
> - uint32_t i = env->vstart;
> + uint32_t sewb = 1 << FIELD_EX64(env->vtype, VTYPE, VSEW);
> + uint32_t startb = env->vstart * sewb;
> + uint32_t i = startb;
>
> memcpy((uint8_t *)vd + H1(i),
> (uint8_t *)vs2 + H1(i),
> - maxsz - env->vstart);
> + maxsz - startb);
>
> env->vstart = 0;
> }
> --
> 2.17.1
>
>
prev parent reply other threads:[~2022-04-06 23:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-30 2:13 [RESEND PATCH] target/riscv: fix start byte for vmv<nf>r.v when vstart != 0 Weiwei Li
2022-03-31 0:15 ` Alistair Francis
2022-04-06 23:07 ` Alistair Francis [this message]
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=CAKmqyKMB4b_aY2d+QJa2R14gsT8o7uNVKSQjecRHbsRHTcz2Dw@mail.gmail.com \
--to=alistair23@gmail.com \
--cc=alistair.francis@wdc.com \
--cc=bin.meng@windriver.com \
--cc=lazyparser@gmail.com \
--cc=liweiwei@iscas.ac.cn \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=wangjunqiang@iscas.ac.cn \
/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).