< prev index next >

test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Short256Vector.java

Print this page
rev 54658 : refactored mask and shuffle creation methods, moved classes to top-level

*** 22,33 **** */ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; ! import jdk.incubator.vector.Vector.Shape; ! import jdk.incubator.vector.Vector.Species; import jdk.incubator.vector.ShortVector; import java.util.concurrent.TimeUnit; import java.util.function.BiFunction; import java.util.function.IntFunction; --- 22,34 ---- */ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; ! import jdk.incubator.vector.VectorShape; ! import jdk.incubator.vector.VectorSpecies; ! import jdk.incubator.vector.VectorShuffle; import jdk.incubator.vector.ShortVector; import java.util.concurrent.TimeUnit; import java.util.function.BiFunction; import java.util.function.IntFunction;
*** 40,50 **** @State(Scope.Benchmark) @Warmup(iterations = 3, time = 1) @Measurement(iterations = 5, time = 1) @Fork(value = 1, jvmArgsPrepend = {"--add-modules=jdk.incubator.vector"}) public class Short256Vector extends AbstractVectorBenchmark { ! static final Species<Short> SPECIES = ShortVector.SPECIES_256; static final int INVOC_COUNT = 1; // get rid of outer loop @Param("1024") int size; --- 41,51 ---- @State(Scope.Benchmark) @Warmup(iterations = 3, time = 1) @Measurement(iterations = 5, time = 1) @Fork(value = 1, jvmArgsPrepend = {"--add-modules=jdk.incubator.vector"}) public class Short256Vector extends AbstractVectorBenchmark { ! static final VectorSpecies<Short> SPECIES = ShortVector.SPECIES_256; static final int INVOC_COUNT = 1; // get rid of outer loop @Param("1024") int size;
*** 106,116 **** public void addMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Short> vmask = ShortVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); --- 107,117 ---- public void addMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Short> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
*** 142,152 **** public void subMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Short> vmask = ShortVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); --- 143,153 ---- public void subMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Short> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
*** 180,190 **** public void mulMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Short> vmask = ShortVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); --- 181,191 ---- public void mulMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Short> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
*** 219,229 **** public void andMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Short> vmask = ShortVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); --- 220,230 ---- public void andMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Short> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
*** 259,269 **** public void orMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Short> vmask = ShortVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); --- 260,270 ---- public void orMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Short> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
*** 299,309 **** public void xorMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Short> vmask = ShortVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); --- 300,310 ---- public void xorMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Short> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
*** 356,366 **** public void aShiftRMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Short> vmask = ShortVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); av.aShiftR((int)b[i], vmask).intoArray(r, i); --- 357,367 ---- public void aShiftRMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Short> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); av.aShiftR((int)b[i], vmask).intoArray(r, i);
*** 394,404 **** public void shiftLMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Short> vmask = ShortVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); av.shiftL((int)b[i], vmask).intoArray(r, i); --- 395,405 ---- public void shiftLMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Short> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); av.shiftL((int)b[i], vmask).intoArray(r, i);
*** 432,442 **** public void shiftRMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Short> vmask = ShortVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); av.shiftR((int)b[i], vmask).intoArray(r, i); --- 433,443 ---- public void shiftRMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Short> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); av.shiftR((int)b[i], vmask).intoArray(r, i);
*** 598,608 **** boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < mask.length; i += SPECIES.length()) { ! Vector.Mask<Short> vmask = ShortVector.maskFromArray(SPECIES, mask, i); r[i] = vmask.anyTrue(); } } bh.consume(r); --- 599,609 ---- boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < mask.length; i += SPECIES.length()) { ! VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, i); r[i] = vmask.anyTrue(); } } bh.consume(r);
*** 615,625 **** boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < mask.length; i += SPECIES.length()) { ! Vector.Mask<Short> vmask = ShortVector.maskFromArray(SPECIES, mask, i); r[i] = vmask.allTrue(); } } bh.consume(r); --- 616,626 ---- boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < mask.length; i += SPECIES.length()) { ! VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, i); r[i] = vmask.allTrue(); } } bh.consume(r);
*** 644,660 **** @Benchmark public Object lessThan() { short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! Vector.Mask<Short> m = ShortVector.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); ! Vector.Mask<Short> mv = av.lessThan(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m; --- 645,661 ---- @Benchmark public Object lessThan() { short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! VectorMask<Short> m = VectorMask.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); ! VectorMask<Short> mv = av.lessThan(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m;
*** 664,680 **** @Benchmark public Object greaterThan() { short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! Vector.Mask<Short> m = ShortVector.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); ! Vector.Mask<Short> mv = av.greaterThan(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m; --- 665,681 ---- @Benchmark public Object greaterThan() { short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! VectorMask<Short> m = VectorMask.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); ! VectorMask<Short> mv = av.greaterThan(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m;
*** 684,700 **** @Benchmark public Object equal() { short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! Vector.Mask<Short> m = ShortVector.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); ! Vector.Mask<Short> mv = av.equal(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m; --- 685,701 ---- @Benchmark public Object equal() { short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! VectorMask<Short> m = VectorMask.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); ! VectorMask<Short> mv = av.equal(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m;
*** 704,720 **** @Benchmark public Object notEqual() { short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! Vector.Mask<Short> m = ShortVector.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); ! Vector.Mask<Short> mv = av.notEqual(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m; --- 705,721 ---- @Benchmark public Object notEqual() { short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! VectorMask<Short> m = VectorMask.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); ! VectorMask<Short> mv = av.notEqual(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m;
*** 724,740 **** @Benchmark public Object lessThanEq() { short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! Vector.Mask<Short> m = ShortVector.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); ! Vector.Mask<Short> mv = av.lessThanEq(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m; --- 725,741 ---- @Benchmark public Object lessThanEq() { short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! VectorMask<Short> m = VectorMask.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); ! VectorMask<Short> mv = av.lessThanEq(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m;
*** 744,760 **** @Benchmark public Object greaterThanEq() { short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! Vector.Mask<Short> m = ShortVector.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); ! Vector.Mask<Short> mv = av.greaterThanEq(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m; --- 745,761 ---- @Benchmark public Object greaterThanEq() { short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! VectorMask<Short> m = VectorMask.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); ! VectorMask<Short> mv = av.greaterThanEq(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m;
*** 765,775 **** public void blend(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Short> vmask = ShortVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i); --- 766,776 ---- public void blend(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Short> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ShortVector bv = ShortVector.fromArray(SPECIES, b, i);
*** 787,797 **** short[] r = fr.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ! av.rearrange(ShortVector.shuffleFromArray(SPECIES, order, i)).intoArray(r, i); } } bh.consume(r); } --- 788,798 ---- short[] r = fr.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); ! av.rearrange(VectorShuffle.fromArray(SPECIES, order, i)).intoArray(r, i); } } bh.consume(r); }
*** 990,1000 **** @Benchmark public void negMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Short> vmask = ShortVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); av.neg(vmask).intoArray(r, i); --- 991,1001 ---- @Benchmark public void negMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Short> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); av.neg(vmask).intoArray(r, i);
*** 1022,1032 **** @Benchmark public void absMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Short> vmask = ShortVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); av.abs(vmask).intoArray(r, i); --- 1023,1033 ---- @Benchmark public void absMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Short> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); av.abs(vmask).intoArray(r, i);
*** 1057,1067 **** @Benchmark public void notMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Short> vmask = ShortVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); av.not(vmask).intoArray(r, i); --- 1058,1068 ---- @Benchmark public void notMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Short> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); av.not(vmask).intoArray(r, i);
< prev index next >