From: Alistair Francis <alistair23@gmail.com>
To: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Cc: qemu-devel@nongnu.org, qemu-riscv@nongnu.org, palmer@dabbelt.com,
Alistair.Francis@wdc.com, dbarboza@ventanamicro.com,
bmeng.cn@gmail.com, iwei1518@gmail.com
Subject: Re: [PATCH 4/4] disas/riscv: Support zcmop disassemble
Date: Tue, 4 Jun 2024 12:23:51 +1000 [thread overview]
Message-ID: <CAKmqyKOYTz4muba1mrGUSRDk+2-H+pkq9PyFeTJa7X1_aiNVig@mail.gmail.com> (raw)
In-Reply-To: <20240522062905.1799-5-zhiwei_liu@linux.alibaba.com>
On Wed, May 22, 2024 at 4:33 PM LIU Zhiwei <zhiwei_liu@linux.alibaba.com> wrote:
>
> Although in QEMU disassemble, we usually lift compressed instruction
> to an normal format when display the instruction name. For C.MOP.n,
> it is more reasonable to directly display its compressed name, because
> its behavior can be redefined by later extension.
>
> Signed-off-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> disas/riscv.c | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/disas/riscv.c b/disas/riscv.c
> index 4cd769f165..41050246f3 100644
> --- a/disas/riscv.c
> +++ b/disas/riscv.c
> @@ -946,6 +946,14 @@ typedef enum {
> rv_mop_rr_5 = 915,
> rv_mop_rr_6 = 916,
> rv_mop_rr_7 = 917,
> + rv_c_mop_1 = 918,
> + rv_c_mop_3 = 919,
> + rv_c_mop_5 = 920,
> + rv_c_mop_7 = 921,
> + rv_c_mop_9 = 922,
> + rv_c_mop_11 = 923,
> + rv_c_mop_13 = 924,
> + rv_c_mop_15 = 925,
> } rv_op;
>
> /* register names */
> @@ -2176,6 +2184,14 @@ const rv_opcode_data rvi_opcode_data[] = {
> { "mop.rr.5", rv_codec_r, rv_fmt_rd_rs1_rs2, NULL, 0, 0, 0 },
> { "mop.rr.6", rv_codec_r, rv_fmt_rd_rs1_rs2, NULL, 0, 0, 0 },
> { "mop.rr.7", rv_codec_r, rv_fmt_rd_rs1_rs2, NULL, 0, 0, 0 },
> + { "c.mop.1", rv_codec_ci_none, rv_fmt_none, NULL, 0, 0, 0 },
> + { "c.mop.3", rv_codec_ci_none, rv_fmt_none, NULL, 0, 0, 0 },
> + { "c.mop.5", rv_codec_ci_none, rv_fmt_none, NULL, 0, 0, 0 },
> + { "c.mop.7", rv_codec_ci_none, rv_fmt_none, NULL, 0, 0, 0 },
> + { "c.mop.9", rv_codec_ci_none, rv_fmt_none, NULL, 0, 0, 0 },
> + { "c.mop.11", rv_codec_ci_none, rv_fmt_none, NULL, 0, 0, 0 },
> + { "c.mop.13", rv_codec_ci_none, rv_fmt_none, NULL, 0, 0, 0 },
> + { "c.mop.15", rv_codec_ci_none, rv_fmt_none, NULL, 0, 0, 0 },
> };
>
> /* CSR names */
> @@ -2469,6 +2485,13 @@ static void decode_inst_opcode(rv_decode *dec, rv_isa isa)
> break;
> case 2: op = rv_op_c_li; break;
> case 3:
> + if (dec->cfg->ext_zcmop) {
> + if ((((inst >> 2) & 0b111111) == 0b100000) &&
> + (((inst >> 11) & 0b11) == 0b0)) {
> + op = rv_c_mop_1 + ((inst >> 8) & 0b111);
> + break;
> + }
> + }
> switch ((inst >> 7) & 0b11111) {
> case 2: op = rv_op_c_addi16sp; break;
> default: op = rv_op_c_lui; break;
> --
> 2.25.1
>
>
prev parent reply other threads:[~2024-06-04 2:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-22 6:29 [PATCH 0/4] target/riscv: Implement May-Be-Operations(zimop) extension LIU Zhiwei
2024-05-22 6:29 ` [PATCH 1/4] target/riscv: Add zimop extension LIU Zhiwei
2024-05-24 9:46 ` Daniel Henrique Barboza
2024-05-26 0:32 ` LIU Zhiwei
2024-06-04 2:19 ` Alistair Francis
2024-05-22 6:29 ` [PATCH 2/4] disas/riscv: Support zimop disassemble LIU Zhiwei
2024-06-04 2:21 ` Alistair Francis
2024-05-22 6:29 ` [PATCH 3/4] target/riscv: Add zcmop extension LIU Zhiwei
2024-05-24 9:48 ` Daniel Henrique Barboza
2024-06-04 2:23 ` Alistair Francis
2024-05-22 6:29 ` [PATCH 4/4] disas/riscv: Support zcmop disassemble LIU Zhiwei
2024-06-04 2:23 ` 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=CAKmqyKOYTz4muba1mrGUSRDk+2-H+pkq9PyFeTJa7X1_aiNVig@mail.gmail.com \
--to=alistair23@gmail.com \
--cc=Alistair.Francis@wdc.com \
--cc=bmeng.cn@gmail.com \
--cc=dbarboza@ventanamicro.com \
--cc=iwei1518@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).