[Bug target/57202] Please make the intrinsics headers like immintrin.h be usable without compiler flags

noloader at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Apr 17 15:34:00 GMT 2017


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

--- Comment #9 from Jeffrey Walton <noloader at gmail dot com> ---
On Mon, Apr 17, 2017 at 11:04 AM, glisse at gcc dot gnu.org
<gcc-bugzilla@gcc.gnu.org> wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57202
>
> --- Comment #8 from Marc Glisse <glisse at gcc dot gnu.org> ---
> (In reply to Jeffrey Walton from comment #7)
>> It appears the intrinsics are not available.
>
> They are available for functions compiled for a suitable target, for instance
> because of -march or thanks to the target attribute (see the original report).
> It does not make sense to make them always available.

But that's what this bug report is for - to make the intrinsicsalways
available.

This code still does not work:

if (HasAVX())
{
    ...
}
else if (HasSSSE3())
{
    // Use _mm_shuffle_epi8()
}
else if (HasSSE2)
{
    // Use _mm_load_si128()
}
else
{
    // Use C/C++
}

When a distro compile with just -march=i686 or -march=x86_64, then the
intrinsics would allow us to easy provide the features for modern
cpus. Because the intrinsics are not available, we're back to that
cursed inline assembly (and its wonderful error messages).

Jeff


More information about the Gcc-bugs mailing list