move arch-specific code to arch/SSE and arch/AltiVec subdirs.

rename the noarch PacketMath.h to DummyPacketMath.h
This commit is contained in:
Benoit Jacob 2008-05-12 08:30:42 +00:00
parent 3562b01105
commit dca416cace
4 changed files with 11 additions and 17 deletions

View File

@ -50,11 +50,12 @@ namespace Eigen {
#include "src/Core/NumTraits.h" #include "src/Core/NumTraits.h"
#include "src/Core/MathFunctions.h" #include "src/Core/MathFunctions.h"
#include "src/Core/PacketMath.h" #include "src/Core/DummyPacketMath.h"
#if defined EIGEN_VECTORIZE_SSE #if defined EIGEN_VECTORIZE_SSE
#include "src/Core/PacketMath_SSE.h" #include "src/Core/arch/SSE/PacketMath.h"
#elif defined EIGEN_VECTORIZE_ALTIVEC #elif defined EIGEN_VECTORIZE_ALTIVEC
#include "src/Core/PacketMath_Altivec.h" #include "src/Core/arch/AltiVec/PacketMath.h"
#endif #endif
#include "src/Core/Functors.h" #include "src/Core/Functors.h"

View File

@ -22,12 +22,8 @@
// License and a copy of the GNU General Public License along with // License and a copy of the GNU General Public License along with
// Eigen. If not, see <http://www.gnu.org/licenses/>. // Eigen. If not, see <http://www.gnu.org/licenses/>.
#ifndef EIGEN_PACKET_MATH_H #ifndef EIGEN_DUMMY_PACKET_MATH_H
#define EIGEN_PACKET_MATH_H #define EIGEN_DUMMY_PACKET_MATH_H
#ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD
#define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 16
#endif
// Default implementation for types not supported by the vectorization. // Default implementation for types not supported by the vectorization.
// In practice these functions are provided to make easier the writting // In practice these functions are provided to make easier the writting
@ -76,5 +72,5 @@ template <typename Scalar> inline Scalar ei_preduxp(const Scalar* vecs) { return
/** \internal \returns the sum of the elements of \a a*/ /** \internal \returns the sum of the elements of \a a*/
template <typename Scalar> inline Scalar ei_predux(const Scalar& a) { return a; } template <typename Scalar> inline Scalar ei_predux(const Scalar& a) { return a; }
#endif // EIGEN_PACKET_MATH_H #endif // EIGEN_DUMMY_PACKET_MATH_H

View File

@ -26,11 +26,9 @@
#ifndef EIGEN_PACKET_MATH_ALTIVEC_H #ifndef EIGEN_PACKET_MATH_ALTIVEC_H
#define EIGEN_PACKET_MATH_ALTIVEC_H #define EIGEN_PACKET_MATH_ALTIVEC_H
#ifndef EIGEN_VECTORIZE_ALTIVEC #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD
#error include PacketMath_Altivec without EIGEN_VECTORIZE_ALTIVEC
#endif
#define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 4 #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 4
#endif
static const vector int v0i = vec_splat_u32(0); static const vector int v0i = vec_splat_u32(0);
static const vector int v16i_ = vec_splat_u32(-16); static const vector int v16i_ = vec_splat_u32(-16);
@ -108,4 +106,3 @@ inline int ei_pfirst(const vector int a)
} }
#endif // EIGEN_PACKET_MATH_ALTIVEC_H #endif // EIGEN_PACKET_MATH_ALTIVEC_H

View File

@ -25,8 +25,8 @@
#ifndef EIGEN_PACKET_MATH_SSE_H #ifndef EIGEN_PACKET_MATH_SSE_H
#define EIGEN_PACKET_MATH_SSE_H #define EIGEN_PACKET_MATH_SSE_H
#ifndef EIGEN_VECTORIZE_SSE #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD
#error include PacketMath_SSE without EIGEN_VECTORIZE_SSE #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 16
#endif #endif
template<> struct ei_packet_traits<float> { typedef __m128 type; enum {size=4}; }; template<> struct ei_packet_traits<float> { typedef __m128 type; enum {size=4}; };