--- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/crypto/ChaChaBench.java 2019-04-26 14:54:45.908375300 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/crypto/ChaChaBench.java 2019-04-26 14:54:45.314932300 -0700 @@ -37,9 +37,9 @@ @Param({"16384", "65536"}) private int dataSize; - private ChaChaVector cc20_S128 = makeCC20(Vector.Shape.S_128_BIT); - private ChaChaVector cc20_S256 = makeCC20(Vector.Shape.S_256_BIT); - private ChaChaVector cc20_S512 = makeCC20(Vector.Shape.S_512_BIT); + private ChaChaVector cc20_S128 = makeCC20(VectorShape.S_128_BIT); + private ChaChaVector cc20_S256 = makeCC20(VectorShape.S_256_BIT); + private ChaChaVector cc20_S512 = makeCC20(VectorShape.S_512_BIT); private byte[] in; private byte[] out; @@ -48,7 +48,7 @@ private byte[] nonce = new byte[12]; private long counter = 0; - private static ChaChaVector makeCC20(Vector.Shape shape) { + private static ChaChaVector makeCC20(VectorShape shape) { ChaChaVector cc20 = new ChaChaVector(shape); runKAT(cc20); return cc20; @@ -81,29 +81,29 @@ private static final int[] STATE_CONSTANTS = new int[]{0x61707865, 0x3320646e, 0x79622d32, 0x6b206574}; - private final Vector.Species intSpecies; + private final VectorSpecies intSpecies; private final int numBlocks; - private final Vector.Shuffle rot1; - private final Vector.Shuffle rot2; - private final Vector.Shuffle rot3; + private final VectorShuffle rot1; + private final VectorShuffle rot2; + private final VectorShuffle rot3; private final IntVector counterAdd; - private final Vector.Shuffle shuf0; - private final Vector.Shuffle shuf1; - private final Vector.Shuffle shuf2; - private final Vector.Shuffle shuf3; - - private final Vector.Mask mask0; - private final Vector.Mask mask1; - private final Vector.Mask mask2; - private final Vector.Mask mask3; + private final VectorShuffle shuf0; + private final VectorShuffle shuf1; + private final VectorShuffle shuf2; + private final VectorShuffle shuf3; + + private final VectorMask mask0; + private final VectorMask mask1; + private final VectorMask mask2; + private final VectorMask mask3; private final int[] state; - public ChaChaVector(Vector.Shape shape) { - this.intSpecies = Vector.Species.of(Integer.class, shape); + public ChaChaVector(VectorShape shape) { + this.intSpecies = VectorSpecies.of(Integer.class, shape); this.numBlocks = intSpecies.length() / 4; this.rot1 = makeRotate(1); @@ -125,7 +125,7 @@ this.state = new int[numBlocks * 16]; } - private Vector.Shuffle makeRotate(int amount) { + private VectorShuffle makeRotate(int amount) { int[] shuffleArr = new int[intSpecies.length()]; for (int i = 0; i < intSpecies.length(); i ++) { @@ -133,7 +133,7 @@ shuffleArr[i] = offset + ((i + amount) % 4); } - return IntVector.shuffleFromValues(intSpecies, shuffleArr); + return VectorShuffle.fromValues(intSpecies, shuffleArr); } private IntVector makeCounterAdd() { @@ -144,16 +144,16 @@ return IntVector.fromArray(intSpecies, addArr, 0); } - private Vector.Shuffle makeRearrangeShuffle(int order) { + private VectorShuffle makeRearrangeShuffle(int order) { int[] shuffleArr = new int[intSpecies.length()]; int start = order * 4; for (int i = 0; i < shuffleArr.length; i++) { shuffleArr[i] = (i % 4) + start; } - return IntVector.shuffleFromArray(intSpecies, shuffleArr, 0); + return VectorShuffle.fromArray(intSpecies, shuffleArr, 0); } - private Vector.Mask makeRearrangeMask(int order) { + private VectorMask makeRearrangeMask(int order) { boolean[] maskArr = new boolean[intSpecies.length()]; int start = order * 4; if (start < maskArr.length) { @@ -162,7 +162,7 @@ } } - return IntVector.maskFromValues(intSpecies, maskArr); + return VectorMask.fromValues(intSpecies, maskArr); } public void makeState(byte[] key, byte[] nonce, long counter, @@ -243,19 +243,19 @@ // first round a = a.add(b); d = d.xor(a); - d = d.rotateL(16); + d = d.rotateLeft(16); c = c.add(d); b = b.xor(c); - b = b.rotateL(12); + b = b.rotateLeft(12); a = a.add(b); d = d.xor(a); - d = d.rotateL(8); + d = d.rotateLeft(8); c = c.add(d); b = b.xor(c); - b = b.rotateL(7); + b = b.rotateLeft(7); // makeRotate b = b.rearrange(rot1); @@ -265,19 +265,19 @@ // second round a = a.add(b); d = d.xor(a); - d = d.rotateL(16); + d = d.rotateLeft(16); c = c.add(d); b = b.xor(c); - b = b.rotateL(12); + b = b.rotateLeft(12); a = a.add(b); d = d.xor(a); - d = d.rotateL(8); + d = d.rotateLeft(8); c = c.add(d); b = b.xor(c); - b = b.rotateL(7); + b = b.rotateLeft(7); // makeRotate b = b.rearrange(rot3);