< prev index next >

test/jdk/jdk/incubator/vector/templates/X-LoadStoreTest.java.template

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

*** 31,42 **** * @run testng $vectorteststype$ #end[MaxBit] * */ ! import jdk.incubator.vector.Vector.Shape; ! import jdk.incubator.vector.Vector.Species; import jdk.incubator.vector.Vector; import jdk.incubator.vector.$Type$Vector; import org.testng.Assert; --- 31,43 ---- * @run testng $vectorteststype$ #end[MaxBit] * */ ! import jdk.incubator.vector.VectorShape; ! import jdk.incubator.vector.VectorSpecies; ! import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.Vector; import jdk.incubator.vector.$Type$Vector; import org.testng.Assert;
*** 56,77 **** import java.util.function.IntFunction; @Test public class $vectorteststype$ extends AbstractVectorTest { #if[MaxBit] ! static final Species<$Wideboxtype$> SPECIES = $Type$Vector.SPECIES_MAX; #else[MaxBit] ! static final Species<$Wideboxtype$> SPECIES = $Type$Vector.SPECIES_$bits$; #end[MaxBit] static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 10); #if[MaxBit] ! static Shape getMaxBit() { ! return Shape.S_Max_BIT; } #end[MaxBit] static void assertArraysEquals($type$[] a, $type$[] r, boolean[] mask) { int i = 0; --- 57,78 ---- import java.util.function.IntFunction; @Test public class $vectorteststype$ extends AbstractVectorTest { #if[MaxBit] ! static final VectorSpecies<$Wideboxtype$> SPECIES = $Type$Vector.SPECIES_MAX; #else[MaxBit] ! static final VectorSpecies<$Wideboxtype$> SPECIES = $Type$Vector.SPECIES_$bits$; #end[MaxBit] static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 10); #if[MaxBit] ! static VectorShape getMaxBit() { ! return VectorShape.S_Max_BIT; } #end[MaxBit] static void assertArraysEquals($type$[] a, $type$[] r, boolean[] mask) { int i = 0;
*** 219,229 **** static void loadStoreMaskArray(IntFunction<$type$[]> fa, IntFunction<boolean[]> fm) { $type$[] a = fa.apply(SPECIES.length()); $type$[] r = new $type$[a.length]; boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<$Boxtype$> vmask = $abstractvectortype$.maskFromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i, vmask); av.intoArray(r, i); --- 220,230 ---- static void loadStoreMaskArray(IntFunction<$type$[]> fa, IntFunction<boolean[]> fm) { $type$[] a = fa.apply(SPECIES.length()); $type$[] r = new $type$[a.length]; boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<$Boxtype$> vmask = VectorMask.fromValues(SPECIES, mask); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i, vmask); av.intoArray(r, i);
*** 293,303 **** IntFunction<ByteBuffer> fb, IntFunction<boolean[]> fm) { ByteBuffer a = toBuffer(fa.apply(SPECIES.length()), fb); ByteBuffer r = fb.apply(a.limit()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<$Boxtype$> vmask = $abstractvectortype$.maskFromValues(SPECIES, mask); int l = a.limit(); int s = SPECIES.length() * SPECIES.elementSize() / 8; for (int ic = 0; ic < INVOC_COUNT; ic++) { --- 294,304 ---- IntFunction<ByteBuffer> fb, IntFunction<boolean[]> fm) { ByteBuffer a = toBuffer(fa.apply(SPECIES.length()), fb); ByteBuffer r = fb.apply(a.limit()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<$Boxtype$> vmask = VectorMask.fromValues(SPECIES, mask); int l = a.limit(); int s = SPECIES.length() * SPECIES.elementSize() / 8; for (int ic = 0; ic < INVOC_COUNT; ic++) {
*** 333,343 **** IntFunction<boolean[]> fm) { ByteBuffer a = toBuffer(fa.apply(SPECIES.length()), fb); a = a.asReadOnlyBuffer().order(a.order()); ByteBuffer r = fb.apply(a.limit()); boolean[] mask = fm.apply(SPECIES.length()); ! Vector.Mask<$Boxtype$> vmask = $abstractvectortype$.maskFromValues(SPECIES, mask); int l = a.limit(); int s = SPECIES.length() * SPECIES.elementSize() / 8; for (int ic = 0; ic < INVOC_COUNT; ic++) { --- 334,344 ---- IntFunction<boolean[]> fm) { ByteBuffer a = toBuffer(fa.apply(SPECIES.length()), fb); a = a.asReadOnlyBuffer().order(a.order()); ByteBuffer r = fb.apply(a.limit()); boolean[] mask = fm.apply(SPECIES.length()); ! VectorMask<$Boxtype$> vmask = VectorMask.fromValues(SPECIES, mask); int l = a.limit(); int s = SPECIES.length() * SPECIES.elementSize() / 8; for (int ic = 0; ic < INVOC_COUNT; ic++) {
< prev index next >