From 974fe38ca38fb812f3ce4be105cf2ff69f40aef1 Mon Sep 17 00:00:00 2001 From: Konstantinos Margaritis Date: Sun, 21 Sep 2014 11:24:30 +0000 Subject: [PATCH] prefetch are noops on VSX --- Eigen/src/Core/arch/AltiVec/PacketMath.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Eigen/src/Core/arch/AltiVec/PacketMath.h b/Eigen/src/Core/arch/AltiVec/PacketMath.h index 3555c521d..1274f72dd 100755 --- a/Eigen/src/Core/arch/AltiVec/PacketMath.h +++ b/Eigen/src/Core/arch/AltiVec/PacketMath.h @@ -28,7 +28,7 @@ namespace internal { // NOTE Altivec has 32 registers, but Eigen only accepts a value of 8 or 16 #ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS -#define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 16 +#define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 32 #endif typedef __vector float Packet4f; @@ -482,8 +482,16 @@ template<> EIGEN_STRONG_INLINE void pstoreu(float* to, const Packet4f& } #endif -template<> EIGEN_STRONG_INLINE void prefetch(const float* addr) { vec_dstt(addr, DST_CTRL(2,2,32), DST_CHAN); } -template<> EIGEN_STRONG_INLINE void prefetch(const int* addr) { vec_dstt(addr, DST_CTRL(2,2,32), DST_CHAN); } +template<> EIGEN_STRONG_INLINE void prefetch(const float* addr) { +#ifndef __VSX__ + vec_dstt(addr, DST_CTRL(2,2,32), DST_CHAN); +#endif +} +template<> EIGEN_STRONG_INLINE void prefetch(const int* addr) { +#ifndef __VSX__ + vec_dstt(addr, DST_CTRL(2,2,32), DST_CHAN); +#endif +} template<> EIGEN_STRONG_INLINE float pfirst(const Packet4f& a) { float EIGEN_ALIGN16 x[4]; vec_st(a, 0, x); return x[0]; } template<> EIGEN_STRONG_INLINE int pfirst(const Packet4i& a) { int EIGEN_ALIGN16 x[4]; vec_st(a, 0, x); return x[0]; }