Skip to content
Permalink
Browse files
Automatic merge of jdk:master into master
  • Loading branch information
duke committed Jan 6, 2021
2 parents b2165f3 + 52d3fee commit 8e5904d7405803330b943bc1354553222d2bbda6
Showing 108 changed files with 7,178 additions and 7,860 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -251,7 +251,7 @@ interface FBooleanBinOp {
boolean apply(boolean a, boolean b);
}

static void assertArraysEquals(boolean[] a, boolean[] b, boolean[] r, FBooleanBinOp f) {
static void assertArraysEquals(boolean[] r, boolean[] a, boolean[] b, FBooleanBinOp f) {
int i = 0;
try {
for (; i < a.length; i++) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -57,36 +57,14 @@ public class Byte128VectorLoadStoreTests extends AbstractVectorTest {

static final int BUFFER_SIZE = Integer.getInteger("jdk.incubator.vector.test.buffer-size", BUFFER_REPS * (128 / 8));

static void assertArraysEquals(byte[] a, byte[] r, boolean[] mask) {
static void assertArraysEquals(byte[] r, byte[] a, boolean[] mask) {
int i = 0;
try {
for (; i < a.length; i++) {
Assert.assertEquals(mask[i % SPECIES.length()] ? a[i] : (byte) 0, r[i]);
Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0);
}
} catch (AssertionError e) {
Assert.assertEquals(mask[i % SPECIES.length()] ? a[i] : (byte) 0, r[i], "at index #" + i);
}
}

static void assertArraysEquals(byte[] a, byte[] r, int[] im) {
int i = 0;
try {
for (; i < a.length; i++) {
Assert.assertEquals(a[im[i]], r[i]);
}
} catch (AssertionError e) {
Assert.assertEquals(a[im[i]], r[i], "at index #" + i);
}
}

static void assertArraysEquals(byte[] a, byte[] r, int[] im, boolean[] mask) {
int i = 0;
try {
for (; i < a.length; i++) {
Assert.assertEquals(mask[i % SPECIES.length()] ? a[im[i]] : (byte) 0, r[i]);
}
} catch (AssertionError e) {
Assert.assertEquals(mask[i % SPECIES.length()] ? a[im[i]] : (byte) 0, r[i], "at index #" + i);
Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0, "at index #" + i);
}
}

@@ -390,7 +368,7 @@ static void loadStoreArray(IntFunction<byte[]> fa) {
av.intoArray(r, i);
}
}
Assert.assertEquals(a, r);
Assert.assertEquals(r, a);
}

@Test(dataProvider = "byteProviderForIOOBE")
@@ -461,7 +439,7 @@ static void loadStoreMaskArray(IntFunction<byte[]> fa,
av.intoArray(r, i);
}
}
assertArraysEquals(a, r, mask);
assertArraysEquals(r, a, mask);


r = new byte[a.length];
@@ -472,7 +450,7 @@ static void loadStoreMaskArray(IntFunction<byte[]> fa,
av.intoArray(r, i, vmask);
}
}
assertArraysEquals(a, r, mask);
assertArraysEquals(r, a, mask);
}

@Test(dataProvider = "byteMaskProviderForIOOBE")
@@ -545,7 +523,7 @@ static void loadStoreMask(IntFunction<byte[]> fa,
vmask.intoArray(r, i);
}
}
Assert.assertEquals(mask, r);
Assert.assertEquals(r, mask);
}


@@ -569,7 +547,7 @@ static void loadStoreByteBuffer(IntFunction<byte[]> fa,
Assert.assertEquals(a.limit(), l, "Input buffer limit changed");
Assert.assertEquals(r.position(), 0, "Result buffer position changed");
Assert.assertEquals(r.limit(), l, "Result buffer limit changed");
Assert.assertEquals(a, r, "Buffers not equal");
Assert.assertEquals(r, a, "Buffers not equal");
}

@Test(dataProvider = "byteByteProviderForIOOBE")
@@ -656,7 +634,7 @@ static void loadStoreByteBufferMask(IntFunction<byte[]> fa,
Assert.assertEquals(a.limit(), l, "Input buffer limit changed");
Assert.assertEquals(r.position(), 0, "Result buffer position changed");
Assert.assertEquals(r.limit(), l, "Result buffer limit changed");
assertArraysEquals(_a, bufferToArray(r), mask);
assertArraysEquals(bufferToArray(r), _a, mask);


r = fb.apply(a.limit());
@@ -671,7 +649,7 @@ static void loadStoreByteBufferMask(IntFunction<byte[]> fa,
Assert.assertEquals(a.limit(), l, "Input buffer limit changed");
Assert.assertEquals(r.position(), 0, "Result buffer position changed");
Assert.assertEquals(r.limit(), l, "Result buffer limit changed");
assertArraysEquals(_a, bufferToArray(r), mask);
assertArraysEquals(bufferToArray(r), _a, mask);
}

@Test(dataProvider = "byteByteMaskProviderForIOOBE")
@@ -787,7 +765,7 @@ static void loadStoreByteArray(IntFunction<byte[]> fa,
av.intoByteArray(r, i, bo);
}
}
Assert.assertEquals(a, r, "Byte arrays not equal");
Assert.assertEquals(r, a, "Byte arrays not equal");
}

@Test(dataProvider = "byteByteProviderForIOOBE")
@@ -868,7 +846,7 @@ static void loadStoreByteArrayMask(IntFunction<byte[]> fa,
av.intoByteArray(r, i, bo);
}
}
assertArraysEquals(a, r, mask);
assertArraysEquals(r, a, mask);


r = new byte[a.length];
@@ -879,7 +857,7 @@ static void loadStoreByteArrayMask(IntFunction<byte[]> fa,
av.intoByteArray(r, i, bo, vmask);
}
}
assertArraysEquals(a, r, mask);
assertArraysEquals(r, a, mask);
}

@Test(dataProvider = "byteByteMaskProviderForIOOBE")
@@ -956,7 +934,7 @@ static void loadStoreMask(IntFunction<boolean[]> fm) {
vmask.intoArray(r, i);
}
}
Assert.assertEquals(a, r);
Assert.assertEquals(r, a);
}

@Test
@@ -967,7 +945,7 @@ static void loadStoreShuffle() {
int [] r = shuffle.toArray();

int [] a = expectedShuffle(SPECIES.length(), fn);
Assert.assertEquals(a, r);
Assert.assertEquals(r, a);
}
}
}

0 comments on commit 8e5904d

Please sign in to comment.