< prev index next >
test/jdk/jdk/incubator/vector/FloatMaxVectorLoadStoreTests.java
Print this page
rev 54658 : refactored mask and shuffle creation methods, moved classes to top-level
*** 27,38 ****
* @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED
* FloatMaxVectorLoadStoreTests
*
*/
! import jdk.incubator.vector.Vector.Shape;
! import jdk.incubator.vector.Vector.Species;
import jdk.incubator.vector.Vector;
import jdk.incubator.vector.FloatVector;
import org.testng.Assert;
--- 27,39 ----
* @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED
* FloatMaxVectorLoadStoreTests
*
*/
! import jdk.incubator.vector.VectorShape;
! import jdk.incubator.vector.VectorSpecies;
! import jdk.incubator.vector.VectorMask;
import jdk.incubator.vector.Vector;
import jdk.incubator.vector.FloatVector;
import org.testng.Assert;
*** 47,63 ****
import java.util.List;
import java.util.function.IntFunction;
@Test
public class FloatMaxVectorLoadStoreTests extends AbstractVectorTest {
! static final Species<Float> SPECIES =
FloatVector.SPECIES_MAX;
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 10);
! static Shape getMaxBit() {
! return Shape.S_Max_BIT;
}
static void assertArraysEquals(float[] a, float[] r, boolean[] mask) {
int i = 0;
try {
--- 48,64 ----
import java.util.List;
import java.util.function.IntFunction;
@Test
public class FloatMaxVectorLoadStoreTests extends AbstractVectorTest {
! static final VectorSpecies<Float> SPECIES =
FloatVector.SPECIES_MAX;
static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 10);
! static VectorShape getMaxBit() {
! return VectorShape.S_Max_BIT;
}
static void assertArraysEquals(float[] a, float[] r, boolean[] mask) {
int i = 0;
try {
*** 204,214 ****
static void loadStoreMaskArray(IntFunction<float[]> fa,
IntFunction<boolean[]> fm) {
float[] a = fa.apply(SPECIES.length());
float[] r = new float[a.length];
boolean[] mask = fm.apply(SPECIES.length());
! Vector.Mask<Float> vmask = FloatVector.maskFromValues(SPECIES, mask);
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
FloatVector av = FloatVector.fromArray(SPECIES, a, i, vmask);
av.intoArray(r, i);
--- 205,215 ----
static void loadStoreMaskArray(IntFunction<float[]> fa,
IntFunction<boolean[]> fm) {
float[] a = fa.apply(SPECIES.length());
float[] r = new float[a.length];
boolean[] mask = fm.apply(SPECIES.length());
! VectorMask<Float> vmask = VectorMask.fromValues(SPECIES, mask);
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
FloatVector av = FloatVector.fromArray(SPECIES, a, i, vmask);
av.intoArray(r, i);
*** 278,288 ****
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<Float> vmask = FloatVector.maskFromValues(SPECIES, mask);
int l = a.limit();
int s = SPECIES.length() * SPECIES.elementSize() / 8;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
--- 279,289 ----
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<Float> vmask = VectorMask.fromValues(SPECIES, mask);
int l = a.limit();
int s = SPECIES.length() * SPECIES.elementSize() / 8;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
*** 318,328 ****
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<Float> vmask = FloatVector.maskFromValues(SPECIES, mask);
int l = a.limit();
int s = SPECIES.length() * SPECIES.elementSize() / 8;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
--- 319,329 ----
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<Float> 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 >