SuperVector shuffle implementation and test function optimized

This commit is contained in:
Apostolos Tapsas
2021-10-22 11:55:39 +00:00
parent 57301721f1
commit d43d6733b6
5 changed files with 7 additions and 18 deletions

View File

@@ -849,15 +849,15 @@ TEST(SimdUtilsTest, pshufb_m128) {
}
u8 vec2[16];
for (int i=0; i<16; i++) {
vec2[i]=i;
}
vec2[i]=i + (rand() % 16 + 0);
}
m128 v1 = loadu128(vec);
m128 v2 = loadu128(vec2);
m128 vres = pshufb_m128(v1, v2);
u8 res[16];
store128(res, vres);
for (int i=0; i<16; i++) {
ASSERT_EQ(vec[vec2[i]], res[i]);
ASSERT_EQ(vec[vec2[i] % 16 ], res[i]);
}
}

View File

@@ -280,13 +280,13 @@ TEST(SuperVectorUtilsTest,pshufb128c) {
}
u8 vec2[16];
for (int i=0; i<16; i++) {
vec2[i]=i;
vec2[i]=i + (rand() % 15 + 0);
}
auto SP1 = SuperVector<16>::loadu(vec);
auto SP2 = SuperVector<16>::loadu(vec2);
auto SResult = SP1.template pshufb<true>(SP2);
for (int i=0; i<16; i++) {
ASSERT_EQ(vec[vec2[i]],SResult.u.u8[i]);
ASSERT_EQ(vec[vec2[i] % 16 ],SResult.u.u8[i]);
}
}