12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have
21 * questions.
22 */
23
24 /*
25 * @test
26 * @modules jdk.incubator.vector
27 * @run testng Long256VectorLoadStoreTests
28 *
29 */
30
31 import jdk.incubator.vector.Vector.Shape;
32 import jdk.incubator.vector.Vector;
33
34 import jdk.incubator.vector.LongVector;
35
36 import org.testng.Assert;
37 import org.testng.annotations.DataProvider;
38 import org.testng.annotations.Test;
39
40 import java.nio.ByteBuffer;
41 import java.nio.LongBuffer;
42 import java.nio.ByteOrder;
43 import java.util.List;
44 import java.util.function.IntFunction;
45
46 @Test
47 public class Long256VectorLoadStoreTests extends AbstractVectorTest {
48 static final LongVector.LongSpecies SPECIES =
49 LongVector.species(Shape.S_256_BIT);
50
51 static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 10);
52
53 static void assertArraysEquals(long[] a, long[] r, boolean[] mask) {
54 int i = 0;
55 try {
56 for (; i < a.length; i++) {
57 Assert.assertEquals(mask[i % SPECIES.length()] ? a[i] : (long) 0, r[i]);
58 }
59 } catch (AssertionError e) {
60 Assert.assertEquals(mask[i % SPECIES.length()] ? a[i] : (long) 0, r[i], "at index #" + i);
61 }
62 }
63
64 static void assertArraysEquals(long[] a, long[] r, int[] im) {
65 int i = 0;
66 try {
67 for (; i < a.length; i++) {
68 Assert.assertEquals(a[im[i]], r[i]);
69 }
|
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have
21 * questions.
22 */
23
24 /*
25 * @test
26 * @modules jdk.incubator.vector
27 * @run testng Long256VectorLoadStoreTests
28 *
29 */
30
31 import jdk.incubator.vector.Vector.Shape;
32 import jdk.incubator.vector.Vector.Species;
33 import jdk.incubator.vector.Vector;
34
35 import jdk.incubator.vector.LongVector;
36
37 import org.testng.Assert;
38 import org.testng.annotations.DataProvider;
39 import org.testng.annotations.Test;
40
41 import java.nio.ByteBuffer;
42 import java.nio.LongBuffer;
43 import java.nio.ByteOrder;
44 import java.util.List;
45 import java.util.function.IntFunction;
46
47 @Test
48 public class Long256VectorLoadStoreTests extends AbstractVectorTest {
49 static final Species<Long> SPECIES =
50 LongVector.SPECIES_256;
51
52 static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 10);
53
54 static void assertArraysEquals(long[] a, long[] r, boolean[] mask) {
55 int i = 0;
56 try {
57 for (; i < a.length; i++) {
58 Assert.assertEquals(mask[i % SPECIES.length()] ? a[i] : (long) 0, r[i]);
59 }
60 } catch (AssertionError e) {
61 Assert.assertEquals(mask[i % SPECIES.length()] ? a[i] : (long) 0, r[i], "at index #" + i);
62 }
63 }
64
65 static void assertArraysEquals(long[] a, long[] r, int[] im) {
66 int i = 0;
67 try {
68 for (; i < a.length; i++) {
69 Assert.assertEquals(a[im[i]], r[i]);
70 }
|