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 1/1] disas/riscv: Guard dec->cfg dereference for host disassemble
Date: Fri, 6 Dec 2024 07:36:41 -0600 [thread overview]
Message-ID: <bbd8f614-f967-4f7f-82c1-eafdd9fbba68@linaro.org> (raw)
In-Reply-To: <5536d7c4-c3df-4cac-900b-bbb3cb2a8c4d@linux.alibaba.com>
On 12/5/24 22:39, LIU Zhiwei wrote:
>
> Both zcmt and zcmp are not compatible with Zcd, as they reuse some encodings from c.fsdsp.
Ok, fair. A comment about conflicts at that point may help.
>
> Zimop or Zcmop also overlap with other isa extensions, as they are maybe-ops. Other extensions
> such as zicfiss will reuse their encodings.
>
> I think we had better disassemble them to zicifss if it has been implemented on the target cpu. Otherwise
> we disassemble them to maybe-ops.
My point is that they are only belong to zimop until they are assigned, like zicifss.
At that point they *have* a defined meaning in the standard isa.
So, yes, disassemble as zicifss, but always, not "if it has been implemented in the target
cpu".
>>> + if (((i == 0) || cfg) && guard_func(cfg)) {
>>
>> This should be i == 0 || (cfg && guard_func(cfg)).
>
> OK. Although I think they are both right.
i = 0
cfg = NULL
(0 == 0 || NULL) && guard_func(NULL)
-> (true || false) && guard_func(NULL)
-> true && guard_func(NULL)
-> guard_func(NULL)
-> boom.
Or are you saying it won't go boom because we happen to know the 0th guard_func only
returns true? There's still no reason to call it...
r~
next prev parent reply other threads:[~2024-12-06 13:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 3:24 [PATCH 1/1] disas/riscv: Guard dec->cfg dereference for host disassemble LIU Zhiwei
2024-12-06 3:36 ` Richard Henderson
2024-12-06 4:39 ` LIU Zhiwei
2024-12-06 13:36 ` Richard Henderson [this message]
2024-12-07 1:27 ` LIU Zhiwei
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=bbd8f614-f967-4f7f-82c1-eafdd9fbba68@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).