- java.lang.Object
-
- jdk.incubator.vector.Vector<Long>
-
- jdk.incubator.vector.LongVector
-
-
Field Summary
Fields Modifier and Type Field Description static VectorSpecies<Long>
SPECIES_128
Species representingLongVector
s ofVectorShape.S_128_BIT
.static VectorSpecies<Long>
SPECIES_256
Species representingLongVector
s ofVectorShape.S_256_BIT
.static VectorSpecies<Long>
SPECIES_512
Species representingLongVector
s ofVectorShape.S_512_BIT
.static VectorSpecies<Long>
SPECIES_64
Species representingLongVector
s ofVectorShape.S_64_BIT
.static VectorSpecies<Long>
SPECIES_MAX
Species representingLongVector
s ofVectorShape.S_Max_BIT
.static VectorSpecies<Long>
SPECIES_PREFERRED
Preferred species forLongVector
s.
-
Method Summary
Modifier and Type Method Description abstract LongVector
add(long s)
Adds this vector to the broadcast of an input scalar.abstract LongVector
add(long s, VectorMask<Long> m)
Adds this vector to broadcast of an input scalar, selecting lane elements controlled by a mask.abstract long
addAll()
Adds all lane elements of this vector.abstract long
addAll(VectorMask<Long> m)
Adds all lane elements of this vector, selecting lane elements controlled by a mask.abstract LongVector
and(long s)
Bitwise ANDs this vector with the broadcast of an input scalar.abstract LongVector
and(long s, VectorMask<Long> m)
Bitwise ANDs this vector with the broadcast of an input scalar, selecting lane elements controlled by a mask.abstract LongVector
and(Vector<Long> v)
Bitwise ANDs this vector with an input vector.abstract LongVector
and(Vector<Long> v, VectorMask<Long> m)
Bitwise ANDs this vector with an input vector, selecting lane elements controlled by a mask.abstract long
andAll()
Logically ANDs all lane elements of this vector.abstract long
andAll(VectorMask<Long> m)
Logically ANDs all lane elements of this vector, selecting lane elements controlled by a mask.abstract LongVector
blend(long s, VectorMask<Long> m)
Blends the lane elements of this vector with those of the broadcast of an input scalar, selecting lanes controlled by a mask.static LongVector
broadcast(VectorSpecies<Long> species, long e)
Returns a vector where all lane elements are set to the primitive valuee
.abstract VectorMask<Long>
equal(long s)
Tests if this vector is equal to the broadcast of an input scalar.static LongVector
fromArray(VectorSpecies<Long> species, long[] a, int offset)
Loads a vector from an array starting at offset.static LongVector
fromArray(VectorSpecies<Long> species, long[] a, int a_offset, int[] indexMap, int i_offset)
Loads a vector from an array using indexes obtained from an index map.static LongVector
fromArray(VectorSpecies<Long> species, long[] a, int offset, VectorMask<Long> m)
Loads a vector from an array starting at offset and using a mask.static LongVector
fromArray(VectorSpecies<Long> species, long[] a, int a_offset, VectorMask<Long> m, int[] indexMap, int i_offset)
Loads a vector from an array using indexes obtained from an index map and using a mask.static LongVector
fromByteArray(VectorSpecies<Long> species, byte[] a, int offset)
Loads a vector from a byte array starting at an offset.static LongVector
fromByteArray(VectorSpecies<Long> species, byte[] a, int offset, VectorMask<Long> m)
Loads a vector from a byte array starting at an offset and using a mask.static LongVector
fromByteBuffer(VectorSpecies<Long> species, ByteBuffer bb, int offset)
Loads a vector from abyte buffer
starting at an offset into the byte buffer.static LongVector
fromByteBuffer(VectorSpecies<Long> species, ByteBuffer bb, int offset, VectorMask<Long> m)
Loads a vector from abyte buffer
starting at an offset into the byte buffer and using a mask.abstract VectorMask<Long>
greaterThan(long s)
Tests if this vector is greater than the broadcast of an input scalar.abstract VectorMask<Long>
greaterThanEq(long s)
Tests if this vector is greater than or equal to the broadcast of an input scalar.abstract void
intoArray(long[] a, int offset)
Stores this vector into an array starting at offset.abstract void
intoArray(long[] a, int a_offset, int[] indexMap, int i_offset)
Stores this vector into an array using indexes obtained from an index map.abstract void
intoArray(long[] a, int offset, VectorMask<Long> m)
Stores this vector into an array starting at offset and using a mask.abstract void
intoArray(long[] a, int a_offset, VectorMask<Long> m, int[] indexMap, int i_offset)
Stores this vector into an array using indexes obtained from an index map and using a mask.abstract long
lane(int i)
Gets the lane element at lane indexi
abstract VectorMask<Long>
lessThan(long s)
Tests if this vector is less than the broadcast of an input scalar.abstract VectorMask<Long>
lessThanEq(long s)
Tests if this vector is less or equal to the broadcast of an input scalar.abstract LongVector
max(long s)
Returns the maximum of this vector and the broadcast of an input scalar.abstract long
maxAll()
Returns the maximum lane element of this vector.abstract long
maxAll(VectorMask<Long> m)
Returns the maximum lane element of this vector, selecting lane elements controlled by a mask.abstract LongVector
min(long s)
Returns the minimum of this vector and the broadcast of an input scalar.abstract long
minAll()
Returns the minimum lane element of this vector.abstract long
minAll(VectorMask<Long> m)
Returns the minimum lane element of this vector, selecting lane elements controlled by a mask.abstract LongVector
mul(long s)
Multiplies this vector with the broadcast of an input scalar.abstract LongVector
mul(long s, VectorMask<Long> m)
Multiplies this vector with the broadcast of an input scalar, selecting lane elements controlled by a mask.abstract long
mulAll()
Multiplies all lane elements of this vector.abstract long
mulAll(VectorMask<Long> m)
Multiplies all lane elements of this vector, selecting lane elements controlled by a mask.abstract LongVector
not()
Bitwise NOTs this vector.abstract LongVector
not(VectorMask<Long> m)
Bitwise NOTs this vector, selecting lane elements controlled by a mask.abstract VectorMask<Long>
notEqual(long s)
Tests if this vector is not equal to the broadcast of an input scalar.abstract LongVector
or(long s)
Bitwise ORs this vector with the broadcast of an input scalar.abstract LongVector
or(long s, VectorMask<Long> m)
Bitwise ORs this vector with the broadcast of an input scalar, selecting lane elements controlled by a mask.abstract LongVector
or(Vector<Long> v)
Bitwise ORs this vector with an input vector.abstract LongVector
or(Vector<Long> v, VectorMask<Long> m)
Bitwise ORs this vector with an input vector, selecting lane elements controlled by a mask.abstract long
orAll()
Logically ORs all lane elements of this vector.abstract long
orAll(VectorMask<Long> m)
Logically ORs all lane elements of this vector, selecting lane elements controlled by a mask.static LongVector
random(VectorSpecies<Long> species)
Returns a vector where each lane element is set to a randomly generated primitive value.LongVector
rotateLeft(int s)
Rotates left this vector by the broadcast of an input scalar.LongVector
rotateLeft(int s, VectorMask<Long> m)
Rotates left this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.LongVector
rotateRight(int s)
Rotates right this vector by the broadcast of an input scalar.LongVector
rotateRight(int s, VectorMask<Long> m)
Rotates right this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.static LongVector
scalars(VectorSpecies<Long> species, long... es)
Returns a vector where each lane element is set to given primitive values.abstract LongVector
shiftArithmeticRight(int s)
Arithmetically right shifts (or signed right shifts) this vector by the broadcast of an input scalar.abstract LongVector
shiftArithmeticRight(int s, VectorMask<Long> m)
Arithmetically right shifts (or signed right shifts) this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.abstract LongVector
shiftArithmeticRight(Vector<Long> v)
Arithmetically right shifts (or signed right shifts) this vector by an input vector.LongVector
shiftArithmeticRight(Vector<Long> v, VectorMask<Long> m)
Arithmetically right shifts (or signed right shifts) this vector by an input vector, selecting lane elements controlled by a mask.abstract LongVector
shiftLeft(int s)
Logically left shifts this vector by the broadcast of an input scalar.abstract LongVector
shiftLeft(int s, VectorMask<Long> m)
Logically left shifts this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.abstract LongVector
shiftLeft(Vector<Long> v)
Logically left shifts this vector by an input vector.LongVector
shiftLeft(Vector<Long> v, VectorMask<Long> m)
Logically left shifts this vector by an input vector, selecting lane elements controlled by a mask.abstract LongVector
shiftRight(int s)
Logically right shifts (or unsigned right shifts) this vector by the broadcast of an input scalar.abstract LongVector
shiftRight(int s, VectorMask<Long> m)
Logically right shifts (or unsigned right shifts) this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.abstract LongVector
shiftRight(Vector<Long> v)
Logically right shifts (or unsigned right shifts) this vector by an input vector.LongVector
shiftRight(Vector<Long> v, VectorMask<Long> m)
Logically right shifts (or unsigned right shifts) this vector by an input vector, selecting lane elements controlled by a mask.static LongVector
single(VectorSpecies<Long> species, long e)
Returns a vector where the first lane element is set to the primtive valuee
, all other lane elements are set to the default value.abstract LongVector
sub(long s)
Subtracts the broadcast of an input scalar from this vector.abstract LongVector
sub(long s, VectorMask<Long> m)
Subtracts the broadcast of an input scalar from this vector, selecting lane elements controlled by a mask.long[]
toArray()
Returns an array containing the lane elements of this vector.abstract LongVector
with(int i, long e)
Replaces the lane element of this vector at lane indexi
with valuee
.abstract LongVector
xor(long s)
Bitwise XORs this vector with the broadcast of an input scalar.abstract LongVector
xor(long s, VectorMask<Long> m)
Bitwise XORs this vector with the broadcast of an input scalar, selecting lane elements controlled by a mask.abstract LongVector
xor(Vector<Long> v)
Bitwise XORs this vector with an input vector.abstract LongVector
xor(Vector<Long> v, VectorMask<Long> m)
Bitwise XORs this vector with an input vector, selecting lane elements controlled by a mask.abstract long
xorAll()
Logically XORs all lane elements of this vector.abstract long
xorAll(VectorMask<Long> m)
Logically XORs all lane elements of this vector, selecting lane elements controlled by a mask.static LongVector
zero(VectorSpecies<Long> species)
Returns a vector where all lane elements are set to the default primitive value.-
Methods declared in class jdk.incubator.vector.Vector
abs, abs, add, add, bitSize, bitSizeForVectorLength, blend, cast, elementSize, elementType, equal, greaterThan, greaterThanEq, intoByteArray, intoByteArray, intoByteBuffer, intoByteBuffer, length, lessThan, lessThanEq, maskAllFalse, maskAllTrue, maskFromArray, maskFromValues, max, max, min, min, mul, mul, neg, neg, notEqual, rearrange, rearrange, reinterpret, reshape, rotateLanesLeft, rotateLanesRight, shape, shiftLanesLeft, shiftLanesRight, shuffle, shuffleFromArray, shuffleFromValues, shuffleIota, shuffleIota, shuffleOffset, species, sub, sub, toShuffle
-
-
-
-
Field Detail
-
SPECIES_64
public static final VectorSpecies<Long> SPECIES_64
Species representingLongVector
s ofVectorShape.S_64_BIT
.
-
SPECIES_128
public static final VectorSpecies<Long> SPECIES_128
Species representingLongVector
s ofVectorShape.S_128_BIT
.
-
SPECIES_256
public static final VectorSpecies<Long> SPECIES_256
Species representingLongVector
s ofVectorShape.S_256_BIT
.
-
SPECIES_512
public static final VectorSpecies<Long> SPECIES_512
Species representingLongVector
s ofVectorShape.S_512_BIT
.
-
SPECIES_MAX
public static final VectorSpecies<Long> SPECIES_MAX
Species representingLongVector
s ofVectorShape.S_Max_BIT
.
-
SPECIES_PREFERRED
public static final VectorSpecies<Long> SPECIES_PREFERRED
Preferred species forLongVector
s. A preferred species is a species of maximal bit size for the platform.
-
-
Method Detail
-
zero
public static LongVector zero(VectorSpecies<Long> species)
Returns a vector where all lane elements are set to the default primitive value.- Parameters:
species
- species of desired vector- Returns:
- a zero vector of given species
-
fromByteArray
public static LongVector fromByteArray(VectorSpecies<Long> species, byte[] a, int offset)
Loads a vector from a byte array starting at an offset.Bytes are composed into primitive lane elements according to the native byte order of the underlying platform
This method behaves as if it returns the result of calling the byte buffer, offset, and mask accepting
method
as follows:return fromByteBuffer(species, ByteBuffer.wrap(a), offset, VectorMask.allTrue());
- Parameters:
species
- species of desired vectora
- the byte arrayoffset
- the offset into the array- Returns:
- a vector loaded from a byte array
- Throws:
IndexOutOfBoundsException
- ifi < 0
oroffset > a.length - (species.length() * species.elementSize() / Byte.SIZE)
-
fromByteArray
public static LongVector fromByteArray(VectorSpecies<Long> species, byte[] a, int offset, VectorMask<Long> m)
Loads a vector from a byte array starting at an offset and using a mask.Bytes are composed into primitive lane elements according to the native byte order of the underlying platform.
This method behaves as if it returns the result of calling the byte buffer, offset, and mask accepting
method
as follows:return fromByteBuffer(species, ByteBuffer.wrap(a), offset, m);
- Parameters:
species
- species of desired vectora
- the byte arrayoffset
- the offset into the arraym
- the mask- Returns:
- a vector loaded from a byte array
- Throws:
IndexOutOfBoundsException
- ifoffset < 0
or for any vector lane indexN
where the mask at laneN
is setoffset >= a.length - (N * species.elementSize() / Byte.SIZE)
-
fromArray
public static LongVector fromArray(VectorSpecies<Long> species, long[] a, int offset)
Loads a vector from an array starting at offset.For each vector lane, where
N
is the vector lane index, the array element at indexoffset + N
is placed into the resulting vector at lane indexN
.- Parameters:
species
- species of desired vectora
- the arrayoffset
- the offset into the array- Returns:
- the vector loaded from an array
- Throws:
IndexOutOfBoundsException
- ifoffset < 0
, oroffset > a.length - species.length()
-
fromArray
public static LongVector fromArray(VectorSpecies<Long> species, long[] a, int offset, VectorMask<Long> m)
Loads a vector from an array starting at offset and using a mask.For each vector lane, where
N
is the vector lane index, if the mask lane at indexN
is set then the array element at indexoffset + N
is placed into the resulting vector at lane indexN
, otherwise the default element value is placed into the resulting vector at lane indexN
.- Parameters:
species
- species of desired vectora
- the arrayoffset
- the offset into the arraym
- the mask- Returns:
- the vector loaded from an array
- Throws:
IndexOutOfBoundsException
- ifoffset < 0
, or for any vector lane indexN
where the mask at laneN
is setoffset > a.length - N
-
fromArray
public static LongVector fromArray(VectorSpecies<Long> species, long[] a, int a_offset, int[] indexMap, int i_offset)
Loads a vector from an array using indexes obtained from an index map.For each vector lane, where
N
is the vector lane index, the array element at indexa_offset + indexMap[i_offset + N]
is placed into the resulting vector at lane indexN
.- Parameters:
species
- species of desired vectora
- the arraya_offset
- the offset into the array, may be negative if relative indexes in the index map compensate to produce a value within the array boundsindexMap
- the index mapi_offset
- the offset into the index map- Returns:
- the vector loaded from an array
- Throws:
IndexOutOfBoundsException
- ifi_offset < 0
, ori_offset > indexMap.length - species.length()
, or for any vector lane indexN
the result ofa_offset + indexMap[i_offset + N]
is< 0
or>= a.length
-
fromArray
public static LongVector fromArray(VectorSpecies<Long> species, long[] a, int a_offset, VectorMask<Long> m, int[] indexMap, int i_offset)
Loads a vector from an array using indexes obtained from an index map and using a mask.For each vector lane, where
N
is the vector lane index, if the mask lane at indexN
is set then the array element at indexa_offset + indexMap[i_offset + N]
is placed into the resulting vector at lane indexN
.- Parameters:
species
- species of desired vectora
- the arraya_offset
- the offset into the array, may be negative if relative indexes in the index map compensate to produce a value within the array boundsm
- the maskindexMap
- the index mapi_offset
- the offset into the index map- Returns:
- the vector loaded from an array
- Throws:
IndexOutOfBoundsException
- ifi_offset < 0
, ori_offset > indexMap.length - species.length()
, or for any vector lane indexN
where the mask at laneN
is set the result ofa_offset + indexMap[i_offset + N]
is< 0
or>= a.length
-
fromByteBuffer
public static LongVector fromByteBuffer(VectorSpecies<Long> species, ByteBuffer bb, int offset)
Loads a vector from abyte buffer
starting at an offset into the byte buffer.Bytes are composed into primitive lane elements according to the native byte order of the underlying platform.
This method behaves as if it returns the result of calling the byte buffer, offset, and mask accepting
fromByteBuffer(VectorSpecies, ByteBuffer, int, VectorMask)
method} as follows:return fromByteBuffer(b, offset, VectorMask.allTrue())
- Parameters:
species
- species of desired vectorbb
- the byte bufferoffset
- the offset into the byte buffer- Returns:
- a vector loaded from a byte buffer
- Throws:
IndexOutOfBoundsException
- if the offset is< 0
, or> b.limit()
, or if there are fewer thanspecies.length() * species.elementSize() / Byte.SIZE
bytes remaining in the byte buffer from the given offset
-
fromByteBuffer
public static LongVector fromByteBuffer(VectorSpecies<Long> species, ByteBuffer bb, int offset, VectorMask<Long> m)
Loads a vector from abyte buffer
starting at an offset into the byte buffer and using a mask.This method behaves as if the byte buffer is viewed as a primitive
buffer
for the primitive element type, according to the native byte order of the underlying platform, and the returned vector is loaded with a mask from a primitive array obtained from the primitive buffer. The following pseudocode expresses the behaviour, whereEBuffer
is the primitive buffer type,e
is the primitive element type, andESpecies
is the primitive species fore
:EBuffer eb = b.duplicate(). order(ByteOrder.nativeOrder()).position(offset). asEBuffer(); e[] es = new e[species.length()]; for (int n = 0; n < t.length; n++) { if (m.isSet(n)) es[n] = eb.get(n); } EVector r = EVector.fromArray(es, 0, m);
- Parameters:
species
- species of desired vectorbb
- the byte bufferoffset
- the offset into the byte bufferm
- the mask- Returns:
- a vector loaded from a byte buffer
- Throws:
IndexOutOfBoundsException
- if the offset is< 0
, or> b.limit()
, for any vector lane indexN
where the mask at laneN
is setoffset >= b.limit() - (N * species.elementSize() / Byte.SIZE)
-
broadcast
public static LongVector broadcast(VectorSpecies<Long> species, long e)
Returns a vector where all lane elements are set to the primitive valuee
.- Parameters:
species
- species of the desired vectore
- the value- Returns:
- a vector of vector where all lane elements are set to
the primitive value
e
-
scalars
public static LongVector scalars(VectorSpecies<Long> species, long... es)
Returns a vector where each lane element is set to given primitive values.For each vector lane, where
N
is the vector lane index, the the primitive value at indexN
is placed into the resulting vector at lane indexN
.- Parameters:
species
- species of the desired vectores
- the given primitive values- Returns:
- a vector where each lane element is set to given primitive values
- Throws:
IndexOutOfBoundsException
- ifes.length < species.length()
-
single
public static final LongVector single(VectorSpecies<Long> species, long e)
Returns a vector where the first lane element is set to the primtive valuee
, all other lane elements are set to the default value.- Parameters:
species
- species of the desired vectore
- the value- Returns:
- a vector where the first lane element is set to the primitive
value
e
-
random
public static LongVector random(VectorSpecies<Long> species)
Returns a vector where each lane element is set to a randomly generated primitive value. The semantics are equivalent to callingThreadLocalRandom.nextLong()
- Parameters:
species
- species of the desired vector- Returns:
- a vector where each lane elements is set to a randomly generated primitive value
-
add
public abstract LongVector add(long s)
Adds this vector to the broadcast of an input scalar.This is a lane-wise binary operation which applies the primitive addition operation (
+
) to each lane.- Parameters:
s
- the input scalar- Returns:
- the result of adding this vector to the broadcast of an input scalar
-
add
public abstract LongVector add(long s, VectorMask<Long> m)
Adds this vector to broadcast of an input scalar, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the primitive addition operation (
+
) to each lane.- Parameters:
s
- the input scalarm
- the mask controlling lane selection- Returns:
- the result of adding this vector to the broadcast of an input scalar
-
sub
public abstract LongVector sub(long s)
Subtracts the broadcast of an input scalar from this vector.This is a lane-wise binary operation which applies the primitive subtraction operation (
-
) to each lane.- Parameters:
s
- the input scalar- Returns:
- the result of subtracting the broadcast of an input scalar from this vector
-
sub
public abstract LongVector sub(long s, VectorMask<Long> m)
Subtracts the broadcast of an input scalar from this vector, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the primitive subtraction operation (
-
) to each lane.- Parameters:
s
- the input scalarm
- the mask controlling lane selection- Returns:
- the result of subtracting the broadcast of an input scalar from this vector
-
mul
public abstract LongVector mul(long s)
Multiplies this vector with the broadcast of an input scalar.This is a lane-wise binary operation which applies the primitive multiplication operation (
*
) to each lane.- Parameters:
s
- the input scalar- Returns:
- the result of multiplying this vector with the broadcast of an input scalar
-
mul
public abstract LongVector mul(long s, VectorMask<Long> m)
Multiplies this vector with the broadcast of an input scalar, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the primitive multiplication operation (
*
) to each lane.- Parameters:
s
- the input scalarm
- the mask controlling lane selection- Returns:
- the result of multiplying this vector with the broadcast of an input scalar
-
min
public abstract LongVector min(long s)
Returns the minimum of this vector and the broadcast of an input scalar.This is a lane-wise binary operation which applies the operation
(a, b) -> Math.min(a, b)
to each lane.- Parameters:
s
- the input scalar- Returns:
- the minimum of this vector and the broadcast of an input scalar
-
max
public abstract LongVector max(long s)
Returns the maximum of this vector and the broadcast of an input scalar.This is a lane-wise binary operation which applies the operation
(a, b) -> Math.max(a, b)
to each lane.- Parameters:
s
- the input scalar- Returns:
- the maximum of this vector and the broadcast of an input scalar
-
equal
public abstract VectorMask<Long> equal(long s)
Tests if this vector is equal to the broadcast of an input scalar.This is a lane-wise binary test operation which applies the primitive equals operation (
==
) each lane.- Parameters:
s
- the input scalar- Returns:
- the result mask of testing if this vector is equal to the broadcast of an input scalar
-
notEqual
public abstract VectorMask<Long> notEqual(long s)
Tests if this vector is not equal to the broadcast of an input scalar.This is a lane-wise binary test operation which applies the primitive not equals operation (
!=
) to each lane.- Parameters:
s
- the input scalar- Returns:
- the result mask of testing if this vector is not equal to the broadcast of an input scalar
-
lessThan
public abstract VectorMask<Long> lessThan(long s)
Tests if this vector is less than the broadcast of an input scalar.This is a lane-wise binary test operation which applies the primitive less than operation (
<
) to each lane.- Parameters:
s
- the input scalar- Returns:
- the mask result of testing if this vector is less than the broadcast of an input scalar
-
lessThanEq
public abstract VectorMask<Long> lessThanEq(long s)
Tests if this vector is less or equal to the broadcast of an input scalar.This is a lane-wise binary test operation which applies the primitive less than or equal to operation (
<=
) to each lane.- Parameters:
s
- the input scalar- Returns:
- the mask result of testing if this vector is less than or equal to the broadcast of an input scalar
-
greaterThan
public abstract VectorMask<Long> greaterThan(long s)
Tests if this vector is greater than the broadcast of an input scalar.This is a lane-wise binary test operation which applies the primitive greater than operation (
>
) to each lane.- Parameters:
s
- the input scalar- Returns:
- the mask result of testing if this vector is greater than the broadcast of an input scalar
-
greaterThanEq
public abstract VectorMask<Long> greaterThanEq(long s)
Tests if this vector is greater than or equal to the broadcast of an input scalar.This is a lane-wise binary test operation which applies the primitive greater than or equal to operation (
>=
) to each lane.- Parameters:
s
- the input scalar- Returns:
- the mask result of testing if this vector is greater than or equal to the broadcast of an input scalar
-
blend
public abstract LongVector blend(long s, VectorMask<Long> m)
Blends the lane elements of this vector with those of the broadcast of an input scalar, selecting lanes controlled by a mask.For each lane of the mask, at lane index
N
, if the mask lane is set then the lane element atN
from the input vector is selected and placed into the resulting vector atN
, otherwise the the lane element atN
from this input vector is selected and placed into the resulting vector atN
.- Parameters:
s
- the input scalarm
- the mask controlling lane selection- Returns:
- the result of blending the lane elements of this vector with those of the broadcast of an input scalar
-
and
public abstract LongVector and(Vector<Long> v)
Bitwise ANDs this vector with an input vector.This is a lane-wise binary operation which applies the primitive bitwise AND operation (
&
) to each lane.- Parameters:
v
- the input vector- Returns:
- the bitwise AND of this vector with the input vector
-
and
public abstract LongVector and(long s)
Bitwise ANDs this vector with the broadcast of an input scalar.This is a lane-wise binary operation which applies the primitive bitwise AND operation (
&
) to each lane.- Parameters:
s
- the input scalar- Returns:
- the bitwise AND of this vector with the broadcast of an input scalar
-
and
public abstract LongVector and(Vector<Long> v, VectorMask<Long> m)
Bitwise ANDs this vector with an input vector, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the primitive bitwise AND operation (
&
) to each lane.- Parameters:
v
- the input vectorm
- the mask controlling lane selection- Returns:
- the bitwise AND of this vector with the input vector
-
and
public abstract LongVector and(long s, VectorMask<Long> m)
Bitwise ANDs this vector with the broadcast of an input scalar, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the primitive bitwise AND operation (
&
) to each lane.- Parameters:
s
- the input scalarm
- the mask controlling lane selection- Returns:
- the bitwise AND of this vector with the broadcast of an input scalar
-
or
public abstract LongVector or(Vector<Long> v)
Bitwise ORs this vector with an input vector.This is a lane-wise binary operation which applies the primitive bitwise OR operation (
|
) to each lane.- Parameters:
v
- the input vector- Returns:
- the bitwise OR of this vector with the input vector
-
or
public abstract LongVector or(long s)
Bitwise ORs this vector with the broadcast of an input scalar.This is a lane-wise binary operation which applies the primitive bitwise OR operation (
|
) to each lane.- Parameters:
s
- the input scalar- Returns:
- the bitwise OR of this vector with the broadcast of an input scalar
-
or
public abstract LongVector or(Vector<Long> v, VectorMask<Long> m)
Bitwise ORs this vector with an input vector, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the primitive bitwise OR operation (
|
) to each lane.- Parameters:
v
- the input vectorm
- the mask controlling lane selection- Returns:
- the bitwise OR of this vector with the input vector
-
or
public abstract LongVector or(long s, VectorMask<Long> m)
Bitwise ORs this vector with the broadcast of an input scalar, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the primitive bitwise OR operation (
|
) to each lane.- Parameters:
s
- the input scalarm
- the mask controlling lane selection- Returns:
- the bitwise OR of this vector with the broadcast of an input scalar
-
xor
public abstract LongVector xor(Vector<Long> v)
Bitwise XORs this vector with an input vector.This is a lane-wise binary operation which applies the primitive bitwise XOR operation (
^
) to each lane.- Parameters:
v
- the input vector- Returns:
- the bitwise XOR of this vector with the input vector
-
xor
public abstract LongVector xor(long s)
Bitwise XORs this vector with the broadcast of an input scalar.This is a lane-wise binary operation which applies the primitive bitwise XOR operation (
^
) to each lane.- Parameters:
s
- the input scalar- Returns:
- the bitwise XOR of this vector with the broadcast of an input scalar
-
xor
public abstract LongVector xor(Vector<Long> v, VectorMask<Long> m)
Bitwise XORs this vector with an input vector, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the primitive bitwise XOR operation (
^
) to each lane.- Parameters:
v
- the input vectorm
- the mask controlling lane selection- Returns:
- the bitwise XOR of this vector with the input vector
-
xor
public abstract LongVector xor(long s, VectorMask<Long> m)
Bitwise XORs this vector with the broadcast of an input scalar, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the primitive bitwise XOR operation (
^
) to each lane.- Parameters:
s
- the input scalarm
- the mask controlling lane selection- Returns:
- the bitwise XOR of this vector with the broadcast of an input scalar
-
not
public abstract LongVector not()
Bitwise NOTs this vector.This is a lane-wise unary operation which applies the primitive bitwise NOT operation (
~
) to each lane.- Returns:
- the bitwise NOT of this vector
-
not
public abstract LongVector not(VectorMask<Long> m)
Bitwise NOTs this vector, selecting lane elements controlled by a mask.This is a lane-wise unary operation which applies the primitive bitwise NOT operation (
~
) to each lane.- Parameters:
m
- the mask controlling lane selection- Returns:
- the bitwise NOT of this vector
-
shiftLeft
public abstract LongVector shiftLeft(int s)
Logically left shifts this vector by the broadcast of an input scalar.This is a lane-wise binary operation which applies the primitive logical left shift operation (
<<
) to each lane to left shift the element by shift value as specified by the input scalar.- Parameters:
s
- the input scalar; the number of the bits to left shift- Returns:
- the result of logically left shifting left this vector by the broadcast of an input scalar
-
shiftLeft
public abstract LongVector shiftLeft(int s, VectorMask<Long> m)
Logically left shifts this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the primitive logical left shift operation (
<<
) to each lane to left shift the element by shift value as specified by the input scalar.- Parameters:
s
- the input scalar; the number of the bits to left shiftm
- the mask controlling lane selection- Returns:
- the result of logically left shifting left this vector by the broadcast of an input scalar
-
shiftLeft
public abstract LongVector shiftLeft(Vector<Long> v)
Logically left shifts this vector by an input vector.This is a lane-wise binary operation which applies the primitive logical left shift operation (
<<
) to each lane. For each lane of this vector, the shift value is the corresponding lane of input vector.- Parameters:
v
- the input vector- Returns:
- the result of logically left shifting this vector by the input vector
-
shiftLeft
public LongVector shiftLeft(Vector<Long> v, VectorMask<Long> m)
Logically left shifts this vector by an input vector, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the primitive logical left shift operation (
<<
) to each lane. For each lane of this vector, the shift value is the corresponding lane of input vector.- Parameters:
v
- the input vectorm
- the mask controlling lane selection- Returns:
- the result of logically left shifting this vector by the input vector
-
shiftRight
public abstract LongVector shiftRight(int s)
Logically right shifts (or unsigned right shifts) this vector by the broadcast of an input scalar.This is a lane-wise binary operation which applies the primitive logical right shift operation (
>>>
) to each lane to logically right shift the element by shift value as specified by the input scalar.- Parameters:
s
- the input scalar; the number of the bits to right shift- Returns:
- the result of logically right shifting this vector by the broadcast of an input scalar
-
shiftRight
public abstract LongVector shiftRight(int s, VectorMask<Long> m)
Logically right shifts (or unsigned right shifts) this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the primitive logical right shift operation (
>>
) to each lane to logically right shift the element by shift value as specified by the input scalar.- Parameters:
s
- the input scalar; the number of the bits to right shiftm
- the mask controlling lane selection- Returns:
- the result of logically right shifting this vector by the broadcast of an input scalar
-
shiftRight
public abstract LongVector shiftRight(Vector<Long> v)
Logically right shifts (or unsigned right shifts) this vector by an input vector.This is a lane-wise binary operation which applies the primitive logical right shift operation (
>>>
) to each lane. For each lane of this vector, the shift value is the corresponding lane of input vector.- Parameters:
v
- the input vector- Returns:
- the result of logically right shifting this vector by the input vector
-
shiftRight
public LongVector shiftRight(Vector<Long> v, VectorMask<Long> m)
Logically right shifts (or unsigned right shifts) this vector by an input vector, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the primitive logical right shift operation (
>>>
) to each lane. For each lane of this vector, the shift value is the corresponding lane of input vector.- Parameters:
v
- the input vectorm
- the mask controlling lane selection- Returns:
- the result of logically right shifting this vector by the input vector
-
shiftArithmeticRight
public abstract LongVector shiftArithmeticRight(int s)
Arithmetically right shifts (or signed right shifts) this vector by the broadcast of an input scalar.This is a lane-wise binary operation which applies the primitive arithmetic right shift operation (
>>
) to each lane to arithmetically right shift the element by shift value as specified by the input scalar.- Parameters:
s
- the input scalar; the number of the bits to right shift- Returns:
- the result of arithmetically right shifting this vector by the broadcast of an input scalar
-
shiftArithmeticRight
public abstract LongVector shiftArithmeticRight(int s, VectorMask<Long> m)
Arithmetically right shifts (or signed right shifts) this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the primitive arithmetic right shift operation (
>>
) to each lane to arithmetically right shift the element by shift value as specified by the input scalar.- Parameters:
s
- the input scalar; the number of the bits to right shiftm
- the mask controlling lane selection- Returns:
- the result of arithmetically right shifting this vector by the broadcast of an input scalar
-
shiftArithmeticRight
public abstract LongVector shiftArithmeticRight(Vector<Long> v)
Arithmetically right shifts (or signed right shifts) this vector by an input vector.This is a lane-wise binary operation which applies the primitive arithmetic right shift operation (
>>
) to each lane. For each lane of this vector, the shift value is the corresponding lane of input vector.- Parameters:
v
- the input vector- Returns:
- the result of arithmetically right shifting this vector by the input vector
-
shiftArithmeticRight
public LongVector shiftArithmeticRight(Vector<Long> v, VectorMask<Long> m)
Arithmetically right shifts (or signed right shifts) this vector by an input vector, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the primitive arithmetic right shift operation (
>>
) to each lane. For each lane of this vector, the shift value is the corresponding lane of input vector.- Parameters:
v
- the input vectorm
- the mask controlling lane selection- Returns:
- the result of arithmetically right shifting this vector by the input vector
-
rotateLeft
public final LongVector rotateLeft(int s)
Rotates left this vector by the broadcast of an input scalar.This is a lane-wise binary operation which applies the operation
Long.rotateLeft(long, int)
to each lane and where lane elements of this vector apply to the first argument, and lane elements of the broadcast vector apply to the second argument (the rotation distance).- Parameters:
s
- the input scalar; the number of the bits to rotate left- Returns:
- the result of rotating left this vector by the broadcast of an input scalar
-
rotateLeft
public final LongVector rotateLeft(int s, VectorMask<Long> m)
Rotates left this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the operation
Long.rotateLeft(long, int)
to each lane and where lane elements of this vector apply to the first argument, and lane elements of the broadcast vector apply to the second argument (the rotation distance).- Parameters:
s
- the input scalar; the number of the bits to rotate leftm
- the mask controlling lane selection- Returns:
- the result of rotating left this vector by the broadcast of an input scalar
-
rotateRight
public final LongVector rotateRight(int s)
Rotates right this vector by the broadcast of an input scalar.This is a lane-wise binary operation which applies the operation
Long.rotateRight(long, int)
to each lane and where lane elements of this vector apply to the first argument, and lane elements of the broadcast vector apply to the second argument (the rotation distance).- Parameters:
s
- the input scalar; the number of the bits to rotate right- Returns:
- the result of rotating right this vector by the broadcast of an input scalar
-
rotateRight
public final LongVector rotateRight(int s, VectorMask<Long> m)
Rotates right this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.This is a lane-wise binary operation which applies the operation
Long.rotateRight(long, int)
to each lane and where lane elements of this vector apply to the first argument, and lane elements of the broadcast vector apply to the second argument (the rotation distance).- Parameters:
s
- the input scalar; the number of the bits to rotate rightm
- the mask controlling lane selection- Returns:
- the result of rotating right this vector by the broadcast of an input scalar
-
addAll
public abstract long addAll()
Adds all lane elements of this vector.This is an associative cross-lane reduction operation which applies the addition operation (
+
) to lane elements, and the identity value is0
.- Returns:
- the addition of all the lane elements of this vector
-
addAll
public abstract long addAll(VectorMask<Long> m)
Adds all lane elements of this vector, selecting lane elements controlled by a mask.This is an associative cross-lane reduction operation which applies the addition operation (
+
) to lane elements, and the identity value is0
.- Parameters:
m
- the mask controlling lane selection- Returns:
- the addition of the selected lane elements of this vector
-
mulAll
public abstract long mulAll()
Multiplies all lane elements of this vector.This is an associative cross-lane reduction operation which applies the multiplication operation (
*
) to lane elements, and the identity value is1
.- Returns:
- the multiplication of all the lane elements of this vector
-
mulAll
public abstract long mulAll(VectorMask<Long> m)
Multiplies all lane elements of this vector, selecting lane elements controlled by a mask.This is an associative cross-lane reduction operation which applies the multiplication operation (
*
) to lane elements, and the identity value is1
.- Parameters:
m
- the mask controlling lane selection- Returns:
- the multiplication of all the lane elements of this vector
-
minAll
public abstract long minAll()
Returns the minimum lane element of this vector.This is an associative cross-lane reduction operation which applies the operation
(a, b) -> Math.min(a, b)
to lane elements, and the identity value isLong.MAX_VALUE
.- Returns:
- the minimum lane element of this vector
-
minAll
public abstract long minAll(VectorMask<Long> m)
Returns the minimum lane element of this vector, selecting lane elements controlled by a mask.This is an associative cross-lane reduction operation which applies the operation
(a, b) -> Math.min(a, b)
to lane elements, and the identity value isLong.MAX_VALUE
.- Parameters:
m
- the mask controlling lane selection- Returns:
- the minimum lane element of this vector
-
maxAll
public abstract long maxAll()
Returns the maximum lane element of this vector.This is an associative cross-lane reduction operation which applies the operation
(a, b) -> Math.max(a, b)
to lane elements, and the identity value isLong.MIN_VALUE
.- Returns:
- the maximum lane element of this vector
-
maxAll
public abstract long maxAll(VectorMask<Long> m)
Returns the maximum lane element of this vector, selecting lane elements controlled by a mask.This is an associative cross-lane reduction operation which applies the operation
(a, b) -> Math.max(a, b)
to lane elements, and the identity value isLong.MIN_VALUE
.- Parameters:
m
- the mask controlling lane selection- Returns:
- the maximum lane element of this vector
-
orAll
public abstract long orAll()
Logically ORs all lane elements of this vector.This is an associative cross-lane reduction operation which applies the logical OR operation (
|
) to lane elements, and the identity value is0
.- Returns:
- the logical OR all the lane elements of this vector
-
orAll
public abstract long orAll(VectorMask<Long> m)
Logically ORs all lane elements of this vector, selecting lane elements controlled by a mask.This is an associative cross-lane reduction operation which applies the logical OR operation (
|
) to lane elements, and the identity value is0
.- Parameters:
m
- the mask controlling lane selection- Returns:
- the logical OR all the lane elements of this vector
-
andAll
public abstract long andAll()
Logically ANDs all lane elements of this vector.This is an associative cross-lane reduction operation which applies the logical AND operation (
|
) to lane elements, and the identity value is-1
.- Returns:
- the logical AND all the lane elements of this vector
-
andAll
public abstract long andAll(VectorMask<Long> m)
Logically ANDs all lane elements of this vector, selecting lane elements controlled by a mask.This is an associative cross-lane reduction operation which applies the logical AND operation (
|
) to lane elements, and the identity value is-1
.- Parameters:
m
- the mask controlling lane selection- Returns:
- the logical AND all the lane elements of this vector
-
xorAll
public abstract long xorAll()
Logically XORs all lane elements of this vector.This is an associative cross-lane reduction operation which applies the logical XOR operation (
^
) to lane elements, and the identity value is0
.- Returns:
- the logical XOR all the lane elements of this vector
-
xorAll
public abstract long xorAll(VectorMask<Long> m)
Logically XORs all lane elements of this vector, selecting lane elements controlled by a mask.This is an associative cross-lane reduction operation which applies the logical XOR operation (
^
) to lane elements, and the identity value is0
.- Parameters:
m
- the mask controlling lane selection- Returns:
- the logical XOR all the lane elements of this vector
-
lane
public abstract long lane(int i)
Gets the lane element at lane indexi
- Parameters:
i
- the lane index- Returns:
- the lane element at lane index
i
- Throws:
IllegalArgumentException
- if the index is is out of range (< 0 || >= length()
)
-
with
public abstract LongVector with(int i, long e)
Replaces the lane element of this vector at lane indexi
with valuee
.This is a cross-lane operation and behaves as if it returns the result of blending this vector with an input vector that is the result of broadcasting
e
and a mask that has only one lane set at lane indexi
.- Parameters:
i
- the lane index of the lane element to be replacede
- the value to be placed- Returns:
- the result of replacing the lane element of this vector at lane
index
i
with valuee
. - Throws:
IllegalArgumentException
- if the index is is out of range (< 0 || >= length()
)
-
toArray
public final long[] toArray()
Returns an array containing the lane elements of this vector.This method behaves as if it
intoArray(long[], int)
stores} this vector into an allocated array and returns the array as follows:long[] a = new long[this.length()]; this.intoArray(a, 0); return a;
- Returns:
- an array containing the the lane elements of this vector
-
intoArray
public abstract void intoArray(long[] a, int offset)
Stores this vector into an array starting at offset.For each vector lane, where
N
is the vector lane index, the lane element at indexN
is stored into the array at indexoffset + N
.- Parameters:
a
- the arrayoffset
- the offset into the array- Throws:
IndexOutOfBoundsException
- ifoffset < 0
, oroffset > a.length - this.length()
-
intoArray
public abstract void intoArray(long[] a, int offset, VectorMask<Long> m)
Stores this vector into an array starting at offset and using a mask.For each vector lane, where
N
is the vector lane index, if the mask lane at indexN
is set then the lane element at indexN
is stored into the array indexoffset + N
.- Parameters:
a
- the arrayoffset
- the offset into the arraym
- the mask- Throws:
IndexOutOfBoundsException
- ifoffset < 0
, or for any vector lane indexN
where the mask at laneN
is setoffset >= a.length - N
-
intoArray
public abstract void intoArray(long[] a, int a_offset, int[] indexMap, int i_offset)
Stores this vector into an array using indexes obtained from an index map.For each vector lane, where
N
is the vector lane index, the lane element at indexN
is stored into the array at indexa_offset + indexMap[i_offset + N]
.- Parameters:
a
- the arraya_offset
- the offset into the array, may be negative if relative indexes in the index map compensate to produce a value within the array boundsindexMap
- the index mapi_offset
- the offset into the index map- Throws:
IndexOutOfBoundsException
- ifi_offset < 0
, ori_offset > indexMap.length - this.length()
, or for any vector lane indexN
the result ofa_offset + indexMap[i_offset + N]
is< 0
or>= a.length
-
intoArray
public abstract void intoArray(long[] a, int a_offset, VectorMask<Long> m, int[] indexMap, int i_offset)
Stores this vector into an array using indexes obtained from an index map and using a mask.For each vector lane, where
N
is the vector lane index, if the mask lane at indexN
is set then the lane element at indexN
is stored into the array at indexa_offset + indexMap[i_offset + N]
.- Parameters:
a
- the arraya_offset
- the offset into the array, may be negative if relative indexes in the index map compensate to produce a value within the array boundsm
- the maskindexMap
- the index mapi_offset
- the offset into the index map- Throws:
IndexOutOfBoundsException
- ifj < 0
, ori_offset > indexMap.length - this.length()
, or for any vector lane indexN
where the mask at laneN
is set the result ofa_offset + indexMap[i_offset + N]
is< 0
or>= a.length
-
-