From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by sourceware.org (Postfix) with ESMTPS id 3C5E63858D33 for ; Wed, 22 Feb 2023 12:42:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C5E63858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-lf1-x12f.google.com with SMTP id w27so9885516lfu.4 for ; Wed, 22 Feb 2023 04:42:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=nvlgaLs5Kpe8q+8dxECqmwe4Ah6entAsO/dXcrOjYrw=; b=B1gToGjizoSjNkIulHQArhMqDjxLdOmUhbZw4JHzZ48qzDv3S7mjiPLuQWXXZcfdsa 3fXCCV/XdxUa5TmPzehgPt7eEcwxpwCORnZbrGDVVBlgHmadPPG1pGqB0oFSyPOxOvnC cygPLLuL7anAUXK6o2IJm4ON/QIithfKTbZz2/NtNozgkZ8QcLh3QK10WloVXJ0J7c1d qONX3J0YD/SyDw/cZys1MklYAxJYtp1n0LN44pxjlgSN9XzCskJFGDxBIAXDoDmfZDjz PwMUYrw3f+q63ZvNaVg40qaKPowMvqA5xlrkBpnxjTy1Zvz6lmB5vNKLValA48UY+Mra tQdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nvlgaLs5Kpe8q+8dxECqmwe4Ah6entAsO/dXcrOjYrw=; b=VMPtkIPRRCPfwCE+PjAS09BXzqrczmX+aNfdDAI95HtAjVMzoXVrnclLTlaRCHuoIc JnbLX+uV3xTY+G0qN2KgQRwF3DHEMFAo3fkWl/c6gmNeTMS2pmUmWAgikll3Xf128SEw kl5ikhyGjDUMa36L00D3/b3FRVUEXxRQz0ytQxtnv0qqAU5VfkY8EqcdXiNyYVn1rg4o i8LRQsD3QXPC9/Mjl7LROLjkB8YLOkh5iZgo7yLMQsqulLDsDH/qq1dmaPIKjnWS0Jh1 Wn5abt3ex1L8cox+ma/a8040YF09v0JhHCmpKpulPCDXXPXtSXRjIaFfyApRqkwb7b8p 6Wnw== X-Gm-Message-State: AO0yUKUmLfIpXvfzEyIjCknYM6YEAXQThN8MyyfRJuOvhXg3RkXDVrxU 66pzsZi4HViTEEY9cV3TMetIXHE/1B4Ceq+7bgSEoA== X-Google-Smtp-Source: AK7set8JuzEG8k3wT4ReUiW6FeQYYkjLLc9tEfVFCf/esELp+pLw+cckqFRCcHPW9uPZbf9f3Qc/eI8UvTEvPIZQOuU= X-Received: by 2002:ac2:48af:0:b0:4db:1abe:35f6 with SMTP id u15-20020ac248af000000b004db1abe35f6mr2710061lfg.3.1677069742509; Wed, 22 Feb 2023 04:42:22 -0800 (PST) MIME-Version: 1.0 References: <20230222094351.1075-1-jinma@linux.alibaba.com> In-Reply-To: <20230222094351.1075-1-jinma@linux.alibaba.com> From: Kito Cheng Date: Wed, 22 Feb 2023 20:42:11 +0800 Message-ID: Subject: Re: [PATCH] RISC-V: When the TARGET_COMPUTE_MULTILIB hook is implemented, check the version of each extension. To: Jin Ma Cc: gcc-patches@gcc.gnu.org, kito.cheng@gmail.com, palmer@dabbelt.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 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 >