Remove some redundant branches

I think they were getting optimized out, but still
This commit is contained in:
2024-08-01 12:37:57 -07:00
parent 3b2bd16cd1
commit f5a0d81c52

View File

@@ -939,6 +939,9 @@ template <class NodeT> int getChildGeqSimd(NodeT *self, int child) {
} }
return -1; return -1;
} }
if (child > 255) {
return -1;
}
#ifdef HAS_AVX #ifdef HAS_AVX
__m128i key_vec = _mm_set1_epi8(child); __m128i key_vec = _mm_set1_epi8(child);
@@ -996,28 +999,12 @@ template <class NodeT> int getChildGeqSimd(NodeT *self, int child) {
#endif #endif
} }
int getChildGeq(Node0 *, int child) { int getChildGeq(Node0 *, int) { return -1; }
if (child > 255) { int getChildGeq(Node3 *self, int child) { return getChildGeqSimd(self, child); }
return -1;
}
return -1;
}
int getChildGeq(Node3 *self, int child) {
if (child > 255) {
return -1;
}
return getChildGeqSimd(self, child);
}
int getChildGeq(Node16 *self, int child) { int getChildGeq(Node16 *self, int child) {
if (child > 255) {
return -1;
}
return getChildGeqSimd(self, child); return getChildGeqSimd(self, child);
} }
int getChildGeq(Node48 *self, int child) { int getChildGeq(Node48 *self, int child) {
if (child > 255) {
return -1;
}
return self->bitSet.firstSetGeq(child); return self->bitSet.firstSetGeq(child);
} }
int getChildGeq(Node256 *self, int child) { int getChildGeq(Node256 *self, int child) {