[Bug libstdc++/124727] simd vec<int> deduced size wrong targeting AVX512
mkretz at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Mar 31 15:25:30 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124727
Matthias Kretz (Vir) <mkretz at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
--- Comment #1 from Matthias Kretz (Vir) <mkretz at gcc dot gnu.org> ---
This is not a bug.
vec<int> is 8 elements with AVX2 and 16 elements with AVX-512. The conversion
from array requires an exactly matching size.
For a fixed array size use e.g. vec<int, 8>.
If you were looking for CTAD, you must use basic_vec, rather than vec. This is
a known limitation of alias templates.
int main() {
using std::simd::basic_vec, std::simd::flag_convert;
basic_vec v = std::array{0,0,0,0, 0,0,0,1<<30};
char bytes[8];
unchecked_store(v, bytes, flag_convert);
}
More information about the Gcc-bugs
mailing list