< prev index next >

test/jdk/jdk/incubator/vector/templates/Unit-header.template

Print this page

 273             } else {
 274                 Assert.assertEquals(r[i], a[i], "at index #" + i);
 275             }
 276         }
 277     }
 278 
 279     static void assertRearrangeArraysEquals($type$[] r, $type$[] a, int[] order, int vector_len) {
 280         int i = 0, j = 0;
 281         try {
 282             for (; i < a.length; i += vector_len) {
 283                 for (j = 0; j < vector_len; j++) {
 284                     Assert.assertEquals(r[i+j], a[i+order[i+j]]);
 285                 }
 286             }
 287         } catch (AssertionError e) {
 288             int idx = i + j;
 289             Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]);
 290         }
 291     }
 292 

















































 293     static void assertSelectFromArraysEquals($type$[] r, $type$[] a, $type$[] order, int vector_len) {
 294         int i = 0, j = 0;
 295         try {
 296             for (; i < a.length; i += vector_len) {
 297                 for (j = 0; j < vector_len; j++) {
 298                     Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]);
 299                 }
 300             }
 301         } catch (AssertionError e) {
 302             int idx = i + j;
 303             Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]);
 304         }
 305     }
 306 
 307     static void assertRearrangeArraysEquals($type$[] r, $type$[] a, int[] order, boolean[] mask, int vector_len) {
 308         int i = 0, j = 0;
 309         try {
 310             for (; i < a.length; i += vector_len) {
 311                 for (j = 0; j < vector_len; j++) {
 312                     if (mask[j % SPECIES.length()])

 273             } else {
 274                 Assert.assertEquals(r[i], a[i], "at index #" + i);
 275             }
 276         }
 277     }
 278 
 279     static void assertRearrangeArraysEquals($type$[] r, $type$[] a, int[] order, int vector_len) {
 280         int i = 0, j = 0;
 281         try {
 282             for (; i < a.length; i += vector_len) {
 283                 for (j = 0; j < vector_len; j++) {
 284                     Assert.assertEquals(r[i+j], a[i+order[i+j]]);
 285                 }
 286             }
 287         } catch (AssertionError e) {
 288             int idx = i + j;
 289             Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]);
 290         }
 291     }
 292 
 293     static void assertcompressArraysEquals($type$[] r, $type$[] a, boolean[] m, int vector_len) {
 294         int i = 0, j = 0, k = 0;
 295         try {
 296             for (; i < a.length; i += vector_len) {
 297                 k = 0;
 298                 for (j = 0; j < vector_len; j++) {
 299                     if (m[(i + j) % SPECIES.length()]) {
 300                         Assert.assertEquals(r[i + k], a[i + j]);
 301                         k++;
 302                     }
 303                 }
 304                 for (; k < vector_len; k++) {
 305                     Assert.assertEquals(r[i + k], ($type$)0);
 306                 }
 307             }
 308         } catch (AssertionError e) {
 309             int idx = i + k;
 310             if (m[(i + j) % SPECIES.length()]) {
 311                 Assert.assertEquals(r[idx], a[i + j], "at index #" + idx);
 312             } else {
 313                 Assert.assertEquals(r[idx], ($type$)0, "at index #" + idx);
 314             }
 315         }
 316     }
 317 
 318     static void assertexpandArraysEquals($type$[] r, $type$[] a, boolean[] m, int vector_len) {
 319         int i = 0, j = 0, k = 0;
 320         try {
 321             for (; i < a.length; i += vector_len) {
 322                 k = 0;
 323                 for (j = 0; j < vector_len; j++) {
 324                     if (m[(i + j) % SPECIES.length()]) {
 325                         Assert.assertEquals(r[i + j], a[i + k]);
 326                         k++;
 327                     } else {
 328                         Assert.assertEquals(r[i + j], ($type$)0);
 329                     }
 330                 }
 331             }
 332         } catch (AssertionError e) {
 333             int idx = i + j;
 334             if (m[idx % SPECIES.length()]) {
 335                 Assert.assertEquals(r[idx], a[i + k], "at index #" + idx);
 336             } else {
 337                 Assert.assertEquals(r[idx], ($type$)0, "at index #" + idx);
 338             }
 339         }
 340     }
 341 
 342     static void assertSelectFromArraysEquals($type$[] r, $type$[] a, $type$[] order, int vector_len) {
 343         int i = 0, j = 0;
 344         try {
 345             for (; i < a.length; i += vector_len) {
 346                 for (j = 0; j < vector_len; j++) {
 347                     Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]);
 348                 }
 349             }
 350         } catch (AssertionError e) {
 351             int idx = i + j;
 352             Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]);
 353         }
 354     }
 355 
 356     static void assertRearrangeArraysEquals($type$[] r, $type$[] a, int[] order, boolean[] mask, int vector_len) {
 357         int i = 0, j = 0;
 358         try {
 359             for (; i < a.length; i += vector_len) {
 360                 for (j = 0; j < vector_len; j++) {
 361                     if (mask[j % SPECIES.length()])
< prev index next >