< prev index next >

test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Long512Vector.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.LongVector; 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.LongVector; 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 Long512Vector extends AbstractVectorBenchmark { ! static final Species<Long> SPECIES = LongVector.SPECIES_512; 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 Long512Vector extends AbstractVectorBenchmark { ! static final VectorSpecies<Long> SPECIES = LongVector.SPECIES_512; static final int INVOC_COUNT = 1; // get rid of outer loop @Param("1024") int size;
*** 106,116 **** public void addMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Long> vmask = LongVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); --- 107,117 ---- public void addMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i);
*** 142,152 **** public void subMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Long> vmask = LongVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); --- 143,153 ---- public void subMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i);
*** 180,190 **** public void mulMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Long> vmask = LongVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); --- 181,191 ---- public void mulMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i);
*** 219,229 **** public void andMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Long> vmask = LongVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); --- 220,230 ---- public void andMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i);
*** 259,269 **** public void orMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Long> vmask = LongVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); --- 260,270 ---- public void orMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i);
*** 299,309 **** public void xorMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Long> vmask = LongVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); --- 300,310 ---- public void xorMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i);
*** 339,349 **** public void shiftRMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Long> vmask = LongVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); --- 340,350 ---- public void shiftRMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i);
*** 379,389 **** public void shiftLMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Long> vmask = LongVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); --- 380,390 ---- public void shiftLMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i);
*** 419,429 **** public void aShiftRMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Long> vmask = LongVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); --- 420,430 ---- public void aShiftRMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i);
*** 458,468 **** public void aShiftRMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Long> vmask = LongVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); av.aShiftR((int)b[i], vmask).intoArray(r, i); --- 459,469 ---- public void aShiftRMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); av.aShiftR((int)b[i], vmask).intoArray(r, i);
*** 496,506 **** public void shiftRMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Long> vmask = LongVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); av.shiftR((int)b[i], vmask).intoArray(r, i); --- 497,507 ---- public void shiftRMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); av.shiftR((int)b[i], vmask).intoArray(r, i);
*** 534,544 **** public void shiftLMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Long> vmask = LongVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); av.shiftL((int)b[i], vmask).intoArray(r, i); --- 535,545 ---- public void shiftLMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); av.shiftL((int)b[i], vmask).intoArray(r, i);
*** 712,722 **** 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<Long> vmask = LongVector.maskFromArray(SPECIES, mask, i); r[i] = vmask.anyTrue(); } } bh.consume(r); --- 713,723 ---- 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<Long> vmask = VectorMask.fromArray(SPECIES, mask, i); r[i] = vmask.anyTrue(); } } bh.consume(r);
*** 729,739 **** 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<Long> vmask = LongVector.maskFromArray(SPECIES, mask, i); r[i] = vmask.allTrue(); } } bh.consume(r); --- 730,740 ---- 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<Long> vmask = VectorMask.fromArray(SPECIES, mask, i); r[i] = vmask.allTrue(); } } bh.consume(r);
*** 758,774 **** @Benchmark public Object lessThan() { long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! Vector.Mask<Long> m = LongVector.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); ! Vector.Mask<Long> mv = av.lessThan(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m; --- 759,775 ---- @Benchmark public Object lessThan() { long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! VectorMask<Long> m = VectorMask.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); ! VectorMask<Long> mv = av.lessThan(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m;
*** 778,794 **** @Benchmark public Object greaterThan() { long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! Vector.Mask<Long> m = LongVector.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); ! Vector.Mask<Long> mv = av.greaterThan(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m; --- 779,795 ---- @Benchmark public Object greaterThan() { long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! VectorMask<Long> m = VectorMask.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); ! VectorMask<Long> mv = av.greaterThan(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m;
*** 798,814 **** @Benchmark public Object equal() { long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! Vector.Mask<Long> m = LongVector.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); ! Vector.Mask<Long> mv = av.equal(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m; --- 799,815 ---- @Benchmark public Object equal() { long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! VectorMask<Long> m = VectorMask.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); ! VectorMask<Long> mv = av.equal(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m;
*** 818,834 **** @Benchmark public Object notEqual() { long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! Vector.Mask<Long> m = LongVector.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); ! Vector.Mask<Long> mv = av.notEqual(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m; --- 819,835 ---- @Benchmark public Object notEqual() { long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! VectorMask<Long> m = VectorMask.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); ! VectorMask<Long> mv = av.notEqual(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m;
*** 838,854 **** @Benchmark public Object lessThanEq() { long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! Vector.Mask<Long> m = LongVector.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); ! Vector.Mask<Long> mv = av.lessThanEq(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m; --- 839,855 ---- @Benchmark public Object lessThanEq() { long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! VectorMask<Long> m = VectorMask.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); ! VectorMask<Long> mv = av.lessThanEq(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m;
*** 858,874 **** @Benchmark public Object greaterThanEq() { long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! Vector.Mask<Long> m = LongVector.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); ! Vector.Mask<Long> mv = av.greaterThanEq(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m; --- 859,875 ---- @Benchmark public Object greaterThanEq() { long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); ! VectorMask<Long> m = VectorMask.maskFromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); ! VectorMask<Long> mv = av.greaterThanEq(bv); m = m.and(mv); // accumulate results, so JIT can't eliminate relevant computations } } return m;
*** 879,889 **** public void blend(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Long> vmask = LongVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); --- 880,890 ---- public void blend(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i);
*** 901,911 **** long[] r = fr.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); ! av.rearrange(LongVector.shuffleFromArray(SPECIES, order, i)).intoArray(r, i); } } bh.consume(r); } --- 902,912 ---- long[] r = fr.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); ! av.rearrange(VectorShuffle.fromArray(SPECIES, order, i)).intoArray(r, i); } } bh.consume(r); }
*** 1104,1114 **** @Benchmark public void negMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Long> vmask = LongVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); av.neg(vmask).intoArray(r, i); --- 1105,1115 ---- @Benchmark public void negMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); av.neg(vmask).intoArray(r, i);
*** 1136,1146 **** @Benchmark public void absMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Long> vmask = LongVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); av.abs(vmask).intoArray(r, i); --- 1137,1147 ---- @Benchmark public void absMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); av.abs(vmask).intoArray(r, i);
*** 1171,1181 **** @Benchmark public void notMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<Long> vmask = LongVector.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); av.not(vmask).intoArray(r, i); --- 1172,1182 ---- @Benchmark public void notMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); av.not(vmask).intoArray(r, i);
< prev index next >