Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 897667 Details for
Bug 936107
dev-cpp/eigen-3.4.0-r2: Uses VSX unconditionally on ppc{,64}, downstream packages fail to build on VSX-less hardware
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Upstream patch to properly guard VSX use, edited for 3.4.0-r2
fix-unconditional-vsx-use.patch (text/plain), 6.78 KB, created by
jonys
on 2024-07-15 12:44:44 UTC
(
hide
)
Description:
Upstream patch to properly guard VSX use, edited for 3.4.0-r2
Filename:
MIME Type:
Creator:
jonys
Created:
2024-07-15 12:44:44 UTC
Size:
6.78 KB
patch
obsolete
>--- a/Eigen/Core 2024-07-15 11:43:55.777054737 +0200 >+++ b/Eigen/Core 2024-07-15 11:44:32.150431036 +0200 >@@ -346,7 +346,7 @@ > #include "src/Core/CoreIterators.h" > #include "src/Core/ConditionEstimator.h" > >-#if defined(EIGEN_VECTORIZE_ALTIVEC) || defined(EIGEN_VECTORIZE_VSX) >+#if defined(EIGEN_VECTORIZE_VSX) > #include "src/Core/arch/AltiVec/MatrixProduct.h" > #elif defined EIGEN_VECTORIZE_NEON > #include "src/Core/arch/NEON/GeneralBlockPanelKernel.h" >--- a/Eigen/src/Core/arch/AltiVec/Complex.h 2024-07-15 11:44:00.093726502 +0200 >+++ b/Eigen/src/Core/arch/AltiVec/Complex.h 2024-07-15 11:44:32.153764374 +0200 >@@ -100,6 +100,7 @@ > HasAbs2 = 0, > HasMin = 0, > HasMax = 0, >+ HasSqrt = 1, > #ifdef __VSX__ > HasBlend = 1, > #endif >@@ -320,6 +321,7 @@ > HasAbs2 = 0, > HasMin = 0, > HasMax = 0, >+ HasSqrt = 1, > HasSetLinear = 0 > }; > }; >--- a/Eigen/src/Core/arch/AltiVec/MathFunctions.h 2024-07-15 11:44:05.473732857 +0200 >+++ b/Eigen/src/Core/arch/AltiVec/MathFunctions.h 2024-07-15 11:45:23.547158416 +0200 >@@ -40,16 +40,14 @@ > return pcos_float(_x); > } > >+#ifdef __VSX__ > #ifndef EIGEN_COMP_CLANG > template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED > Packet4f prsqrt<Packet4f>(const Packet4f& x) > { > return vec_rsqrt(x); > } >-#endif > >-#ifdef __VSX__ >-#ifndef EIGEN_COMP_CLANG > template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED > Packet2d prsqrt<Packet2d>(const Packet2d& x) > { >@@ -74,6 +72,26 @@ > { > return pexp_double(_x); > } >+ >+template<> EIGEN_STRONG_INLINE Packet8bf psqrt<Packet8bf> (const Packet8bf& a){ >+ BF16_TO_F32_UNARY_OP_WRAPPER(psqrt<Packet4f>, a); >+} >+ >+#ifndef EIGEN_COMP_CLANG >+template<> EIGEN_STRONG_INLINE Packet8bf prsqrt<Packet8bf> (const Packet8bf& a){ >+ BF16_TO_F32_UNARY_OP_WRAPPER(prsqrt<Packet4f>, a); >+} >+#endif >+#else >+template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS >+Packet4f psqrt<Packet4f>(const Packet4f& x) >+{ >+ Packet4f a; >+ for (Index i = 0; i < packet_traits<float>::size; i++) { >+ a[i] = numext::sqrt(x[i]); >+ } >+ return a; >+} > #endif > > // Hyperbolic Tangent function. >--- a/Eigen/src/Core/arch/AltiVec/PacketMath.h 2024-07-15 11:44:10.737072408 +0200 >+++ b/Eigen/src/Core/arch/AltiVec/PacketMath.h 2024-07-15 11:46:48.813925804 +0200 >@@ -175,16 +175,19 @@ > #else > HasRsqrt = 0, > #endif >+ HasTanh = EIGEN_FAST_MATH, >+ HasErf = EIGEN_FAST_MATH, >+ HasRint = 1, > #else > HasSqrt = 0, > HasRsqrt = 0, >- HasTanh = EIGEN_FAST_MATH, >- HasErf = EIGEN_FAST_MATH, >+ HasTanh = 0, >+ HasErf = 0, >+ HasRint = 0, > #endif > HasRound = 1, > HasFloor = 1, > HasCeil = 1, >- HasRint = 1, > HasNegate = 1, > HasBlend = 1 > }; >@@ -217,16 +220,17 @@ > #else > HasRsqrt = 0, > #endif >+ HasRint = 1, > #else > HasSqrt = 0, > HasRsqrt = 0, >- HasTanh = EIGEN_FAST_MATH, >- HasErf = EIGEN_FAST_MATH, >+ HasRint = 0, > #endif >+ HasTanh = 0, >+ HasErf = 0, > HasRound = 1, > HasFloor = 1, > HasCeil = 1, >- HasRint = 1, > HasNegate = 1, > HasBlend = 1 > }; >@@ -872,19 +876,29 @@ > return vec_nor(c,c); > } > >+#ifdef __VSX__ > template<> EIGEN_STRONG_INLINE Packet4i pcmp_le(const Packet4i& a, const Packet4i& b) { return reinterpret_cast<Packet4i>(vec_cmple(a,b)); } >+#endif > template<> EIGEN_STRONG_INLINE Packet4i pcmp_lt(const Packet4i& a, const Packet4i& b) { return reinterpret_cast<Packet4i>(vec_cmplt(a,b)); } > template<> EIGEN_STRONG_INLINE Packet4i pcmp_eq(const Packet4i& a, const Packet4i& b) { return reinterpret_cast<Packet4i>(vec_cmpeq(a,b)); } >+#ifdef __VSX__ > template<> EIGEN_STRONG_INLINE Packet8s pcmp_le(const Packet8s& a, const Packet8s& b) { return reinterpret_cast<Packet8s>(vec_cmple(a,b)); } >+#endif > template<> EIGEN_STRONG_INLINE Packet8s pcmp_lt(const Packet8s& a, const Packet8s& b) { return reinterpret_cast<Packet8s>(vec_cmplt(a,b)); } > template<> EIGEN_STRONG_INLINE Packet8s pcmp_eq(const Packet8s& a, const Packet8s& b) { return reinterpret_cast<Packet8s>(vec_cmpeq(a,b)); } >+#ifdef __VSX__ > template<> EIGEN_STRONG_INLINE Packet8us pcmp_le(const Packet8us& a, const Packet8us& b) { return reinterpret_cast<Packet8us>(vec_cmple(a,b)); } >+#endif > template<> EIGEN_STRONG_INLINE Packet8us pcmp_lt(const Packet8us& a, const Packet8us& b) { return reinterpret_cast<Packet8us>(vec_cmplt(a,b)); } > template<> EIGEN_STRONG_INLINE Packet8us pcmp_eq(const Packet8us& a, const Packet8us& b) { return reinterpret_cast<Packet8us>(vec_cmpeq(a,b)); } >+#ifdef __VSX__ > template<> EIGEN_STRONG_INLINE Packet16c pcmp_le(const Packet16c& a, const Packet16c& b) { return reinterpret_cast<Packet16c>(vec_cmple(a,b)); } >+#endif > template<> EIGEN_STRONG_INLINE Packet16c pcmp_lt(const Packet16c& a, const Packet16c& b) { return reinterpret_cast<Packet16c>(vec_cmplt(a,b)); } > template<> EIGEN_STRONG_INLINE Packet16c pcmp_eq(const Packet16c& a, const Packet16c& b) { return reinterpret_cast<Packet16c>(vec_cmpeq(a,b)); } >+#ifdef __VSX__ > template<> EIGEN_STRONG_INLINE Packet16uc pcmp_le(const Packet16uc& a, const Packet16uc& b) { return reinterpret_cast<Packet16uc>(vec_cmple(a,b)); } >+#endif > template<> EIGEN_STRONG_INLINE Packet16uc pcmp_lt(const Packet16uc& a, const Packet16uc& b) { return reinterpret_cast<Packet16uc>(vec_cmplt(a,b)); } > template<> EIGEN_STRONG_INLINE Packet16uc pcmp_eq(const Packet16uc& a, const Packet16uc& b) { return reinterpret_cast<Packet16uc>(vec_cmpeq(a,b)); } > >@@ -937,6 +951,7 @@ > } > template<> EIGEN_STRONG_INLINE Packet4f pceil<Packet4f>(const Packet4f& a) { return vec_ceil(a); } > template<> EIGEN_STRONG_INLINE Packet4f pfloor<Packet4f>(const Packet4f& a) { return vec_floor(a); } >+#ifdef __VSX__ > template<> EIGEN_STRONG_INLINE Packet4f print<Packet4f>(const Packet4f& a) > { > Packet4f res; >@@ -947,6 +962,7 @@ > > return res; > } >+#endif > > template<typename Packet> EIGEN_STRONG_INLINE Packet ploadu_common(const __UNPACK_TYPE__(Packet)* from) > { >@@ -1341,12 +1357,6 @@ > BF16_TO_F32_BINARY_OP_WRAPPER(psub<Packet4f>, a, b); > } > >-template<> EIGEN_STRONG_INLINE Packet8bf psqrt<Packet8bf> (const Packet8bf& a){ >- BF16_TO_F32_UNARY_OP_WRAPPER(vec_sqrt, a); >-} >-template<> EIGEN_STRONG_INLINE Packet8bf prsqrt<Packet8bf> (const Packet8bf& a){ >- BF16_TO_F32_UNARY_OP_WRAPPER(prsqrt<Packet4f>, a); >-} > template<> EIGEN_STRONG_INLINE Packet8bf pexp<Packet8bf> (const Packet8bf& a){ > BF16_TO_F32_UNARY_OP_WRAPPER(pexp_float, a); > } >@@ -1390,9 +1400,11 @@ > template<> EIGEN_STRONG_INLINE Packet8bf pround<Packet8bf> (const Packet8bf& a){ > BF16_TO_F32_UNARY_OP_WRAPPER(pround<Packet4f>, a); > } >+#ifdef __VSX__ > template<> EIGEN_STRONG_INLINE Packet8bf print<Packet8bf> (const Packet8bf& a){ > BF16_TO_F32_UNARY_OP_WRAPPER(print<Packet4f>, a); > } >+#endif > template<> EIGEN_STRONG_INLINE Packet8bf pmadd(const Packet8bf& a, const Packet8bf& b, const Packet8bf& c) { > Packet4f a_even = Bf16ToF32Even(a); > Packet4f a_odd = Bf16ToF32Odd(a);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 936107
: 897667