From 8523d447a137f20de5485fbdd28aafc3d0774153 Mon Sep 17 00:00:00 2001 From: Chip-Kerchner Date: Wed, 24 Feb 2021 14:46:04 -0600 Subject: Fixes to support old and new versions of the compilers for built-ins. Cast to non-const when using vector_pair with certain built-ins. --- Eigen/src/Core/arch/AltiVec/MatrixProduct.h | 2 +- Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'Eigen/src/Core/arch') diff --git a/Eigen/src/Core/arch/AltiVec/MatrixProduct.h b/Eigen/src/Core/arch/AltiVec/MatrixProduct.h index 9d9bbebe5..89d81e06f 100644 --- a/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +++ b/Eigen/src/Core/arch/AltiVec/MatrixProduct.h @@ -12,7 +12,7 @@ #include "MatrixProductCommon.h" -#if __GNUC__ > 10 || \ +#if __GNUC__ > 10 || __clang_major__ > 11 || \ (__GNUC__ == 10 && (__GNUC_MINOR__ > 2 || \ (__GNUC_MINOR__ == 2 && \ __GNUC_PATCHLEVEL__ >= 1))) diff --git a/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h b/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h index a91ec3204..888f7cd08 100644 --- a/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +++ b/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h @@ -12,6 +12,10 @@ #pragma GCC target("cpu=power10") +#if !__has_builtin(__builtin_vsx_assemble_pair) +#define __builtin_vsx_assemble_pair __builtin_mma_assemble_pair +#endif + namespace Eigen { namespace internal { @@ -193,13 +197,13 @@ EIGEN_STRONG_INLINE void pgerMMA, true>(__vec template<> EIGEN_STRONG_INLINE void pgerMMA(__vector_quad *acc, const __vector_pair& a, const Packet2d& b) { - __builtin_mma_xvf64gerpp(acc, a, (__vector unsigned char)b); + __builtin_mma_xvf64gerpp(acc, (__vector_pair)a, (__vector unsigned char)b); } template<> EIGEN_STRONG_INLINE void pgerMMA(__vector_quad *acc, const __vector_pair& a, const Packet2d& b) { - __builtin_mma_xvf64gernp(acc, a, (__vector unsigned char)b); + __builtin_mma_xvf64gernp(acc, (__vector_pair)a, (__vector unsigned char)b); } template<> @@ -231,7 +235,7 @@ EIGEN_STRONG_INLINE void ploadRhsMMA >(const do template<> EIGEN_STRONG_INLINE void ploadRhsMMA(const double *rhs, __vector_pair &rhsV) { - __builtin_mma_assemble_pair(&rhsV, (__vector unsigned char)(*(((Packet2d *)rhs) + 1)), (__vector unsigned char)(*((Packet2d *)rhs))); + __builtin_vsx_assemble_pair(&rhsV, (__vector unsigned char)(*(((Packet2d *)rhs) + 1)), (__vector unsigned char)(*((Packet2d *)rhs))); } template -- cgit v1.2.3