8278796: Incorrect behavior of FloatVector.withLane on X86
Reviewed-by: sviswanathan, kvn
This commit is contained in:
parent
f5d7c777bc
commit
8494fec665
@ -4572,7 +4572,8 @@ instruct insertF(vec dst, regF val, immU8 idx) %{
|
||||
assert(Matcher::vector_element_basic_type(this) == T_FLOAT, "sanity");
|
||||
assert($idx$$constant < (int)Matcher::vector_length(this), "out of bounds");
|
||||
|
||||
__ insertps($dst$$XMMRegister, $val$$XMMRegister, $idx$$constant);
|
||||
uint x_idx = $idx$$constant & right_n_bits(2);
|
||||
__ insertps($dst$$XMMRegister, $val$$XMMRegister, x_idx << 4);
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
@ -4592,13 +4593,13 @@ instruct vinsertF(vec dst, vec src, regF val, immU8 idx, vec vtmp) %{
|
||||
uint y_idx = ($idx$$constant >> 2) & 1;
|
||||
int vlen_enc = Assembler::AVX_256bit;
|
||||
__ vextracti128($vtmp$$XMMRegister, $src$$XMMRegister, y_idx);
|
||||
__ vinsertps($vtmp$$XMMRegister, $vtmp$$XMMRegister, $val$$XMMRegister, x_idx);
|
||||
__ vinsertps($vtmp$$XMMRegister, $vtmp$$XMMRegister, $val$$XMMRegister, x_idx << 4);
|
||||
__ vinserti128($dst$$XMMRegister, $src$$XMMRegister, $vtmp$$XMMRegister, y_idx);
|
||||
} else {
|
||||
assert(vlen == 16, "sanity");
|
||||
uint y_idx = ($idx$$constant >> 2) & 3;
|
||||
__ vextracti32x4($vtmp$$XMMRegister, $src$$XMMRegister, y_idx);
|
||||
__ vinsertps($vtmp$$XMMRegister, $vtmp$$XMMRegister, $val$$XMMRegister, x_idx);
|
||||
__ vinsertps($vtmp$$XMMRegister, $vtmp$$XMMRegister, $val$$XMMRegister, x_idx << 4);
|
||||
__ vinserti32x4($dst$$XMMRegister, $src$$XMMRegister, $vtmp$$XMMRegister, y_idx);
|
||||
}
|
||||
%}
|
||||
|
@ -226,10 +226,10 @@ public class Byte128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3444,13 +3444,16 @@ public class Byte128VectorTests extends AbstractVectorTest {
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (byte)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (byte)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (byte)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (byte)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(byte a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Byte256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3444,13 +3444,16 @@ public class Byte256VectorTests extends AbstractVectorTest {
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (byte)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (byte)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (byte)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (byte)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(byte a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Byte512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3444,13 +3444,16 @@ public class Byte512VectorTests extends AbstractVectorTest {
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (byte)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (byte)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (byte)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (byte)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(byte a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Byte64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3444,13 +3444,16 @@ public class Byte64VectorTests extends AbstractVectorTest {
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (byte)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (byte)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (byte)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (byte)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(byte a) {
|
||||
return bits(a)==0;
|
||||
|
@ -231,10 +231,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3449,13 +3449,16 @@ public class ByteMaxVectorTests extends AbstractVectorTest {
|
||||
byte[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (byte)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (byte)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (byte)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (byte)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(byte a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Double128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -2457,13 +2457,16 @@ public class Double128VectorTests extends AbstractVectorTest {
|
||||
double[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (double)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (double)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (double)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (double)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(double a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Double256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -2457,13 +2457,16 @@ public class Double256VectorTests extends AbstractVectorTest {
|
||||
double[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (double)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (double)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (double)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (double)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(double a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Double512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -2457,13 +2457,16 @@ public class Double512VectorTests extends AbstractVectorTest {
|
||||
double[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (double)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (double)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (double)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (double)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(double a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Double64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -2457,13 +2457,16 @@ public class Double64VectorTests extends AbstractVectorTest {
|
||||
double[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (double)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (double)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (double)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (double)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(double a) {
|
||||
return bits(a)==0;
|
||||
|
@ -231,10 +231,10 @@ public class DoubleMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -2462,13 +2462,16 @@ public class DoubleMaxVectorTests extends AbstractVectorTest {
|
||||
double[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (double)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (double)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (double)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (double)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(double a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Float128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -2467,13 +2467,16 @@ public class Float128VectorTests extends AbstractVectorTest {
|
||||
float[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (float)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (float)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (float)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (float)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(float a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Float256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -2467,13 +2467,16 @@ public class Float256VectorTests extends AbstractVectorTest {
|
||||
float[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (float)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (float)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (float)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (float)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(float a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Float512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -2467,13 +2467,16 @@ public class Float512VectorTests extends AbstractVectorTest {
|
||||
float[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (float)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (float)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (float)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (float)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(float a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Float64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -2467,13 +2467,16 @@ public class Float64VectorTests extends AbstractVectorTest {
|
||||
float[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (float)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (float)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (float)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (float)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(float a) {
|
||||
return bits(a)==0;
|
||||
|
@ -231,10 +231,10 @@ public class FloatMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -2472,13 +2472,16 @@ public class FloatMaxVectorTests extends AbstractVectorTest {
|
||||
float[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (float)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (float)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (float)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (float)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(float a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Int128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3409,13 +3409,16 @@ public class Int128VectorTests extends AbstractVectorTest {
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (int)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (int)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (int)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (int)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(int a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Int256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3409,13 +3409,16 @@ public class Int256VectorTests extends AbstractVectorTest {
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (int)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (int)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (int)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (int)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(int a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Int512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3409,13 +3409,16 @@ public class Int512VectorTests extends AbstractVectorTest {
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (int)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (int)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (int)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (int)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(int a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Int64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3409,13 +3409,16 @@ public class Int64VectorTests extends AbstractVectorTest {
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (int)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (int)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (int)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (int)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(int a) {
|
||||
return bits(a)==0;
|
||||
|
@ -231,10 +231,10 @@ public class IntMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3414,13 +3414,16 @@ public class IntMaxVectorTests extends AbstractVectorTest {
|
||||
int[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
IntVector av = IntVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (int)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (int)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (int)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (int)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(int a) {
|
||||
return bits(a)==0;
|
||||
|
@ -183,10 +183,10 @@ public class Long128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3431,13 +3431,16 @@ public class Long128VectorTests extends AbstractVectorTest {
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (long)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (long)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (long)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (long)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(long a) {
|
||||
return bits(a)==0;
|
||||
|
@ -183,10 +183,10 @@ public class Long256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3431,13 +3431,16 @@ public class Long256VectorTests extends AbstractVectorTest {
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (long)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (long)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (long)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (long)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(long a) {
|
||||
return bits(a)==0;
|
||||
|
@ -183,10 +183,10 @@ public class Long512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3431,13 +3431,16 @@ public class Long512VectorTests extends AbstractVectorTest {
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (long)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (long)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (long)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (long)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(long a) {
|
||||
return bits(a)==0;
|
||||
|
@ -183,10 +183,10 @@ public class Long64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3431,13 +3431,16 @@ public class Long64VectorTests extends AbstractVectorTest {
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (long)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (long)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (long)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (long)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(long a) {
|
||||
return bits(a)==0;
|
||||
|
@ -188,10 +188,10 @@ public class LongMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3436,13 +3436,16 @@ public class LongMaxVectorTests extends AbstractVectorTest {
|
||||
long[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
LongVector av = LongVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (long)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (long)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (long)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (long)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(long a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Short128VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3434,13 +3434,16 @@ public class Short128VectorTests extends AbstractVectorTest {
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (short)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (short)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (short)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (short)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(short a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Short256VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3434,13 +3434,16 @@ public class Short256VectorTests extends AbstractVectorTest {
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (short)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (short)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (short)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (short)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(short a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Short512VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3434,13 +3434,16 @@ public class Short512VectorTests extends AbstractVectorTest {
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (short)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (short)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (short)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (short)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(short a) {
|
||||
return bits(a)==0;
|
||||
|
@ -226,10 +226,10 @@ public class Short64VectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3434,13 +3434,16 @@ public class Short64VectorTests extends AbstractVectorTest {
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (short)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (short)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (short)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (short)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(short a) {
|
||||
return bits(a)==0;
|
||||
|
@ -231,10 +231,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
@ -3439,13 +3439,16 @@ public class ShortMaxVectorTests extends AbstractVectorTest {
|
||||
short[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, (short)4).intoArray(r, i);
|
||||
av.withLane((j++ & (SPECIES.length()-1)), (short)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
assertInsertArraysEquals(r, a, (short)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, (short)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
static boolean testIS_DEFAULT(short a) {
|
||||
return bits(a)==0;
|
||||
|
@ -2,9 +2,9 @@
|
||||
$type$[] r = fr.apply(SPECIES.length());
|
||||
|
||||
for (int ic = 0; ic < INVOC_COUNT; ic++) {
|
||||
for (int i = 0; i < a.length; i += SPECIES.length()) {
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
$abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i);
|
||||
av.withLane(0, ($type$)4).intoArray(r, i);
|
||||
av.withLane((j++ \& (SPECIES.length()-1)), ($type$)(65535+i)).intoArray(r, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,5 +2,8 @@
|
||||
@Test(dataProvider = "$type$UnaryOpProvider")
|
||||
static void with$vectorteststype$(IntFunction<$type$ []> fa) {
|
||||
[[KERNEL]]
|
||||
assertInsertArraysEquals(r, a, ($type$)4, 0);
|
||||
|
||||
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
|
||||
assertInsertArraysEquals(r, a, ($type$)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
|
||||
}
|
||||
}
|
||||
|
@ -257,10 +257,10 @@ public class $vectorteststype$ extends AbstractVectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
static void assertInsertArraysEquals($type$[] r, $type$[] a, $type$ element, int index) {
|
||||
int i = 0;
|
||||
static void assertInsertArraysEquals($type$[] r, $type$[] a, $type$ element, int index, int start, int end) {
|
||||
int i = start;
|
||||
try {
|
||||
for (; i < a.length; i += 1) {
|
||||
for (; i < end; i += 1) {
|
||||
if(i%SPECIES.length() == index) {
|
||||
Assert.assertEquals(r[i], element);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user