2 Commits

Author SHA1 Message Date
45da8fb996 Use the faster unvectorized implementation for Node3
Some checks failed
Tests / Clang total: 1039, passed: 1039
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / SIMD fallback total: 1039, passed: 1039
Tests / 32-bit versions total: 1039, passed: 1039
Tests / Release [gcc] total: 1039, passed: 1039
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc,aarch64] total: 775, passed: 775
Tests / Coverage total: 780, passed: 780
weaselab/conflict-set/pipeline/head There was a failure building this commit
2024-06-28 22:52:39 -07:00
4958a4cced Make always_inline function inline
Try to fix warning in jenkins
2024-06-28 22:42:01 -07:00

View File

@@ -1850,9 +1850,9 @@ bool scan16(const InternalVersionT *vs, const uint8_t *is, int begin, int end,
// Returns true if v[i] <= readVersion for all i such that begin <= i < end
//
// always_inline So that we can optimize when begin or end is a constant.
__attribute((always_inline)) bool scan16(const InternalVersionT *vs, int begin,
int end,
InternalVersionT readVersion) {
inline __attribute((always_inline)) bool scan16(const InternalVersionT *vs,
int begin, int end,
InternalVersionT readVersion) {
assert(0 <= begin && begin < 16);
assert(0 <= end && end <= 16);
assert(begin <= end);
@@ -1923,29 +1923,34 @@ bool checkMaxBetweenExclusive(Node *n, int begin, int end,
// [begin, end) is now the half-open interval of children we're interested in.
assert(begin < end);
const unsigned shiftUpperBound = end - begin;
const unsigned shiftAmount = begin;
auto inBounds = [&](unsigned c) { return c - shiftAmount < shiftUpperBound; };
switch (n->getType()) {
case Type_Node0: // GCOVR_EXCL_LINE
// We would have returned above, after not finding a child
__builtin_unreachable(); // GCOVR_EXCL_LINE
case Type_Node3: {
auto *self = static_cast<Node3 *>(n);
bool result = true;
for (int i = 0; i < 3; ++i) {
result &= !((self->childMaxVersion[i] > readVersion) &&
inBounds(self->index[i]));
const unsigned shiftUpperBound = end - begin;
const unsigned shiftAmount = begin;
auto inBounds = [&](unsigned c) {
return c - shiftAmount < shiftUpperBound;
};
uint32_t compared = 0;
for (int i = 0; i < Node3::kMaxNodes; ++i) {
compared |= (self->childMaxVersion[i] > readVersion) << i;
}
return result;
} break;
uint32_t mask = 0;
for (int i = 0; i < Node3::kMaxNodes; ++i) {
mask |= inBounds(self->index[i]) << i;
}
return !(compared & mask);
}
case Type_Node16: {
auto *self = static_cast<Node16 *>(n);
return scan16(self->childMaxVersion, self->index, begin, end, readVersion);
} break;
}
case Type_Node48: {
auto *self = static_cast<Node48 *>(n);
// Check all pages