Skip to content

Commit

Permalink
Fix spurious warning spotted by -Werror
Browse files Browse the repository at this point in the history
Including a real error :-)
  • Loading branch information
serge-sans-paille committed Nov 30, 2023
1 parent eba5e56 commit 9b69f1d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion include/xsimd/arch/generic/xsimd_generic_memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ namespace xsimd
inline batch<IT, A> create_compress_swizzle_mask(I bitmask, ::xsimd::detail::index_sequence<Is...>)
{
batch<IT, A> swizzle_mask(IT(0));
size_t i = 0;
alignas(A::alignment()) IT mask_buffer[batch<IT, A>::size] = { Is... };
size_t inserted = 0;
for (size_t i = 0; i < sizeof...(Is); ++i)
Expand Down
4 changes: 4 additions & 0 deletions include/xsimd/arch/xsimd_avx512f.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2033,10 +2033,12 @@ namespace xsimd
XSIMD_IF_CONSTEXPR(sizeof(T) == 1)
{
assert(false && "not implemented yet");
return {};
}
else XSIMD_IF_CONSTEXPR(sizeof(T) == 2)
{
assert(false && "not implemented yet");
return {};
}
else XSIMD_IF_CONSTEXPR(sizeof(T) == 4)
{
Expand Down Expand Up @@ -2099,10 +2101,12 @@ namespace xsimd
XSIMD_IF_CONSTEXPR(sizeof(T) == 1)
{
assert(false && "not implemented yet");
return {};
}
else XSIMD_IF_CONSTEXPR(sizeof(T) == 2)
{
assert(false && "not implemented yet");
return {};
}
else XSIMD_IF_CONSTEXPR(sizeof(T) == 4)
{
Expand Down
1 change: 1 addition & 0 deletions test/test_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ struct batch_test
{
batch_type b;
// value initialized to random data, can't be checked
(void)b;

array_type tmp;
std::fill(tmp.begin(), tmp.end(), value_type(2));
Expand Down
2 changes: 2 additions & 0 deletions test/test_batch_bool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ struct batch_bool_test
{
batch_bool_type a;
// value uninitialized, cannot test it.
(void)a;

bool_array_type res;
batch_bool_type b(true);
Expand Down Expand Up @@ -368,6 +369,7 @@ struct batch_bool_test
// FIXME: this volatile statement is useless on its own, but it
// workaround a bug in MSVC 2022 on avx2 that shows up in CI.
volatile auto _ = ((bool_g.half | bool_g.ihalf) == bool_g.all_true);
(void)_;
INFO("operator|");
CHECK_UNARY(res);
}
Expand Down
2 changes: 1 addition & 1 deletion test/test_batch_constant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ struct constant_batch_test

constexpr auto n12_usub = -n12;
constexpr auto n12_usub_ = xsimd::make_batch_constant<batch_type, constant<(value_type)-12>>();
static_assert(std::is_same<decltype(n12_inv), decltype(n12_inv_)>::value, "-n12 == n12_usub");
static_assert(std::is_same<decltype(n12_usub), decltype(n12_usub_)>::value, "-n12 == n12_usub");
}
};

Expand Down
4 changes: 2 additions & 2 deletions test/test_shuffle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ struct compress_test
for (size_t i = 0; i < size; ++i)
mask[i] = i % 2 == 0;

for (size_t i = 0, j = 0; i < size; ++i)
for (size_t i = 0; i < size; ++i)
expected[i] = i < size / 2 ? input[2 * i] : 0;

auto b = xsimd::compress(
Expand All @@ -337,7 +337,7 @@ struct compress_test
for (size_t i = 0; i < size; ++i)
mask[i] = i % 3 == 0;

for (size_t i = 0, j = 0; i < size; ++i)
for (size_t i = 0; i < size; ++i)
expected[i] = i < size / 3 ? input[3 * i] : 0;

auto b = xsimd::compress(
Expand Down

0 comments on commit 9b69f1d

Please sign in to comment.