From d71ac6a75593fad75b548a8945ce9a0fbca6392a Mon Sep 17 00:00:00 2001 From: Chip Kerchner Date: Wed, 15 Mar 2023 16:50:46 +0000 Subject: [PATCH] Fix recent PowerPC warnings and clang warning --- .../src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h | 12 ++++-------- Eigen/src/Core/util/DisableStupidWarnings.h | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h b/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h index 22dbab585..fe4906d10 100644 --- a/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h +++ b/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h @@ -57,10 +57,10 @@ EIGEN_ALWAYS_INLINE void KLoop } BFLOAT16_UNROLL - for(Index i = 0, k = 0; i < num_rhs; i++) { + for(Index i = 0, x = 0; i < num_rhs; i++) { BFLOAT16_UNROLL - for(Index j = 0; j < num_lhs; j++, k++) { - __builtin_mma_xvbf16ger2pp(&(quad_acc[k]), reinterpret_cast(rhs[i].m_val), reinterpret_cast(lhs[j].m_val)); + for(Index j = 0; j < num_lhs; j++, x++) { + __builtin_mma_xvbf16ger2pp(&(quad_acc[x]), reinterpret_cast(rhs[i].m_val), reinterpret_cast(lhs[j].m_val)); } } } @@ -730,12 +730,8 @@ EIGEN_ALWAYS_INLINE void outputVecResults(Packet4f (&acc)[num_acc][4], float *re } else { if (extra == 3) { pstoreu_partial(result + k, d0, extra); - } else if (extra == 2) { - Packet2ul d1 = reinterpret_cast(d0); - *(unsigned long long *)(result + k) = d1[0]; } else { - Packet4i d1 = reinterpret_cast(d0); - *(unsigned int *)(result + k) = d1[0]; + memcpy((void *)(result + k), (void *)(&d0), sizeof(float) * extra); } } } diff --git a/Eigen/src/Core/util/DisableStupidWarnings.h b/Eigen/src/Core/util/DisableStupidWarnings.h index eed239769..bed6cddf8 100644 --- a/Eigen/src/Core/util/DisableStupidWarnings.h +++ b/Eigen/src/Core/util/DisableStupidWarnings.h @@ -48,7 +48,7 @@ #if __has_warning("-Wimplicit-int-float-conversion") #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" #endif - #if ( defined(__ALTIVEC__) || defined(__VSX__) ) && __cplusplus < 201103L + #if ( defined(__ALTIVEC__) || defined(__VSX__) ) && ( !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 201112L) ) // warning: generic selections are a C11-specific feature // ignoring warnings thrown at vec_ctf in Altivec/PacketMath.h #if __has_warning("-Wc11-extensions")