Casts are implemented in terms of static_casts and loops.
In general, this looks good to me.
I suggested a lot of test improvements, but not very much to the code.
Needs the same kind of namespace changes in the tests as in D41376, but that's a minor thing.
Weird indentation in the enable_if
All the tests should #include "test_macros.h"
I think this is worth a comment here - "This conversion is deleted so that it prevents ..."
General comment: We have a macro called ASSERT_SAME_TYPE that makes this clearer.
Instead of all this, you can just write:
ASSERT_SAME_TYPE(decltype(static_simd_cast<simd<float, simd_abi::scalar>>(fixed_size_simd<int, 1>())), simd<float, simd_abi::scalar);
Since this is an extension, then the test needs to live in test/libcxx, not test/std.
Same for to_native.pass.cpp below.
All of these tests need to check the "noexcept-ness" of the operation.
ASSERT_NOEXCEPT ( to_fixed_size(std::declval<native_simd<int>>())); ASSERT_SAME_TYPE(decltype(to_fixed_size(std::declval<native_simd<int>>())), fixed_size_simd<int, native_simd<int>::size()>);