From: Richard Henderson <richard.henderson@linaro.org>
To: ~liuxu <liuxu@nucleisys.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH qemu] target/riscv: Add Zilsd and Zcmlsd extension support
Date: Mon, 8 Jul 2024 08:37:08 -0700 [thread overview]
Message-ID: <a3e6cd8b-068d-465b-a95c-45e55c2c289d@linaro.org> (raw)
In-Reply-To: <171997728731.22972.8946294105229314138-0@git.sr.ht>
On 7/2/24 01:10, ~liuxu wrote:
> +static bool gen_load_ld(DisasContext *ctx, arg_lb *a, MemOp memop, int flag)
> +{
> + REQUIRE_ZCMLSD(ctx);
> + REQUIRE_32BIT(ctx);
> +
> + if (flag&&a->rd==0){
> + return false;
> + }
> +
> + TCGv dest_low= dest_gpr(ctx, a->rd);
> + TCGv addr = get_address(ctx, a->rs1, a->imm);
> + tcg_gen_qemu_ld_tl(dest_low, addr, ctx->mem_idx, memop);
> +
> + TCGv dest_high= dest_gpr(ctx, a->rd+1);
> + tcg_gen_addi_tl(addr, addr, 32);
> + tcg_gen_qemu_ld_tl(dest_high, addr, ctx->mem_idx, memop);
> +
> + gen_set_gpr(ctx, a->rd, dest_low);
> + gen_set_gpr(ctx, a->rd+1, dest_high);
> +
> + return true;
> +}
You need to impliment this as one 64-bit load and split the data afterward with
tcg_gen_extr_i64_tl(). That will also fix the incorrect increment that Alistair noted.
r~
prev parent reply other threads:[~2024-07-08 15:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-02 8:10 [PATCH qemu] target/riscv: Add Zilsd and Zcmlsd extension support ~liuxu
2024-07-08 3:54 ` Alistair Francis
2024-07-08 15:37 ` Richard Henderson [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=a3e6cd8b-068d-465b-a95c-45e55c2c289d@linaro.org \
--to=richard.henderson@linaro.org \
--cc=liuxu@nucleisys.com \
--cc=qemu-devel@nongnu.org \
/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).