Casts are implemented in terms of static_casts and loops.
Details
Diff Detail
- Build Status
Buildable 13308 Build 13308: arc lint + arc unit
Event Timeline
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.
libcxx/include/experimental/simd | ||
---|---|---|
1010 | Weird indentation in the enable_if | |
libcxx/test/std/experimental/simd/simd.casts/simd_cast.pass.cpp | ||
19 | All the tests should #include "test_macros.h" | |
22 | I think this is worth a comment here - "This conversion is deleted so that it prevents ..." | |
libcxx/test/std/experimental/simd/simd.casts/static_simd_cast.pass.cpp | ||
33 | 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); | |
libcxx/test/std/experimental/simd/simd.casts/to_compatible.pass.cpp | ||
40 | Since this is an extension, then the test needs to live in test/libcxx, not test/std. Same for to_native.pass.cpp below. | |
libcxx/test/std/experimental/simd/simd.casts/to_fixed_size.pass.cpp | ||
31 | 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()>); |
Weird indentation in the enable_if