From bb1cc0d092e118ad2a6119d40349479152cb583d Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 5 Oct 2009 10:55:42 -0400 Subject: [PATCH] after all we're not aligning to 8byte boundary keep most of the changes though as they make the code more extensible --- Eigen/src/Core/MatrixStorage.h | 14 ++------------ Eigen/src/Core/util/Macros.h | 1 - test/unalignedassert.cpp | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 23 deletions(-) diff --git a/Eigen/src/Core/MatrixStorage.h b/Eigen/src/Core/MatrixStorage.h index 654fdf5e6..73b17e63e 100644 --- a/Eigen/src/Core/MatrixStorage.h +++ b/Eigen/src/Core/MatrixStorage.h @@ -29,14 +29,12 @@ struct ei_constructor_without_unaligned_array_assert {}; /** \internal - * Static array. If the MatrixOptions require auto-alignment, and the array will be automatically aligned: - * - to 16 bytes boundary, if the total size is a multiple of 16 bytes; - * - or else to 8 bytes boundary, if the total size is a multiple of 8 bytes. + * Static array. If the MatrixOptions require auto-alignment, the array will be automatically aligned: + * to 16 bytes boundary if the total size is a multiple of 16 bytes. */ template struct ei_matrix_array { @@ -63,14 +61,6 @@ struct ei_matrix_array ei_matrix_array(ei_constructor_without_unaligned_array_assert) {} }; -template -struct ei_matrix_array -{ - EIGEN_ALIGN8 T array[Size]; - ei_matrix_array() { EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(0x7) } - ei_matrix_array(ei_constructor_without_unaligned_array_assert) {} -}; - /** \internal * * \class ei_matrix_storage diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index fb149e50a..706b30174 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -223,7 +223,6 @@ using Eigen::ei_cos; #endif #define EIGEN_ALIGN16 EIGEN_ALIGN_TO_BOUNDARY(16) -#define EIGEN_ALIGN8 EIGEN_ALIGN_TO_BOUNDARY(8) #ifdef EIGEN_DONT_USE_RESTRICT_KEYWORD #define EIGEN_RESTRICT diff --git a/test/unalignedassert.cpp b/test/unalignedassert.cpp index 8acc90158..233268d1d 100644 --- a/test/unalignedassert.cpp +++ b/test/unalignedassert.cpp @@ -93,7 +93,7 @@ void construct_at_boundary(int boundary) void unalignedassert() { - construct_at_boundary(8); + construct_at_boundary(4); construct_at_boundary(4); construct_at_boundary(16); construct_at_boundary(16); @@ -101,12 +101,17 @@ void unalignedassert() construct_at_boundary(16); construct_at_boundary(16); - construct_at_boundary(8); + construct_at_boundary(4); construct_at_boundary(16); construct_at_boundary(16); - construct_at_boundary(8); + construct_at_boundary(4); construct_at_boundary(16); + construct_at_boundary(16); + construct_at_boundary(4); + construct_at_boundary(16); + construct_at_boundary(16); + check_unalignedassert_good(); check_unalignedassert_good(); check_unalignedassert_good(); @@ -117,19 +122,14 @@ void unalignedassert() check_unalignedassert_good >(); #if EIGEN_ALIGN - VERIFY_RAISES_ASSERT(construct_at_boundary(4)); - VERIFY_RAISES_ASSERT(construct_at_boundary(4)); VERIFY_RAISES_ASSERT(construct_at_boundary(8)); - VERIFY_RAISES_ASSERT(construct_at_boundary(4)); - VERIFY_RAISES_ASSERT(construct_at_boundary(8)); - VERIFY_RAISES_ASSERT(construct_at_boundary(4)); VERIFY_RAISES_ASSERT(construct_at_boundary(8)); VERIFY_RAISES_ASSERT(construct_at_boundary(8)); - VERIFY_RAISES_ASSERT(construct_at_boundary(4)); VERIFY_RAISES_ASSERT(construct_at_boundary(8)); VERIFY_RAISES_ASSERT(construct_at_boundary(8)); - VERIFY_RAISES_ASSERT(construct_at_boundary(4)); VERIFY_RAISES_ASSERT(construct_at_boundary(8)); + VERIFY_RAISES_ASSERT(construct_at_boundary(8)); + VERIFY_RAISES_ASSERT(construct_at_boundary(8)); #endif }