2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 21:07:42 +00:00

SIMD refactor

This commit is contained in:
Jack Andersen
2018-12-07 15:49:15 -10:00
parent e1fa938127
commit 7c7da6671a
201 changed files with 2475 additions and 1906 deletions

View File

@@ -41,20 +41,23 @@ template <> inline void DNAColor::Enumerate<BigDNA::ReadYaml>(typename ReadYaml:
size_t count;
if (auto v = _r.enterSubVector(nullptr, count))
{
r = (count >= 1) ? _r.readFloat(nullptr) : 0.f;
g = (count >= 2) ? _r.readFloat(nullptr) : 0.f;
b = (count >= 3) ? _r.readFloat(nullptr) : 0.f;
a = (count >= 4) ? _r.readFloat(nullptr) : 0.f;
zeus::simd_floats f;
f[0] = (count >= 1) ? _r.readFloat(nullptr) : 0.f;
f[1] = (count >= 2) ? _r.readFloat(nullptr) : 0.f;
f[2] = (count >= 3) ? _r.readFloat(nullptr) : 0.f;
f[3] = (count >= 4) ? _r.readFloat(nullptr) : 0.f;
mSimd.copy_from(f);
}
}
template <> inline void DNAColor::Enumerate<BigDNA::WriteYaml>(typename WriteYaml::StreamT& _w)
{
if (auto v = _w.enterSubVector(nullptr))
{
_w.writeFloat(nullptr, r);
_w.writeFloat(nullptr, g);
_w.writeFloat(nullptr, b);
_w.writeFloat(nullptr, a);
zeus::simd_floats f(mSimd);
_w.writeFloat(nullptr, f[0]);
_w.writeFloat(nullptr, f[1]);
_w.writeFloat(nullptr, f[2]);
_w.writeFloat(nullptr, f[3]);
}
}
template <> inline void DNAColor::Enumerate<BigDNA::BinarySize>(typename BinarySize::StreamT& _s)