From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ACB953858D35; Wed, 1 Feb 2023 14:23:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ACB953858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675261425; bh=cYDilc9r4mW+ncyiksYxFAMhf6w+wx5m0YC5clYnr6g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=P1BEZpq7WBPjq/hhhVHbFOL3kjDXQvIzQnSKAXRbSgf5nKa7ufjSlNAZHE+IjKgsL Gxkct1RBbF6BlUM/Q0RoOIaovwQ6+D4dyz7GcLQnEdJRmE83sSUOggYen20B47aXD9 N3rxHi5okbyVn/S6k3utyjeNXoTvJs+/kvfXem2I= From: "iam at valdikss dot org.ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/100758] __builtin_cpu_supports does not (always) detect "sse2" Date: Wed, 01 Feb 2023 14:23:45 +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: iam at valdikss dot org.ru 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 #11 from ValdikSS --- Well, the function is called __builtin_cpu_supports, for which one might ex= pect that it just checks CPUID and returns reliable results, while in reality it operates using the build-in CPU support list. The function does not return = an error if it's unable to detect the feature, resulting in incorrect results, which makes the function unreliable. The fact that it may not always detect features which are present in the CPU is not documented, which brings the confusion among developers such as this bug. VIA processors have progressed into Zhaoxin CPU family which is fairly rece= nt (2014-2019, with plans to release new processors soon). They both share alm= ost the same CPUID data, that's why adding support for either of these CPU automatically implements the other one.=