From: Richard Henderson <richard.henderson@linaro.org>
To: "Christoph Müllner" <christoph.muellner@vrull.eu>
Cc: qemu-riscv@nongnu.org, qemu-devel@nongnu.org,
Alistair Francis <alistair.francis@wdc.com>,
Bin Meng <bin.meng@windriver.com>,
Philipp Tomsich <philipp.tomsich@vrull.eu>,
Palmer Dabbelt <palmer@dabbelt.com>,
Jeff Law <jeffreyalaw@gmail.com>,
Tsukasa OI <research_trasio@irq.a4lg.com>,
liweiwei@iscas.ac.cn,
Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
Liu Zhiwei <zhiwei_liu@linux.alibaba.com>,
Rob Bradford <rbradford@rivosinc.com>
Subject: Re: [PATCH v5] riscv: Add support for the Zfa extension
Date: Fri, 30 Jun 2023 19:47:17 +0200 [thread overview]
Message-ID: <affadf63-7080-14ec-1b53-f7373cf06a68@linaro.org> (raw)
In-Reply-To: <CAEg0e7gsUNj=PmvvVDNTH+jc63sqrRBK_UiT0AEHMWGpYOjGfw@mail.gmail.com>
On 6/30/23 17:11, Christoph Müllner wrote:
> On Fri, Jun 30, 2023 at 4:03 PM Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>
>> On 6/30/23 13:52, Christoph Muellner wrote:
>>> +bool trans_fmvh_x_d(DisasContext *ctx, arg_fmvh_x_d *a)
>>> +{
>>> + REQUIRE_FPU;
>>> + REQUIRE_ZFA(ctx);
>>> + REQUIRE_EXT(ctx, RVD);
>>> + REQUIRE_32BIT(ctx);
>>> +
>>> + TCGv dst = dest_gpr(ctx, a->rd);
>>> + TCGv_i64 t1 = tcg_temp_new_i64();
>>> +
>>> + tcg_gen_extract_i64(t1, cpu_fpr[a->rs1], 32, 32);
>>> + tcg_gen_trunc_i64_tl(dst, t1);
>>> + gen_set_gpr(ctx, a->rd, dst);
>>
>> I think you would prefer
>>
>> tcg_gen_srai_tl(t1, cpu_fpr[rs1], 32);
>
> sari_tl() will not work, because cpu_fpr[a->rs1] is a TCGv_i64.
> So I need to use sari_i64() and keep the trunc_i64_tl():
>
> TCGv dst = dest_gpr(ctx, a->rd);
> TCGv_i64 t1 = tcg_temp_new_i64();
> tcg_gen_sari_i64(dst, cpu_fpr[a->rs1], 32);
> tcg_gen_trunc_i64_tl(dst, t1);
> gen_set_gpr(ctx, a->rd, dst);
I beg your pardon, typo. You have grasped my intent, thanks.
r~
prev parent reply other threads:[~2023-06-30 17:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-30 11:52 [PATCH v5] riscv: Add support for the Zfa extension Christoph Muellner
2023-06-30 13:50 ` Richard Henderson
2023-06-30 14:03 ` Richard Henderson
2023-06-30 15:11 ` Christoph Müllner
2023-06-30 17:47 ` 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=affadf63-7080-14ec-1b53-f7373cf06a68@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=bin.meng@windriver.com \
--cc=christoph.muellner@vrull.eu \
--cc=dbarboza@ventanamicro.com \
--cc=jeffreyalaw@gmail.com \
--cc=liweiwei@iscas.ac.cn \
--cc=palmer@dabbelt.com \
--cc=philipp.tomsich@vrull.eu \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=rbradford@rivosinc.com \
--cc=research_trasio@irq.a4lg.com \
--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).