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

            Bug ID: 80353
           Summary: AVX512: _mm512_slli_epi32, the last argument must be
                    an 8-bit immediate
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: m...@sven-woop.de
  Target Milestone: ---

GCC trunk does not propagate constant to _mm512_slli_epi32 intrinsic:

#include <immintrin.h>

#define __forceinline inline __attribute__((always_inline))

__forceinline __m128i sll128 ( const __m128i a, const int& n ) { return
_mm_slli_epi32(a, n); }
__forceinline __m256i sll256 ( const __m256i a, const int& n ) { return
_mm256_slli_epi32(a, n); }
__forceinline __m512i sll512 ( const __m512i a, const int& n ) { return
_mm512_slli_epi32(a, n); }

void test()
{
  __m128i a = sll128(_mm_set1_epi32(0),4);
  __m256i b = sll256(_mm256_set1_epi32(0),4);
  __m512i c = sll512(_mm512_set1_epi32(0),4);
}

The first two work, while the last not. Output is:

test.cpp:8:73: error: the last argument must be an 8-bit immediate
 __forceinline __m512i sll512 ( const __m512i a, const int& n ) { return
_mm512_slli_epi32(a, n); }

Reply via email to