< prev index next >
src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorSpecies.java
Print this page
*** 42,56 ****
* @return the primitive element type
*/
public abstract Class<E> elementType();
/**
! * Returns the vector box type for this species
*
! * @return the box type
*/
! abstract Class<?> boxType();
/**
* Returns the vector mask type for this species
*
* @return the box type
--- 42,56 ----
* @return the primitive element type
*/
public abstract Class<E> elementType();
/**
! * Returns the vector type corresponding to this species
*
! * @return the vector type corresponding to this species
*/
! abstract Class<?> vectorType();
/**
* Returns the vector mask type for this species
*
* @return the box type
*** 93,102 ****
--- 93,112 ----
*
* @return the total vector size, in bits
*/
default public int bitSize() { return shape().bitSize(); }
+ /**
+ * Helper function to calculate the loop terminating condition when iterating over an array of given length.
+ * Returns the result of {@code (length & ~(this.length() - 1))}
+ *
+ * @return the result of {@code (length & ~(this.length() - 1))}
+ */
+ default public int loopBound(int length) {
+ return length & ~(this.length() - 1);
+ }
+
// Factory
/**
* Finds a species for an element type and shape.
*
< prev index next >