public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Tsukasa OI <research_trasio@irq.a4lg.com>
To: Nelson Chu <nelson@rivosinc.com>
Cc: binutils@sourceware.org
Subject: Re: [PATCH 2/2] RISC-V: Reorder CSR classes related to 'Ssstateen'
Date: Thu, 29 Dec 2022 15:24:48 +0900	[thread overview]
Message-ID: <c409df09-4d3e-5653-343b-68301cb5ee96@irq.a4lg.com> (raw)
In-Reply-To: <CAPpQWtBRnzcbLpmEvCZHEq3_Ru3_tpfbDbD9hmFU0h0XPDvnHg@mail.gmail.com>

On 2022/12/29 14:19, Nelson Chu wrote:
> On Thu, Dec 29, 2022 at 11:55 AM Tsukasa OI
> <research_trasio@irq.a4lg.com> wrote:
>>
>> From: Tsukasa OI <research_trasio@irq.a4lg.com>
>>
>> This is a generic tidying commit to fix a minor ordering issue on commit
>> 15253318be09 ("RISC-V: Add 'Ssstateen' extension and its CSRs").
> 
> May I ask what the order problem here is which needs to be fixed?

A consensus to make CSR classes roughly ordered by its extension name.

Before:
  Ssaia -> Ssstateen -> Sscofpmf -> Sstc
After:
  Ssaia -> Sscofpmf -> Ssstateen -> Sstc

Yes, this is not a functional problem but I wanted to fix that before it
gets dirtier.

Thanks,
Tsukasa

> 
> Thanks
> Nelson
> 
>> gas/ChangeLog:
>>
>>         * config/tc-riscv.c (enum riscv_csr_class): Reorder 'Ssstateen'-
>>         related CSR classes.
>>         (riscv_csr_address): Likewise.
>> ---
>>  gas/config/tc-riscv.c | 16 ++++++++--------
>>  1 file changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
>> index cc0d74921027..28df21351eef 100644
>> --- a/gas/config/tc-riscv.c
>> +++ b/gas/config/tc-riscv.c
>> @@ -80,11 +80,11 @@ enum riscv_csr_class
>>    CSR_CLASS_SSAIA_AND_H,       /* Ssaia with H */
>>    CSR_CLASS_SSAIA_32,          /* Ssaia, rv32 only */
>>    CSR_CLASS_SSAIA_AND_H_32,    /* Ssaia with H, rv32 only */
>> +  CSR_CLASS_SSCOFPMF,          /* Sscofpmf only */
>> +  CSR_CLASS_SSCOFPMF_32,       /* Sscofpmf RV32 only */
>>    CSR_CLASS_SSSTATEEN,         /* S[ms]stateen only */
>>    CSR_CLASS_SSSTATEEN_AND_H,   /* S[ms]stateen only (with H) */
>>    CSR_CLASS_SSSTATEEN_AND_H_32,        /* S[ms]stateen RV32 only (with H) */
>> -  CSR_CLASS_SSCOFPMF,          /* Sscofpmf only */
>> -  CSR_CLASS_SSCOFPMF_32,       /* Sscofpmf RV32 only */
>>    CSR_CLASS_SSTC,              /* Sstc only */
>>    CSR_CLASS_SSTC_AND_H,                /* Sstc only (with H) */
>>    CSR_CLASS_SSTC_32,           /* Sstc RV32 only */
>> @@ -1065,6 +1065,12 @@ riscv_csr_address (const char *csr_name,
>>                        || csr_class == CSR_CLASS_SSAIA_AND_H_32);
>>        extension = "ssaia";
>>        break;
>> +    case CSR_CLASS_SSCOFPMF_32:
>> +      is_rv32_only = true;
>> +      /* Fall through.  */
>> +    case CSR_CLASS_SSCOFPMF:
>> +      extension = "sscofpmf";
>> +      break;
>>      case CSR_CLASS_SSSTATEEN_AND_H_32:
>>        is_rv32_only = true;
>>        /* Fall through.  */
>> @@ -1074,12 +1080,6 @@ riscv_csr_address (const char *csr_name,
>>      case CSR_CLASS_SSSTATEEN:
>>        extension = "ssstateen";
>>        break;
>> -    case CSR_CLASS_SSCOFPMF_32:
>> -      is_rv32_only = true;
>> -      /* Fall through.  */
>> -    case CSR_CLASS_SSCOFPMF:
>> -      extension = "sscofpmf";
>> -      break;
>>      case CSR_CLASS_SSTC:
>>      case CSR_CLASS_SSTC_AND_H:
>>      case CSR_CLASS_SSTC_32:
>> --
>> 2.39.0
>>
> 

  reply	other threads:[~2022-12-29  6:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-29  3:55 [PATCH 1/2] RISC-V: Simplify riscv_csr_address logic on state enable extensions Tsukasa OI
2022-12-29  3:55 ` [PATCH 2/2] RISC-V: Reorder CSR classes related to 'Ssstateen' Tsukasa OI
2022-12-29  5:19   ` Nelson Chu
2022-12-29  6:24     ` Tsukasa OI [this message]
2022-12-29  5:14 ` [PATCH 1/2] RISC-V: Simplify riscv_csr_address logic on state enable extensions Nelson Chu

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=c409df09-4d3e-5653-343b-68301cb5ee96@irq.a4lg.com \
    --to=research_trasio@irq.a4lg.com \
    --cc=binutils@sourceware.org \
    --cc=nelson@rivosinc.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).