mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-27 03:40:22 +00:00
Fix TestAltivecOps on AIX
This commit is contained in:
parent
0b348fe4be
commit
92808945c1
@ -1362,9 +1362,9 @@ inline T VecSwapWords(const T vec)
|
||||
template <class T>
|
||||
inline T VecGetLow(const T val)
|
||||
{
|
||||
#if (CRYPTOPP_BIG_ENDIAN)
|
||||
#if (CRYPTOPP_BIG_ENDIAN) && (_ARCH_PWR8)
|
||||
const T zero = {0};
|
||||
return VecMergeLo(zero, val);
|
||||
return (T)VecMergeLo((uint64x2_p)zero, (uint64x2_p)val);
|
||||
#else
|
||||
return VecShiftRightOctet<8>(VecShiftLeftOctet<8>(val));
|
||||
#endif
|
||||
@ -1384,9 +1384,9 @@ inline T VecGetLow(const T val)
|
||||
template <class T>
|
||||
inline T VecGetHigh(const T val)
|
||||
{
|
||||
#if (CRYPTOPP_BIG_ENDIAN)
|
||||
#if (CRYPTOPP_BIG_ENDIAN) && (_ARCH_PWR8)
|
||||
const T zero = {0};
|
||||
return VecMergeHi(zero, val);
|
||||
return (T)VecMergeHi((uint64x2_p)zero, (uint64x2_p)val);
|
||||
#else
|
||||
return VecShiftRightOctet<8>(val);
|
||||
#endif
|
||||
|
10
validat1.cpp
10
validat1.cpp
@ -1187,13 +1187,17 @@ bool TestAltivecOps()
|
||||
//********** Extraction **********//
|
||||
bool pass3=true;
|
||||
|
||||
uint8x16_p ex1 = {0x1f,0x1e,0x1d,0x1c, 0x1b,0x1a,0x19,0x18,
|
||||
const byte bex1[] = {0x1f,0x1e,0x1d,0x1c, 0x1b,0x1a,0x19,0x18,
|
||||
0x17,0x16,0x15,0x14, 0x13,0x12,0x11,0x10};
|
||||
uint8x16_p ex2 = {0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,
|
||||
const byte bex2[] = {0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,
|
||||
0x17,0x16,0x15,0x14, 0x13,0x12,0x11,0x10};
|
||||
uint8x16_p ex3 = {0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,
|
||||
const byte bex3[] = {0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,
|
||||
0x1f,0x1e,0x1d,0x1c, 0x1b,0x1a,0x19,0x18};
|
||||
|
||||
const uint8x16_p ex1 = (uint8x16_p)VecLoad(bex1);
|
||||
const uint8x16_p ex2 = (uint8x16_p)VecLoad(bex2);
|
||||
const uint8x16_p ex3 = (uint8x16_p)VecLoad(bex3);
|
||||
|
||||
pass3 = VecEqual(ex2, VecGetLow(ex1)) && pass3;
|
||||
CRYPTOPP_ASSERT(pass3);
|
||||
pass3 = VecEqual(ex3, VecGetHigh(ex1)) && pass3;
|
||||
|
Loading…
Reference in New Issue
Block a user