<div dir="auto">OK, thanks<div dir="auto"><br></div><div dir="auto">(You'll need to add the PR number to the first line to get past the hooks)</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sat, 4 Apr 2026, 09:35 Matthias Kretz, <<a href="mailto:MatthiasKretz@gmx.net">MatthiasKretz@gmx.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The rest of this test is still relevant, thus only the (b)float16_t<br>
tests are made optional rather than skipping the whole test via<br>
dg-effective-target.<br>
<br>
libstdc++-v3/ChangeLog:<br>
<br>
PR libstdc++/124722<br>
* testsuite/std/simd/traits_impl.cc: Add __STDCPP_FLOAT16_T__<br>
and __STDCPP_BFLOAT16_T__ guards.<br>
<br>
Signed-off-by: Matthias Kretz <<a href="mailto:m.kretz@gsi.de" target="_blank" rel="noreferrer">m.kretz@gsi.de</a>><br>
---<br>
libstdc++-v3/testsuite/std/simd/traits_impl.cc | 16 +++++++++++++++-<br>
1 file changed, 15 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/libstdc++-v3/testsuite/std/simd/traits_impl.cc b/libstdc++-v3/<br>
testsuite/std/simd/traits_impl.cc<br>
index a264bd5f140..06bf6d5be25 100644<br>
--- a/libstdc++-v3/testsuite/std/simd/traits_impl.cc<br>
+++ b/libstdc++-v3/testsuite/std/simd/traits_impl.cc<br>
@@ -9,7 +9,9 @@<br>
<br>
namespace simd = std::simd;<br>
<br>
+#ifdef __STDCPP_FLOAT16_T__<br>
using std::float16_t;<br>
+#endif<br>
using std::float32_t;<br>
using std::float64_t;<br>
<br>
@@ -17,7 +19,11 @@ namespace simd<br>
<br>
void test()<br>
{<br>
- template for (auto t : {float(), double(), float16_t(), float32_t(), <br>
float64_t()})<br>
+ template for (auto t : {float(), double(),<br>
+#ifdef __STDCPP_FLOAT16_T__<br>
+ float16_t(),<br>
+#endif<br>
+ float32_t(), float64_t()})<br>
{<br>
using T = decltype(t);<br>
static_assert(__vectorizable<T>);<br>
@@ -25,7 +31,9 @@ namespace simd<br>
<br>
static_assert(!__vectorizable<const float>);<br>
static_assert(!__vectorizable<float&>);<br>
+#ifdef __STDCPP_BFLOAT16_T__<br>
static_assert(!__vectorizable<std::bfloat16_t>);<br>
+#endif<br>
<br>
template for (constexpr int N : {1, 2, 4, 8})<br>
{<br>
@@ -82,8 +90,10 @@ namespace simd<br>
static_assert( __value_preserving_convertible_to<float, double>);<br>
static_assert(!__value_preserving_convertible_to<double, float>);<br>
<br>
+#ifdef __STDCPP_FLOAT16_T__<br>
static_assert(__explicitly_convertible_to<float, float16_t>);<br>
static_assert(__explicitly_convertible_to<long, float16_t>);<br>
+#endif<br>
<br>
static_assert(__constexpr_wrapper_like<std::constant_wrapper<2>>);<br>
static_assert(__constexpr_wrapper_like<std::integral_constant<int, 1>>);<br>
@@ -95,7 +105,9 @@ namespace simd<br>
static_assert(!__broadcast_constructible<const int, float>);<br>
<br>
static_assert(__broadcast_constructible<decltype(std::cw<2>), float>);<br>
+#ifdef __STDCPP_FLOAT16_T__<br>
static_assert(__broadcast_constructible<decltype(std::cw<0.f>), <br>
std::float16_t>);<br>
+#endif<br>
<br>
<br>
static_assert(__higher_rank_than<long, int>);<br>
@@ -112,7 +124,9 @@ namespace simd<br>
static_assert(__higher_rank_than<unsigned long, int>);<br>
static_assert(__higher_rank_than<unsigned long long, long>);<br>
<br>
+#ifdef __STDCPP_FLOAT16_T__<br>
static_assert(__higher_rank_than<float, float16_t>);<br>
+#endif<br>
static_assert(__higher_rank_than<float32_t, float>);<br>
static_assert(__higher_rank_than<double, float32_t>);<br>
static_assert(__higher_rank_than<double, float>);<br>
-- <br>
──────────────────────────────────────────────────────────────────────────<br>
Dr. Matthias Kretz <a href="https://mattkretz.github.io" rel="noreferrer noreferrer" target="_blank">https://mattkretz.github.io</a><br>
GSI Helmholtz Center for Heavy Ion Research <a href="https://gsi.de" rel="noreferrer noreferrer" target="_blank">https://gsi.de</a><br>
std::simd<br>
──────────────────────────────────────────────────────────────────────────<br>
<br>
<br>
<br>
<br>
</blockquote></div>