< prev index next >
src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java
Print this page
*** 153,163 ****
throw new IllegalArgumentException("Vector length this species length differ");
return VectorIntrinsics.cast(
ShortMaxVector.class,
short.class, LENGTH,
! s.boxType(),
s.elementType(), LENGTH,
this, s,
(species, vector) -> vector.castDefault(species)
);
}
--- 153,163 ----
throw new IllegalArgumentException("Vector length this species length differ");
return VectorIntrinsics.cast(
ShortMaxVector.class,
short.class, LENGTH,
! s.vectorType(),
s.elementType(), LENGTH,
this, s,
(species, vector) -> vector.castDefault(species)
);
}
*** 291,338 ****
@Override
@ForceInline
public ShortVector reshape(VectorSpecies<Short> s) {
Objects.requireNonNull(s);
! if (s.bitSize() == 64 && (s.boxType() == Short64Vector.class)) {
return VectorIntrinsics.reinterpret(
ShortMaxVector.class,
short.class, LENGTH,
Short64Vector.class,
short.class, Short64Vector.LENGTH,
this, s,
(species, vector) -> (ShortVector) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 128 && (s.boxType() == Short128Vector.class)) {
return VectorIntrinsics.reinterpret(
ShortMaxVector.class,
short.class, LENGTH,
Short128Vector.class,
short.class, Short128Vector.LENGTH,
this, s,
(species, vector) -> (ShortVector) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 256 && (s.boxType() == Short256Vector.class)) {
return VectorIntrinsics.reinterpret(
ShortMaxVector.class,
short.class, LENGTH,
Short256Vector.class,
short.class, Short256Vector.LENGTH,
this, s,
(species, vector) -> (ShortVector) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 512 && (s.boxType() == Short512Vector.class)) {
return VectorIntrinsics.reinterpret(
ShortMaxVector.class,
short.class, LENGTH,
Short512Vector.class,
short.class, Short512Vector.LENGTH,
this, s,
(species, vector) -> (ShortVector) vector.defaultReinterpret(species)
);
} else if ((s.bitSize() > 0) && (s.bitSize() <= 2048)
! && (s.bitSize() % 128 == 0) && (s.boxType() == ShortMaxVector.class)) {
return VectorIntrinsics.reinterpret(
ShortMaxVector.class,
short.class, LENGTH,
ShortMaxVector.class,
short.class, ShortMaxVector.LENGTH,
--- 291,338 ----
@Override
@ForceInline
public ShortVector reshape(VectorSpecies<Short> s) {
Objects.requireNonNull(s);
! if (s.bitSize() == 64 && (s.vectorType() == Short64Vector.class)) {
return VectorIntrinsics.reinterpret(
ShortMaxVector.class,
short.class, LENGTH,
Short64Vector.class,
short.class, Short64Vector.LENGTH,
this, s,
(species, vector) -> (ShortVector) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 128 && (s.vectorType() == Short128Vector.class)) {
return VectorIntrinsics.reinterpret(
ShortMaxVector.class,
short.class, LENGTH,
Short128Vector.class,
short.class, Short128Vector.LENGTH,
this, s,
(species, vector) -> (ShortVector) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 256 && (s.vectorType() == Short256Vector.class)) {
return VectorIntrinsics.reinterpret(
ShortMaxVector.class,
short.class, LENGTH,
Short256Vector.class,
short.class, Short256Vector.LENGTH,
this, s,
(species, vector) -> (ShortVector) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 512 && (s.vectorType() == Short512Vector.class)) {
return VectorIntrinsics.reinterpret(
ShortMaxVector.class,
short.class, LENGTH,
Short512Vector.class,
short.class, Short512Vector.LENGTH,
this, s,
(species, vector) -> (ShortVector) vector.defaultReinterpret(species)
);
} else if ((s.bitSize() > 0) && (s.bitSize() <= 2048)
! && (s.bitSize() % 128 == 0) && (s.vectorType() == ShortMaxVector.class)) {
return VectorIntrinsics.reinterpret(
ShortMaxVector.class,
short.class, LENGTH,
ShortMaxVector.class,
short.class, ShortMaxVector.LENGTH,
*** 655,705 ****
return blend(xor(v), m);
}
@Override
@ForceInline
! public ShortMaxVector shiftL(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_LSHIFT, ShortMaxVector.class, short.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> (short) (a << (i & 15))));
}
@Override
@ForceInline
! public ShortMaxVector shiftL(int s, VectorMask<Short> m) {
! return blend(shiftL(s), m);
}
@Override
@ForceInline
! public ShortMaxVector shiftR(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_URSHIFT, ShortMaxVector.class, short.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> (short) ((a & 0xFFFF) >>> (i & 15))));
}
@Override
@ForceInline
! public ShortMaxVector shiftR(int s, VectorMask<Short> m) {
! return blend(shiftR(s), m);
}
@Override
@ForceInline
! public ShortMaxVector aShiftR(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_RSHIFT, ShortMaxVector.class, short.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> (short) (a >> (i & 15))));
}
@Override
@ForceInline
! public ShortMaxVector aShiftR(int s, VectorMask<Short> m) {
! return blend(aShiftR(s), m);
}
// Ternary operations
// Type specific horizontal reductions
--- 655,732 ----
return blend(xor(v), m);
}
@Override
@ForceInline
! public ShortMaxVector shiftLeft(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_LSHIFT, ShortMaxVector.class, short.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> (short) (a << (i & 0xF))));
}
@Override
@ForceInline
! public ShortMaxVector shiftLeft(int s, VectorMask<Short> m) {
! return blend(shiftLeft(s), m);
}
@Override
@ForceInline
! public ShortMaxVector shiftLeft(Vector<Short> s) {
! ShortMaxVector shiftv = (ShortMaxVector)s;
! // As per shift specification for Java, mask the shift count.
! shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF));
! return this.bOp(shiftv, (i, a, b) -> (short) (a << (b & 0xF)));
! }
!
! @Override
! @ForceInline
! public ShortMaxVector shiftRight(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_URSHIFT, ShortMaxVector.class, short.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> (short) ((a & 0xFFFF) >>> (i & 0xF))));
! }
!
! @Override
! @ForceInline
! public ShortMaxVector shiftRight(int s, VectorMask<Short> m) {
! return blend(shiftRight(s), m);
}
@Override
@ForceInline
! public ShortMaxVector shiftRight(Vector<Short> s) {
! ShortMaxVector shiftv = (ShortMaxVector)s;
! // As per shift specification for Java, mask the shift count.
! shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF));
! return this.bOp(shiftv, (i, a, b) -> (short) (a >>> (b & 0xF)));
}
@Override
@ForceInline
! public ShortMaxVector shiftArithmeticRight(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_RSHIFT, ShortMaxVector.class, short.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> (short) (a >> (i & 0xF))));
! }
!
! @Override
! @ForceInline
! public ShortMaxVector shiftArithmeticRight(int s, VectorMask<Short> m) {
! return blend(shiftArithmeticRight(s), m);
}
@Override
@ForceInline
! public ShortMaxVector shiftArithmeticRight(Vector<Short> s) {
! ShortMaxVector shiftv = (ShortMaxVector)s;
! // As per shift specification for Java, mask the shift count.
! shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF));
! return this.bOp(shiftv, (i, a, b) -> (short) (a >> (b & 0xF)));
}
// Ternary operations
// Type specific horizontal reductions
*** 1027,1047 ****
}
@Override
! public ShortMaxVector rotateEL(int j) {
short[] vec = getElements();
short[] res = new short[length()];
for (int i = 0; i < length(); i++){
res[(j + i) % length()] = vec[i];
}
return new ShortMaxVector(res);
}
@Override
! public ShortMaxVector rotateER(int j) {
short[] vec = getElements();
short[] res = new short[length()];
for (int i = 0; i < length(); i++){
int z = i - j;
if(j < 0) {
--- 1054,1074 ----
}
@Override
! public ShortMaxVector rotateLanesLeft(int j) {
short[] vec = getElements();
short[] res = new short[length()];
for (int i = 0; i < length(); i++){
res[(j + i) % length()] = vec[i];
}
return new ShortMaxVector(res);
}
@Override
! public ShortMaxVector rotateLanesRight(int j) {
short[] vec = getElements();
short[] res = new short[length()];
for (int i = 0; i < length(); i++){
int z = i - j;
if(j < 0) {
*** 1052,1072 ****
}
return new ShortMaxVector(res);
}
@Override
! public ShortMaxVector shiftEL(int j) {
short[] vec = getElements();
short[] res = new short[length()];
for (int i = 0; i < length() - j; i++) {
res[i] = vec[i + j];
}
return new ShortMaxVector(res);
}
@Override
! public ShortMaxVector shiftER(int j) {
short[] vec = getElements();
short[] res = new short[length()];
for (int i = 0; i < length() - j; i++){
res[i + j] = vec[i];
}
--- 1079,1099 ----
}
return new ShortMaxVector(res);
}
@Override
! public ShortMaxVector shiftLanesLeft(int j) {
short[] vec = getElements();
short[] res = new short[length()];
for (int i = 0; i < length() - j; i++) {
res[i] = vec[i + j];
}
return new ShortMaxVector(res);
}
@Override
! public ShortMaxVector shiftLanesRight(int j) {
short[] vec = getElements();
short[] res = new short[length()];
for (int i = 0; i < length() - j; i++){
res[i + j] = vec[i];
}
< prev index next >