From patchwork Thu Mar 9 02:16:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mayshao-oc X-Patchwork-Id: 66558 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp48014wrd; Wed, 8 Mar 2023 18:18:42 -0800 (PST) X-Google-Smtp-Source: AK7set/wTcZSfsRs4LezrER8/ZN2ixqxoNvXCOq9hyscH7XJ1M1fQFTr8zkU24KxPuTuGJNdV1Gn X-Received: by 2002:a17:906:1410:b0:8f6:76da:90dd with SMTP id p16-20020a170906141000b008f676da90ddmr18271457ejc.64.1678328322776; Wed, 08 Mar 2023 18:18:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678328322; cv=none; d=google.com; s=arc-20160816; b=YkFCydA83fWIamaxH9i58uXTOP00Gt90p+pzitj1JPYFR3OHJWJHEhylh/LEtKRDm4 pIXq/t9Gw4OME9f3QJOspw83ZjzyLfjcWSd3ksQZlipPbYsUOaIEc6rH/0v3gO6Hinp6 aEXiDLAWvJHD0+CidNjr8sH0/QssJE3xlH3i1m6nCdVyXddcGlaYe4TWPBbXbBa2rsBy YlQwNnu+j39BOlZCKoeIKQ/ibYsDatJ5qaZDP/tHC5zlnHa/DqkBXIWWDjYbhzinxPCD /MWBmNpALIuPVP0d76eQTEinaNpxdrL85K43JsxS0pyoJjey/C1bWL1cjZq6SjYz0Mpl dTIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dmarc-filter :delivered-to; bh=+A409pBbdzuZpnY2QYRGSh64P4PLlDW0FbKxCX0NUGE=; b=hqGvqRoa7gLFhLBF756xl4t1QwZKS65nX/2MLFwFblwn+9DIGbQ8d2VQNORDpHuibr Hj8zFs5/Tdgaqv1gMPhGh8G26eW+HYhMicR7mH+4Bx8FD7MXKxcl/3dtWUYP7C+Wr46/ ny1ni2mzZMw2YoGPNyoe2SFeLAA/HjPZSUlxBLbcgFk1U+cEPXEADfw1zlK94ULDnH/t vBiYr8S5u9tHzlw3cBQmwPBuLMcd548bNv8hypRbsFw20DulXjxfk46Xi+uuEPnqYrof wXxSKChlA4KeyIpYlapdPJVGNcNq6XxjvYc8xv25Cu9re1yQ1Jz7mYKj0+qQN/4PTHSP pOLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id y14-20020a170906914e00b008d2e6df3b6dsi6573607ejw.712.2023.03.08.18.18.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 18:18:42 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 71169384D196 for ; Thu, 9 Mar 2023 02:17:52 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx1.zhaoxin.com (MX1.ZHAOXIN.COM [210.0.225.12]) by sourceware.org (Postfix) with ESMTPS id 97CA73850864 for ; Thu, 9 Mar 2023 02:16:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 97CA73850864 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=zhaoxin.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=zhaoxin.com X-ASG-Debug-ID: 1678328198-086e23383c02b80001-Gfy7bY Received: from ZXSHMBX2.zhaoxin.com (ZXSHMBX2.zhaoxin.com [10.28.252.164]) by mx1.zhaoxin.com with ESMTP id X0itnwIYnWvTf2Ml (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 09 Mar 2023 10:16:38 +0800 (CST) X-Barracuda-Envelope-From: Mayshao-oc@zhaoxin.com X-Barracuda-RBL-Trusted-Forwarder: 10.28.252.164 Received: from ZXBJMBX02.zhaoxin.com (10.29.252.6) by ZXSHMBX2.zhaoxin.com (10.28.252.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 9 Mar 2023 10:16:37 +0800 Received: from zhaoxin.zhaoxin.com (10.29.8.5) by ZXBJMBX02.zhaoxin.com (10.29.252.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 9 Mar 2023 10:16:36 +0800 X-Barracuda-RBL-Trusted-Forwarder: 10.28.252.164 From: mayshao X-Barracuda-RBL-Trusted-Forwarder: 10.29.252.6 To: CC: , , , , , , mayshao-oc Subject: [gcc10 backport] i386: Call get_available_features for all CPUs with max_level >= 1 [PR100758] Date: Thu, 9 Mar 2023 10:16:36 +0800 X-ASG-Orig-Subj: [gcc10 backport] i386: Call get_available_features for all CPUs with max_level >= 1 [PR100758] Message-ID: <20230309021636.19815-1-mayshao-oc@zhaoxin.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.29.8.5] X-ClientProxiedBy: zxbjmbx1.zhaoxin.com (10.29.252.163) To ZXBJMBX02.zhaoxin.com (10.29.252.6) X-Barracuda-Connect: ZXSHMBX2.zhaoxin.com[10.28.252.164] X-Barracuda-Start-Time: 1678328198 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://10.28.252.35:4443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at zhaoxin.com X-Barracuda-Scan-Msg-Size: 1867 X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0193 1.0000 -1.8956 X-Barracuda-Spam-Score: -1.90 X-Barracuda-Spam-Status: No, SCORE=-1.90 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.105773 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759854714578051874?= X-GMAIL-MSGID: =?utf-8?q?1759854799390345233?= From: mayshao-oc Hi Jakub: This is backport of the fix for PR target/100758 from mainline to the gcc10 release branch. Because the bug still exists in gcc10 on Zhaoxin platform, and it will incur ISA feature detection failure, we want to fix it as the mainline.This patch has been retested against the gcc10 branch on Intel,Amd,Zhaoxin with make bootstrap and make -k check without failure. Ok for the gcc10 branch? BR Mayshao libgcc/ChangeLog: PR target/100758 * config/i386/cpuinfo.c (__cpu_indicator_init): Call get_available_features for all CPUs with max_level >= 1, rather than just Intel, AMD. --- libgcc/config/i386/cpuinfo.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c index 83301a1445f..ad250edbcb7 100644 --- a/libgcc/config/i386/cpuinfo.c +++ b/libgcc/config/i386/cpuinfo.c @@ -474,6 +474,9 @@ __cpu_indicator_init (void) extended_model = (eax >> 12) & 0xf0; extended_family = (eax >> 20) & 0xff; + /* Find available features. */ + get_available_features (ecx, edx, max_level); + if (vendor == signature_INTEL_ebx) { /* Adjust model and family for Intel CPUS. */ @@ -487,8 +490,6 @@ __cpu_indicator_init (void) /* Get CPU type. */ get_intel_cpu (family, model, brand_id); - /* Find available features. */ - get_available_features (ecx, edx, max_level); __cpu_model.__cpu_vendor = VENDOR_INTEL; } else if (vendor == signature_AMD_ebx) @@ -502,8 +503,6 @@ __cpu_indicator_init (void) /* Get CPU type. */ get_amd_cpu (family, model); - /* Find available features. */ - get_available_features (ecx, edx, max_level); __cpu_model.__cpu_vendor = VENDOR_AMD; } else