From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x112f.google.com (mail-yw1-x112f.google.com [IPv6:2607:f8b0:4864:20::112f]) by sourceware.org (Postfix) with ESMTPS id 0547D3858C50 for ; Thu, 9 Feb 2023 16:34:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0547D3858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-4c24993965eso32082167b3.12 for ; Thu, 09 Feb 2023 08:34:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=7YV+v6Mc9wTdVLNE0t2H2vweXF9sUdjWXFq+XiqgTHQ=; b=dE2DPinif5H7d7kEkYdJxUhIY/GSbtTuIt3NzXie+QYxuw63CCYusGUXzFl2am2zaR 4BV3dgA2+pYt8KysXPbfs3+9b49zKxwgBpizHFxmVS3NzW7L3yAv5DWwwd+22rVi9MsG ybg/p4/4RdvIZyg/O+NlbrTO8H5Qv1XocqE9mI1yvVOBHT4SyuJ7wp4JOJLSphBv8fLL +sAfJK8lpDaDHa14fqgSoFsNlFfAMU9ejw7aD6Zu/2FHeclBXKCkBD0NOOPAct9AntmY o8S0Ncn6bw0GBKFQX79bRwuKRI4pkyB6CIiAm6CZofUz4jXP4aO+Ck3Te/LOIDoGoUGb 07fA== 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=7YV+v6Mc9wTdVLNE0t2H2vweXF9sUdjWXFq+XiqgTHQ=; b=KoIqr9uUzdGvNGiV/5GI4QoOKtam7ZBUj74ZYJyI0jeQgWTL03ro/wFfD/EYT7alS8 hoVRbVhRqV6EuM423v1rTU6x1S6eHg3rIeVN5lkZCGlRTXk0BPPnDgG6DfnpUf1CFTwi 3w8Pi3zee6zpR8Ff3Poi4MhLbuqc98WIAs8v2Fd0woWg/WhJpiAF93jm8IWk+gyD3g5T 8SoAsC8tt8ONwLkfjI2VRB2GVu6SJW7TBtZs9AN87Cv0qC770tR1rGlkD2X0CZiYk/qG BELUu7sJoyRNHUQnYMlAlHWvbNICc3ZtgCMdZu7ZIZufv1cxbwUIeKVxGHM05xGqYcvv 8sBA== X-Gm-Message-State: AO0yUKWJDcGi8GcWBz1Hc5p+jFU4wnnRdkfXd2SPZIj7Dby/T21fjBtR D3nCj2sg+vC6L29KDHDockS+DETl62Ios3hazGE= X-Google-Smtp-Source: AK7set86ymKuwGk8XQRWnSO0bnqI3pTQqzJRqbk61wabETcsAYjrfdgHBf7wD67bUWjOw03eM4nIg7UojSCtg1WAzWk= X-Received: by 2002:a0d:eb09:0:b0:506:6366:617c with SMTP id u9-20020a0deb09000000b005066366617cmr1222410ywe.368.1675960480054; Thu, 09 Feb 2023 08:34:40 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Uros Bizjak Date: Thu, 9 Feb 2023 17:34:28 +0100 Message-ID: Subject: Re: [PATCH] i386: Call get_available_features for all CPUs with max_level >= 1 [PR100758] To: Jakub Jelinek Cc: "H.J. Lu" , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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: On Thu, Feb 9, 2023 at 4:43 PM Jakub Jelinek wrote: > > On Thu, Feb 09, 2023 at 07:30:52AM -0800, H.J. Lu wrote: > > On Thu, Feb 9, 2023 at 4:12 AM Jakub Jelinek wrote: > > > get_available_features doesn't depend on cpu_model2->__cpu_{family,model} > > > and just sets stuff up based on CPUID leaf 1, or some extended ones, > > > so I wonder why are we calling it separately for Intel, AMD and Zhaoxin > > > and not for all other CPUs too? I think various programs in the wild > > > which aren't using __builtin_cpu_{is,supports} just check the various CPUID > > > leafs and query bits in there, without blacklisting unknown CPU vendors, > > > so I think even __builtin_cpu_supports ("sse2") etc. should be reliable > > > if those VENDOR_{CENTAUR,CYRIX,NSC,OTHER} CPUs set those bits in CPUID leaf > > > 1 or some extended ones. Calling it for all CPUs also means it can be > > > inlined because there will be just a single caller. > > > > > > I will test on Intel but can't test it on non-Intel (or with some extra > > > effort on AMD; for both of those arches it should be really no change in > > > behavior). > > > > > > Thoughts on this? > > > > No objection here. It just isn't easy to verify CPUID behavior on > > other processors. > > Sure, worst case it can be reverted or exceptions could be added if some > CPUs misbehave but then we'd hopefully have detailed into on how exactly it > behaves. > > FYI, I've successfully bootstrapped/regtested this on Intel i9-7960X > and Martin Liska has regtested it with just i386.exp tests on AMD. > > Uros, is this ok now? OK. Let's go forward with the patch. Thanks, Uros. > > > > 2023-02-09 Jakub Jelinek > > > > > > PR target/100758 > > > * common/config/i386/cpuinfo.h (get_zhaoxin_cpu): Formatting fixes. > > > (cpu_indicator_init): Call get_available_features for all CPUs with > > > max_level >= 1, rather than just Intel, AMD or Zhaoxin. Formatting > > > fixes. > > Jakub >