public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Tsukasa OI <research_trasio@irq.a4lg.com>
Cc: binutils@sourceware.org, Nelson Chu <nelson.chu@sifive.com>,
	Kito Cheng <kito.cheng@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>
Subject: Re: [RFC PATCH 3/5] RISC-V: Mapping symbols with ISA string on assembler
Date: Thu, 11 Aug 2022 14:12:07 +0200	[thread overview]
Message-ID: <d1dcf876-5a00-8783-e2b1-a3ace6a2d403@suse.com> (raw)
In-Reply-To: <96c38e56-6454-5eb0-c0e6-6652ae14aa71@irq.a4lg.com>

On 11.08.2022 13:43, Tsukasa OI wrote:
> On 2022/08/11 16:31, Jan Beulich wrote:
>> On 11.08.2022 09:00, Tsukasa OI via Binutils wrote:
>>> @@ -3855,11 +3887,15 @@ s_riscv_option (int x ATTRIBUTE_UNUSED)
>>>    if (strcmp (name, "rvc") == 0)
>>>      {
>>>        riscv_update_subset (&riscv_rps_as, "+c");
>>> +      updated_riscv_subsets = true;
>>> +      riscv_opts.arch_is_default = false;
>>>        riscv_set_rvc (true);
>>>      }
>>>    else if (strcmp (name, "norvc") == 0)
>>>      {
>>>        riscv_update_subset (&riscv_rps_as, "-c");
>>> +      updated_riscv_subsets = true;
>>> +      riscv_opts.arch_is_default = false;
>>>        riscv_set_rvc (false);
>>>      }
>>>    else if (strcmp (name, "pic") == 0)
>>> @@ -3880,6 +3916,8 @@ s_riscv_option (int x ATTRIBUTE_UNUSED)
>>>        if (ISSPACE (*name) && *name != '\0')
>>>  	name++;
>>>        riscv_update_subset (&riscv_rps_as, name);
>>> +      updated_riscv_subsets = true;
>>> +      riscv_opts.arch_is_default = false;
>>
>> Seeing that all three call sites of riscv_update_subset() gain the
>> same extra code - wouldn't these assignments better move into that
>> function? (The function living in bfd may make this difficult, but
>> it being used by gas only suggests it might better be moved over. Or
>> otherwise maybe add a local helper function doing all three things?)
> 
> Adding a local helper function would be the best.

Just out of curiosity, could you explain to me why the function is
to remain in bfd when gas is its only user?

Jan

  reply	other threads:[~2022-08-11 12:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-05  9:36 [PATCH] RISC-V: Output mapping symbols with ISA string once .option arch is used Nelson Chu
2022-08-05 10:31 ` Tsukasa OI
2022-08-11  7:00 ` [RFC PATCH 0/5] RISC-V: Support mapping symbols with ISA string Tsukasa OI
2022-08-11  7:00   ` [RFC PATCH 1/5] RISC-V: Use bool on riscv_set_options members Tsukasa OI
2022-08-11  7:00   ` [RFC PATCH 2/5] gas: Copyediting on tc-riscv.c Tsukasa OI
2022-08-11  7:00   ` [RFC PATCH 3/5] RISC-V: Mapping symbols with ISA string on assembler Tsukasa OI
2022-08-11  7:31     ` Jan Beulich
2022-08-11 11:43       ` Tsukasa OI
2022-08-11 12:12         ` Jan Beulich [this message]
2022-08-11  7:00   ` [RFC PATCH 4/5] RISC-V: Mapping symbols with ISA string on disassembler Tsukasa OI
2022-08-11  7:00   ` [RFC PATCH 5/5] RISC-V: New testcases for mapping symbols w/ ISA Tsukasa OI

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=d1dcf876-5a00-8783-e2b1-a3ace6a2d403@suse.com \
    --to=jbeulich@suse.com \
    --cc=binutils@sourceware.org \
    --cc=kito.cheng@sifive.com \
    --cc=nelson.chu@sifive.com \
    --cc=palmer@dabbelt.com \
    --cc=research_trasio@irq.a4lg.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 read-only IMAP folder(s) and NNTP newsgroup(s).