https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125445
Bug ID: 125445
Summary: simd::vec conversion to underlying GNU vector type
uses wrong type
Product: gcc
Version: 16.1.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: ---
The _NativeVecType of simd::basic_vec incorrectly uses the canonical value type
to determine the implementation-defined vector type to be convertible to/from.
As a consequence, it is impossible to use a simd::vec<char, 32> where e.g.
__builtin_ia32_psadbw expects __vector(32) char.
Test case (https://compiler-explorer.com/z/ExedK6hs9):
#include <simd>
namespace simd = std::simd;
simd::vec<long long, 4> f(simd::vec<char, 32> x, simd::vec<char, 32> y)
{
return __builtin_ia32_psadbw256(x, y);
}