Skip to content

Commit

Permalink
8306008: Several Vector API tests fail for client VM after JDK-8304450
Browse files Browse the repository at this point in the history
Reviewed-by: psandoz
  • Loading branch information
Quan Anh Mai committed Apr 25, 2023
1 parent e8f62de commit 0ff3a27
Show file tree
Hide file tree
Showing 11 changed files with 275 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -805,13 +805,31 @@ public int laneSource(int i) {
@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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,13 +809,31 @@ public int laneSource(int i) {
@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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -817,13 +817,31 @@ public int laneSource(int i) {
@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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,31 @@ public int laneSource(int i) {
@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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -802,13 +802,31 @@ public int laneSource(int i) {
@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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,13 +806,31 @@ public int laneSource(int i) {
@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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -810,13 +810,31 @@ public int laneSource(int i) {
@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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -818,13 +818,31 @@ public int laneSource(int i) {
@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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,31 @@ public int laneSource(int i) {
@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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,13 +804,31 @@ public int laneSource(int i) {
@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) {
Expand Down

1 comment on commit 0ff3a27

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.