Skip to content

Commit 7ed69a9

Browse files
junparserserge-sans-paille
authored andcommitted
fix build warning as error
1 parent 7a4933d commit 7ed69a9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/xsimd/arch/xsimd_avx512f.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,13 +1121,15 @@ namespace xsimd
11211121
XSIMD_INLINE batch<float, A> insert(batch<float, A> const& self, float val, index<I>, requires_arch<avx512f>) noexcept
11221122
{
11231123

1124-
return _mm512_castsi512_ps(_mm512_mask_set1_epi32(_mm512_castps_si512(self), __mmask16(1 << (I & 15)), *(int32_t*)&val));
1124+
int32_t* tmp = reinterpret_cast<int32_t*>(&val);
1125+
return _mm512_castsi512_ps(_mm512_mask_set1_epi32(_mm512_castps_si512(self), __mmask16(1 << (I & 15)), *tmp));
11251126
}
11261127

11271128
template <class A, size_t I>
11281129
XSIMD_INLINE batch<double, A> insert(batch<double, A> const& self, double val, index<I>, requires_arch<avx512f>) noexcept
11291130
{
1130-
return _mm512_castsi512_pd(_mm512_mask_set1_epi64(_mm512_castpd_si512(self), __mmask8(1 << (I & 7)), *(int64_t*)&val));
1131+
int64_t* tmp = reinterpret_cast<int64_t*>(&val);
1132+
return _mm512_castsi512_pd(_mm512_mask_set1_epi64(_mm512_castpd_si512(self), __mmask8(1 << (I & 7)), *tmp));
11311133
}
11321134
template <class A, class T, size_t I, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
11331135
XSIMD_INLINE batch<T, A> insert(batch<T, A> const& self, T val, index<I> pos, requires_arch<avx512f>) noexcept

0 commit comments

Comments
 (0)