< prev index next >
src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template
Print this page
*** 169,179 ****
throw new IllegalArgumentException("Vector length this species length differ");
return VectorIntrinsics.cast(
$vectortype$.class,
$type$.class, LENGTH,
! s.boxType(),
s.elementType(), LENGTH,
this, s,
(species, vector) -> vector.castDefault(species)
);
}
--- 169,179 ----
throw new IllegalArgumentException("Vector length this species length differ");
return VectorIntrinsics.cast(
$vectortype$.class,
$type$.class, LENGTH,
! s.vectorType(),
s.elementType(), LENGTH,
this, s,
(species, vector) -> vector.castDefault(species)
);
}
*** 307,354 ****
@Override
@ForceInline
public $abstractvectortype$ reshape(VectorSpecies<$Boxtype$> s) {
Objects.requireNonNull(s);
! if (s.bitSize() == 64 && (s.boxType() == $Type$64Vector.class)) {
return VectorIntrinsics.reinterpret(
$vectortype$.class,
$type$.class, LENGTH,
$Type$64Vector.class,
$type$.class, $Type$64Vector.LENGTH,
this, s,
(species, vector) -> ($abstractvectortype$) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 128 && (s.boxType() == $Type$128Vector.class)) {
return VectorIntrinsics.reinterpret(
$vectortype$.class,
$type$.class, LENGTH,
$Type$128Vector.class,
$type$.class, $Type$128Vector.LENGTH,
this, s,
(species, vector) -> ($abstractvectortype$) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 256 && (s.boxType() == $Type$256Vector.class)) {
return VectorIntrinsics.reinterpret(
$vectortype$.class,
$type$.class, LENGTH,
$Type$256Vector.class,
$type$.class, $Type$256Vector.LENGTH,
this, s,
(species, vector) -> ($abstractvectortype$) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 512 && (s.boxType() == $Type$512Vector.class)) {
return VectorIntrinsics.reinterpret(
$vectortype$.class,
$type$.class, LENGTH,
$Type$512Vector.class,
$type$.class, $Type$512Vector.LENGTH,
this, s,
(species, vector) -> ($abstractvectortype$) vector.defaultReinterpret(species)
);
} else if ((s.bitSize() > 0) && (s.bitSize() <= 2048)
! && (s.bitSize() % 128 == 0) && (s.boxType() == $Type$MaxVector.class)) {
return VectorIntrinsics.reinterpret(
$vectortype$.class,
$type$.class, LENGTH,
$Type$MaxVector.class,
$type$.class, $Type$MaxVector.LENGTH,
--- 307,354 ----
@Override
@ForceInline
public $abstractvectortype$ reshape(VectorSpecies<$Boxtype$> s) {
Objects.requireNonNull(s);
! if (s.bitSize() == 64 && (s.vectorType() == $Type$64Vector.class)) {
return VectorIntrinsics.reinterpret(
$vectortype$.class,
$type$.class, LENGTH,
$Type$64Vector.class,
$type$.class, $Type$64Vector.LENGTH,
this, s,
(species, vector) -> ($abstractvectortype$) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 128 && (s.vectorType() == $Type$128Vector.class)) {
return VectorIntrinsics.reinterpret(
$vectortype$.class,
$type$.class, LENGTH,
$Type$128Vector.class,
$type$.class, $Type$128Vector.LENGTH,
this, s,
(species, vector) -> ($abstractvectortype$) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 256 && (s.vectorType() == $Type$256Vector.class)) {
return VectorIntrinsics.reinterpret(
$vectortype$.class,
$type$.class, LENGTH,
$Type$256Vector.class,
$type$.class, $Type$256Vector.LENGTH,
this, s,
(species, vector) -> ($abstractvectortype$) vector.defaultReinterpret(species)
);
! } else if (s.bitSize() == 512 && (s.vectorType() == $Type$512Vector.class)) {
return VectorIntrinsics.reinterpret(
$vectortype$.class,
$type$.class, LENGTH,
$Type$512Vector.class,
$type$.class, $Type$512Vector.LENGTH,
this, s,
(species, vector) -> ($abstractvectortype$) vector.defaultReinterpret(species)
);
} else if ((s.bitSize() > 0) && (s.bitSize() <= 2048)
! && (s.bitSize() % 128 == 0) && (s.vectorType() == $Type$MaxVector.class)) {
return VectorIntrinsics.reinterpret(
$vectortype$.class,
$type$.class, LENGTH,
$Type$MaxVector.class,
$type$.class, $Type$MaxVector.LENGTH,
*** 944,1091 ****
#end[BITWISE]
#if[byte]
@Override
@ForceInline
! public $vectortype$ shiftL(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_LSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> ($type$) (a << (i & 7))));
}
@Override
@ForceInline
! public $vectortype$ shiftL(int s, VectorMask<$Boxtype$> m) {
! return blend(shiftL(s), m);
}
@Override
@ForceInline
! public $vectortype$ shiftR(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_URSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> ($type$) ((a & 0xFF) >>> (i & 7))));
}
@Override
@ForceInline
! public $vectortype$ shiftR(int s, VectorMask<$Boxtype$> m) {
! return blend(shiftR(s), m);
}
@Override
@ForceInline
! public $vectortype$ aShiftR(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_RSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> ($type$) (a >> (i & 7))));
}
@Override
@ForceInline
! public $vectortype$ aShiftR(int s, VectorMask<$Boxtype$> m) {
! return blend(aShiftR(s), m);
}
#end[byte]
#if[short]
@Override
@ForceInline
! public $vectortype$ shiftL(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_LSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> ($type$) (a << (i & 15))));
}
@Override
@ForceInline
! public $vectortype$ shiftL(int s, VectorMask<$Boxtype$> m) {
! return blend(shiftL(s), m);
}
@Override
@ForceInline
! public $vectortype$ shiftR(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_URSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> ($type$) ((a & 0xFFFF) >>> (i & 15))));
}
@Override
@ForceInline
! public $vectortype$ shiftR(int s, VectorMask<$Boxtype$> m) {
! return blend(shiftR(s), m);
}
@Override
@ForceInline
! public $vectortype$ aShiftR(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_RSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> ($type$) (a >> (i & 15))));
}
@Override
@ForceInline
! public $vectortype$ aShiftR(int s, VectorMask<$Boxtype$> m) {
! return blend(aShiftR(s), m);
}
#end[short]
#if[intOrLong]
@Override
@ForceInline
! public $vectortype$ shiftL(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_LSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
(v, i) -> v.uOp((__, a) -> ($type$) (a << i)));
}
@Override
@ForceInline
! public $vectortype$ shiftL(int s, VectorMask<$Boxtype$> m) {
! return blend(shiftL(s), m);
}
@Override
@ForceInline
! public $vectortype$ shiftR(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_URSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
(v, i) -> v.uOp((__, a) -> ($type$) (a >>> i)));
}
@Override
@ForceInline
! public $vectortype$ shiftR(int s, VectorMask<$Boxtype$> m) {
! return blend(shiftR(s), m);
}
@Override
@ForceInline
! public $vectortype$ aShiftR(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_RSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
(v, i) -> v.uOp((__, a) -> ($type$) (a >> i)));
}
@Override
@ForceInline
! public $vectortype$ aShiftR(int s, VectorMask<$Boxtype$> m) {
! return blend(aShiftR(s), m);
}
@Override
@ForceInline
! public $vectortype$ shiftL(Vector<$Boxtype$> s) {
$vectortype$ shiftv = ($vectortype$)s;
// As per shift specification for Java, mask the shift count.
shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, {#if[int]?0x1f:0x3f}));
return VectorIntrinsics.binaryOp(
VECTOR_OP_LSHIFT, $vectortype$.class, $type$.class, LENGTH,
--- 944,1146 ----
#end[BITWISE]
#if[byte]
@Override
@ForceInline
! public $vectortype$ shiftLeft(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_LSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> ($type$) (a << (i & 0x7))));
}
@Override
@ForceInline
! public $vectortype$ shiftLeft(int s, VectorMask<$Boxtype$> m) {
! return blend(shiftLeft(s), m);
}
@Override
@ForceInline
! public $vectortype$ shiftLeft(Vector<$Boxtype$> s) {
! $vectortype$ shiftv = ($vectortype$)s;
! // As per shift specification for Java, mask the shift count.
! shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, ($type$) 0x7));
! return this.bOp(shiftv, (i, a, b) -> ($type$) (a << (b & 0x7)));
! }
!
! @Override
! @ForceInline
! public $vectortype$ shiftRight(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_URSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> ($type$) ((a & 0xFF) >>> (i & 0x7))));
}
@Override
@ForceInline
! public $vectortype$ shiftRight(int s, VectorMask<$Boxtype$> m) {
! return blend(shiftRight(s), m);
}
@Override
@ForceInline
! public $vectortype$ shiftRight(Vector<$Boxtype$> s) {
! $vectortype$ shiftv = ($vectortype$)s;
! // As per shift specification for Java, mask the shift count.
! shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, ($type$) 0x7));
! return this.bOp(shiftv, (i, a, b) -> ($type$) (a >>> (b & 0x7)));
! }
!
! @Override
! @ForceInline
! public $vectortype$ shiftArithmeticRight(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_RSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> ($type$) (a >> (i & 0x7))));
}
@Override
@ForceInline
! public $vectortype$ shiftArithmeticRight(int s, VectorMask<$Boxtype$> m) {
! return blend(shiftArithmeticRight(s), m);
}
+
+ @Override
+ @ForceInline
+ public $vectortype$ shiftArithmeticRight(Vector<$Boxtype$> s) {
+ $vectortype$ shiftv = ($vectortype$)s;
+ // As per shift specification for Java, mask the shift count.
+ shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, ($type$) 0x7));
+ return this.bOp(shiftv, (i, a, b) -> ($type$) (a >> (b & 0x7)));
+ }
+
#end[byte]
#if[short]
@Override
@ForceInline
! public $vectortype$ shiftLeft(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_LSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> ($type$) (a << (i & 0xF))));
}
@Override
@ForceInline
! public $vectortype$ shiftLeft(int s, VectorMask<$Boxtype$> m) {
! return blend(shiftLeft(s), m);
}
@Override
@ForceInline
! public $vectortype$ shiftLeft(Vector<$Boxtype$> s) {
! $vectortype$ shiftv = ($vectortype$)s;
! // As per shift specification for Java, mask the shift count.
! shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, ($type$) 0xF));
! return this.bOp(shiftv, (i, a, b) -> ($type$) (a << (b & 0xF)));
! }
!
! @Override
! @ForceInline
! public $vectortype$ shiftRight(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_URSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> ($type$) ((a & 0xFFFF) >>> (i & 0xF))));
! }
!
! @Override
! @ForceInline
! public $vectortype$ shiftRight(int s, VectorMask<$Boxtype$> m) {
! return blend(shiftRight(s), m);
}
@Override
@ForceInline
! public $vectortype$ shiftRight(Vector<$Boxtype$> s) {
! $vectortype$ shiftv = ($vectortype$)s;
! // As per shift specification for Java, mask the shift count.
! shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, ($type$) 0xF));
! return this.bOp(shiftv, (i, a, b) -> ($type$) (a >>> (b & 0xF)));
}
@Override
@ForceInline
! public $vectortype$ shiftArithmeticRight(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_RSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
! (v, i) -> v.uOp((__, a) -> ($type$) (a >> (i & 0xF))));
}
@Override
@ForceInline
! public $vectortype$ shiftArithmeticRight(int s, VectorMask<$Boxtype$> m) {
! return blend(shiftArithmeticRight(s), m);
! }
!
! @Override
! @ForceInline
! public $vectortype$ shiftArithmeticRight(Vector<$Boxtype$> s) {
! $vectortype$ shiftv = ($vectortype$)s;
! // As per shift specification for Java, mask the shift count.
! shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, ($type$) 0xF));
! return this.bOp(shiftv, (i, a, b) -> ($type$) (a >> (b & 0xF)));
}
#end[short]
#if[intOrLong]
@Override
@ForceInline
! public $vectortype$ shiftLeft(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_LSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
(v, i) -> v.uOp((__, a) -> ($type$) (a << i)));
}
@Override
@ForceInline
! public $vectortype$ shiftLeft(int s, VectorMask<$Boxtype$> m) {
! return blend(shiftLeft(s), m);
}
@Override
@ForceInline
! public $vectortype$ shiftRight(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_URSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
(v, i) -> v.uOp((__, a) -> ($type$) (a >>> i)));
}
@Override
@ForceInline
! public $vectortype$ shiftRight(int s, VectorMask<$Boxtype$> m) {
! return blend(shiftRight(s), m);
}
@Override
@ForceInline
! public $vectortype$ shiftArithmeticRight(int s) {
return VectorIntrinsics.broadcastInt(
VECTOR_OP_RSHIFT, $vectortype$.class, $type$.class, LENGTH,
this, s,
(v, i) -> v.uOp((__, a) -> ($type$) (a >> i)));
}
@Override
@ForceInline
! public $vectortype$ shiftArithmeticRight(int s, VectorMask<$Boxtype$> m) {
! return blend(shiftArithmeticRight(s), m);
}
@Override
@ForceInline
! public $vectortype$ shiftLeft(Vector<$Boxtype$> s) {
$vectortype$ shiftv = ($vectortype$)s;
// As per shift specification for Java, mask the shift count.
shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, {#if[int]?0x1f:0x3f}));
return VectorIntrinsics.binaryOp(
VECTOR_OP_LSHIFT, $vectortype$.class, $type$.class, LENGTH,
*** 1093,1103 ****
(v1, v2) -> v1.bOp(v2,(i,a, b) -> ($type$) (a << b)));
}
@Override
@ForceInline
! public $vectortype$ shiftR(Vector<$Boxtype$> s) {
$vectortype$ shiftv = ($vectortype$)s;
// As per shift specification for Java, mask the shift count.
shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, {#if[int]?0x1f:0x3f}));
return VectorIntrinsics.binaryOp(
VECTOR_OP_URSHIFT, $vectortype$.class, $type$.class, LENGTH,
--- 1148,1158 ----
(v1, v2) -> v1.bOp(v2,(i,a, b) -> ($type$) (a << b)));
}
@Override
@ForceInline
! public $vectortype$ shiftRight(Vector<$Boxtype$> s) {
$vectortype$ shiftv = ($vectortype$)s;
// As per shift specification for Java, mask the shift count.
shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, {#if[int]?0x1f:0x3f}));
return VectorIntrinsics.binaryOp(
VECTOR_OP_URSHIFT, $vectortype$.class, $type$.class, LENGTH,
*** 1105,1115 ****
(v1, v2) -> v1.bOp(v2,(i,a, b) -> ($type$) (a >>> b)));
}
@Override
@ForceInline
! public $vectortype$ aShiftR(Vector<$Boxtype$> s) {
$vectortype$ shiftv = ($vectortype$)s;
// As per shift specification for Java, mask the shift count.
shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, {#if[int]?0x1f:0x3f}));
return VectorIntrinsics.binaryOp(
VECTOR_OP_RSHIFT, $vectortype$.class, $type$.class, LENGTH,
--- 1160,1170 ----
(v1, v2) -> v1.bOp(v2,(i,a, b) -> ($type$) (a >>> b)));
}
@Override
@ForceInline
! public $vectortype$ shiftArithmeticRight(Vector<$Boxtype$> s) {
$vectortype$ shiftv = ($vectortype$)s;
// As per shift specification for Java, mask the shift count.
shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, {#if[int]?0x1f:0x3f}));
return VectorIntrinsics.binaryOp(
VECTOR_OP_RSHIFT, $vectortype$.class, $type$.class, LENGTH,
*** 1567,1587 ****
return new $fpvectortype$(res);
}
#end[intOrLong]
@Override
! public $vectortype$ rotateEL(int j) {
$type$[] vec = getElements();
$type$[] res = new $type$[length()];
for (int i = 0; i < length(); i++){
res[(j + i) % length()] = vec[i];
}
return new $vectortype$(res);
}
@Override
! public $vectortype$ rotateER(int j) {
$type$[] vec = getElements();
$type$[] res = new $type$[length()];
for (int i = 0; i < length(); i++){
int z = i - j;
if(j < 0) {
--- 1622,1642 ----
return new $fpvectortype$(res);
}
#end[intOrLong]
@Override
! public $vectortype$ rotateLanesLeft(int j) {
$type$[] vec = getElements();
$type$[] res = new $type$[length()];
for (int i = 0; i < length(); i++){
res[(j + i) % length()] = vec[i];
}
return new $vectortype$(res);
}
@Override
! public $vectortype$ rotateLanesRight(int j) {
$type$[] vec = getElements();
$type$[] res = new $type$[length()];
for (int i = 0; i < length(); i++){
int z = i - j;
if(j < 0) {
*** 1592,1612 ****
}
return new $vectortype$(res);
}
@Override
! public $vectortype$ shiftEL(int j) {
$type$[] vec = getElements();
$type$[] res = new $type$[length()];
for (int i = 0; i < length() - j; i++) {
res[i] = vec[i + j];
}
return new $vectortype$(res);
}
@Override
! public $vectortype$ shiftER(int j) {
$type$[] vec = getElements();
$type$[] res = new $type$[length()];
for (int i = 0; i < length() - j; i++){
res[i + j] = vec[i];
}
--- 1647,1667 ----
}
return new $vectortype$(res);
}
@Override
! public $vectortype$ shiftLanesLeft(int j) {
$type$[] vec = getElements();
$type$[] res = new $type$[length()];
for (int i = 0; i < length() - j; i++) {
res[i] = vec[i + j];
}
return new $vectortype$(res);
}
@Override
! public $vectortype$ shiftLanesRight(int j) {
$type$[] vec = getElements();
$type$[] res = new $type$[length()];
for (int i = 0; i < length() - j; i++){
res[i + j] = vec[i];
}
< prev index next >