Vectorize inner page check for Node256
This commit is contained in:
@@ -313,7 +313,7 @@ struct Node256 : Node {
|
|||||||
BitSet bitSet;
|
BitSet bitSet;
|
||||||
Node *children[256];
|
Node *children[256];
|
||||||
int64_t childMaxVersion[256];
|
int64_t childMaxVersion[256];
|
||||||
constexpr static int kMaxOfMaxPageSize = 8;
|
constexpr static int kMaxOfMaxPageSize = 16;
|
||||||
constexpr static int kMaxOfMaxShift =
|
constexpr static int kMaxOfMaxShift =
|
||||||
std::countr_zero(uint32_t(kMaxOfMaxPageSize));
|
std::countr_zero(uint32_t(kMaxOfMaxPageSize));
|
||||||
constexpr static int kMaxOfMaxTotalPages = 256 / kMaxOfMaxPageSize;
|
constexpr static int kMaxOfMaxTotalPages = 256 / kMaxOfMaxPageSize;
|
||||||
@@ -1843,13 +1843,17 @@ bool checkMaxBetweenExclusive(Node *n, int begin, int end,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Check inner pages
|
uint64_t conflict = 0;
|
||||||
bool result = true;
|
// Check all pages
|
||||||
for (int i = (begin >> Node256::kMaxOfMaxShift) + 1;
|
for (int i = 0; i < Node256::kMaxOfMaxTotalPages; ++i) {
|
||||||
i < ((end - 1) >> Node256::kMaxOfMaxShift); ++i) {
|
conflict |= (self->maxOfMax[i] > readVersion) << i;
|
||||||
result &= self->maxOfMax[i] <= readVersion;
|
|
||||||
}
|
}
|
||||||
return result;
|
// Only keep inner pages
|
||||||
|
const int pageBegin = (begin >> Node256::kMaxOfMaxShift) + 1;
|
||||||
|
const int pageEnd = (end - 1) >> Node256::kMaxOfMaxShift;
|
||||||
|
conflict &= (1 << pageEnd) - 1;
|
||||||
|
conflict >>= pageBegin;
|
||||||
|
return !conflict;
|
||||||
}
|
}
|
||||||
default: // GCOVR_EXCL_LINE
|
default: // GCOVR_EXCL_LINE
|
||||||
__builtin_unreachable(); // GCOVR_EXCL_LINE
|
__builtin_unreachable(); // GCOVR_EXCL_LINE
|
||||||
|
Reference in New Issue
Block a user