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

            Bug ID: 109261
           Summary: std::experimental::simd is not usable in several
                    constant expressions
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: mkretz at gcc dot gnu.org
          Reporter: mkretz at gcc dot gnu.org
  Target Milestone: ---

std::experimental::simd wants to work in constant expressions with
-std=gnu++17. But it fails for many valid cases.

Testcase (https://godbolt.org/z/sjrfMM89h):

#include <experimental/simd>
#include <array>

using V = std::experimental::simd<int>;
using V12 = std::experimental::fixed_size_simd<int, 12>;

constexpr std::array<int, V12::size()> data = {};
constexpr auto a = V12(data.data(), std::experimental::element_aligned);

constexpr auto b = []() constexpr {
    V12 x = 1;
    where(x > 0, x) = 0;
    return x;
}();

constexpr auto c = V()[0];

constexpr auto d = !V() && !!V();

Reply via email to