< prev index next >
test/jdk/jdk/incubator/vector/VectorRuns.java
Print this page
rev 54658 : refactored mask and shuffle creation methods, moved classes to top-level
*** 20,31 ****
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import jdk.incubator.vector.IntVector;
! import jdk.incubator.vector.Vector.Shape;
! import jdk.incubator.vector.Vector.Species;
import jdk.incubator.vector.Vector;
import java.util.stream.IntStream;
/**
--- 20,32 ----
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import jdk.incubator.vector.IntVector;
! import jdk.incubator.vector.VectorMask;
! import jdk.incubator.vector.VectorShape;
! import jdk.incubator.vector.VectorSpecies;
import jdk.incubator.vector.Vector;
import java.util.stream.IntStream;
/**
*** 63,84 ****
return r;
}
static int countRunAscendingVector(int[] a) {
! Species<Integer> species = IntVector.SPECIES_256;
int r = 1;
if (r >= a.length)
return a.length;
int length = a.length & (species.length() - 1);
if (length == a.length) length -= species.length();
while (r < length) {
IntVector vl = IntVector.fromArray(species, a, r - 1);
IntVector vr = IntVector.fromArray(species, a, r);
! Vector.Mask<Integer> m = vl.greaterThan(vr);
if (m.anyTrue())
return r + Long.numberOfTrailingZeros(m.toLong());
r += species.length();
}
--- 64,85 ----
return r;
}
static int countRunAscendingVector(int[] a) {
! VectorSpecies<Integer> species = IntVector.SPECIES_256;
int r = 1;
if (r >= a.length)
return a.length;
int length = a.length & (species.length() - 1);
if (length == a.length) length -= species.length();
while (r < length) {
IntVector vl = IntVector.fromArray(species, a, r - 1);
IntVector vr = IntVector.fromArray(species, a, r);
! VectorMask<Integer> m = vl.greaterThan(vr);
if (m.anyTrue())
return r + Long.numberOfTrailingZeros(m.toLong());
r += species.length();
}
< prev index next >