Use shifts for VectorGetLow

pull/703/head
Jeffrey Walton 2018-08-10 01:24:32 -04:00
parent b44de10e18
commit eddc357981
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 8 additions and 3 deletions

View File

@ -234,6 +234,10 @@ void Benchmark2(double t, double hertz)
if (HasPMULL())
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM");
else
#elif CRYPTOPP_POWER8_VMULL_AVAILABLE
if (HasPMULL())
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM");
else
#endif
{
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM (2K tables)", MakeParameters(Name::TableSize(), 2048));

View File

@ -336,9 +336,10 @@ inline T VectorRotateRight(const T& vec)
template <class T>
inline T VectorGetLow(const T& val)
{
const T zero = {0};
const uint8x16_p mask = {16,16,16,16, 16,16,16,16, 8,9,10,11, 12,13,14,15 };
return (T)vec_perm(val, zero, mask);
//const T zero = {0};
//const uint8x16_p mask = {16,16,16,16, 16,16,16,16, 8,9,10,11, 12,13,14,15 };
//return (T)vec_perm(val, zero, mask);
return VectorShiftLeft<8>(VectorShiftRight<8>(val));
}
/// \brief Extract a dword from a vector