Skip to content

Commit 8239b5e

Browse files
committed
fixing win build
1 parent 7fa61b3 commit 8239b5e

File tree

3 files changed

+22
-28
lines changed

3 files changed

+22
-28
lines changed

include/xsimd/arch/xsimd_avx.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,9 +1484,9 @@ namespace xsimd
14841484
XSIMD_IF_CONSTEXPR(is_dup)
14851485
{
14861486
constexpr auto control = is_dup_low ? 0x00 : 0x11;
1487-
const auto is_dup_identity = is_dup_low ? detail::is_identity<uint32_t, V0, V1, V2, V3>() : detail::is_identity<int64_t, V4 - 4, V5 - 4, V6 - 4, V7 - 4>();
1487+
constexpr auto is_dup_identity = is_dup_low ? detail::is_identity<uint32_t, V0, V1, V2, V3>() : detail::is_identity<int64_t, V4 - 4, V5 - 4, V6 - 4, V7 - 4>();
14881488
auto split = _mm256_permute2f128_ps(self, self, control);
1489-
if (!is_dup_identity)
1489+
XSIMD_IF_CONSTEXPR(!is_dup_identity)
14901490
{
14911491
constexpr auto shuffle_mask = is_dup_low ? detail::mod_shuffle(V0, V1, V2, V3) : detail::mod_shuffle(V4 - 4, V5 - 4, V6 - 4, V7 - 4);
14921492
split = _mm256_permute_ps(split, shuffle_mask);

include/xsimd/arch/xsimd_avx2.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -902,15 +902,11 @@ namespace xsimd
902902
}
903903

904904
// swizzle (dynamic mask)
905-
906905
template <class A>
907906
XSIMD_INLINE batch<float, A> swizzle(batch<float, A> const& self, batch<uint32_t, A> mask, requires_arch<avx2>) noexcept
908907
{
909908
return swizzle(self, mask, avx {});
910-
// this does not allow duplicates in the output
911-
// return _mm256_permutevar8x32_ps(self, mask);
912909
}
913-
914910
template <class A>
915911
XSIMD_INLINE batch<double, A> swizzle(batch<double, A> const& self, batch<uint64_t, A> mask, requires_arch<avx2>) noexcept
916912
{
@@ -932,8 +928,6 @@ namespace xsimd
932928
template <class A>
933929
XSIMD_INLINE batch<uint32_t, A> swizzle(batch<uint32_t, A> const& self, batch<uint32_t, A> mask, requires_arch<avx2>) noexcept
934930
{
935-
// this does not allow duplicates in the output
936-
// return _mm256_permutevar8x32_epi32(self, mask);
937931
return swizzle(self, mask, avx {});
938932
}
939933
template <class A>

include/xsimd/arch/xsimd_sse2.hpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,8 +1698,7 @@ namespace xsimd
16981698
return self;
16991699
}
17001700
// 1) duplicate‐low‐half?
1701-
constexpr bool dup_lo = detail::is_dup_lo(mask);
1702-
XSIMD_IF_CONSTEXPR(dup_lo)
1701+
XSIMD_IF_CONSTEXPR(detail::is_dup_lo(mask))
17031702
{
17041703
// permute low half and broadcast
17051704
const auto lo = _mm_shufflelo_epi16(self, imm_lo);
@@ -1708,8 +1707,7 @@ namespace xsimd
17081707
}
17091708

17101709
// 2) duplicate‐high‐half?
1711-
constexpr bool dup_hi = detail::is_dup_hi(mask);
1712-
XSIMD_IF_CONSTEXPR(dup_hi)
1710+
XSIMD_IF_CONSTEXPR(detail::is_dup_hi(mask))
17131711
{
17141712
// permute high half and broadcast
17151713
const auto hi = _mm_shufflehi_epi16(self, imm_lo);
@@ -1725,26 +1723,28 @@ namespace xsimd
17251723
_mm_shufflelo_epi16(self, imm_hi), // permute words 0-3 (hi pattern)
17261724
_mm_shufflelo_epi16(self, imm_hi));
17271725

1728-
const auto hi0_all = [&]
1726+
__m128i hi0_all;
1727+
XSIMD_IF_CONSTEXPR(!detail::is_identity<uint16_t, V0, V1, V2, V3>())
17291728
{
1730-
XSIMD_IF_CONSTEXPR(detail::is_identity<uint32_t, V0, V1, V2, V3>())
1731-
{
1732-
return _mm_unpackhi_epi64(self, self);
1733-
}
1734-
__m128i hi = _mm_shufflehi_epi16(self, imm_lo); // permute 4-7
1735-
return _mm_unpackhi_epi64(hi, hi); // broadcast
1736-
}();
1729+
__m128i hi = _mm_shufflehi_epi16(self, imm_lo);
1730+
hi0_all = _mm_unpackhi_epi64(hi, hi);
1731+
}
1732+
else
1733+
{
1734+
// if the “low-pattern” is identity in the high half, just keep it
1735+
hi0_all = _mm_unpackhi_epi64(self, self);
1736+
}
17371737

1738-
// ----- build hi1_all ---------------------------------------------------
1739-
const auto hi1_all = [&]
1738+
__m128i hi1_all;
1739+
XSIMD_IF_CONSTEXPR(!detail::is_identity<int32_t, V4 - 4, V5 - 4, V6 - 4, V7 - 4>())
17401740
{
1741-
XSIMD_IF_CONSTEXPR(detail::is_identity<int32_t, V4 - 4, V5 - 4, V6 - 4, V7 - 4>())
1742-
{
1743-
return _mm_unpackhi_epi64(self, self);
1744-
}
17451741
__m128i hi = _mm_shufflehi_epi16(self, imm_hi);
1746-
return _mm_unpackhi_epi64(hi, hi);
1747-
}();
1742+
hi1_all = _mm_unpackhi_epi64(hi, hi);
1743+
}
1744+
else
1745+
{
1746+
hi1_all = _mm_unpackhi_epi64(self, self);
1747+
}
17481748

17491749
// merge halves
17501750
const auto low_all = _mm_unpacklo_epi64(lo0_all, lo1_all);

0 commit comments

Comments
 (0)