Skip to content

Commit cc1c078

Browse files
committed
fix style issues and fix the implementation of first() for 32-bit architectures in windows
1 parent ca5199d commit cc1c078

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

include/xsimd/arch/xsimd_avx.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,16 +1891,15 @@ namespace xsimd
18911891
}
18921892
else XSIMD_IF_CONSTEXPR(sizeof(T) == 8)
18931893
{
1894-
__m128i low = _mm256_castsi256_si128(self);
1895-
return static_cast<T>(_mm_cvtsi128_si64(low));
1894+
batch<T, sse4_2> low = _mm256_castsi256_si128(self);
1895+
return first(low, sse4_2 {});
18961896
}
18971897
else
18981898
{
18991899
assert(false && "unsupported arch/op combination");
19001900
return {};
19011901
}
19021902
}
1903-
19041903
}
19051904
}
19061905

include/xsimd/arch/xsimd_avx512f.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2369,7 +2369,8 @@ namespace xsimd
23692369
}
23702370
else XSIMD_IF_CONSTEXPR(sizeof(T) == 8)
23712371
{
2372-
return static_cast<T>(_mm_cvtsi128_si64(_mm512_castsi512_si128(self)));
2372+
batch<T, sse4_2> low = _mm512_castsi256_si128(self);
2373+
return first(low, sse4_2 {});
23732374
}
23742375
else
23752376
{

include/xsimd/arch/xsimd_sse2.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,15 @@ namespace xsimd
18131813
}
18141814
else XSIMD_IF_CONSTEXPR(sizeof(T) == 8)
18151815
{
1816+
#if defined(__x86_64__)
18161817
return static_cast<T>(_mm_cvtsi128_si64(self));
1818+
#else
1819+
__m128i m;
1820+
_mm_storel_epi64(&m, self);
1821+
int64_t i;
1822+
std::memcpy(&i, &m, sizeof(i));
1823+
return i;
1824+
#endif
18171825
}
18181826
else
18191827
{

include/xsimd/types/xsimd_batch.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,6 @@ namespace xsimd
11001100
{
11011101
}
11021102

1103-
11041103
template <class T, class A>
11051104
template <class U, class... V, size_t I, size_t... Is>
11061105
XSIMD_INLINE auto batch_bool<T, A>::make_register(detail::index_sequence<I, Is...>, U u, V... v) noexcept -> register_type

0 commit comments

Comments
 (0)