Update pshiftleft to pass the shift as a true compile-time integer.

This commit is contained in:
Gael Guennebaud
2018-11-27 22:57:30 +01:00
parent fa7fd61eda
commit a1a5fbbd21
4 changed files with 11 additions and 9 deletions

View File

@@ -219,9 +219,11 @@ pxor(const Packet& a, const Packet& b) { return a ^ b; }
template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
pandnot(const Packet& a, const Packet& b) { return a & (!b); }
/** \internal \returns \a a shifted by n bits */
template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
pshiftleft(const Packet& a, int n); /* { return a << n; } */
/** \internal \returns \a a shifted by N bits */
template<int N> EIGEN_DEVICE_FUNC inline int
pshiftleft(const int& a) { return a << N; }
template<int N> EIGEN_DEVICE_FUNC inline long int
pshiftleft(const long int& a) { return a << N; }
/** \internal \returns the significant and exponent of the underlying floating point numbers
* See https://en.cppreference.com/w/cpp/numeric/math/frexp