Truffle simd vectorized

This commit is contained in:
apostolos
2021-07-02 17:12:47 +03:00
committed by Konstantinos Margaritis
parent d1009e8830
commit 1ce5e17ce9
7 changed files with 413 additions and 609 deletions

View File

@@ -117,6 +117,43 @@ TEST(SuperVectorUtilsTest,OR128c){
}
}
TEST(SuperVectorUtilsTest,XOR128c){
srand (time(NULL));
u8 vec[16];
for (int i=0; i<16; i++) {
vec[i] = rand() % 100 + 1;
}
u8 vec2[16];
for (int i=0; i<16; i++) {
vec2[i] = rand() % 100 + 1;
}
auto SP1 = SuperVector<16>::loadu(vec);
auto SP2 = SuperVector<16>::loadu(vec2);
auto SPResult = SP1 ^ SP2;
for (int i=0; i<16; i++) {
ASSERT_EQ(SPResult.u.u8[i],vec[i] ^ vec2[i]);
}
}
TEST(SuperVectorUtilsTest,OPXOR128c){
srand (time(NULL));
u8 vec[16];
for (int i=0; i<16; i++) {
vec[i] = rand() % 100 + 1;
}
u8 vec2[16];
for (int i=0; i<16; i++) {
vec2[i] = rand() % 100 + 1;
}
auto SP1 = SuperVector<16>::loadu(vec);
auto SP2 = SuperVector<16>::loadu(vec2);
auto SPResult = SP1.opxor(SP2);
for (int i=0; i<16; i++) {
ASSERT_EQ(SPResult.u.u8[i],vec[i] ^ vec2[i]);
}
}
TEST(SuperVectorUtilsTest,OPANDNOT128c){
auto SP1 = SuperVector<16>::Zeroes();
auto SP2 = SuperVector<16>::Ones();