--- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/AbstractVectorBenchmark.java 2019-04-26 14:54:55.082423300 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/AbstractVectorBenchmark.java 2019-04-26 14:54:54.473103200 -0700 @@ -28,8 +28,9 @@ import jdk.incubator.vector.ShortVector; import jdk.incubator.vector.LongVector; import jdk.incubator.vector.Vector; -import jdk.incubator.vector.Vector.Shape; -import jdk.incubator.vector.Vector.Species; +import jdk.incubator.vector.VectorShape; +import jdk.incubator.vector.VectorSpecies; +import jdk.incubator.vector.VectorMask; import java.util.Random; import java.util.function.IntFunction; @@ -37,78 +38,78 @@ public class AbstractVectorBenchmark { static final Random RANDOM = new Random(Integer.getInteger("jdk.incubator.vector.random-seed", 1337)); - static final Species B64 = ByteVector.SPECIES_64; - static final Species B128 = ByteVector.SPECIES_128; - static final Species B256 = ByteVector.SPECIES_256; - static final Species B512 = ByteVector.SPECIES_512; - - static final Species S64 = ShortVector.SPECIES_64; - static final Species S128 = ShortVector.SPECIES_128; - static final Species S256 = ShortVector.SPECIES_256; - static final Species S512 = ShortVector.SPECIES_512; - - static final Species I64 = IntVector.SPECIES_64; - static final Species I128 = IntVector.SPECIES_128; - static final Species I256 = IntVector.SPECIES_256; - static final Species I512 = IntVector.SPECIES_512; - - static final Species L64 = LongVector.SPECIES_64; - static final Species L128 = LongVector.SPECIES_128; - static final Species L256 = LongVector.SPECIES_256; - static final Species L512 = LongVector.SPECIES_512; + static final VectorSpecies B64 = ByteVector.SPECIES_64; + static final VectorSpecies B128 = ByteVector.SPECIES_128; + static final VectorSpecies B256 = ByteVector.SPECIES_256; + static final VectorSpecies B512 = ByteVector.SPECIES_512; + + static final VectorSpecies S64 = ShortVector.SPECIES_64; + static final VectorSpecies S128 = ShortVector.SPECIES_128; + static final VectorSpecies S256 = ShortVector.SPECIES_256; + static final VectorSpecies S512 = ShortVector.SPECIES_512; + + static final VectorSpecies I64 = IntVector.SPECIES_64; + static final VectorSpecies I128 = IntVector.SPECIES_128; + static final VectorSpecies I256 = IntVector.SPECIES_256; + static final VectorSpecies I512 = IntVector.SPECIES_512; + + static final VectorSpecies L64 = LongVector.SPECIES_64; + static final VectorSpecies L128 = LongVector.SPECIES_128; + static final VectorSpecies L256 = LongVector.SPECIES_256; + static final VectorSpecies L512 = LongVector.SPECIES_512; - static Shape widen(Shape s) { + static VectorShape widen(VectorShape s) { switch (s) { - case S_64_BIT: return Shape.S_128_BIT; - case S_128_BIT: return Shape.S_256_BIT; - case S_256_BIT: return Shape.S_512_BIT; + case S_64_BIT: return VectorShape.S_128_BIT; + case S_128_BIT: return VectorShape.S_256_BIT; + case S_256_BIT: return VectorShape.S_512_BIT; default: throw new IllegalArgumentException("" + s); } } - static Shape narrow(Shape s) { + static VectorShape narrow(VectorShape s) { switch (s) { - case S_512_BIT: return Shape.S_256_BIT; - case S_256_BIT: return Shape.S_128_BIT; - case S_128_BIT: return Shape.S_64_BIT; + case S_512_BIT: return VectorShape.S_256_BIT; + case S_256_BIT: return VectorShape.S_128_BIT; + case S_128_BIT: return VectorShape.S_64_BIT; default: throw new IllegalArgumentException("" + s); } } - static Species widen(Species s) { - return Vector.Species.of(s.elementType(), widen(s.shape())); + static VectorSpecies widen(VectorSpecies s) { + return VectorSpecies.of(s.elementType(), widen(s.shape())); } - static Species narrow(Species s) { - return Vector.Species.of(s.elementType(), narrow(s.shape())); + static VectorSpecies narrow(VectorSpecies s) { + return VectorSpecies.of(s.elementType(), narrow(s.shape())); } - static IntVector join(Species from, Species to, IntVector lo, IntVector hi) { + static IntVector join(VectorSpecies from, VectorSpecies to, IntVector lo, IntVector hi) { assert 2 * from.length() == to.length(); int vlen = from.length(); var lo_mask = mask(from, to, 0); var v1 = lo.reshape(to); - var v2 = hi.reshape(to).shiftER(vlen); + var v2 = hi.reshape(to).shiftLanesRight(vlen); var r = v2.blend(v1, lo_mask); return r; } - static Vector.Mask mask(Species from, Species to, int i) { + static VectorMask mask(VectorSpecies from, VectorSpecies to, int i) { int vlen = from.length(); var v1 = IntVector.broadcast(from, 1); // [1 1 ... 1] var v2 = v1.reshape(to); // [0 0 ... 0 | ... | 1 1 ... 1] - var v3 = v2.shiftER(i * vlen); // [0 0 ... 0 | 1 1 ... 1 | 0 0 ... 0] + var v3 = v2.shiftLanesRight(i * vlen); // [0 0 ... 0 | 1 1 ... 1 | 0 0 ... 0] return v3.notEqual(0); // [F F ... F | T T ... T | F F ... F] } static IntVector sum(ByteVector va) { - Species species = Species.of(Integer.class, va.shape()); + VectorSpecies species = VectorSpecies.of(Integer.class, va.shape()); var acc = IntVector.zero(species); int limit = va.length() / species.length(); for (int k = 0; k < limit; k++) { - var vb = ((IntVector)(va.shiftEL(k * B64.length()).reshape(B64).cast(species))).and(0xFF); + var vb = ((IntVector)(va.shiftLanesLeft(k * B64.length()).reshape(B64).cast(species))).and(0xFF); acc = acc.add(vb); } return acc;