[PATCH] D41148: [libcxx] implement <experimental/simd> declarations based on P0214R7.

Marshall Clow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 4 15:55:00 PDT 2018


mclow.lists added inline comments.


================
Comment at: libcxx/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp:44
+static_assert(is_abi_tag<simd_abi::compatible<float>>::value, "");
+static_assert(is_abi_tag<simd_abi::compatible<double>>::value, "");
+
----------------
Needs negative tests.



================
Comment at: libcxx/test/std/experimental/simd/simd.traits/is_simd.pass.cpp:68
+
+static_assert(!is_simd<int>::value, "");
+
----------------
Negative tests, too, please.


================
Comment at: libcxx/test/std/experimental/simd/simd.traits/is_simd_flag_type.pass.cpp:27
+static_assert(is_simd_flag_type<overaligned_tag<16>>::value, "");
+static_assert(is_simd_flag_type<overaligned_tag<32>>::value, "");
+
----------------
It's good that you check that all the things do pass, but you should have some failing tests, too:

   static_assert(!is_simd_flag_type<void>::value, "");
   static_assert(!is_simd_flag_type<int>::value, "");
   static_assert(!is_simd_flag_type<float>::value, "");
   static_assert(!is_simd_flag_type<std::string>::value, "");
   static_assert(!is_simd_flag_type<fixed_size_simd<int8_t>>::value, "");
   static_assert(!is_simd_flag_type<native_simd_mask<int8_t>>::value, "");




================
Comment at: libcxx/test/std/experimental/simd/simd.traits/is_simd_mask.pass.cpp:68
+
+static_assert(!is_simd_mask<int>::value, "");
+
----------------
How about a couple more negative tests here?
You've got `int`, how about `float`, and `std::string` and a few of the simd types?



https://reviews.llvm.org/D41148





More information about the cfe-commits mailing list