@@ -2370,12 +2370,12 @@ _S_fpclassify(_SimdWrapper<_Tp, _Np> __x)
constexpr size_t _NI = sizeof(__xn) / sizeof(_I);
_GLIBCXX_SIMD_USE_CONSTEXPR auto __minn
= __vector_bitcast<_I>(__vector_broadcast<_NI>(__norm_min_v<_Tp>));
- _GLIBCXX_SIMD_USE_CONSTEXPR auto __infn
- = __vector_bitcast<_I>(__vector_broadcast<_NI>(__infinity_v<_Tp>));
_GLIBCXX_SIMD_USE_CONSTEXPR auto __fp_normal
= __vector_broadcast<_NI, _I>(FP_NORMAL);
#if !__FINITE_MATH_ONLY__
+ _GLIBCXX_SIMD_USE_CONSTEXPR auto __infn
+ = __vector_bitcast<_I>(__vector_broadcast<_NI>(__infinity_v<_Tp>));
_GLIBCXX_SIMD_USE_CONSTEXPR auto __fp_nan
= __vector_broadcast<_NI, _I>(FP_NAN);
_GLIBCXX_SIMD_USE_CONSTEXPR auto __fp_infinite
@@ -38,9 +38,11 @@ test()
{
using T = typename V::value_type;
using intv = std::experimental::fixed_size_simd<int, V::size()>;
+#if __GCC_IEC_559 >= 2
constexpr T inf = std::__infinity_v<T>;
constexpr T denorm_min = std::__infinity_v<T>;
constexpr T nan = std::__quiet_NaN_v<T>;
+#endif
constexpr T max = std::__finite_max_v<T>;
constexpr T norm_min = std::__norm_min_v<T>;
test_values<V>(
@@ -25,11 +25,17 @@ test()
{
using int_v = std::experimental::fixed_size_simd<int, V::size()>;
using T = typename V::value_type;
+#if __GCC_IEC_559 >= 2 || defined __STDC_IEC_559__
constexpr auto denorm_min = std::__denorm_min_v<T>;
+#endif
+#if __GCC_IEC_559 >= 2
constexpr auto norm_min = std::__norm_min_v<T>;
+#endif
constexpr auto max = std::__finite_max_v<T>;
+#if defined __STDC_IEC_559__
constexpr auto nan = std::__quiet_NaN_v<T>;
constexpr auto inf = std::__infinity_v<T>;
+#endif
test_values<V>(
{0, 0.25, 0.5, 1, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 31, -0., -0.25, -0.5, -1,
@@ -137,7 +137,6 @@ test()
if (modf_is_broken)
return;
V integral = {};
- const V totest = modf(input, &integral);
auto&& expected = [&](const auto& v) -> std::pair<const V, const V> {
std::pair<V, V> tmp = {};
using std::modf;
@@ -149,8 +148,9 @@ test()
}
return tmp;
};
- const auto expect1 = expected(input);
#ifdef __STDC_IEC_559__
+ const V totest = modf(input, &integral);
+ const auto expect1 = expected(input);
COMPARE(isnan(totest), isnan(expect1.first))
<< "modf(" << input << ", iptr) = " << totest << " != " << expect1;
COMPARE(isnan(integral), isnan(expect1.second))
@@ -27,11 +27,13 @@ test()
vir::test::setFuzzyness<double>(1);
using T = typename V::value_type;
+#ifdef __STDC_IEC_559__
constexpr T nan = std::__quiet_NaN_v<T>;
constexpr T inf = std::__infinity_v<T>;
constexpr T denorm_min = std::__denorm_min_v<T>;
- constexpr T norm_min = std::__norm_min_v<T>;
constexpr T min = std::__finite_min_v<T>;
+#endif
+ constexpr T norm_min = std::__norm_min_v<T>;
constexpr T max = std::__finite_max_v<T>;
test_values<V>({1,
2,
@@ -24,8 +24,10 @@
test()
{
using T = typename V::value_type;
+#ifdef __STDC_IEC_559__
constexpr T inf = std::__infinity_v<T>;
constexpr T denorm_min = std::__denorm_min_v<T>;
+#endif
constexpr T norm_min = std::__norm_min_v<T>;
constexpr T max = std::__finite_max_v<T>;
constexpr T min = std::__finite_min_v<T>;