Enum VectorShape

    • Enum Constant Detail

      • S_64_BIT

        public static final VectorShape S_64_BIT
        Shape of length 64 bits
      • S_128_BIT

        public static final VectorShape S_128_BIT
        Shape of length 128 bits
      • S_256_BIT

        public static final VectorShape S_256_BIT
        Shape of length 256 bits
      • S_512_BIT

        public static final VectorShape S_512_BIT
        Shape of length 512 bits
      • S_Max_BIT

        public static final VectorShape S_Max_BIT
        Shape of maximum length supported on the platform
    • Method Detail

      • values

        public static VectorShape[] values()
        Returns an array containing the constants of this enum type, in the order they are declared.
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static VectorShape valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • vectorBitSize

        public int vectorBitSize()
        Returns the size, in bits, of vectors of this shape.
        Returns:
        the size, in bits, of vectors of this shape.
      • withLanes

        public <E> VectorSpecies<E> withLanes​(Class<E> elementType)
        Finds a vector species with the given element type and the current shape. Returns the same value as VectorSpecies.of(elementType, this).
        Type Parameters:
        E - the boxed element type
        Parameters:
        elementType - the required element type
        Returns:
        a species for the given element type and this shape
        See Also:
        VectorSpecies.of(Class, VectorShape)
      • forBitSize

        public static VectorShape forBitSize​(int bitSize)
        Finds an appropriate shape depending on the proposed bit-size of a vector.
        Parameters:
        bitSize - the proposed vector size in bits
        Returns:
        a shape corresponding to the vector bit-size
        See Also:
        vectorBitSize()
      • preferredShape

        public static VectorShape preferredShape()
        Finds the vector shape preferred by the current platform for all vector element types.

        The preferred shape by the platform has the largest possible bit-size, under the constraint that all lane sizes are supported, from byte to double. Thus, all the preferred vector species for various lane types will have a common underlying shape.

        Returns:
        a preferred shape for all element types
        Throws:
        IllegalArgumentException - if no such shape exists
        See Also:
        VectorSpecies.ofPreferred(Class)