From: Richard Henderson <richard.henderson@linaro.org>
To: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>, qemu-devel@nongnu.org
Cc: qemu-riscv@nongnu.org, palmer@dabbelt.com,
alistair.francis@wdc.com, dbarboza@ventanamicro.com,
liwei1518@gmail.com, bmeng.cn@gmail.com
Subject: Re: [PATCH v2 2/3] target/riscv: Add MXLEN check for F/D/Q applies to zama16b
Date: Fri, 2 Aug 2024 16:46:26 +1000 [thread overview]
Message-ID: <e59ce92a-b8ef-4ddc-b385-14ae89db02e2@linaro.org> (raw)
In-Reply-To: <84313f06-fae5-471e-b218-2640554f6c46@linux.alibaba.com>
On 8/2/24 16:42, LIU Zhiwei wrote:
>
> On 2024/8/2 13:47, Richard Henderson wrote:
>> On 8/2/24 13:16, LIU Zhiwei wrote:
>>> Zama16b loads and stores of no more than MXLEN bits defined in the F, D, and Q
>>> extensions.
>>>
>>> Signed-off-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
>>> ---
>>> target/riscv/insn_trans/trans_rvd.c.inc | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/target/riscv/insn_trans/trans_rvd.c.inc b/target/riscv/insn_trans/
>>> trans_rvd.c.inc
>>> index 2be037930a..dbe508c7e0 100644
>>> --- a/target/riscv/insn_trans/trans_rvd.c.inc
>>> +++ b/target/riscv/insn_trans/trans_rvd.c.inc
>>> @@ -52,7 +52,7 @@ static bool trans_fld(DisasContext *ctx, arg_fld *a)
>>> * in the F, D, and Q extensions. Otherwise, it falls through to default
>>> * MO_ATOM_IFALIGN.
>>> */
>>> - if ((ctx->xl >= MXL_RV64) && (ctx->cfg_ptr->ext_zama16b)) {
>>> + if ((ctx->misa_mxl_max >= MXL_RV64) && ctx->cfg_ptr->ext_zama16b) {
>>> memop |= MO_ATOM_WITHIN16;
>>> }
>>> @@ -72,7 +72,7 @@ static bool trans_fsd(DisasContext *ctx, arg_fsd *a)
>>> REQUIRE_FPU;
>>> REQUIRE_EXT(ctx, RVD);
>>> - if (ctx->cfg_ptr->ext_zama16b) {
>>> + if ((ctx->misa_mxl_max >= MXL_RV64) && ctx->cfg_ptr->ext_zama16b) {
>>> memop |= MO_ATOM_WITHIN16;
>>> }
>>
>> I guess this is ok, because MXL cannot currently be changed. But since that is a
>> possible future enhancement, perhaps add a get_mxl(ctx) accessor anyway, for
>> documentation purposes.
> Can we use the existing get_xl_max(ctx) instead of adding a new get_mxl(ctx).
Yes, that looks fine.
That could be renamed get_mxl. :-)
r~
next prev parent reply other threads:[~2024-08-02 6:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 3:16 [PATCH v2 0/3] target/riscv: Remove redundant insn length check for zama16b LIU Zhiwei
2024-08-02 3:16 ` [PATCH v2 1/3] " LIU Zhiwei
2024-08-02 5:38 ` Richard Henderson
2024-08-02 6:31 ` LIU Zhiwei
2024-08-02 3:16 ` [PATCH v2 2/3] target/riscv: Add MXLEN check for F/D/Q applies to zama16b LIU Zhiwei
2024-08-02 5:47 ` Richard Henderson
2024-08-02 6:21 ` LIU Zhiwei
2024-08-02 6:45 ` Richard Henderson
2024-08-02 6:53 ` LIU Zhiwei
2024-08-02 6:42 ` LIU Zhiwei
2024-08-02 6:46 ` Richard Henderson [this message]
2024-08-02 3:16 ` [PATCH v2 3/3] target/riscv: Relax fld alignment requirement LIU Zhiwei
2024-08-02 5:52 ` Richard Henderson
2024-08-02 6:27 ` LIU Zhiwei
2024-08-02 6:49 ` Richard Henderson
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=e59ce92a-b8ef-4ddc-b385-14ae89db02e2@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=bmeng.cn@gmail.com \
--cc=dbarboza@ventanamicro.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).