public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Kito Cheng <kito.cheng@sifive.com>
To: Jiawei <jiawei@iscas.ac.cn>
Cc: binutils@sourceware.org, nelson@rivosinc.com, palmer@dabbelt.com,
	 jbeulich@suse.com, research_trasio@irq.a4lg.com,
	christoph.muellner@vrull.eu,  jeremy.bennett@embecosm.com,
	nandni.jamnadas@embecosm.com,  mary.bennett@embecosm.com,
	charlie.keaney@embecosm.com,  simon.cook@embecosm.com,
	sinan.lin@linux.alibaba.com,  gaofei@eswincomputing.com,
	fujin.zhao@foxmail.com, wuwei2016@iscas.ac.cn,
	 shihua@iscas.ac.cn, shiyulong@iscas.ac.cn,
	chenyixuan@iscas.ac.cn
Subject: Re: [PATCH v4 1/2] RISC-V: Support Zcmp push/pop instructions.
Date: Fri, 26 Jan 2024 16:33:00 +0800	[thread overview]
Message-ID: <CALLt3TgpDpkPBO0PJ4rYdrnGhiVSiv_Y7-30CFbMUPmFxY_z2A@mail.gmail.com> (raw)
In-Reply-To: <20240124093725.567220-1-jiawei@iscas.ac.cn>

> +/* If set, disassemble numeric register names instead of ABI names.  */
> +static int numeric = false;
>
>  /* Set default RISC-V disassembler options.  */
>
> @@ -84,6 +86,7 @@ set_default_riscv_dis_options (void)
>    riscv_gpr_names = riscv_gpr_names_abi;
>    riscv_fpr_names = riscv_fpr_names_abi;
>    no_aliases = false;
> +  numeric = false;
>  }
>
>  /* Parse RISC-V disassembler option (without arguments).  */
> @@ -97,6 +100,7 @@ parse_riscv_dis_option_without_args (const char *option)
>      {
>        riscv_gpr_names = riscv_gpr_names_numeric;
>        riscv_fpr_names = riscv_fpr_names_numeric;
> +      numeric = true;
>      }
>    else
>      return false;
> @@ -215,6 +219,50 @@ maybe_print_address (struct riscv_private_data *pd, int base_reg, int offset,
>      pd->print_addr = (bfd_vma)(uint32_t)pd->print_addr;
>  }
>
> +/* Get Zcmp reg_list field.  */
> +
> +static void
> +print_reg_list (disassemble_info *info, insn_t l)
> +{

bool numeric = riscv_gpr_names == riscv_gpr_names_numeric;

then you can drop numeric from global variables.

> +  unsigned reg_list = (int)EXTRACT_OPERAND (REG_LIST, l);
> +  unsigned r_start = numeric ? X_S2 : X_S0;
> +  info->fprintf_func (info->stream, "%s", riscv_gpr_names[X_RA]);
> +
> +  if (reg_list == 5)
> +    info->fprintf_func (info->stream, ",%s", riscv_gpr_names[X_S0]);
> +  else if (reg_list == 6 || (numeric && reg_list > 6))
> +    info->fprintf_func (info->stream, ",%s-%s",
> +         riscv_gpr_names[X_S0],
> +         riscv_gpr_names[X_S1]);
> +

      parent reply	other threads:[~2024-01-26  8:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24  9:37 Jiawei
2024-01-24  9:37 ` [PATCH v4 2/2] RISC-V: Support Zcmp cm.mv instructions Jiawei
2024-01-26  8:33 ` Kito Cheng [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=CALLt3TgpDpkPBO0PJ4rYdrnGhiVSiv_Y7-30CFbMUPmFxY_z2A@mail.gmail.com \
    --to=kito.cheng@sifive.com \
    --cc=binutils@sourceware.org \
    --cc=charlie.keaney@embecosm.com \
    --cc=chenyixuan@iscas.ac.cn \
    --cc=christoph.muellner@vrull.eu \
    --cc=fujin.zhao@foxmail.com \
    --cc=gaofei@eswincomputing.com \
    --cc=jbeulich@suse.com \
    --cc=jeremy.bennett@embecosm.com \
    --cc=jiawei@iscas.ac.cn \
    --cc=mary.bennett@embecosm.com \
    --cc=nandni.jamnadas@embecosm.com \
    --cc=nelson@rivosinc.com \
    --cc=palmer@dabbelt.com \
    --cc=research_trasio@irq.a4lg.com \
    --cc=shihua@iscas.ac.cn \
    --cc=shiyulong@iscas.ac.cn \
    --cc=simon.cook@embecosm.com \
    --cc=sinan.lin@linux.alibaba.com \
    --cc=wuwei2016@iscas.ac.cn \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).