mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-29 19:24:25 +03:00
SuperVector shuffle implementation and test function optimized
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user