Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/xvec/x86/permute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ inline auto permute_x86_register(x86_avx2_tag, const basic_vec<_Tp, _AbiT>& v, c
// same size. There is no advantage to using 128-bit permute instructions.
const auto _rv = permute<vec<_Tp>::size()>(v, perm_uninitResize);

auto impl = [_rv]<typename _ImplT>(_ImplT i) -> _ImplT {
auto impl = [_rv]<typename _ImplT>(_ImplT i) {
auto block = permute<vec<_Tp>::size>(i, perm_uninitResize); // Bump to whole register

auto r = [=]{
Expand Down
7 changes: 4 additions & 3 deletions test/TestSimdPermute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(BySmallIndex, TypeParam, PermuteTestTypes)
{
using UnsignedIndexSimd = xvec::simd::vec<unsigned short, 5>;
const auto unsignedIndexes = GetRandomVector<UnsignedIndexSimd>(TypeParam::size() - 1);
const auto signedIndexes = xvec::rebind_cast<signed short>(unsignedIndexes);
const auto signedIndexes1 = xvec::rebind_cast<signed short>(unsignedIndexes);
const auto signedIndexes2 = xvec::rebind_cast<signed int>(unsignedIndexes);

std::array<typename TypeParam::value_type, 5> expected{};
for (std::size_t i = 0; i < expected.size(); ++i)
Expand All @@ -168,13 +169,13 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(BySmallIndex, TypeParam, PermuteTestTypes)
const auto computedOptionUnsignedA = permute(f.v0, unsignedIndexes);
BOOST_TEST(to_array(computedOptionUnsignedA) == expected, boost::test_tools::per_element());

const auto computedOptionSignedA = permute(f.v0, signedIndexes);
const auto computedOptionSignedA = permute(f.v0, signedIndexes1);
BOOST_TEST(to_array(computedOptionSignedA) == expected, boost::test_tools::per_element());

const auto computedOptionUnsignedB = f.v0[unsignedIndexes];
BOOST_TEST(to_array(computedOptionUnsignedB) == expected, boost::test_tools::per_element());

const auto computedOptionSignedB = f.v0[signedIndexes];
const auto computedOptionSignedB = f.v0[signedIndexes2];
BOOST_TEST(to_array(computedOptionSignedB) == expected, boost::test_tools::per_element());

#if defined(_XVEC_HAS_CONSTEXPR)
Expand Down
Loading