public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: When the TARGET_COMPUTE_MULTILIB hook is implemented, check the version of each extension.
@ 2023-02-22  9:43 Jin Ma
  2023-02-22 12:42 ` Kito Cheng
  0 siblings, 1 reply; 2+ messages in thread
From: Jin Ma @ 2023-02-22  9:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: kito.cheng, kito.cheng, palmer, Jin Ma

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] RISC-V: When the TARGET_COMPUTE_MULTILIB hook is implemented, check the version of each extension.
  2023-02-22  9:43 [PATCH] RISC-V: When the TARGET_COMPUTE_MULTILIB hook is implemented, check the version of each extension Jin Ma
@ 2023-02-22 12:42 ` Kito Cheng
  0 siblings, 0 replies; 2+ messages in thread
From: Kito Cheng @ 2023-02-22 12:42 UTC (permalink / raw)
  To: Jin Ma; +Cc: gcc-patches, kito.cheng, palmer

Hi Jin:

Curious, did you introduce version info into the multi-lib path in
your donwstream GCC? I suspect we need a more complete solution to
deal with the multiversion issue, so it would be great if you can
provide more experience with this part?

Thanks :)


On Wed, Feb 22, 2023 at 5:44 PM Jin Ma <jinma@linux.alibaba.com> wrote:
>
> 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
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-22 12:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-22  9:43 [PATCH] RISC-V: When the TARGET_COMPUTE_MULTILIB hook is implemented, check the version of each extension Jin Ma
2023-02-22 12:42 ` Kito Cheng

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).