-
- Type Parameters:
E
- the boxed element type of this species
public interface VectorSpecies<E>
Interface supporting vectors of same element type,E
andshape
.
-
-
Method Summary
Modifier and Type Method Description default int
bitSize()
Returns the total vector size, in bits, of vectors produced by this species.Class<?>
boxType()
Returns the vector box type for this speciesint
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 speciesdefault int
length()
Returns the mask, shuffe, or vector lanes produced by this species.Class<?>
maskType()
Returns the vector mask type for this speciesstatic <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.
-
-
-
Method Detail
-
elementType
Class<E> elementType()
Returns the primitive element type of vectors produced by this species.- Returns:
- the primitive element type
-
boxType
Class<?> boxType()
Returns the vector box type for this species- Returns:
- the box type
-
maskType
Class<?> maskType()
Returns the vector mask type for this species- Returns:
- the box 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 primitive element type
-
indexShape
VectorShape indexShape()
Returns the shape of the corresponding index species- Returns:
- the shape
-
length
default int length()
Returns the mask, shuffe, 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
-
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 types
- 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
-
-