Switch to 2-mask version of vec_perm for repack

pull/600/head
Jeffrey Walton 2018-03-11 13:56:02 -04:00
parent 03d4508a76
commit a0cbdc7ba4
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 4 additions and 8 deletions

View File

@ -1063,8 +1063,7 @@ static inline
uint32x4_p8 VectorMaj(const uint32x4_p8 x, const uint32x4_p8 y, const uint32x4_p8 z)
{
// The trick below is due to Andy Polyakov and Jack Lloyd
const uint32x4_p8 xy = vec_xor(x, y);
return vec_sel(y, z, xy);
return vec_sel(y, z, vec_xor(x, y));
}
static inline
@ -1112,10 +1111,8 @@ uint32x4_p8 VectorPack(const uint32x4_p8 a, const uint32x4_p8 b,
const uint32x4_p8 c, const uint32x4_p8 d)
{
const uint8x16_p8 m1 = {0,1,2,3, 16,17,18,19, 0,0,0,0, 0,0,0,0};
const uint8x16_p8 m2 = {0,1,2,3, 4,5,6,7, 16,17,18,19, 0,0,0,0};
const uint8x16_p8 m3 = {0,1,2,3, 4,5,6,7, 8,9,10,11, 16,17,18,19};
return vec_perm(vec_perm(vec_perm(a,b,m1),c,m2),d,m3);
const uint8x16_p8 m2 = {0,1,2,3, 4,5,6,7, 16,17,18,19, 20,21,22,23};
return vec_perm(vec_perm(a,b,m1), vec_perm(c,d,m1), m2);
}
template <unsigned int L> static inline
@ -1373,8 +1370,7 @@ static inline
uint64x2_p8 VectorMaj(const uint64x2_p8 x, const uint64x2_p8 y, const uint64x2_p8 z)
{
// The trick below is due to Andy Polyakov and Jack Lloyd
const uint64x2_p8 xy = vec_xor(x, y);
return vec_sel(y, z, xy);
return vec_sel(y, z, vec_xor(x, y));
}
static inline