[Bug target/100758] __builtin_cpu_supports does not (always) detect "sse2"

gcc at eckner dot net gcc-bugzilla@gcc.gnu.org
Wed May 26 09:12:31 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100758

--- Comment #2 from Erich Eckner <gcc at eckner dot net> ---
We use this in archlinux32 to detect, if we can install packages, that have
sse2 opcodes:

If one sets "Architecture = auto" in /etc/pacman.conf, uname only gives "i686"
in both cases (this is how archlinux does/did the probing), and then, 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, but fails on via cpus.

Details about expected features: https://archlinux32.org/architecture/

We can add some cumbersome code which probes for sse2, but I'd really prefer
some compiler builtin instead :-)


More information about the Gcc-bugs mailing list