public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jin Ma <jinma@linux.alibaba.com>
To: gcc-patches@gcc.gnu.org
Cc: kito.cheng@sifive.com, kito.cheng@gmail.com, palmer@dabbelt.com,
	Jin Ma <jinma@linux.alibaba.com>
Subject: [PATCH] RISC-V: When the TARGET_COMPUTE_MULTILIB hook is implemented, check the version of each extension.
Date: Wed, 22 Feb 2023 17:43:51 +0800	[thread overview]
Message-ID: <20230222094351.1075-1-jinma@linux.alibaba.com> (raw)

When there is an extension with different versions, the result of the TARGET_COMPUTE_MULTILIB hook
is generally wrong, so the version needs to be considered.

gcc/ChangeLog:

	* common/config/riscv/riscv-common.cc (riscv_subset_list::match_score): Match the version
	of each extension.
---
 gcc/common/config/riscv/riscv-common.cc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc
index ebc1ed7d7e4..0a15ff705d1 100644
--- a/gcc/common/config/riscv/riscv-common.cc
+++ b/gcc/common/config/riscv/riscv-common.cc
@@ -331,10 +331,9 @@ riscv_subset_list::match_score (riscv_subset_list *list) const
   /* list must be subset of current this list, otherwise it not safe to
      link.
      TODO: We might give different weight for each extension, but the rule could
-	   be complicated.
-     TODO: We might consider the version of each extension.  */
+	   be complicated.  */
   for (s = list->m_head; s != NULL; s = s->next)
-    if (this->lookup (s->name.c_str ()) != NULL)
+    if (this->lookup (s->name.c_str (), s->major_version, s->minor_version) != NULL)
       score++;
     else
       return 0;
-- 
2.17.1


             reply	other threads:[~2023-02-22  9:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22  9:43 Jin Ma [this message]
2023-02-22 12:42 ` Kito Cheng

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=20230222094351.1075-1-jinma@linux.alibaba.com \
    --to=jinma@linux.alibaba.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kito.cheng@gmail.com \
    --cc=kito.cheng@sifive.com \
    --cc=palmer@dabbelt.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).