mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-24 14:45:14 +08:00
Fix compilation with gcc-4.6.0, patch provided by Anton Gladky <gladky.anton@gmail.com>,
working on debian packaging.
This commit is contained in:
parent
012419166e
commit
a18a1be42d
@ -70,7 +70,7 @@ template<> EIGEN_STRONG_INLINE Packet2cf pset1<Packet2cf>(const std::complex<flo
|
||||
{
|
||||
Packet2cf res;
|
||||
/* On AltiVec we cannot load 64-bit registers, so wa have to take care of alignment */
|
||||
if((ptrdiff_t(&from) % 16) == 0)
|
||||
if((std::ptrdiff_t(&from) % 16) == 0)
|
||||
res.v = pload<Packet4f>((const float *)&from);
|
||||
else
|
||||
res.v = ploadu<Packet4f>((const float *)&from);
|
||||
|
@ -296,14 +296,14 @@ template<> EIGEN_STRONG_INLINE Packet4i ploadu<Packet4i>(const int* from)
|
||||
template<> EIGEN_STRONG_INLINE Packet4f ploaddup<Packet4f>(const float* from)
|
||||
{
|
||||
Packet4f p;
|
||||
if((ptrdiff_t(&from) % 16) == 0) p = pload<Packet4f>(from);
|
||||
if((std::ptrdiff_t(&from) % 16) == 0) p = pload<Packet4f>(from);
|
||||
else p = ploadu<Packet4f>(from);
|
||||
return vec_perm(p, p, p16uc_DUPLICATE);
|
||||
}
|
||||
template<> EIGEN_STRONG_INLINE Packet4i ploaddup<Packet4i>(const int* from)
|
||||
{
|
||||
Packet4i p;
|
||||
if((ptrdiff_t(&from) % 16) == 0) p = pload<Packet4i>(from);
|
||||
if((std::ptrdiff_t(&from) % 16) == 0) p = pload<Packet4i>(from);
|
||||
else p = ploadu<Packet4i>(from);
|
||||
return vec_perm(p, p, p16uc_DUPLICATE);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ namespace Eigen {
|
||||
{
|
||||
public:
|
||||
typedef size_t size_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef T* pointer;
|
||||
typedef const T* const_pointer;
|
||||
typedef T& reference;
|
||||
|
@ -38,7 +38,7 @@ template<int Alignment,typename VectorType> void map_class_vector(const VectorTy
|
||||
Scalar* a_array = internal::aligned_new<Scalar>(arraysize+1);
|
||||
Scalar* array = a_array;
|
||||
if(Alignment!=Aligned)
|
||||
array = (Scalar*)(ptrdiff_t(a_array) + (internal::packet_traits<Scalar>::AlignedOnScalar?sizeof(Scalar):sizeof(typename NumTraits<Scalar>::Real)));
|
||||
array = (Scalar*)(std::ptrdiff_t(a_array) + (internal::packet_traits<Scalar>::AlignedOnScalar?sizeof(Scalar):sizeof(typename NumTraits<Scalar>::Real)));
|
||||
|
||||
{
|
||||
Map<VectorType, Alignment, InnerStride<3> > map(array, size);
|
||||
@ -77,7 +77,7 @@ template<int Alignment,typename MatrixType> void map_class_matrix(const MatrixTy
|
||||
Scalar* a_array = internal::aligned_new<Scalar>(arraysize+1);
|
||||
Scalar* array = a_array;
|
||||
if(Alignment!=Aligned)
|
||||
array = (Scalar*)(ptrdiff_t(a_array) + (internal::packet_traits<Scalar>::AlignedOnScalar?sizeof(Scalar):sizeof(typename NumTraits<Scalar>::Real)));
|
||||
array = (Scalar*)(std::ptrdiff_t(a_array) + (internal::packet_traits<Scalar>::AlignedOnScalar?sizeof(Scalar):sizeof(typename NumTraits<Scalar>::Real)));
|
||||
|
||||
// test no inner stride and some dynamic outer stride
|
||||
{
|
||||
|
@ -393,7 +393,7 @@ class FFT
|
||||
for (int k=0;k<nx;++k)
|
||||
*x++ *= s;
|
||||
#else
|
||||
if ( ((ptrdiff_t)x) & 15 )
|
||||
if ( ((std::ptrdiff_t)x) & 15 )
|
||||
Matrix<T_Data, Dynamic, 1>::Map(x,nx) *= s;
|
||||
else
|
||||
Matrix<T_Data, Dynamic, 1>::MapAligned(x,nx) *= s;
|
||||
|
Loading…
Reference in New Issue
Block a user