< prev index next >
src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java
Print this page
rev 55891 : 8222897: [vector] Renaming of shift, rotate operations. Few other api changes.
Summary: Renaming of shift, rotate operations. Few other api changes.
Reviewed-by: jrose, briangoetz
rev 55894 : 8222897: [vector] Renaming of shift, rotate operations. Few other api changes.
Summary: Renaming of shift, rotate operations. Few other api changes.
Reviewed-by: jrose, briangoetz
@@ -161,11 +161,11 @@
throw new IllegalArgumentException("Vector length this species length differ");
return VectorIntrinsics.cast(
IntMaxVector.class,
int.class, LENGTH,
- s.boxType(),
+ s.vectorType(),
s.elementType(), LENGTH,
this, s,
(species, vector) -> vector.castDefault(species)
);
}
@@ -299,48 +299,48 @@
@Override
@ForceInline
public IntVector reshape(VectorSpecies<Integer> s) {
Objects.requireNonNull(s);
- if (s.bitSize() == 64 && (s.boxType() == Int64Vector.class)) {
+ if (s.bitSize() == 64 && (s.vectorType() == Int64Vector.class)) {
return VectorIntrinsics.reinterpret(
IntMaxVector.class,
int.class, LENGTH,
Int64Vector.class,
int.class, Int64Vector.LENGTH,
this, s,
(species, vector) -> (IntVector) vector.defaultReinterpret(species)
);
- } else if (s.bitSize() == 128 && (s.boxType() == Int128Vector.class)) {
+ } else if (s.bitSize() == 128 && (s.vectorType() == Int128Vector.class)) {
return VectorIntrinsics.reinterpret(
IntMaxVector.class,
int.class, LENGTH,
Int128Vector.class,
int.class, Int128Vector.LENGTH,
this, s,
(species, vector) -> (IntVector) vector.defaultReinterpret(species)
);
- } else if (s.bitSize() == 256 && (s.boxType() == Int256Vector.class)) {
+ } else if (s.bitSize() == 256 && (s.vectorType() == Int256Vector.class)) {
return VectorIntrinsics.reinterpret(
IntMaxVector.class,
int.class, LENGTH,
Int256Vector.class,
int.class, Int256Vector.LENGTH,
this, s,
(species, vector) -> (IntVector) vector.defaultReinterpret(species)
);
- } else if (s.bitSize() == 512 && (s.boxType() == Int512Vector.class)) {
+ } else if (s.bitSize() == 512 && (s.vectorType() == Int512Vector.class)) {
return VectorIntrinsics.reinterpret(
IntMaxVector.class,
int.class, LENGTH,
Int512Vector.class,
int.class, Int512Vector.LENGTH,
this, s,
(species, vector) -> (IntVector) vector.defaultReinterpret(species)
);
} else if ((s.bitSize() > 0) && (s.bitSize() <= 2048)
- && (s.bitSize() % 128 == 0) && (s.boxType() == IntMaxVector.class)) {
+ && (s.bitSize() % 128 == 0) && (s.vectorType() == IntMaxVector.class)) {
return VectorIntrinsics.reinterpret(
IntMaxVector.class,
int.class, LENGTH,
IntMaxVector.class,
int.class, IntMaxVector.LENGTH,
@@ -663,56 +663,56 @@
return blend(xor(v), m);
}
@Override
@ForceInline
- public IntMaxVector shiftL(int s) {
+ public IntMaxVector shiftLeft(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_LSHIFT, IntMaxVector.class, int.class, LENGTH,
this, s,
(v, i) -> v.uOp((__, a) -> (int) (a << i)));
}
@Override
@ForceInline
- public IntMaxVector shiftL(int s, VectorMask<Integer> m) {
- return blend(shiftL(s), m);
+ public IntMaxVector shiftLeft(int s, VectorMask<Integer> m) {
+ return blend(shiftLeft(s), m);
}
@Override
@ForceInline
- public IntMaxVector shiftR(int s) {
+ public IntMaxVector shiftRight(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_URSHIFT, IntMaxVector.class, int.class, LENGTH,
this, s,
(v, i) -> v.uOp((__, a) -> (int) (a >>> i)));
}
@Override
@ForceInline
- public IntMaxVector shiftR(int s, VectorMask<Integer> m) {
- return blend(shiftR(s), m);
+ public IntMaxVector shiftRight(int s, VectorMask<Integer> m) {
+ return blend(shiftRight(s), m);
}
@Override
@ForceInline
- public IntMaxVector aShiftR(int s) {
+ public IntMaxVector shiftArithmeticRight(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_RSHIFT, IntMaxVector.class, int.class, LENGTH,
this, s,
(v, i) -> v.uOp((__, a) -> (int) (a >> i)));
}
@Override
@ForceInline
- public IntMaxVector aShiftR(int s, VectorMask<Integer> m) {
- return blend(aShiftR(s), m);
+ public IntMaxVector shiftArithmeticRight(int s, VectorMask<Integer> m) {
+ return blend(shiftArithmeticRight(s), m);
}
@Override
@ForceInline
- public IntMaxVector shiftL(Vector<Integer> s) {
+ public IntMaxVector shiftLeft(Vector<Integer> s) {
IntMaxVector shiftv = (IntMaxVector)s;
// As per shift specification for Java, mask the shift count.
shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f));
return VectorIntrinsics.binaryOp(
VECTOR_OP_LSHIFT, IntMaxVector.class, int.class, LENGTH,
@@ -720,11 +720,11 @@
(v1, v2) -> v1.bOp(v2,(i,a, b) -> (int) (a << b)));
}
@Override
@ForceInline
- public IntMaxVector shiftR(Vector<Integer> s) {
+ public IntMaxVector shiftRight(Vector<Integer> s) {
IntMaxVector shiftv = (IntMaxVector)s;
// As per shift specification for Java, mask the shift count.
shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f));
return VectorIntrinsics.binaryOp(
VECTOR_OP_URSHIFT, IntMaxVector.class, int.class, LENGTH,
@@ -732,11 +732,11 @@
(v1, v2) -> v1.bOp(v2,(i,a, b) -> (int) (a >>> b)));
}
@Override
@ForceInline
- public IntMaxVector aShiftR(Vector<Integer> s) {
+ public IntMaxVector shiftArithmeticRight(Vector<Integer> s) {
IntMaxVector shiftv = (IntMaxVector)s;
// As per shift specification for Java, mask the shift count.
shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f));
return VectorIntrinsics.binaryOp(
VECTOR_OP_RSHIFT, IntMaxVector.class, int.class, LENGTH,
@@ -748,113 +748,113 @@
// Type specific horizontal reductions
@Override
@ForceInline
- public int addAll() {
+ public int addLanes() {
return (int) VectorIntrinsics.reductionCoerced(
VECTOR_OP_ADD, IntMaxVector.class, int.class, LENGTH,
this,
v -> (long) v.rOp((int) 0, (i, a, b) -> (int) (a + b)));
}
@Override
@ForceInline
- public int andAll() {
+ public int andLanes() {
return (int) VectorIntrinsics.reductionCoerced(
VECTOR_OP_AND, IntMaxVector.class, int.class, LENGTH,
this,
v -> (long) v.rOp((int) -1, (i, a, b) -> (int) (a & b)));
}
@Override
@ForceInline
- public int andAll(VectorMask<Integer> m) {
- return IntVector.broadcast(SPECIES, (int) -1).blend(this, m).andAll();
+ public int andLanes(VectorMask<Integer> m) {
+ return IntVector.broadcast(SPECIES, (int) -1).blend(this, m).andLanes();
}
@Override
@ForceInline
- public int minAll() {
+ public int minLanes() {
return (int) VectorIntrinsics.reductionCoerced(
VECTOR_OP_MIN, IntMaxVector.class, int.class, LENGTH,
this,
v -> (long) v.rOp(Integer.MAX_VALUE , (i, a, b) -> (int) Math.min(a, b)));
}
@Override
@ForceInline
- public int maxAll() {
+ public int maxLanes() {
return (int) VectorIntrinsics.reductionCoerced(
VECTOR_OP_MAX, IntMaxVector.class, int.class, LENGTH,
this,
v -> (long) v.rOp(Integer.MIN_VALUE , (i, a, b) -> (int) Math.max(a, b)));
}
@Override
@ForceInline
- public int mulAll() {
+ public int mulLanes() {
return (int) VectorIntrinsics.reductionCoerced(
VECTOR_OP_MUL, IntMaxVector.class, int.class, LENGTH,
this,
v -> (long) v.rOp((int) 1, (i, a, b) -> (int) (a * b)));
}
@Override
@ForceInline
- public int orAll() {
+ public int orLanes() {
return (int) VectorIntrinsics.reductionCoerced(
VECTOR_OP_OR, IntMaxVector.class, int.class, LENGTH,
this,
v -> (long) v.rOp((int) 0, (i, a, b) -> (int) (a | b)));
}
@Override
@ForceInline
- public int orAll(VectorMask<Integer> m) {
- return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).orAll();
+ public int orLanes(VectorMask<Integer> m) {
+ return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).orLanes();
}
@Override
@ForceInline
- public int xorAll() {
+ public int xorLanes() {
return (int) VectorIntrinsics.reductionCoerced(
VECTOR_OP_XOR, IntMaxVector.class, int.class, LENGTH,
this,
v -> (long) v.rOp((int) 0, (i, a, b) -> (int) (a ^ b)));
}
@Override
@ForceInline
- public int xorAll(VectorMask<Integer> m) {
- return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).xorAll();
+ public int xorLanes(VectorMask<Integer> m) {
+ return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).xorLanes();
}
@Override
@ForceInline
- public int addAll(VectorMask<Integer> m) {
- return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).addAll();
+ public int addLanes(VectorMask<Integer> m) {
+ return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).addLanes();
}
@Override
@ForceInline
- public int mulAll(VectorMask<Integer> m) {
- return IntVector.broadcast(SPECIES, (int) 1).blend(this, m).mulAll();
+ public int mulLanes(VectorMask<Integer> m) {
+ return IntVector.broadcast(SPECIES, (int) 1).blend(this, m).mulLanes();
}
@Override
@ForceInline
- public int minAll(VectorMask<Integer> m) {
- return IntVector.broadcast(SPECIES, Integer.MAX_VALUE).blend(this, m).minAll();
+ public int minLanes(VectorMask<Integer> m) {
+ return IntVector.broadcast(SPECIES, Integer.MAX_VALUE).blend(this, m).minLanes();
}
@Override
@ForceInline
- public int maxAll(VectorMask<Integer> m) {
- return IntVector.broadcast(SPECIES, Integer.MIN_VALUE).blend(this, m).maxAll();
+ public int maxLanes(VectorMask<Integer> m) {
+ return IntVector.broadcast(SPECIES, Integer.MIN_VALUE).blend(this, m).maxLanes();
}
@Override
@ForceInline
public VectorShuffle<Integer> toShuffle() {
@@ -1105,21 +1105,21 @@
}
return new FloatMaxVector(res);
}
@Override
- public IntMaxVector rotateEL(int j) {
+ public IntMaxVector rotateLanesLeft(int j) {
int[] vec = getElements();
int[] res = new int[length()];
for (int i = 0; i < length(); i++){
res[(j + i) % length()] = vec[i];
}
return new IntMaxVector(res);
}
@Override
- public IntMaxVector rotateER(int j) {
+ public IntMaxVector rotateLanesRight(int j) {
int[] vec = getElements();
int[] res = new int[length()];
for (int i = 0; i < length(); i++){
int z = i - j;
if(j < 0) {
@@ -1130,21 +1130,21 @@
}
return new IntMaxVector(res);
}
@Override
- public IntMaxVector shiftEL(int j) {
+ public IntMaxVector shiftLanesLeft(int j) {
int[] vec = getElements();
int[] res = new int[length()];
for (int i = 0; i < length() - j; i++) {
res[i] = vec[i + j];
}
return new IntMaxVector(res);
}
@Override
- public IntMaxVector shiftER(int j) {
+ public IntMaxVector shiftLanesRight(int j) {
int[] vec = getElements();
int[] res = new int[length()];
for (int i = 0; i < length() - j; i++){
res[i + j] = vec[i];
}
< prev index next >