summaryrefslogtreecommitdiffstats
path: root/kit/Delta.hpp
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-08-28 21:05:05 +0100
committerCaolán McNamara <caolanm@gmail.com>2023-09-25 16:55:04 +0100
commit42e98bb2e476e7cde0c477d3319a030fe7c58865 (patch)
tree95a8c1fe48dcc2c9bd5c4856c8491d26b99d2a67 /kit/Delta.hpp
parentSIMD - first cut at building LUT for vpermd gather. (diff)
downloadonline-42e98bb2e476e7cde0c477d3319a030fe7c58865.tar.gz
online-42e98bb2e476e7cde0c477d3319a030fe7c58865.zip
experimentally bootstrap something using avx2 to generate bitmap
just enough to get the same results as before https://github.com/CollaboraOnline/online/issues/7165 Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I109c9b8f1e7935782c72e0179aa0ed48712eadb6
Diffstat (limited to 'kit/Delta.hpp')
-rw-r--r--kit/Delta.hpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/kit/Delta.hpp b/kit/Delta.hpp
index 920ad804c0..aa76702cc3 100644
--- a/kit/Delta.hpp
+++ b/kit/Delta.hpp
@@ -144,17 +144,20 @@ class DeltaGenerator {
return sizeof(DeltaBitmapRow) + _rleSize * 4;
}
- bool initPixRowSimd(const uint32_t *from);
-
void initRow(const uint32_t *from, unsigned int width)
{
uint32_t scratch[width];
+ uint32_t simd_scratch[width];
+ uint64_t simd_rleMask[_rleMaskUnits];
+ unsigned int simd_outp = 0;
+
uint32_t lastPix = 0x00000000; // transparency
unsigned int x = 0, outp = 0;
- if (!simd::HasAVX2 || width != 256 ||
- !simd_initPixRowSimd(from, scratch, &outp, _rleMask))
+ bool noCompare = !simd::HasAVX2 || width != 256 ||
+ !simd_initPixRowSimd(from, simd_scratch, &simd_outp, simd_rleMask);
+ if (true)
{
// non-accelerated path
for (unsigned int nMask = 0; nMask < 4; ++nMask)
@@ -207,6 +210,19 @@ class DeltaGenerator {
}
else
_rleData = nullptr;
+
+ // check our result
+ if (!noCompare)
+ {
+ if (memcmp(_rleMask, simd_rleMask, sizeof (_rleMask)))
+ {
+ std::cerr << "Masks differ " <<
+ Util::bytesToHexString(reinterpret_cast<const char *>(_rleMask), sizeof(_rleMask)) << "\n" <<
+ Util::bytesToHexString(reinterpret_cast<const char *>(simd_rleMask), sizeof(_rleMask)) << "\n";
+ }
+// assert(_rleSize == simd_outp);
+// assert(!memcmp(scratch, simd_scratch, _rleSize));
+ }
}
bool identical(const DeltaBitmapRow &other) const