libstdc++: Resolve -Wunused-variable warnings in stdx::simd and tests
Signed-off-by: Matthias Kretz <m.kretz@gsi.de> libstdc++-v3/ChangeLog: * include/experimental/bits/simd_builtin.h (_S_fpclassify): Move __infn into #ifdef'ed block. * testsuite/experimental/simd/tests/fpclassify.cc: Declare constants only when used. * testsuite/experimental/simd/tests/frexp.cc: Likewise. * testsuite/experimental/simd/tests/logarithm.cc: Likewise. * testsuite/experimental/simd/tests/trunc_ceil_floor.cc: Likewise. * testsuite/experimental/simd/tests/ldexp_scalbn_scalbln_modf.cc: Move totest and expect1 into #ifdef'ed block.
This commit is contained in:
parent
9f5065094c
commit
a7129e82be
6 changed files with 17 additions and 5 deletions
|
@ -2370,12 +2370,12 @@ template <typename _Abi, typename>
|
|||
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 @@ template <typename V>
|
|||
{
|
||||
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 @@ template <typename V>
|
|||
{
|
||||
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 @@ template <typename V>
|
|||
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 @@ template <typename V>
|
|||
}
|
||||
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 @@ template <typename V>
|
|||
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 @@ template <typename V>
|
|||
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>;
|
||||
|
|
Loading…
Add table
Reference in a new issue