incorrect return type of static_simd_cast
mattkretz opened this issue · 2 comments
mattkretz commented
[parallel.simd.casts] p12 specifies the return type to be "simd<T, Abi> if either U is T or U and T are integral types that only differ in signedness". This rule is inconsistent wrt. char / signed char / unsigned char and wchar_t, char16_t, and char32_t. E.g. static_simd_cast<char>(simd<signed char>()) produces a fixed_size ABI, instead of the compatible ABI as is the case for static_simd_cast<unsigned char>(simd<signed char>()).
Proposed resolution:
Modify 9.4.5/12
Tifis_simd_v<T>is true, otherwisesimd<T, Abi>if eitherUisTorUandTare integral types that only differ in signednessmake_signed_t<U>ismake_signed_t<T>, otherwisesimd<T, simd_abi::fixed_size<simd<U, Abi>::size()>>.
brycelelbach commented
P1111r0 should deal with this. It was reported in an NB comment on the Parallelism TS v2 (CH15).
mattkretz commented
this is resolved after NB comments were applied