Only switch on type once in checkMaxBetweenExclusive
All checks were successful
Tests / Clang total: 1337, passed: 1337
Clang |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Tests / SIMD fallback total: 1337, passed: 1337
Tests / 32-bit versions total: 1337, passed: 1337
Tests / Release [gcc] total: 1337, passed: 1337
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Tests / Release [gcc,aarch64] total: 997, passed: 997
Tests / Coverage total: 1004, passed: 1004
Code Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 98.77% (1602/1622)
* Branch Coverage: 65.86% (1468/2229)
* Complexity Density: 0.00
* Lines of Code: 1622
#### Quality Gates Summary
Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
All checks were successful
Tests / Clang total: 1337, passed: 1337
Clang |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Tests / SIMD fallback total: 1337, passed: 1337
Tests / 32-bit versions total: 1337, passed: 1337
Tests / Release [gcc] total: 1337, passed: 1337
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Tests / Release [gcc,aarch64] total: 997, passed: 997
Tests / Coverage total: 1004, passed: 1004
Code Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 98.77% (1602/1622)
* Branch Coverage: 65.86% (1468/2229)
* Complexity Density: 0.00
* Lines of Code: 1622
#### Quality Gates Summary
Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
This commit is contained in:
@@ -2001,31 +2001,30 @@ bool checkMaxBetweenExclusive(Node *n, int begin, int end,
|
|||||||
|
|
||||||
assert(!(begin == -1 && end == 256));
|
assert(!(begin == -1 && end == 256));
|
||||||
|
|
||||||
{
|
|
||||||
int c = getChildGeq(n, begin + 1);
|
|
||||||
if (c >= 0 && c < end) {
|
|
||||||
auto *child = getChildExists(n, c);
|
|
||||||
if (child->entryPresent) {
|
|
||||||
if (!(child->entry.rangeVersion <= readVersion)) {
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
begin = c;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// [begin, end) is now the half-open interval of children we're interested in.
|
|
||||||
assert(begin < end);
|
|
||||||
|
|
||||||
switch (n->getType()) {
|
switch (n->getType()) {
|
||||||
case Type_Node0: // GCOVR_EXCL_LINE
|
case Type_Node0:
|
||||||
// We would have returned above, after not finding a child
|
return true;
|
||||||
__builtin_unreachable(); // GCOVR_EXCL_LINE
|
|
||||||
case Type_Node3: {
|
case Type_Node3: {
|
||||||
auto *self = static_cast<Node3 *>(n);
|
auto *self = static_cast<Node3 *>(n);
|
||||||
|
|
||||||
|
{
|
||||||
|
int c = begin == 255 ? -1 : getChildGeqSimd(self, begin + 1);
|
||||||
|
if (c >= 0 && c < end) {
|
||||||
|
auto *child = self->children[getNodeIndex(self, c)];
|
||||||
|
if (child->entryPresent) {
|
||||||
|
if (!(child->entry.rangeVersion <= readVersion)) {
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
begin = c;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// [begin, end) is now the half-open interval of children we're interested
|
||||||
|
// in.
|
||||||
|
assert(begin < end);
|
||||||
|
}
|
||||||
|
|
||||||
const unsigned shiftUpperBound = end - begin;
|
const unsigned shiftUpperBound = end - begin;
|
||||||
const unsigned shiftAmount = begin;
|
const unsigned shiftAmount = begin;
|
||||||
auto inBounds = [&](unsigned c) {
|
auto inBounds = [&](unsigned c) {
|
||||||
@@ -2045,11 +2044,48 @@ bool checkMaxBetweenExclusive(Node *n, int begin, int end,
|
|||||||
case Type_Node16: {
|
case Type_Node16: {
|
||||||
auto *self = static_cast<Node16 *>(n);
|
auto *self = static_cast<Node16 *>(n);
|
||||||
|
|
||||||
|
{
|
||||||
|
int c = begin == 255 ? -1 : getChildGeqSimd(self, begin + 1);
|
||||||
|
if (c >= 0 && c < end) {
|
||||||
|
auto *child = self->children[getNodeIndex(self, c)];
|
||||||
|
if (child->entryPresent) {
|
||||||
|
if (!(child->entry.rangeVersion <= readVersion)) {
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
begin = c;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// [begin, end) is now the half-open interval of children we're interested
|
||||||
|
// in.
|
||||||
|
assert(begin < end);
|
||||||
|
}
|
||||||
|
|
||||||
return scan16<kAVX512>(self->childMaxVersion, self->index, begin, end,
|
return scan16<kAVX512>(self->childMaxVersion, self->index, begin, end,
|
||||||
readVersion);
|
readVersion);
|
||||||
}
|
}
|
||||||
case Type_Node48: {
|
case Type_Node48: {
|
||||||
auto *self = static_cast<Node48 *>(n);
|
auto *self = static_cast<Node48 *>(n);
|
||||||
|
|
||||||
|
{
|
||||||
|
int c = self->bitSet.firstSetGeq(begin + 1);
|
||||||
|
if (c >= 0 && c < end) {
|
||||||
|
auto *child = self->children[self->index[c]];
|
||||||
|
if (child->entryPresent) {
|
||||||
|
if (!(child->entry.rangeVersion <= readVersion)) {
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
begin = c;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// [begin, end) is now the half-open interval of children we're interested
|
||||||
|
// in.
|
||||||
|
assert(begin < end);
|
||||||
|
}
|
||||||
|
|
||||||
// Check all pages
|
// Check all pages
|
||||||
static_assert(Node48::kMaxOfMaxPageSize == 16);
|
static_assert(Node48::kMaxOfMaxPageSize == 16);
|
||||||
for (int i = 0; i < Node48::kMaxOfMaxTotalPages; ++i) {
|
for (int i = 0; i < Node48::kMaxOfMaxTotalPages; ++i) {
|
||||||
@@ -2067,6 +2103,25 @@ bool checkMaxBetweenExclusive(Node *n, int begin, int end,
|
|||||||
case Type_Node256: {
|
case Type_Node256: {
|
||||||
static_assert(Node256::kMaxOfMaxTotalPages == 16);
|
static_assert(Node256::kMaxOfMaxTotalPages == 16);
|
||||||
auto *self = static_cast<Node256 *>(n);
|
auto *self = static_cast<Node256 *>(n);
|
||||||
|
|
||||||
|
{
|
||||||
|
int c = self->bitSet.firstSetGeq(begin + 1);
|
||||||
|
if (c >= 0 && c < end) {
|
||||||
|
auto *child = self->children[c];
|
||||||
|
if (child->entryPresent) {
|
||||||
|
if (!(child->entry.rangeVersion <= readVersion)) {
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
begin = c;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// [begin, end) is now the half-open interval of children we're interested
|
||||||
|
// in.
|
||||||
|
assert(begin < end);
|
||||||
|
}
|
||||||
|
|
||||||
const int firstPage = begin >> Node256::kMaxOfMaxShift;
|
const int firstPage = begin >> Node256::kMaxOfMaxShift;
|
||||||
const int lastPage = (end - 1) >> Node256::kMaxOfMaxShift;
|
const int lastPage = (end - 1) >> Node256::kMaxOfMaxShift;
|
||||||
// Check the only page if there's only one
|
// Check the only page if there's only one
|
||||||
|
Reference in New Issue
Block a user