salvatore-campagna commented on code in PR #16160:
URL: https://github.com/apache/lucene/pull/16160#discussion_r3390201739
##########
lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesProducer.java:
##########
@@ -480,6 +480,59 @@ static void rangeIntoBitSet(
values, fromDoc, toDoc, minValue, maxValue, bitSet, offset);
}
+ private static void rangeGcdDeltaIntoBitSet(
+ LongValues values,
+ int fromDoc,
+ int toDoc,
+ long minValue,
+ long maxValue,
+ long mul,
+ long delta,
+ FixedBitSet bitSet,
+ int offset) {
+ long encodedMin;
+ long encodedMax;
+ try {
+ encodedMin = Math.subtractExact(minValue, delta);
+ encodedMax = Math.subtractExact(maxValue, delta);
+ if (mul != 1) {
+ encodedMin = ceilDiv(encodedMin, mul);
+ encodedMax = Math.floorDiv(encodedMax, mul);
+ }
+ encodedMin = Math.max(0, encodedMin);
+ } catch (ArithmeticException _) {
Review Comment:
What do we do for open bounds like `Long.MIN_VALUE` or `Long.MAX_VALUE`?
Looks like they would hit the overflow fallback? I am thinking whether it would
be possible to use SIMD also when we just have min or max.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]