]> git.sesse.net Git - plocate/commitdiff
Hand-roll zeroing of destination docids for SSE2; takes us seemingly up from ~84...
authorSteinar H. Gunderson <steinar+git@gunderson.no>
Tue, 6 Oct 2020 20:20:00 +0000 (22:20 +0200)
committerSteinar H. Gunderson <steinar+git@gunderson.no>
Wed, 7 Oct 2020 22:44:35 +0000 (00:44 +0200)
turbopfor.h

index e4c31e6fd1c898ce94dc26378c68ee2bf6f1472f..84e354dd257d921db4cfead2a205a2cb449ab412 100644 (file)
@@ -507,7 +507,11 @@ const unsigned char *decode_pfor_bitmap_interleaved_128_32(const unsigned char *
        constexpr unsigned BlockSize = 128;
        using Docid = uint32_t;
 
-       memset(out, 0, BlockSize * sizeof(Docid));
+       // Set all output values to zero, before the exceptions are filled in.
+       #pragma GCC unroll 4
+       for (unsigned i = 0; i < BlockSize / 4; ++i) {
+               _mm_storeu_si128(reinterpret_cast<__m128i *>(out) + i, _mm_setzero_si128());
+       }
 
        const unsigned bit_width = *in++ & 0x3f;