benwtrent commented on code in PR #16050:
URL: https://github.com/apache/lucene/pull/16050#discussion_r3237076906


##########
lucene/core/src/java25/org/apache/lucene/internal/vectorization/PanamaDocValuesRangeSupport.java:
##########
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.internal.vectorization;
+
+import jdk.incubator.vector.LongVector;
+import jdk.incubator.vector.VectorMask;
+import jdk.incubator.vector.VectorOperators;
+import jdk.incubator.vector.VectorSpecies;
+import org.apache.lucene.util.FixedBitSet;
+import org.apache.lucene.util.LongValues;
+
+/** Panama Vector API implementation of {@link DocValuesRangeSupport}. */
+final class PanamaDocValuesRangeSupport implements DocValuesRangeSupport {
+
+  static final PanamaDocValuesRangeSupport INSTANCE = new 
PanamaDocValuesRangeSupport();
+
+  private static final VectorSpecies<Long> LONG_SPECIES = 
LongVector.SPECIES_PREFERRED;
+
+  private PanamaDocValuesRangeSupport() {}
+
+  @Override
+  public void rangeIntoBitSet(
+      LongValues values,
+      int fromDoc,
+      int toDoc,
+      long minValue,
+      long maxValue,
+      FixedBitSet bitSet,
+      int offset) {
+    final int vectorLen = LONG_SPECIES.length();
+
+    // Only use SIMD if vector length >= 4 (AVX-256 or better).
+    // On 128-bit SIMD (2 longs), the scratch buffer overhead outweighs the 
benefit.
+    if (vectorLen < 4) {

Review Comment:
   @sgup432 
   
   >  Let me re-run, confirm and remove this.
   
   Cool, I would also suggest please use the names and formatting similar to 
the larger panama vector code files, clearly indicating 128 vs 256 vs 512, etc. 



-- 
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]

Reply via email to