Fixing my vecdecode finisher. It was garbage.
This commit is contained in:
parent
59bfb807e1
commit
fd2ae7e3bd
|
@ -319,8 +319,9 @@ static size_t bitmap_decode_avx2(uint8_t *bitmapInPtr, size_t bitsin, uint32_t *
|
||||||
if ((bitsin % 64) != 0) {
|
if ((bitsin % 64) != 0) {
|
||||||
// finish off the work the slow way.
|
// finish off the work the slow way.
|
||||||
uint64_t bitset = 0;
|
uint64_t bitset = 0;
|
||||||
memcpy(&bitset, bitmapInPtr, sizeof(bitset));
|
size_t leftoverbits = bitsin - sizeinwords * 64;
|
||||||
bitset = bitset & ((UINT64_C(1) << (bitsin % 64)) - 1);
|
size_t leftoverbytes = ( leftoverbits + 7 ) / 8;
|
||||||
|
memcpy(&bitset, bitmapInPtr + sizeinwords * 8, leftoverbytes);
|
||||||
while (bitset != 0) {
|
while (bitset != 0) {
|
||||||
uint64_t t = bitset & -bitset;
|
uint64_t t = bitset & -bitset;
|
||||||
int r = __builtin_ctzll(bitset);
|
int r = __builtin_ctzll(bitset);
|
||||||
|
|
|
@ -319,8 +319,9 @@ static size_t bitmap_decode_avx2(uint8_t *bitmapInPtr, size_t bitsin, uint32_t *
|
||||||
if ((bitsin % 64) != 0) {
|
if ((bitsin % 64) != 0) {
|
||||||
// finish off the work the slow way.
|
// finish off the work the slow way.
|
||||||
uint64_t bitset = 0;
|
uint64_t bitset = 0;
|
||||||
memcpy(&bitset, bitmapInPtr, sizeof(bitset));
|
size_t leftoverbits = bitsin - sizeinwords * 64;
|
||||||
bitset = bitset & ((UINT64_C(1) << (bitsin % 64)) - 1);
|
size_t leftoverbytes = ( leftoverbits + 7 ) / 8;
|
||||||
|
memcpy(&bitset, bitmapInPtr + sizeinwords * 8, leftoverbytes);
|
||||||
while (bitset != 0) {
|
while (bitset != 0) {
|
||||||
uint64_t t = bitset & -bitset;
|
uint64_t t = bitset & -bitset;
|
||||||
int r = __builtin_ctzll(bitset);
|
int r = __builtin_ctzll(bitset);
|
||||||
|
|
Loading…
Reference in New Issue