-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc++] <experimental/simd> Reduce types for template parameter U in tests #83781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-libcxx Author: ZhangYin (joy2myself) ChangesFull diff: https://github.com/llvm/llvm-project/pull/83781.diff 6 Files Affected:
diff --git a/libcxx/test/std/experimental/simd/simd.class/simd_ctor_broadcast.pass.cpp b/libcxx/test/std/experimental/simd/simd.class/simd_ctor_broadcast.pass.cpp
index 679cb1aa167c57..79bd657cef9756 100644
--- a/libcxx/test/std/experimental/simd/simd.class/simd_ctor_broadcast.pass.cpp
+++ b/libcxx/test/std/experimental/simd/simd.class/simd_ctor_broadcast.pass.cpp
@@ -110,7 +110,7 @@ template <class T, std::size_t>
struct CheckBroadcastCtorTraits {
template <class SimdAbi>
void operator()() {
- types::for_each(arithmetic_no_bool_types(), CheckBroadcastCtorTraitsHelper<T, SimdAbi>());
+ types::for_each(types_for_template_parameter(), CheckBroadcastCtorTraitsHelper<T, SimdAbi>());
static_assert(!has_broadcast_ctor<no_implicit_type<T>, T, SimdAbi>::value);
static_assert(has_broadcast_ctor<implicit_type<T>, T, SimdAbi>::value);
diff --git a/libcxx/test/std/experimental/simd/simd.class/simd_ctor_conversion.pass.cpp b/libcxx/test/std/experimental/simd/simd.class/simd_ctor_conversion.pass.cpp
index 5920d62e0e5a61..041592f50c8b44 100644
--- a/libcxx/test/std/experimental/simd/simd.class/simd_ctor_conversion.pass.cpp
+++ b/libcxx/test/std/experimental/simd/simd.class/simd_ctor_conversion.pass.cpp
@@ -50,7 +50,7 @@ struct CheckConversionSimdCtor {
for (size_t i = 0; i < array_size; ++i)
expected_value[i] = static_cast<T>(i);
- types::for_each(arithmetic_no_bool_types(), ConversionHelper<T, SimdAbi, array_size>(expected_value));
+ types::for_each(types_for_template_parameter(), ConversionHelper<T, SimdAbi, array_size>(expected_value));
}
};
@@ -74,7 +74,7 @@ struct CheckConversionSimdCtorTraits {
void operator()() {
constexpr std::size_t array_size = ex::simd_size_v<T, SimdAbi>;
- types::for_each(arithmetic_no_bool_types(), CheckConversionSimdCtorTraitsHelper<T, SimdAbi, array_size>());
+ types::for_each(types_for_template_parameter(), CheckConversionSimdCtorTraitsHelper<T, SimdAbi, array_size>());
}
};
diff --git a/libcxx/test/std/experimental/simd/simd.class/simd_ctor_load.pass.cpp b/libcxx/test/std/experimental/simd/simd.class/simd_ctor_load.pass.cpp
index 3992f3e450cb2a..feee69daee9c29 100644
--- a/libcxx/test/std/experimental/simd/simd.class/simd_ctor_load.pass.cpp
+++ b/libcxx/test/std/experimental/simd/simd.class/simd_ctor_load.pass.cpp
@@ -59,9 +59,9 @@ struct CheckSimdLoadCtor {
void operator()() {
constexpr std::size_t array_size = ex::simd_size_v<T, SimdAbi>;
- types::for_each(arithmetic_no_bool_types(), ElementAlignedLoadCtorHelper<T, SimdAbi, array_size>());
- types::for_each(arithmetic_no_bool_types(), VectorAlignedLoadCtorHelper<T, SimdAbi, array_size>());
- types::for_each(arithmetic_no_bool_types(), OveralignedLoadCtorHelper<T, SimdAbi, array_size>());
+ types::for_each(types_for_template_parameter(), ElementAlignedLoadCtorHelper<T, SimdAbi, array_size>());
+ types::for_each(types_for_template_parameter(), VectorAlignedLoadCtorHelper<T, SimdAbi, array_size>());
+ types::for_each(types_for_template_parameter(), OveralignedLoadCtorHelper<T, SimdAbi, array_size>());
}
};
diff --git a/libcxx/test/std/experimental/simd/simd.mask.class/simd_mask_ctor_conversion.pass.cpp b/libcxx/test/std/experimental/simd/simd.mask.class/simd_mask_ctor_conversion.pass.cpp
index dc0764f937fc04..82f1fcb142f24b 100644
--- a/libcxx/test/std/experimental/simd/simd.mask.class/simd_mask_ctor_conversion.pass.cpp
+++ b/libcxx/test/std/experimental/simd/simd.mask.class/simd_mask_ctor_conversion.pass.cpp
@@ -42,7 +42,7 @@ struct CheckConversionMaskCtor {
constexpr std::size_t array_size = ex::simd_size_v<T, SimdAbi>;
std::array<bool, array_size> expected_value{};
- types::for_each(arithmetic_no_bool_types(), ConversionHelper<T, SimdAbi, array_size>(expected_value));
+ types::for_each(types_for_template_parameter(), ConversionHelper<T, SimdAbi, array_size>(expected_value));
}
};
@@ -65,7 +65,7 @@ struct CheckConversionMaskCtorTraits {
void operator()() {
constexpr std::size_t array_size = ex::simd_size_v<T, SimdAbi>;
- types::for_each(arithmetic_no_bool_types(), CheckConversionMaskCtorTraitsHelper<T, SimdAbi, array_size>());
+ types::for_each(types_for_template_parameter(), CheckConversionMaskCtorTraitsHelper<T, SimdAbi, array_size>());
}
};
diff --git a/libcxx/test/std/experimental/simd/simd.reference/reference_assignment.pass.cpp b/libcxx/test/std/experimental/simd/simd.reference/reference_assignment.pass.cpp
index cfef55a868ba01..7bc9c6886204ac 100644
--- a/libcxx/test/std/experimental/simd/simd.reference/reference_assignment.pass.cpp
+++ b/libcxx/test/std/experimental/simd/simd.reference/reference_assignment.pass.cpp
@@ -72,10 +72,10 @@ template <class T, std::size_t>
struct CheckReferenceAssignment {
template <class SimdAbi>
void operator()() {
- types::for_each(arithmetic_no_bool_types(), CheckSimdReferenceAssignmentHelper<T, SimdAbi>());
- types::for_each(arithmetic_no_bool_types(), CheckMaskReferenceAssignmentHelper<T, SimdAbi>());
+ types::for_each(types_for_template_parameter(), CheckSimdReferenceAssignmentHelper<T, SimdAbi>());
+ types::for_each(types_for_template_parameter(), CheckMaskReferenceAssignmentHelper<T, SimdAbi>());
- types::for_each(arithmetic_no_bool_types(), CheckReferenceAssignmentTraitsHelper<T, SimdAbi>());
+ types::for_each(types_for_template_parameter(), CheckReferenceAssignmentTraitsHelper<T, SimdAbi>());
}
};
diff --git a/libcxx/test/std/experimental/simd/test_utils.h b/libcxx/test/std/experimental/simd/test_utils.h
index b3679b51e50b50..039ee073099503 100644
--- a/libcxx/test/std/experimental/simd/test_utils.h
+++ b/libcxx/test/std/experimental/simd/test_utils.h
@@ -48,6 +48,16 @@ using arithmetic_no_bool_types = types::concatenate_t<types::integer_types, type
using arithmetic_no_bool_types = types::concatenate_t<types::integer_types, types::floating_point_types>;
#endif
+using types_for_template_parameter =
+ types::type_list<char,
+ unsigned,
+ int,
+#ifndef TEST_HAS_NO_INT128
+ __int128_t,
+#endif
+ float,
+ double>;
+
template <template <class T, std::size_t N> class Func>
void test_all_simd_abi() {
types::for_each(arithmetic_no_bool_types(), TestAllSimdAbiFunctor<Func>());
|
@philnik777 gentle ping. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with comment addressed.
✅ With the latest revision this PR passed the Python code formatter. |
✅ With the latest revision this PR passed the C/C++ code formatter. |
No description provided.