Move eigen_packet_wrapper to GenericPacketMath.h and use it for SSE/AVX/AVX512 as it is already used for NEON.

This will allow us to define multiple packet types backed by the same vector type, e.g., __m128i.
Use this machanism to define packets for half and clean up the packet op implementations.
This commit is contained in:
Rasmus Munk Larsen
2020-04-15 18:17:19 +00:00
parent 4aae8ac693
commit 5ab87d8aba
5 changed files with 134 additions and 205 deletions

View File

@@ -36,22 +36,6 @@ namespace internal {
#endif
#endif
template<typename T,int unique_id>
struct eigen_packet_wrapper
{
operator T&() { return m_val; }
operator const T&() const { return m_val; }
eigen_packet_wrapper() {}
eigen_packet_wrapper(const T &v) : m_val(v) {}
eigen_packet_wrapper& operator=(const T &v)
{
m_val = v;
return *this;
}
T m_val;
};
#if EIGEN_COMP_MSVC
// In MSVC's arm_neon.h header file, all NEON vector types