From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 45FC438582AB; Thu, 9 Feb 2023 16:45:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 45FC438582AB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675961157; bh=WrGVmh9YrSbDPDcRPVe/i5LLHaqAo3HGNUV2OTIsFv0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=j55xI5U5vAxp6kKC1H4Suo60S1Ly4WDh8nL/eQATK7pHbmx9BT81GJ2fNcp8Iq+EV UbwjF0d25TOYvG2/08koOB11Gu1+hBjv9RzYQpfUviSU/U3GIef5BiDp44hjaNsAl2 JmVhtyNOhxFQ1y7DZMva0vw4ReJ/kyBGyiCgYVUA= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/100758] __builtin_cpu_supports does not (always) detect "sse2" Date: Thu, 09 Feb 2023 16:45:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100758 --- Comment #19 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:b24e9c083093a9e1b1007933a184c02f7ff058db commit r13-5759-gb24e9c083093a9e1b1007933a184c02f7ff058db Author: Jakub Jelinek Date: Thu Feb 9 17:43:19 2023 +0100 i386: Call get_available_features for all CPUs with max_level >=3D 1 [PR100758] get_available_features doesn't depend on cpu_model2->__cpu_{family,mode= l} 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 C= PUID 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 have tested it on Intel and Martin tested it on AMD, but can't test it on non-Intel/AMD; for Intel/AMD/Zhaoxin it should be really no change in behavior. 2023-02-09 Jakub Jelinek PR target/100758 * common/config/i386/cpuinfo.h (get_zhaoxin_cpu): Formatting fi= xes. (cpu_indicator_init): Call get_available_features for all CPUs = with max_level >=3D 1, rather than just Intel, AMD or Zhaoxin. Form= atting fixes.=