From: Nelson Chu <nelson@rivosinc.com>
To: Tsukasa OI <research_trasio@irq.a4lg.com>
Cc: Kito Cheng <kito.cheng@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
binutils@sourceware.org
Subject: Re: [PATCH 1/2] RISC-V: Simplify riscv_csr_address logic on state enable extensions
Date: Thu, 29 Dec 2022 13:14:08 +0800 [thread overview]
Message-ID: <CAPpQWtCOUg_dgj5yRnCJ-oJKc3-+k+Kg0+Kod=cMpmEg-kBmsg@mail.gmail.com> (raw)
In-Reply-To: <c509db05e4f1500736f4de994ed2aede544234d5.1672286099.git.research_trasio@irq.a4lg.com>
LGTM, thanks, please commit.
Nelson
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 commit makes CSR class handling for 'Smstateen' and 'Ssstateen'
> extensions simpler using fall-throughs (as used in CSR_CLASS_I{,_32}).
>
> gas/ChangeLog:
>
> * config/tc-riscv.c (riscv_csr_address): Simplify the logic for
> 'Smstateen' and 'Ssstateen' extensions.
> ---
> gas/config/tc-riscv.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
> index 77c0d2e32abf..cc0d74921027 100644
> --- a/gas/config/tc-riscv.c
> +++ b/gas/config/tc-riscv.c
> @@ -1049,9 +1049,10 @@ riscv_csr_address (const char *csr_name,
> case CSR_CLASS_SMAIA:
> extension = "smaia";
> break;
> - case CSR_CLASS_SMSTATEEN:
> case CSR_CLASS_SMSTATEEN_32:
> - is_rv32_only = (csr_class == CSR_CLASS_SMSTATEEN_32);
> + is_rv32_only = true;
> + /* Fall through. */
> + case CSR_CLASS_SMSTATEEN:
> extension = "smstateen";
> break;
> case CSR_CLASS_SSAIA:
> @@ -1064,12 +1065,13 @@ riscv_csr_address (const char *csr_name,
> || csr_class == CSR_CLASS_SSAIA_AND_H_32);
> extension = "ssaia";
> break;
> - case CSR_CLASS_SSSTATEEN:
> - case CSR_CLASS_SSSTATEEN_AND_H:
> case CSR_CLASS_SSSTATEEN_AND_H_32:
> - is_rv32_only = (csr_class == CSR_CLASS_SSSTATEEN_AND_H_32);
> - is_h_required = (csr_class == CSR_CLASS_SSSTATEEN_AND_H
> - || csr_class == CSR_CLASS_SSSTATEEN_AND_H_32);
> + is_rv32_only = true;
> + /* Fall through. */
> + case CSR_CLASS_SSSTATEEN_AND_H:
> + is_h_required = true;
> + /* Fall through. */
> + case CSR_CLASS_SSSTATEEN:
> extension = "ssstateen";
> break;
> case CSR_CLASS_SSCOFPMF_32:
>
> base-commit: dc20b8f00abb74e2c26846c615ec5ba3a62f8677
> --
> 2.39.0
>
prev parent reply other threads:[~2022-12-29 5:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-29 3:55 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
2022-12-29 5:14 ` Nelson Chu [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='CAPpQWtCOUg_dgj5yRnCJ-oJKc3-+k+Kg0+Kod=cMpmEg-kBmsg@mail.gmail.com' \
--to=nelson@rivosinc.com \
--cc=binutils@sourceware.org \
--cc=kito.cheng@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).