mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8306008: Several Vector API tests fail for client VM after JDK-8304450
Reviewed-by: psandoz
This commit is contained in:
parent
e8f62de1cf
commit
0ff3a2784e
11 changed files with 275 additions and 70 deletions
|
@ -805,13 +805,31 @@ final class Double128Vector extends DoubleVector {
|
|||
@Override
|
||||
@ForceInline
|
||||
public void intoArray(int[] a, int offset) {
|
||||
VectorSpecies<Integer> species = VectorSpecies.of(
|
||||
int.class,
|
||||
VectorShape.forBitSize(length() * Integer.SIZE));
|
||||
Vector<Long> v = toBitsVector();
|
||||
v.convertShape(VectorOperators.L2I, species, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
switch (length()) {
|
||||
case 1 -> a[offset] = laneSource(0);
|
||||
case 2 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 4 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 8 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 16 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
default -> {
|
||||
VectorIntrinsics.checkFromIndexSize(offset, length(), a.length);
|
||||
for (int i = 0; i < length(); i++) {
|
||||
a[offset + i] = laneSource(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static long[] prepare(int[] indices, int offset) {
|
||||
|
|
|
@ -809,13 +809,31 @@ final class Double256Vector extends DoubleVector {
|
|||
@Override
|
||||
@ForceInline
|
||||
public void intoArray(int[] a, int offset) {
|
||||
VectorSpecies<Integer> species = VectorSpecies.of(
|
||||
int.class,
|
||||
VectorShape.forBitSize(length() * Integer.SIZE));
|
||||
Vector<Long> v = toBitsVector();
|
||||
v.convertShape(VectorOperators.L2I, species, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
switch (length()) {
|
||||
case 1 -> a[offset] = laneSource(0);
|
||||
case 2 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 4 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 8 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 16 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
default -> {
|
||||
VectorIntrinsics.checkFromIndexSize(offset, length(), a.length);
|
||||
for (int i = 0; i < length(); i++) {
|
||||
a[offset + i] = laneSource(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static long[] prepare(int[] indices, int offset) {
|
||||
|
|
|
@ -817,13 +817,31 @@ final class Double512Vector extends DoubleVector {
|
|||
@Override
|
||||
@ForceInline
|
||||
public void intoArray(int[] a, int offset) {
|
||||
VectorSpecies<Integer> species = VectorSpecies.of(
|
||||
int.class,
|
||||
VectorShape.forBitSize(length() * Integer.SIZE));
|
||||
Vector<Long> v = toBitsVector();
|
||||
v.convertShape(VectorOperators.L2I, species, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
switch (length()) {
|
||||
case 1 -> a[offset] = laneSource(0);
|
||||
case 2 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 4 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 8 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 16 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
default -> {
|
||||
VectorIntrinsics.checkFromIndexSize(offset, length(), a.length);
|
||||
for (int i = 0; i < length(); i++) {
|
||||
a[offset + i] = laneSource(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static long[] prepare(int[] indices, int offset) {
|
||||
|
|
|
@ -803,7 +803,31 @@ final class Double64Vector extends DoubleVector {
|
|||
@Override
|
||||
@ForceInline
|
||||
public void intoArray(int[] a, int offset) {
|
||||
a[offset] = laneSource(0);
|
||||
switch (length()) {
|
||||
case 1 -> a[offset] = laneSource(0);
|
||||
case 2 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 4 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 8 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 16 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
default -> {
|
||||
VectorIntrinsics.checkFromIndexSize(offset, length(), a.length);
|
||||
for (int i = 0; i < length(); i++) {
|
||||
a[offset + i] = laneSource(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static long[] prepare(int[] indices, int offset) {
|
||||
|
|
|
@ -802,13 +802,31 @@ final class DoubleMaxVector extends DoubleVector {
|
|||
@Override
|
||||
@ForceInline
|
||||
public void intoArray(int[] a, int offset) {
|
||||
VectorSpecies<Integer> species = VectorSpecies.of(
|
||||
int.class,
|
||||
VectorShape.forBitSize(length() * Integer.SIZE));
|
||||
Vector<Long> v = toBitsVector();
|
||||
v.convertShape(VectorOperators.L2I, species, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
switch (length()) {
|
||||
case 1 -> a[offset] = laneSource(0);
|
||||
case 2 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 4 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 8 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 16 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
default -> {
|
||||
VectorIntrinsics.checkFromIndexSize(offset, length(), a.length);
|
||||
for (int i = 0; i < length(); i++) {
|
||||
a[offset + i] = laneSource(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static long[] prepare(int[] indices, int offset) {
|
||||
|
|
|
@ -806,13 +806,31 @@ final class Long128Vector extends LongVector {
|
|||
@Override
|
||||
@ForceInline
|
||||
public void intoArray(int[] a, int offset) {
|
||||
VectorSpecies<Integer> species = VectorSpecies.of(
|
||||
int.class,
|
||||
VectorShape.forBitSize(length() * Integer.SIZE));
|
||||
Vector<Long> v = toBitsVector();
|
||||
v.convertShape(VectorOperators.L2I, species, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
switch (length()) {
|
||||
case 1 -> a[offset] = laneSource(0);
|
||||
case 2 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 4 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 8 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 16 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
default -> {
|
||||
VectorIntrinsics.checkFromIndexSize(offset, length(), a.length);
|
||||
for (int i = 0; i < length(); i++) {
|
||||
a[offset + i] = laneSource(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static long[] prepare(int[] indices, int offset) {
|
||||
|
|
|
@ -810,13 +810,31 @@ final class Long256Vector extends LongVector {
|
|||
@Override
|
||||
@ForceInline
|
||||
public void intoArray(int[] a, int offset) {
|
||||
VectorSpecies<Integer> species = VectorSpecies.of(
|
||||
int.class,
|
||||
VectorShape.forBitSize(length() * Integer.SIZE));
|
||||
Vector<Long> v = toBitsVector();
|
||||
v.convertShape(VectorOperators.L2I, species, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
switch (length()) {
|
||||
case 1 -> a[offset] = laneSource(0);
|
||||
case 2 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 4 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 8 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 16 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
default -> {
|
||||
VectorIntrinsics.checkFromIndexSize(offset, length(), a.length);
|
||||
for (int i = 0; i < length(); i++) {
|
||||
a[offset + i] = laneSource(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static long[] prepare(int[] indices, int offset) {
|
||||
|
|
|
@ -818,13 +818,31 @@ final class Long512Vector extends LongVector {
|
|||
@Override
|
||||
@ForceInline
|
||||
public void intoArray(int[] a, int offset) {
|
||||
VectorSpecies<Integer> species = VectorSpecies.of(
|
||||
int.class,
|
||||
VectorShape.forBitSize(length() * Integer.SIZE));
|
||||
Vector<Long> v = toBitsVector();
|
||||
v.convertShape(VectorOperators.L2I, species, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
switch (length()) {
|
||||
case 1 -> a[offset] = laneSource(0);
|
||||
case 2 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 4 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 8 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 16 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
default -> {
|
||||
VectorIntrinsics.checkFromIndexSize(offset, length(), a.length);
|
||||
for (int i = 0; i < length(); i++) {
|
||||
a[offset + i] = laneSource(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static long[] prepare(int[] indices, int offset) {
|
||||
|
|
|
@ -804,7 +804,31 @@ final class Long64Vector extends LongVector {
|
|||
@Override
|
||||
@ForceInline
|
||||
public void intoArray(int[] a, int offset) {
|
||||
a[offset] = laneSource(0);
|
||||
switch (length()) {
|
||||
case 1 -> a[offset] = laneSource(0);
|
||||
case 2 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 4 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 8 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 16 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
default -> {
|
||||
VectorIntrinsics.checkFromIndexSize(offset, length(), a.length);
|
||||
for (int i = 0; i < length(); i++) {
|
||||
a[offset + i] = laneSource(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static long[] prepare(int[] indices, int offset) {
|
||||
|
|
|
@ -804,13 +804,31 @@ final class LongMaxVector extends LongVector {
|
|||
@Override
|
||||
@ForceInline
|
||||
public void intoArray(int[] a, int offset) {
|
||||
VectorSpecies<Integer> species = VectorSpecies.of(
|
||||
int.class,
|
||||
VectorShape.forBitSize(length() * Integer.SIZE));
|
||||
Vector<Long> v = toBitsVector();
|
||||
v.convertShape(VectorOperators.L2I, species, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
switch (length()) {
|
||||
case 1 -> a[offset] = laneSource(0);
|
||||
case 2 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 4 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 8 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 16 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
default -> {
|
||||
VectorIntrinsics.checkFromIndexSize(offset, length(), a.length);
|
||||
for (int i = 0; i < length(); i++) {
|
||||
a[offset + i] = laneSource(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static long[] prepare(int[] indices, int offset) {
|
||||
|
|
|
@ -1132,18 +1132,31 @@ final class $vectortype$ extends $abstractvectortype$ {
|
|||
toBitsVector().intoArray(a, offset);
|
||||
#end[intOrFloat]
|
||||
#if[longOrDouble]
|
||||
#if[!1L]
|
||||
VectorSpecies<Integer> species = VectorSpecies.of(
|
||||
int.class,
|
||||
VectorShape.forBitSize(length() * Integer.SIZE));
|
||||
Vector<Long> v = toBitsVector();
|
||||
v.convertShape(VectorOperators.L2I, species, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
#end[!1L]
|
||||
#if[1L]
|
||||
a[offset] = laneSource(0);
|
||||
#end[1L]
|
||||
switch (length()) {
|
||||
case 1 -> a[offset] = laneSource(0);
|
||||
case 2 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 4 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 8 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
case 16 -> toBitsVector()
|
||||
.convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0)
|
||||
.reinterpretAsInts()
|
||||
.intoArray(a, offset);
|
||||
default -> {
|
||||
VectorIntrinsics.checkFromIndexSize(offset, length(), a.length);
|
||||
for (int i = 0; i < length(); i++) {
|
||||
a[offset + i] = laneSource(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
#end[longOrDouble]
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue