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

            Bug ID: 91066
           Summary: GCC does not provide XOP functions through
                    <ammintrin.h>
           Product: gcc
           Version: 8.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: noloader at gmail dot com
  Target Milestone: ---

This is a tad bit unusual since we can use SSE2, SSE3, ..., AVX, AVX2 as
expected.

According to the GCC docs and -march=bdver1, the arch does enable XOP as
expected (https://gcc.gnu.org/onlinedocs/gcc-8.3.0/gcc/x86-Options.html).
However, the XOP functions are not available through either <immintrin.h>
(http://www.g-truc.net/post-0359.html) or <ammintrin.h>
(https://docs.microsoft.com/en-us/cpp/intrinsics/x64-amd64-intrinsics-list?view=vs-2019).

bulldozer:cryptopp$ cd ..
bulldozer:~$ g++ -march=bdver1 -msse4.1 test.cxx
test.cxx: In function ‘int main(int, char**)’:
test.cxx:15:9: error: ‘_mm_roti_epi64’ was not declared in this scope
     b = _mm_roti_epi64(a, 1);
         ^~~~~~~~~~~~~~
test.cxx:15:9: note: suggested alternative: ‘_mm_rorv_epi64’
     b = _mm_roti_epi64(a, 1);
         ^~~~~~~~~~~~~~
         _mm_rorv_epi64

bulldozer:~$ cat test.cxx
#ifdef __XOP__
#include <immintrin.h>
#include <ammintrin.h>
#endif

#ifdef __SSE41__
#include <smmintrin.h>
#endif

int main(int argc, char* argv[])
{
    __m128i a=_mm_setzero_si128(), b=_mm_setzero_si128(), c;

#ifdef __XOP__
    b = _mm_roti_epi64(a, 1);
#endif

#ifdef __SSE41__
    c = _mm_blend_epi16(a, b, 0);
#endif

    return 0;
}

And:

$ gcc --version
gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2)

$ lsb_release -a
Distributor ID: Fedora
Description:    Fedora release 29 (Twenty Nine)
Release:        29
Codename:       TwentyNine

Reply via email to