public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Kito Cheng <kito@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-10034] RISC-V: Fix wrong expansion for arch-canonicalize
Date: Thu, 26 May 2022 06:50:40 +0000 (GMT)	[thread overview]
Message-ID: <20220526065040.C329238356B4@sourceware.org> (raw)

https://gcc.gnu.org/g:778b1362f9038471f4693410345f25f7ba7c8bc8

commit r11-10034-g778b1362f9038471f4693410345f25f7ba7c8bc8
Author: Kito Cheng <kito.cheng@sifive.com>
Date:   Mon May 9 11:44:30 2022 +0800

    RISC-V: Fix wrong expansion for arch-canonicalize
    
    rv64gcv should exapnd into:
    
    rv64imafdcv_zicsr_zifencei_zve32f_zve32x_zve64d_zve64f_zve64x_zvl128b_zvl32b_zvl64b
    
    but we exapnd fd twice for now:
    
    rv64imafdfdcv_zicsr_zifencei_zve32f_zve32x_zve64d_zve64f_zve64x_zvl128b_zvl32b_zvl64b
    
    gcc/ChangeLog:
    
            * config/riscv/arch-canonicalize: Handle g correctly.
    
    (cherry picked from commit 27239e13b1ba383e2706231917062aa6e14150a8)

Diff:
---
 gcc/config/riscv/arch-canonicalize | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gcc/config/riscv/arch-canonicalize b/gcc/config/riscv/arch-canonicalize
index 3a91cfe687f..980b1d1dcba 100755
--- a/gcc/config/riscv/arch-canonicalize
+++ b/gcc/config/riscv/arch-canonicalize
@@ -45,8 +45,10 @@ def arch_canonicalize(arch, isa_spec):
   is_isa_spec_2p2 = isa_spec == '2.2'
   new_arch = ""
   extra_long_ext = []
+  std_exts = []
   if arch[:5] in ['rv32e', 'rv32i', 'rv32g', 'rv64i', 'rv64g']:
-    new_arch = arch[:5].replace("g", "imafd")
+    new_arch = arch[:5].replace("g", "i")
+    std_exts = ['m', 'a', 'f', 'd']
     if arch[:5] in ['rv32g', 'rv64g']:
       if not is_isa_spec_2p2:
         extra_long_ext = ['zicsr', 'zifencei']
@@ -61,10 +63,10 @@ def arch_canonicalize(arch, isa_spec):
   if long_ext_prefixes_idx:
     first_long_ext_idx = min(long_ext_prefixes_idx)
     long_exts = arch[first_long_ext_idx:].split("_")
-    std_exts = list(arch[5:first_long_ext_idx])
+    std_exts += list(arch[5:first_long_ext_idx])
   else:
     long_exts = []
-    std_exts = list(arch[5:])
+    std_exts += list(arch[5:])
 
   long_exts += extra_long_ext


                 reply	other threads:[~2022-05-26  6:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220526065040.C329238356B4@sourceware.org \
    --to=kito@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /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).