diff --git a/Eigen/src/Core/DenseStorage.h b/Eigen/src/Core/DenseStorage.h index 39507ff37..1bcaf4c56 100644 --- a/Eigen/src/Core/DenseStorage.h +++ b/Eigen/src/Core/DenseStorage.h @@ -65,7 +65,7 @@ struct plain_array template struct plain_array { - EIGEN_ALIGN16 T array[Size]; + EIGEN_USER_ALIGN16 T array[Size]; plain_array() { EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(0xf) } plain_array(constructor_without_unaligned_array_assert) {} }; @@ -73,7 +73,7 @@ struct plain_array template struct plain_array { - EIGEN_ALIGN16 T array[1]; + EIGEN_USER_ALIGN16 T array[1]; plain_array() {} plain_array(constructor_without_unaligned_array_assert) {} }; diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 9fce08b00..d2fa3230b 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -261,9 +261,7 @@ * If we made alignment depend on whether or not EIGEN_VECTORIZE is defined, it would be impossible to link * vectorized and non-vectorized code. */ -#if !EIGEN_ALIGN_STATICALLY - #define EIGEN_ALIGN_TO_BOUNDARY(n) -#elif (defined __GNUC__) || (defined __PGI) || (defined __IBMCPP__) +#if (defined __GNUC__) || (defined __PGI) || (defined __IBMCPP__) #define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n))) #elif (defined _MSC_VER) #define EIGEN_ALIGN_TO_BOUNDARY(n) __declspec(align(n)) @@ -276,6 +274,14 @@ #define EIGEN_ALIGN16 EIGEN_ALIGN_TO_BOUNDARY(16) +#if EIGEN_ALIGN_STATICALLY +#define EIGEN_USER_ALIGN_TO_BOUNDARY(n) EIGEN_ALIGN_TO_BOUNDARY(n) +#define EIGEN_USER_ALIGN16 EIGEN_ALIGN16 +#else +#define EIGEN_USER_ALIGN_TO_BOUNDARY(n) +#define EIGEN_USER_ALIGN16 +#endif + #ifdef EIGEN_DONT_USE_RESTRICT_KEYWORD #define EIGEN_RESTRICT #endif