Interface VectorSpecies<E>

  • Type Parameters:
    E - the boxed element type of this species

    public interface VectorSpecies<E>
    Interface supporting vectors of same element type, E and shape.
    • Method Summary

      Modifier and Type Method Description
      default int bitSize()
      Returns the total vector size, in bits, of vectors produced by this species.
      int elementSize()
      Returns the element size, in bits, of vectors produced by this species.
      Class<E> elementType()
      Returns the primitive element type of vectors produced by this species.
      VectorShape indexShape()
      Returns the shape of the corresponding index species
      default int length()
      Returns the mask, shuffle, or vector lanes produced by this species.
      default int loopBound​(int length)
      Helper function to calculate the loop terminating condition when iterating over an array of given length.
      Class<?> maskType()
      Returns the vector mask type for this species
      static <E> VectorSpecies<E> of​(Class<E> c, VectorShape s)
      Finds a species for an element type and shape.
      static <E> VectorSpecies<E> ofPreferred​(Class<E> c)
      Finds a preferred species for an element type.
      VectorShape shape()
      Returns the shape of masks, shuffles, and vectors produced by this species.
      Class<?> vectorType()
      Returns the vector type corresponding to this species
    • Method Detail

      • elementType

        Class<E> elementType()
        Returns the primitive element type of vectors produced by this species.
        Returns:
        the primitive element type
      • vectorType

        Class<?> vectorType()
        Returns the vector type corresponding to this species
        Returns:
        the vector type corresponding to this species
      • maskType

        Class<?> maskType()
        Returns the vector mask type for this species
        Returns:
        the mask type
      • elementSize

        int elementSize()
        Returns the element size, in bits, of vectors produced by this species.
        Returns:
        the element size, in bits
      • shape

        VectorShape shape()
        Returns the shape of masks, shuffles, and vectors produced by this species.
        Returns:
        the shape
      • indexShape

        VectorShape indexShape()
        Returns the shape of the corresponding index species
        Returns:
        the shape of index species
      • length

        default int length()
        Returns the mask, shuffle, or vector lanes produced by this species.
        Returns:
        the the number of lanes
      • bitSize

        default int bitSize()
        Returns the total vector size, in bits, of vectors produced by this species.
        Returns:
        the total vector size, in bits
      • loopBound

        default int loopBound​(int length)
        Helper function to calculate the loop terminating condition when iterating over an array of given length. Returns the result of (length & ~(this.length() - 1))
        Returns:
        the result of (length & ~(this.length() - 1))
      • of

        static <E> VectorSpecies<E> of​(Class<E> c,
                                       VectorShape s)
        Finds a species for an element type and shape.
        Type Parameters:
        E - the boxed element type
        Parameters:
        c - the element type
        s - the shape
        Returns:
        a species for an element type and shape
        Throws:
        IllegalArgumentException - if no such species exists for the element type and/or shape
      • ofPreferred

        static <E> VectorSpecies<E> ofPreferred​(Class<E> c)
        Finds a preferred species for an element type.

        A preferred species is a species chosen by the platform that has a shape of maximal bit size. A preferred species for different element types will have the same shape, and therefore vectors created from such species will be shape compatible.

        Type Parameters:
        E - the boxed element type
        Parameters:
        c - the element type
        Returns:
        a preferred species for an element type
        Throws:
        IllegalArgumentException - if no such species exists for the element type