Implicit cast of Altivec vectors failing with XL compiler.
In VTK/ThirdParty/eigen/vtkeigen/eigen/src/Core/arch/AltiVec/PacketMath.h
the operation vec_cmpeq(reinterpret_cast<Packet2d>(select), reinterpret_cast<Packet2d>(p2l_ONE))
will return a vector type with a __bool
qualifier. At least it does with the XL compiler (clang frontend).
This will cause the implicit cast to fail. Making it explicit as in the patch below should be, in my understanding, sufficient as types are compatible.
diff -ur src-original/VTK/ThirdParty/eigen/vtkeigen/eigen/src/Core/arch/AltiVec/PacketMath.h src/VTK/ThirdParty/eigen/vtkeigen/eigen/src/Core/arch/AltiVec/PacketMath.h
--- src-original/VTK/ThirdParty/eigen/vtkeigen/eigen/src/Core/arch/AltiVec/PacketMath.h
+++ src/VTK/ThirdParty/eigen/vtkeigen/eigen/src/Core/arch/AltiVec/PacketMath.h
@@ -1022,7 +1022,7 @@
template<> EIGEN_STRONG_INLINE Packet2d pblend(const Selector<2>& ifPacket, const Packet2d& thenPacket, const Packet2d& elsePacket) {
Packet2l select = { ifPacket.select[0], ifPacket.select[1] };
- Packet2bl mask = vec_cmpeq(reinterpret_cast<Packet2d>(select), reinterpret_cast<Packet2d>(p2l_ONE));
+ Packet2bl mask = reinterpret_cast<Packet2ul>(vec_cmpeq(reinterpret_cast<Packet2d>(select), reinterpret_cast<Packet2d>(p2l_ONE)));
return vec_sel(elsePacket, thenPacket, mask);
}
#endif // __VSX__