Remove specializations for VectorShiftLeft and VectorShiftRight

pull/703/head
Jeffrey Walton 2018-08-10 23:29:20 -04:00
parent 555f4742c7
commit 78d3a279dc
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 10 additions and 48 deletions

View File

@ -188,6 +188,11 @@ inline T VectorShiftLeft(const T& vec)
// Out of range
return zero;
}
else if (C == 0)
{
// Noop
return vec;
}
else
{
#if CRYPTOPP_BIG_ENDIAN
@ -198,30 +203,6 @@ inline T VectorShiftLeft(const T& vec)
}
}
// Full specializations for 0 over uint8x16_p to uint64x2_p
template<>
inline uint8x16_p VectorShiftLeft<0, uint8x16_p>(const uint8x16_p& vec)
{
return vec;
}
template<>
inline uint16x8_p VectorShiftLeft<0, uint16x8_p>(const uint16x8_p& vec)
{
return vec;
}
template<>
inline uint32x4_p VectorShiftLeft<0, uint32x4_p>(const uint32x4_p& vec)
{
return vec;
}
#if defined(CRYPTOPP_POWER8_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
template<>
inline uint64x2_p VectorShiftLeft<0, uint64x2_p>(const uint64x2_p& vec)
{
return vec;
}
#endif
/// \brief Shift a vector right
/// \tparam C shift byte count
/// \tparam T vector type
@ -249,6 +230,11 @@ inline T VectorShiftRight(const T& vec)
// Out of range
return zero;
}
else if (C == 0)
{
// Noop
return vec;
}
else
{
#if CRYPTOPP_BIG_ENDIAN
@ -259,30 +245,6 @@ inline T VectorShiftRight(const T& vec)
}
}
// Full specializations for 0 over uint8x16_p to uint64x2_p
template<>
inline uint8x16_p VectorShiftRight<0, uint8x16_p>(const uint8x16_p& vec)
{
return vec;
}
template<>
inline uint16x8_p VectorShiftRight<0, uint16x8_p>(const uint16x8_p& vec)
{
return vec;
}
template<>
inline uint32x4_p VectorShiftRight<0, uint32x4_p>(const uint32x4_p& vec)
{
return vec;
}
#if defined(CRYPTOPP_POWER8_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
template<>
inline uint64x2_p VectorShiftRight<0, uint64x2_p>(const uint64x2_p& vec)
{
return vec;
}
#endif
/// \brief Rotate a vector left
/// \tparam C shift byte count
/// \tparam T vector type