mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-16 11:23:14 +08:00
proper C++ casting
This commit is contained in:
parent
10cd52350f
commit
634fedaf68
@ -102,7 +102,7 @@ template<> EIGEN_STRONG_INLINE Packet2cf pset1<Packet2cf>(const std::complex<flo
|
|||||||
Packet2cf res;
|
Packet2cf res;
|
||||||
#if EIGEN_GNUC_AT_MOST(4,2)
|
#if EIGEN_GNUC_AT_MOST(4,2)
|
||||||
// workaround annoying "may be used uninitialized in this function" warning with gcc 4.2
|
// workaround annoying "may be used uninitialized in this function" warning with gcc 4.2
|
||||||
res.v = _mm_loadl_pi(_mm_set1_ps(0.0f), (const __m64*)&from);
|
res.v = _mm_loadl_pi(_mm_set1_ps(0.0f), reinterpret_cast<const __m64*>(&from));
|
||||||
#else
|
#else
|
||||||
res.v = _mm_loadl_pi(res.v, (const __m64*)&from);
|
res.v = _mm_loadl_pi(res.v, (const __m64*)&from);
|
||||||
#endif
|
#endif
|
||||||
|
@ -291,7 +291,7 @@ template<> EIGEN_STRONG_INLINE Packet4i ploadu<Packet4i>(const int* from)
|
|||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE Packet4f ploaddup<Packet4f>(const float* from)
|
template<> EIGEN_STRONG_INLINE Packet4f ploaddup<Packet4f>(const float* from)
|
||||||
{
|
{
|
||||||
return vec4f_swizzle1(_mm_castpd_ps(_mm_load_sd((const double*)from)), 0, 0, 1, 1);
|
return vec4f_swizzle1(_mm_castpd_ps(_mm_load_sd(reinterpret_cast<const double*>(from))), 0, 0, 1, 1);
|
||||||
}
|
}
|
||||||
template<> EIGEN_STRONG_INLINE Packet2d ploaddup<Packet2d>(const double* from)
|
template<> EIGEN_STRONG_INLINE Packet2d ploaddup<Packet2d>(const double* from)
|
||||||
{ return pset1<Packet2d>(from[0]); }
|
{ return pset1<Packet2d>(from[0]); }
|
||||||
@ -311,8 +311,8 @@ template<> EIGEN_STRONG_INLINE void pstoreu<double>(double* to, const Packet2d&
|
|||||||
_mm_storel_pd((to), from);
|
_mm_storel_pd((to), from);
|
||||||
_mm_storeh_pd((to+1), from);
|
_mm_storeh_pd((to+1), from);
|
||||||
}
|
}
|
||||||
template<> EIGEN_STRONG_INLINE void pstoreu<float>(float* to, const Packet4f& from) { EIGEN_DEBUG_UNALIGNED_STORE pstoreu((double*)to, _mm_castps_pd(from)); }
|
template<> EIGEN_STRONG_INLINE void pstoreu<float>(float* to, const Packet4f& from) { EIGEN_DEBUG_UNALIGNED_STORE pstoreu(reinterpret_cast<double*>(to), _mm_castps_pd(from)); }
|
||||||
template<> EIGEN_STRONG_INLINE void pstoreu<int>(int* to, const Packet4i& from) { EIGEN_DEBUG_UNALIGNED_STORE pstoreu((double*)to, _mm_castsi128_pd(from)); }
|
template<> EIGEN_STRONG_INLINE void pstoreu<int>(int* to, const Packet4i& from) { EIGEN_DEBUG_UNALIGNED_STORE pstoreu(reinterpret_cast<double*>(to), _mm_castsi128_pd(from)); }
|
||||||
|
|
||||||
// some compilers might be tempted to perform multiple moves instead of using a vector path.
|
// some compilers might be tempted to perform multiple moves instead of using a vector path.
|
||||||
template<> EIGEN_STRONG_INLINE void pstore1<Packet4f>(float* to, const float& a)
|
template<> EIGEN_STRONG_INLINE void pstore1<Packet4f>(float* to, const float& a)
|
||||||
|
@ -763,7 +763,7 @@ namespace internal {
|
|||||||
|
|
||||||
inline bool cpuid_is_vendor(int abcd[4], const char* vendor)
|
inline bool cpuid_is_vendor(int abcd[4], const char* vendor)
|
||||||
{
|
{
|
||||||
return abcd[1]==((int*)(vendor))[0] && abcd[3]==((int*)(vendor))[1] && abcd[2]==((int*)(vendor))[2];
|
return abcd[1]==(reinterpret_cast<const int*>(vendor))[0] && abcd[3]==(reinterpret_cast<const int*>(vendor))[1] && abcd[2]==(reinterpret_cast<const int*>(vendor))[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void queryCacheSizes_intel_direct(int& l1, int& l2, int& l3)
|
inline void queryCacheSizes_intel_direct(int& l1, int& l2, int& l3)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user