Commit 247b7eb6 authored by Bramas, Berenger (bbramas)'s avatar Bramas, Berenger (bbramas)

Merge branch 'utest-unaligned-loadstore' into 'master'

Update unit test (load store)

add a hard test for unaligned load/store

See merge request !7
parents 917a20d5 d10195ec
......@@ -204,6 +204,32 @@ class TestAll : public UTester< TestAll< VecType > > {
equalToArray(VecType().setFromIndirectArray(reals, indirect), reals);
}
{
for(int idxOffsetIn = 0 ; idxOffsetIn < sizeof(RealType)*VecType::VecLength ; ++idxOffsetIn){
unsigned char* bufferIn[sizeof(RealType)*VecType::VecLength*2] = {0};
RealType* realsIn = reinterpret_cast<RealType*>(&bufferIn[idxOffsetIn]);
for (int idx = 0; idx < VecType::VecLength; ++idx) {
realsIn[idx] = RealType(idx);
}
VecType vec(realsIn);
equalToArray(vec, realsIn);
vec.setFromArray(realsIn);
equalToArray(vec, realsIn);
for(int idxOffsetOut = 0 ; idxOffsetOut < sizeof(RealType)*VecType::VecLength ; ++idxOffsetOut){
unsigned char* bufferOut[sizeof(RealType)*VecType::VecLength*2] = {0};
RealType* realsOut = reinterpret_cast<RealType*>(&bufferOut[idxOffsetOut]);
vec.storeInArray(realsOut);
for (int idx = 0; idx < VecType::VecLength; ++idx) {
UASSERTEEQUAL(realsOut[idx], realsIn[idx]);
}
}
}
}
{
RealType reals[VecType::VecLength];
int indirect[VecType::VecLength];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment