< prev index next >
src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java
Print this page
*** 152,162 ****
throw new IllegalArgumentException("Vector length this species length differ");
return VectorIntrinsics.cast(
Byte64Vector.class,
byte.class, LENGTH,
! s.boxType(),
s.elementType(), LENGTH,
this, s,
(species, vector) -> vector.castDefault(species)
);
}
--- 152,162 ----
throw new IllegalArgumentException("Vector length this species length differ");
return VectorIntrinsics.cast(
Byte64Vector.class,
byte.class, LENGTH,
! s.vectorType(),
s.elementType(), LENGTH,
this, s,
(species, vector) -> vector.castDefault(species)
);
}
*** 290,337 ****
@Override
@ForceInline
public ByteVector reshape(VectorSpecies<Byte> s) {
Objects.requireNonNull(s);
! if (s.bitSize() == 64 && (s.boxType() == Byte64Vector.class)) {
return VectorIntrinsics.reinterpret(
Byte64Vector.class,
byte.class, LENGTH,
Byte64Vector.class,
byte.class, Byte64Vector.LENGTH,
this, s,
(species, vector) -> (ByteVector) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 128 && (s.boxType() == Byte128Vector.class)) {
return VectorIntrinsics.reinterpret(
Byte64Vector.class,
byte.class, LENGTH,
Byte128Vector.class,
byte.class, Byte128Vector.LENGTH,
this, s,
(species, vector) -> (ByteVector) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 256 && (s.boxType() == Byte256Vector.class)) {
return VectorIntrinsics.reinterpret(
Byte64Vector.class,
byte.class, LENGTH,
Byte256Vector.class,
byte.class, Byte256Vector.LENGTH,
this, s,
(species, vector) -> (ByteVector) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 512 && (s.boxType() == Byte512Vector.class)) {
return VectorIntrinsics.reinterpret(
Byte64Vector.class,
byte.class, LENGTH,
Byte512Vector.class,
byte.class, Byte512Vector.LENGTH,
this, s,
(species, vector) -> (ByteVector) vector.defaultReinterpret(species)
);
} else if ((s.bitSize() > 0) && (s.bitSize() <= 2048)
! && (s.bitSize() % 128 == 0) && (s.boxType() == ByteMaxVector.class)) {
return VectorIntrinsics.reinterpret(
Byte64Vector.class,
byte.class, LENGTH,
ByteMaxVector.class,
byte.class, ByteMaxVector.LENGTH,
--- 290,337 ----
@Override
@ForceInline
public ByteVector reshape(VectorSpecies<Byte> s) {
Objects.requireNonNull(s);
! if (s.bitSize() == 64 && (s.vectorType() == Byte64Vector.class)) {
return VectorIntrinsics.reinterpret(
Byte64Vector.class,
byte.class, LENGTH,
Byte64Vector.class,
byte.class, Byte64Vector.LENGTH,
this, s,
(species, vector) -> (ByteVector) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 128 && (s.vectorType() == Byte128Vector.class)) {
return VectorIntrinsics.reinterpret(
Byte64Vector.class,
byte.class, LENGTH,
Byte128Vector.class,
byte.class, Byte128Vector.LENGTH,
this, s,
(species, vector) -> (ByteVector) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 256 && (s.vectorType() == Byte256Vector.class)) {
return VectorIntrinsics.reinterpret(
Byte64Vector.class,
byte.class, LENGTH,
Byte256Vector.class,
byte.class, Byte256Vector.LENGTH,
this, s,
(species, vector) -> (ByteVector) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 512 && (s.vectorType() == Byte512Vector.class)) {
return VectorIntrinsics.reinterpret(
Byte64Vector.class,
byte.class, LENGTH,
Byte512Vector.class,
byte.class, Byte512Vector.LENGTH,
this, s,
(species, vector) -> (ByteVector) vector.defaultReinterpret(species)
);
} else if ((s.bitSize() > 0) && (s.bitSize() <= 2048)
! && (s.bitSize() % 128 == 0) && (s.vectorType() == ByteMaxVector.class)) {
return VectorIntrinsics.reinterpret(
Byte64Vector.class,
byte.class, LENGTH,
ByteMaxVector.class,
byte.class, ByteMaxVector.LENGTH,
*** 654,705 ****
return blend(xor(v), m);
}
@Override
@ForceInline
! public Byte64Vector shiftL(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_LSHIFT, Byte64Vector.class, byte.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> (byte) (a << (i & 7))));
}
@Override
@ForceInline
! public Byte64Vector shiftL(int s, VectorMask<Byte> m) {
! return blend(shiftL(s), m);
}
@Override
@ForceInline
! public Byte64Vector shiftR(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_URSHIFT, Byte64Vector.class, byte.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> (byte) ((a & 0xFF) >>> (i & 7))));
}
@Override
@ForceInline
! public Byte64Vector shiftR(int s, VectorMask<Byte> m) {
! return blend(shiftR(s), m);
}
@Override
@ForceInline
! public Byte64Vector aShiftR(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_RSHIFT, Byte64Vector.class, byte.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> (byte) (a >> (i & 7))));
}
@Override
@ForceInline
! public Byte64Vector aShiftR(int s, VectorMask<Byte> m) {
! return blend(aShiftR(s), m);
}
// Ternary operations
// Type specific horizontal reductions
--- 654,733 ----
return blend(xor(v), m);
}
@Override
@ForceInline
! public Byte64Vector shiftLeft(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_LSHIFT, Byte64Vector.class, byte.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> (byte) (a << (i & 0x7))));
}
@Override
@ForceInline
! public Byte64Vector shiftLeft(int s, VectorMask<Byte> m) {
! return blend(shiftLeft(s), m);
}
@Override
@ForceInline
! public Byte64Vector shiftLeft(Vector<Byte> s) {
! Byte64Vector shiftv = (Byte64Vector)s;
! // As per shift specification for Java, mask the shift count.
! shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7));
! return this.bOp(shiftv, (i, a, b) -> (byte) (a << (b & 0x7)));
! }
!
! @Override
! @ForceInline
! public Byte64Vector shiftRight(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_URSHIFT, Byte64Vector.class, byte.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> (byte) ((a & 0xFF) >>> (i & 0x7))));
}
@Override
@ForceInline
! public Byte64Vector shiftRight(int s, VectorMask<Byte> m) {
! return blend(shiftRight(s), m);
}
@Override
@ForceInline
! public Byte64Vector shiftRight(Vector<Byte> s) {
! Byte64Vector shiftv = (Byte64Vector)s;
! // As per shift specification for Java, mask the shift count.
! shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7));
! return this.bOp(shiftv, (i, a, b) -> (byte) (a >>> (b & 0x7)));
! }
!
! @Override
! @ForceInline
! public Byte64Vector shiftArithmeticRight(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_RSHIFT, Byte64Vector.class, byte.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> (byte) (a >> (i & 0x7))));
! }
!
! @Override
! @ForceInline
! public Byte64Vector shiftArithmeticRight(int s, VectorMask<Byte> m) {
! return blend(shiftArithmeticRight(s), m);
}
@Override
@ForceInline
! public Byte64Vector shiftArithmeticRight(Vector<Byte> s) {
! Byte64Vector shiftv = (Byte64Vector)s;
! // As per shift specification for Java, mask the shift count.
! shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7));
! return this.bOp(shiftv, (i, a, b) -> (byte) (a >> (b & 0x7)));
}
+
// Ternary operations
// Type specific horizontal reductions
*** 1026,1046 ****
}
@Override
! public Byte64Vector rotateEL(int j) {
byte[] vec = getElements();
byte[] res = new byte[length()];
for (int i = 0; i < length(); i++){
res[(j + i) % length()] = vec[i];
}
return new Byte64Vector(res);
}
@Override
! public Byte64Vector rotateER(int j) {
byte[] vec = getElements();
byte[] res = new byte[length()];
for (int i = 0; i < length(); i++){
int z = i - j;
if(j < 0) {
--- 1054,1074 ----
}
@Override
! public Byte64Vector rotateLanesLeft(int j) {
byte[] vec = getElements();
byte[] res = new byte[length()];
for (int i = 0; i < length(); i++){
res[(j + i) % length()] = vec[i];
}
return new Byte64Vector(res);
}
@Override
! public Byte64Vector rotateLanesRight(int j) {
byte[] vec = getElements();
byte[] res = new byte[length()];
for (int i = 0; i < length(); i++){
int z = i - j;
if(j < 0) {
*** 1051,1071 ****
}
return new Byte64Vector(res);
}
@Override
! public Byte64Vector shiftEL(int j) {
byte[] vec = getElements();
byte[] res = new byte[length()];
for (int i = 0; i < length() - j; i++) {
res[i] = vec[i + j];
}
return new Byte64Vector(res);
}
@Override
! public Byte64Vector shiftER(int j) {
byte[] vec = getElements();
byte[] res = new byte[length()];
for (int i = 0; i < length() - j; i++){
res[i + j] = vec[i];
}
--- 1079,1099 ----
}
return new Byte64Vector(res);
}
@Override
! public Byte64Vector shiftLanesLeft(int j) {
byte[] vec = getElements();
byte[] res = new byte[length()];
for (int i = 0; i < length() - j; i++) {
res[i] = vec[i + j];
}
return new Byte64Vector(res);
}
@Override
! public Byte64Vector shiftLanesRight(int j) {
byte[] vec = getElements();
byte[] res = new byte[length()];
for (int i = 0; i < length() - j; i++){
res[i + j] = vec[i];
}
< prev index next >