From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E97EA385041A; Wed, 26 May 2021 09:54:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E97EA385041A From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/100758] __builtin_cpu_supports does not (always) detect "sse2" Date: Wed, 26 May 2021 09:54:07 +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: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2021 09:54:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100758 --- Comment #5 from Richard Biener --- (In reply to Erich Eckner from comment #2) > We use this in archlinux32 to detect, if we can install packages, that ha= ve > sse2 opcodes: >=20 > If one sets "Architecture =3D auto" in /etc/pacman.conf, uname only gives > "i686" in both cases (this is how archlinux does/did the probing), and th= en, > we probe for sse2 to check, if we really are "i686" or "pentium4" (our > nomenclature for "i686" + sse2). This works well on amd and intel cpus, b= ut > fails on via cpus. >=20 > Details about expected features: https://archlinux32.org/architecture/ >=20 > We can add some cumbersome code which probes for sse2, but I'd really pre= fer > some compiler builtin instead :-) Eh, including cpuid.h and using that to check for SSE2 shouldn't be too hard (or parsing /proc/cpuinfo).=