diff --git a/Eigen/src/Core/arch/AltiVec/PacketMath.h b/Eigen/src/Core/arch/AltiVec/PacketMath.h index 976b5d707..cfff6691e 100755 --- a/Eigen/src/Core/arch/AltiVec/PacketMath.h +++ b/Eigen/src/Core/arch/AltiVec/PacketMath.h @@ -37,8 +37,8 @@ typedef __vector unsigned int Packet4ui; typedef __vector __bool int Packet4bi; typedef __vector short int Packet8s; typedef __vector unsigned short int Packet8us; -typedef __vector int8_t Packet16c; -typedef __vector uint8_t Packet16uc; +typedef __vector signed char Packet16c; +typedef __vector unsigned char Packet16uc; typedef eigen_packet_wrapper<__vector unsigned short int,0> Packet8bf; // We don't want to write the same code all the time, but we need to reuse the constants @@ -290,7 +290,7 @@ struct packet_traits : default_packet_traits { }; template <> -struct packet_traits : default_packet_traits { +struct packet_traits : default_packet_traits { typedef Packet16c type; typedef Packet16c half; enum { @@ -308,7 +308,7 @@ struct packet_traits : default_packet_traits { }; template <> -struct packet_traits : default_packet_traits { +struct packet_traits : default_packet_traits { typedef Packet16uc type; typedef Packet16uc half; enum { @@ -353,13 +353,13 @@ template<> struct unpacket_traits template<> struct unpacket_traits { - typedef int8_t type; + typedef signed char type; typedef Packet16c half; enum {size=16, alignment=Aligned16, vectorizable=true, masked_load_available=false, masked_store_available=false}; }; template<> struct unpacket_traits { - typedef uint8_t type; + typedef unsigned char type; typedef Packet16uc half; enum {size=16, alignment=Aligned16, vectorizable=true, masked_load_available=false, masked_store_available=false}; }; @@ -374,7 +374,7 @@ inline std::ostream & operator <<(std::ostream & s, const Packet16c & v) { union { Packet16c v; - int8_t n[16]; + signed char n[16]; } vt; vt.v = v; for (int i=0; i< 16; i++) @@ -386,7 +386,7 @@ inline std::ostream & operator <<(std::ostream & s, const Packet16uc & v) { union { Packet16uc v; - uint8_t n[16]; + unsigned char n[16]; } vt; vt.v = v; for (int i=0; i< 16; i++) @@ -462,12 +462,12 @@ template<> EIGEN_STRONG_INLINE Packet8us pload(const unsigned short i return pload_common(from); } -template<> EIGEN_STRONG_INLINE Packet16c pload(const int8_t* from) +template<> EIGEN_STRONG_INLINE Packet16c pload(const signed char* from) { return pload_common(from); } -template<> EIGEN_STRONG_INLINE Packet16uc pload(const uint8_t* from) +template<> EIGEN_STRONG_INLINE Packet16uc pload(const unsigned char* from) { return pload_common(from); } @@ -515,12 +515,12 @@ template<> EIGEN_STRONG_INLINE void pstore(bfloat16* to, const P pstore_common(reinterpret_cast(to), from); } -template<> EIGEN_STRONG_INLINE void pstore(int8_t* to, const Packet16c& from) +template<> EIGEN_STRONG_INLINE void pstore(signed char* to, const Packet16c& from) { pstore_common(to, from); } -template<> EIGEN_STRONG_INLINE void pstore(uint8_t* to, const Packet16uc& from) +template<> EIGEN_STRONG_INLINE void pstore(unsigned char* to, const Packet16uc& from) { pstore_common(to, from); } @@ -562,11 +562,11 @@ template<> EIGEN_STRONG_INLINE Packet8us pset1(const unsigned short i return pset1_size8(from); } -template<> EIGEN_STRONG_INLINE Packet16c pset1(const int8_t& from) { +template<> EIGEN_STRONG_INLINE Packet16c pset1(const signed char& from) { return pset1_size16(from); } -template<> EIGEN_STRONG_INLINE Packet16uc pset1(const uint8_t& from) { +template<> EIGEN_STRONG_INLINE Packet16uc pset1(const unsigned char& from) { return pset1_size16(from); } @@ -669,12 +669,12 @@ template EIGEN_DEVICE_FUNC inline Packet pgather_size16(const _ } -template<> EIGEN_DEVICE_FUNC inline Packet16c pgather(const int8_t* from, Index stride) +template<> EIGEN_DEVICE_FUNC inline Packet16c pgather(const signed char* from, Index stride) { return pgather_size16(from, stride); } -template<> EIGEN_DEVICE_FUNC inline Packet16uc pgather(const uint8_t* from, Index stride) +template<> EIGEN_DEVICE_FUNC inline Packet16uc pgather(const unsigned char* from, Index stride) { return pgather_size16(from, stride); } @@ -746,12 +746,12 @@ template EIGEN_DEVICE_FUNC inline void pscatter_size16(__UNPACK to[15*stride] = a[15]; } -template<> EIGEN_DEVICE_FUNC inline void pscatter(int8_t* to, const Packet16c& from, Index stride) +template<> EIGEN_DEVICE_FUNC inline void pscatter(signed char* to, const Packet16c& from, Index stride) { pscatter_size16(to, from, stride); } -template<> EIGEN_DEVICE_FUNC inline void pscatter(uint8_t* to, const Packet16uc& from, Index stride) +template<> EIGEN_DEVICE_FUNC inline void pscatter(unsigned char* to, const Packet16uc& from, Index stride) { pscatter_size16(to, from, stride); } @@ -760,8 +760,8 @@ template<> EIGEN_STRONG_INLINE Packet4f plset(const float& a) { template<> EIGEN_STRONG_INLINE Packet4i plset(const int& a) { return pset1(a) + p4i_COUNTDOWN; } template<> EIGEN_STRONG_INLINE Packet8s plset(const short int& a) { return pset1(a) + p8s_COUNTDOWN; } template<> EIGEN_STRONG_INLINE Packet8us plset(const unsigned short int& a) { return pset1(a) + p8us_COUNTDOWN; } -template<> EIGEN_STRONG_INLINE Packet16c plset(const int8_t& a) { return pset1(a) + p16c_COUNTDOWN; } -template<> EIGEN_STRONG_INLINE Packet16uc plset(const uint8_t& a) { return pset1(a) + p16uc_COUNTDOWN; } +template<> EIGEN_STRONG_INLINE Packet16c plset(const signed char& a) { return pset1(a) + p16c_COUNTDOWN; } +template<> EIGEN_STRONG_INLINE Packet16uc plset(const unsigned char& a) { return pset1(a) + p16uc_COUNTDOWN; } template<> EIGEN_STRONG_INLINE Packet4f padd (const Packet4f& a, const Packet4f& b) { return a + b; } template<> EIGEN_STRONG_INLINE Packet4i padd (const Packet4i& a, const Packet4i& b) { return a + b; } @@ -859,6 +859,11 @@ template<> EIGEN_STRONG_INLINE Packet16uc pmax(const Packet16uc& a, template<> EIGEN_STRONG_INLINE Packet4f pcmp_le(const Packet4f& a, const Packet4f& b) { return reinterpret_cast(vec_cmple(a,b)); } template<> EIGEN_STRONG_INLINE Packet4f pcmp_lt(const Packet4f& a, const Packet4f& b) { return reinterpret_cast(vec_cmplt(a,b)); } template<> EIGEN_STRONG_INLINE Packet4f pcmp_eq(const Packet4f& a, const Packet4f& b) { return reinterpret_cast(vec_cmpeq(a,b)); } +template<> EIGEN_STRONG_INLINE Packet16c pcmp_eq(const Packet16c& a, const Packet16c& b) { return reinterpret_cast(vec_cmpeq(a,b)); } +template<> EIGEN_STRONG_INLINE Packet16uc pcmp_eq(const Packet16uc& a, const Packet16uc& b) { return reinterpret_cast(vec_cmpeq(a,b)); } + +template<> EIGEN_STRONG_INLINE Packet8s pcmp_eq(const Packet8s& a, const Packet8s& b) { return reinterpret_cast(vec_cmpeq(a,b)); } +template<> EIGEN_STRONG_INLINE Packet8us pcmp_eq(const Packet8us& a, const Packet8us& b) { return reinterpret_cast(vec_cmpeq(a,b)); } template<> EIGEN_STRONG_INLINE Packet4f pcmp_lt_or_nan(const Packet4f& a, const Packet4f& b) { Packet4f c = reinterpret_cast(vec_cmpge(a,b)); @@ -946,11 +951,11 @@ template<> EIGEN_STRONG_INLINE Packet8bf ploadu(const bfloat16* from) { return ploadu_common(reinterpret_cast(from)); } -template<> EIGEN_STRONG_INLINE Packet16c ploadu(const int8_t* from) +template<> EIGEN_STRONG_INLINE Packet16c ploadu(const signed char* from) { return ploadu_common(from); } -template<> EIGEN_STRONG_INLINE Packet16uc ploadu(const uint8_t* from) +template<> EIGEN_STRONG_INLINE Packet16uc ploadu(const unsigned char* from) { return ploadu_common(from); } @@ -1008,7 +1013,7 @@ template<> EIGEN_STRONG_INLINE Packet8bf ploadquad(const bfloat16* return ploadquad(reinterpret_cast(from)); } -template<> EIGEN_STRONG_INLINE Packet16c ploaddup(const int8_t* from) +template<> EIGEN_STRONG_INLINE Packet16c ploaddup(const signed char* from) { Packet16c p; if((std::ptrdiff_t(from) % 16) == 0) p = pload(from); @@ -1016,7 +1021,7 @@ template<> EIGEN_STRONG_INLINE Packet16c ploaddup(const int8_t* f return vec_perm(p, p, p16uc_DUPLICATE8_HI); } -template<> EIGEN_STRONG_INLINE Packet16uc ploaddup(const uint8_t* from) +template<> EIGEN_STRONG_INLINE Packet16uc ploaddup(const unsigned char* from) { Packet16uc p; if((std::ptrdiff_t(from) % 16) == 0) p = pload(from); @@ -1065,11 +1070,11 @@ template<> EIGEN_STRONG_INLINE void pstoreu(bfloat16* to, const P { pstoreu_common(reinterpret_cast(to), from); } -template<> EIGEN_STRONG_INLINE void pstoreu(int8_t* to, const Packet16c& from) +template<> EIGEN_STRONG_INLINE void pstoreu(signed char* to, const Packet16c& from) { pstoreu_common(to, from); } -template<> EIGEN_STRONG_INLINE void pstoreu(uint8_t* to, const Packet16uc& from) +template<> EIGEN_STRONG_INLINE void pstoreu(unsigned char* to, const Packet16uc& from) { pstoreu_common(to, from); } @@ -1094,12 +1099,12 @@ template<> EIGEN_STRONG_INLINE unsigned short int pfirst(const Packet return pfirst_common(a); } -template<> EIGEN_STRONG_INLINE int8_t pfirst(const Packet16c& a) +template<> EIGEN_STRONG_INLINE signed char pfirst(const Packet16c& a) { return pfirst_common(a); } -template<> EIGEN_STRONG_INLINE uint8_t pfirst(const Packet16uc& a) +template<> EIGEN_STRONG_INLINE unsigned char pfirst(const Packet16uc& a) { return pfirst_common(a); } @@ -1405,12 +1410,12 @@ template EIGEN_STRONG_INLINE __UNPACK_TYPE__(Packet) predux_siz + predux(third_quarter) + predux(fourth_quarter)); } -template<> EIGEN_STRONG_INLINE int8_t predux(const Packet16c& a) +template<> EIGEN_STRONG_INLINE signed char predux(const Packet16c& a) { return predux_size16(a); } -template<> EIGEN_STRONG_INLINE uint8_t predux(const Packet16uc& a) +template<> EIGEN_STRONG_INLINE unsigned char predux(const Packet16uc& a) { return predux_size16(a); } @@ -1462,7 +1467,7 @@ template<> EIGEN_STRONG_INLINE bfloat16 predux_mul(const Packet8bf& a } -template<> EIGEN_STRONG_INLINE int8_t predux_mul(const Packet16c& a) +template<> EIGEN_STRONG_INLINE signed char predux_mul(const Packet16c& a) { Packet16c pair, quad, octo, result; @@ -1474,7 +1479,7 @@ template<> EIGEN_STRONG_INLINE int8_t predux_mul(const Packet16c& a) return pfirst(result); } -template<> EIGEN_STRONG_INLINE uint8_t predux_mul(const Packet16uc& a) +template<> EIGEN_STRONG_INLINE unsigned char predux_mul(const Packet16uc& a) { Packet16uc pair, quad, octo, result; @@ -1545,7 +1550,7 @@ template<> EIGEN_STRONG_INLINE unsigned short int predux_min(const Pa return pfirst(octo); } -template<> EIGEN_STRONG_INLINE int8_t predux_min(const Packet16c& a) +template<> EIGEN_STRONG_INLINE signed char predux_min(const Packet16c& a) { Packet16c pair, quad, octo, result; @@ -1557,7 +1562,7 @@ template<> EIGEN_STRONG_INLINE int8_t predux_min(const Packet16c& a) return pfirst(result); } -template<> EIGEN_STRONG_INLINE uint8_t predux_min(const Packet16uc& a) +template<> EIGEN_STRONG_INLINE unsigned char predux_min(const Packet16uc& a) { Packet16uc pair, quad, octo, result; @@ -1625,7 +1630,7 @@ template<> EIGEN_STRONG_INLINE unsigned short int predux_max(const Pa return pfirst(octo); } -template<> EIGEN_STRONG_INLINE int8_t predux_max(const Packet16c& a) +template<> EIGEN_STRONG_INLINE signed char predux_max(const Packet16c& a) { Packet16c pair, quad, octo, result; @@ -1637,7 +1642,7 @@ template<> EIGEN_STRONG_INLINE int8_t predux_max(const Packet16c& a) return pfirst(result); } -template<> EIGEN_STRONG_INLINE uint8_t predux_max(const Packet16uc& a) +template<> EIGEN_STRONG_INLINE unsigned char predux_max(const Packet16uc& a) { Packet16uc pair, quad, octo, result;