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

            Bug ID: 109822
           Summary: Converting std::experimental::simd masks yields an
                    error
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jens.maurer at gmx dot net
  Target Milestone: ---

Reproducer:

#include <experimental/simd>
auto x =
to_native(to_fixed_size(std::experimental::native_simd<int>::mask_type()));

This converts a native SIMD mask type to fixed-size and back.  I believe this
should work, but gcc disagrees:

/usr/include/c++/12/experimental/bits/simd.h:3224:3: note:   template argument
deduction/substitution failed:
x.cc:4:19: note:   mismatched types ‘long unsigned int’ and ‘int’

(Also reproducible with gcc 13.1.)

The issue is that the SIMD implementation of libstdc++ uses a mixture of "int"
and "size_t" for the type of non-type template parameters for "number of
elements in this SIMD vector", causing deduction failures when gcc tries to
match template arguments with template parameters.

It seems the Technical Specification uses "int" throughout.

Reply via email to