1 2 @Test(dataProvider = "$type$CompareOpProvider") 3 static void lt$vectorteststype$BroadcastSmokeTest(IntFunction<$type$[]> fa, IntFunction<$type$[]> fb) { 4 $type$[] a = fa.apply(SPECIES.length()); 5 $type$[] b = fb.apply(SPECIES.length()); 6 7 for (int i = 0; i < a.length; i += SPECIES.length()) { 8 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 9 VectorMask<$Wideboxtype$> mv = av.lt(b[i]); 10 11 // Check results as part of computation. 12 for (int j = 0; j < SPECIES.length(); j++) { 13 Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); 14 } 15 } 16 } 17 18 @Test(dataProvider = "$type$CompareOpProvider") 19 static void eq$vectorteststype$BroadcastMaskedSmokeTest(IntFunction<$type$[]> fa, IntFunction<$type$[]> fb) { 20 $type$[] a = fa.apply(SPECIES.length()); 21 $type$[] b = fb.apply(SPECIES.length()); 22 23 for (int i = 0; i < a.length; i += SPECIES.length()) { 24 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 25 VectorMask<$Wideboxtype$> mv = av.eq(b[i]); 26 27 // Check results as part of computation. 28 for (int j = 0; j < SPECIES.length(); j++) { 29 Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); 30 } 31 } 32 } 33 34 #if[byteOrShort] 35 @Test(dataProvider = "$type$UnaryOpProvider") 36 #else[byteOrShort] 37 #if[Int] 38 @Test(dataProvider = "$type$UnaryOpProvider") 39 #else[Int] 40 @Test(dataProvider = "$type$toIntUnaryOpProvider") 41 #end[Int] 42 #end[byteOrShort] 43 static void toIntArray$vectorteststype$SmokeTest(IntFunction<$type$[]> fa) { 44 $type$[] a = fa.apply(SPECIES.length()); 45 46 for (int i = 0; i < a.length; i += SPECIES.length()) { 47 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 48 int[] r = av.toIntArray(); 49 assertArraysEquals(r, a, i); 50 } 51 } 52 53 #if[FP] 54 @Test(dataProvider = "$type$toLongUnaryOpProvider") 55 #else[FP] 56 @Test(dataProvider = "$type$UnaryOpProvider") 57 #end[FP] 58 static void toLongArray$vectorteststype$SmokeTest(IntFunction<$type$[]> fa) { 59 $type$[] a = fa.apply(SPECIES.length()); 60 61 for (int i = 0; i < a.length; i += SPECIES.length()) { 62 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 63 long[] r = av.toLongArray(); 64 assertArraysEquals(r, a, i); 65 } 66 } 67 68 #if[!Double] 69 @Test(dataProvider = "$type$UnaryOpProvider") 70 static void toDoubleArray$vectorteststype$SmokeTest(IntFunction<$type$[]> fa) { 71 $type$[] a = fa.apply(SPECIES.length()); 72 73 for (int i = 0; i < a.length; i += SPECIES.length()) { 74 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 75 double[] r = av.toDoubleArray(); 76 assertArraysEquals(r, a, i); 77 } 78 } 79 #end[!Double] 80 81 @Test(dataProvider = "$type$UnaryOpProvider") 82 static void toString$vectorteststype$SmokeTest(IntFunction<$type$[]> fa) { 83 $type$[] a = fa.apply(SPECIES.length()); 84 85 for (int i = 0; i < a.length; i += SPECIES.length()) { 86 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 87 String str = av.toString(); 88 89 $type$ subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); 90 Assert.assertTrue(str.equals(Arrays.toString(subarr)), "at index " + i + ", string should be = " + Arrays.toString(subarr) + ", but is = " + str); 91 } 92 } 93 94 @Test(dataProvider = "$type$UnaryOpProvider") 95 static void hashCode$vectorteststype$SmokeTest(IntFunction<$type$[]> fa) { 96 $type$[] a = fa.apply(SPECIES.length()); 97 98 for (int i = 0; i < a.length; i += SPECIES.length()) { 99 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 100 int hash = av.hashCode(); 101 102 $type$ subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); 103 int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); 104 Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); 105 } 106 } 107 108 #if[byte] 109 @Test(dataProvider = "$type$UnaryOpProvider") 110 static void reinterpretAsBytes$vectorteststype$SmokeTest(IntFunction<$type$[]> fa) { 111 $type$[] a = fa.apply(SPECIES.length()); 112 $type$[] r = new $type$[a.length]; 113 114 for (int i = 0; i < a.length; i += SPECIES.length()) { 115 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 116 av.reinterpretAsBytes().intoArray(r, i); 117 } 118 assertArraysEquals(r, a, 0); 119 } 120 #end[byte] 121 122 #if[!Long] 123 static long ADDReduceLong($type$[] a, int idx) { 124 $type$ res = 0; 125 for (int i = idx; i < (idx + SPECIES.length()); i++) { 126 res += a[i]; 127 } 128 129 return (long)res; 130 } 131 132 static long ADDReduceAllLong($type$[] a) { 133 long res = 0; 134 for (int i = 0; i < a.length; i += SPECIES.length()) { 135 res += ADDReduceLong(a, i); 136 } 137 138 return res; 139 } 140 141 @Test(dataProvider = "$type$UnaryOpProvider") 142 static void ADDReduceLong$vectorteststype$(IntFunction<$type$[]> fa) { 143 $type$[] a = fa.apply(SPECIES.length()); 144 long[] r = lfr.apply(SPECIES.length()); 145 long ra = 0; 146 147 for (int i = 0; i < a.length; i += SPECIES.length()) { 148 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 149 r[i] = av.reduceLanesToLong(VectorOperators.ADD); 150 } 151 152 ra = 0; 153 for (int i = 0; i < a.length; i ++) { 154 ra += r[i]; 155 } 156 157 assertReductionLongArraysEquals(r, ra, a, 158 $vectorteststype$::ADDReduceLong, $vectorteststype$::ADDReduceAllLong); 159 } 160 161 static long ADDReduceLongMasked($type$[] a, int idx, boolean[] mask) { 162 $type$ res = 0; 163 for (int i = idx; i < (idx + SPECIES.length()); i++) { 164 if(mask[i % SPECIES.length()]) 165 res += a[i]; 166 } 167 168 return (long)res; 169 } 170 171 static long ADDReduceAllLongMasked($type$[] a, boolean[] mask) { 172 long res = 0; 173 for (int i = 0; i < a.length; i += SPECIES.length()) { 174 res += ADDReduceLongMasked(a, i, mask); 175 } 176 177 return res; 178 } 179 180 @Test(dataProvider = "$type$UnaryOpMaskProvider") 181 static void ADDReduceLong$vectorteststype$Masked(IntFunction<$type$[]> fa, IntFunction<boolean[]> fm) { 182 $type$[] a = fa.apply(SPECIES.length()); 183 long[] r = lfr.apply(SPECIES.length()); 184 boolean[] mask = fm.apply(SPECIES.length()); 185 VectorMask<$Wideboxtype$> vmask = VectorMask.fromArray(SPECIES, mask, 0); 186 long ra = 0; 187 188 for (int i = 0; i < a.length; i += SPECIES.length()) { 189 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 190 r[i] = av.reduceLanesToLong(VectorOperators.ADD, vmask); 191 } 192 193 ra = 0; 194 for (int i = 0; i < a.length; i ++) { 195 ra += r[i]; 196 } 197 198 assertReductionLongArraysEqualsMasked(r, ra, a, mask, 199 $vectorteststype$::ADDReduceLongMasked, $vectorteststype$::ADDReduceAllLongMasked); 200 } 201 202 #if[FP] 203 @Test(dataProvider = "$type$toLongUnaryOpProvider") 204 #else[FP] 205 @Test(dataProvider = "$type$UnaryOpProvider") 206 #end[FP] 207 static void BroadcastLong$vectorteststype$SmokeTest(IntFunction<$type$[]> fa) { 208 $type$[] a = fa.apply(SPECIES.length()); 209 $type$[] r = new $type$[a.length]; 210 211 for (int i = 0; i < a.length; i += SPECIES.length()) { 212 $abstractvectortype$.broadcast(SPECIES, (long)a[i]).intoArray(r, i); 213 } 214 assertBroadcastArraysEquals(r, a); 215 } 216 217 @Test(dataProvider = "$type$BinaryOpMaskProvider") 218 static void blend$vectorteststype$BroadcastLongSmokeTest(IntFunction<$type$[]> fa, IntFunction<$type$[]> fb, 219 IntFunction<boolean[]> fm) { 220 $type$[] a = fa.apply(SPECIES.length()); 221 $type$[] b = fb.apply(SPECIES.length()); 222 $type$[] r = fr.apply(SPECIES.length()); 223 boolean[] mask = fm.apply(SPECIES.length()); 224 VectorMask<$Wideboxtype$> vmask = VectorMask.fromArray(SPECIES, mask, 0); 225 226 for (int ic = 0; ic < INVOC_COUNT; ic++) { 227 for (int i = 0; i < a.length; i += SPECIES.length()) { 228 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 229 av.blend((long)b[i], vmask).intoArray(r, i); 230 } 231 } 232 assertBroadcastLongArraysEquals(r, a, b, mask, $vectorteststype$::blend); 233 } 234 #end[!Long] 235 236 #if[Long] 237 @Test(dataProvider = "$type$UnaryOpProvider") 238 static void ADDReduceLong$vectorteststype$(IntFunction<$type$[]> fa) { 239 $type$[] a = fa.apply(SPECIES.length()); 240 $type$[] r = fr.apply(SPECIES.length()); 241 $type$ ra = 0; 242 243 for (int i = 0; i < a.length; i += SPECIES.length()) { 244 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 245 r[i] = av.reduceLanesToLong(VectorOperators.ADD); 246 } 247 248 ra = 0; 249 for (int i = 0; i < a.length; i ++) { 250 ra += r[i]; 251 } 252 253 assertReductionArraysEquals(r, ra, a, 254 $vectorteststype$::ADDReduce, $vectorteststype$::ADDReduceAll); 255 } 256 257 @Test(dataProvider = "$type$UnaryOpMaskProvider") 258 static void ADDReduceLong$vectorteststype$Masked(IntFunction<$type$[]> fa, IntFunction<boolean[]> fm) { 259 $type$[] a = fa.apply(SPECIES.length()); 260 $type$[] r = fr.apply(SPECIES.length()); 261 boolean[] mask = fm.apply(SPECIES.length()); 262 VectorMask<$Wideboxtype$> vmask = VectorMask.fromArray(SPECIES, mask, 0); 263 $type$ ra = 0; 264 265 for (int i = 0; i < a.length; i += SPECIES.length()) { 266 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 267 r[i] = av.reduceLanesToLong(VectorOperators.ADD, vmask); 268 } 269 270 ra = 0; 271 for (int i = 0; i < a.length; i ++) { 272 ra += r[i]; 273 } 274 275 assertReductionArraysEqualsMasked(r, ra, a, mask, 276 $vectorteststype$::ADDReduceMasked, $vectorteststype$::ADDReduceAllMasked); 277 } 278 #end[Long] 279 280 #if[Int] 281 @Test(dataProvider = "$type$UnaryOpShuffleProvider") 282 #else[Int] 283 @Test(dataProvider = "$type$UnaryOpSelectFromProvider") 284 #end[Int] 285 static void SelectFrom$vectorteststype$(IntFunction<$type$[]> fa, 286 BiFunction<Integer,Integer,$type$[]> fs) { 287 $type$[] a = fa.apply(SPECIES.length()); 288 $type$[] order = fs.apply(a.length, SPECIES.length()); 289 $type$[] r = fr.apply(SPECIES.length()); 290 291 for (int i = 0; i < a.length; i += SPECIES.length()) { 292 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 293 $abstractvectortype$ bv = $abstractvectortype$.fromArray(SPECIES, order, i); 294 bv.selectFrom(av).intoArray(r, i); 295 } 296 297 assertSelectFromArraysEquals(r, a, order, SPECIES.length()); 298 } 299 300 #if[Int] 301 @Test(dataProvider = "$type$UnaryOpShuffleMaskProvider") 302 #else[Int] 303 @Test(dataProvider = "$type$UnaryOpSelectFromMaskProvider") 304 #end[Int] 305 static void SelectFrom$vectorteststype$MaskedSmokeTest(IntFunction<$type$[]> fa, 306 BiFunction<Integer,Integer,$type$[]> fs, 307 IntFunction<boolean[]> fm) { 308 $type$[] a = fa.apply(SPECIES.length()); 309 $type$[] order = fs.apply(a.length, SPECIES.length()); 310 $type$[] r = fr.apply(SPECIES.length()); 311 boolean[] mask = fm.apply(SPECIES.length()); 312 VectorMask<$Wideboxtype$> vmask = VectorMask.fromArray(SPECIES, mask, 0); 313 314 for (int i = 0; i < a.length; i += SPECIES.length()) { 315 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 316 $abstractvectortype$ bv = $abstractvectortype$.fromArray(SPECIES, order, i); 317 bv.selectFrom(av, vmask).intoArray(r, i); 318 } 319 320 assertSelectFromArraysEquals(r, a, order, mask, SPECIES.length()); 321 } 322 323 @Test(dataProvider = "shuffleProvider") 324 static void shuffleMiscellaneous$vectorteststype$SmokeTest(BiFunction<Integer,Integer,int[]> fs) { 325 int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); 326 327 for (int i = 0; i < a.length; i += SPECIES.length()) { 328 var shuffle = VectorShuffle.fromArray(SPECIES, a, i); 329 int hash = shuffle.hashCode(); 330 int length = shuffle.length(); 331 332 int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); 333 int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); 334 Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); 335 Assert.assertEquals(length, SPECIES.length()); 336 } 337 } 338 339 @Test(dataProvider = "shuffleProvider") 340 static void shuffleToString$vectorteststype$SmokeTest(BiFunction<Integer,Integer,int[]> fs) { 341 int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); 342 343 for (int i = 0; i < a.length; i += SPECIES.length()) { 344 var shuffle = VectorShuffle.fromArray(SPECIES, a, i); 345 String str = shuffle.toString(); 346 347 int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); 348 Assert.assertTrue(str.equals("Shuffle" + Arrays.toString(subarr)), "at index " + 349 i + ", string should be = " + Arrays.toString(subarr) + ", but is = " + str); 350 } 351 } 352 353 @Test(dataProvider = "shuffleCompareOpProvider") 354 static void shuffleEquals$vectorteststype$SmokeTest(BiFunction<Integer,Integer,int[]> fa, BiFunction<Integer,Integer,int[]> fb) { 355 int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); 356 int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); 357 358 for (int i = 0; i < a.length; i += SPECIES.length()) { 359 var av = VectorShuffle.fromArray(SPECIES, a, i); 360 var bv = VectorShuffle.fromArray(SPECIES, b, i); 361 boolean eq = av.equals(bv); 362 int to = i + SPECIES.length(); 363 Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); 364 } 365 } 366 367 @Test(dataProvider = "maskCompareOpProvider") 368 static void maskEquals$vectorteststype$SmokeTest(IntFunction<boolean[]> fa, IntFunction<boolean[]> fb) { 369 boolean[] a = fa.apply(SPECIES.length()); 370 boolean[] b = fb.apply(SPECIES.length()); 371 372 for (int i = 0; i < a.length; i += SPECIES.length()) { 373 var av = SPECIES.loadMask(a, i); 374 var bv = SPECIES.loadMask(b, i); 375 boolean equals = av.equals(bv); 376 int to = i + SPECIES.length(); 377 Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); 378 } 379 } 380 381 static boolean beq(boolean a, boolean b) { 382 return (a == b); 383 } 384 385 @Test(dataProvider = "maskCompareOpProvider") 386 static void maskEq$vectorteststype$SmokeTest(IntFunction<boolean[]> fa, IntFunction<boolean[]> fb) { 387 boolean[] a = fa.apply(SPECIES.length()); 388 boolean[] b = fb.apply(SPECIES.length()); 389 boolean[] r = new boolean[a.length]; 390 391 for (int i = 0; i < a.length; i += SPECIES.length()) { 392 var av = SPECIES.loadMask(a, i); 393 var bv = SPECIES.loadMask(b, i); 394 var cv = av.eq(bv); 395 cv.intoArray(r, i); 396 } 397 assertArraysEquals(r, a, b, $vectorteststype$::beq); 398 } 399 400 @Test(dataProvider = "maskProvider") 401 static void maskHashCode$vectorteststype$SmokeTest(IntFunction<boolean[]> fa) { 402 boolean[] a = fa.apply(SPECIES.length()); 403 404 for (int i = 0; i < a.length; i += SPECIES.length()) { 405 var vmask = SPECIES.loadMask(a, i); 406 int hash = vmask.hashCode(); 407 408 boolean subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); 409 int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); 410 Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); 411 } 412 } 413 414 static int maskTrueCount(boolean[] a, int idx) { 415 int trueCount = 0; 416 for (int i = idx; i < idx + SPECIES.length(); i++) { 417 trueCount += a[i] ? 1 : 0; 418 } 419 return trueCount; 420 } 421 422 @Test(dataProvider = "maskProvider") 423 static void maskTrueCount$vectorteststype$SmokeTest(IntFunction<boolean[]> fa) { 424 boolean[] a = fa.apply(SPECIES.length()); 425 int[] r = new int[a.length]; 426 427 for (int ic = 0; ic < INVOC_COUNT * INVOC_COUNT; ic++) { 428 for (int i = 0; i < a.length; i += SPECIES.length()) { 429 var vmask = SPECIES.loadMask(a, i); 430 r[i] = vmask.trueCount(); 431 } 432 } 433 434 assertMaskReductionArraysEquals(r, a, $vectorteststype$::maskTrueCount); 435 } 436 437 static int maskLastTrue(boolean[] a, int idx) { 438 int i = idx + SPECIES.length() - 1; 439 for (; i >= idx; i--) { 440 if (a[i]) { 441 break; 442 } 443 } 444 return i - idx; 445 } 446 447 @Test(dataProvider = "maskProvider") 448 static void maskLastTrue$vectorteststype$SmokeTest(IntFunction<boolean[]> fa) { 449 boolean[] a = fa.apply(SPECIES.length()); 450 int[] r = new int[a.length]; 451 452 for (int ic = 0; ic < INVOC_COUNT * INVOC_COUNT; ic++) { 453 for (int i = 0; i < a.length; i += SPECIES.length()) { 454 var vmask = SPECIES.loadMask(a, i); 455 r[i] = vmask.lastTrue(); 456 } 457 } 458 459 assertMaskReductionArraysEquals(r, a, $vectorteststype$::maskLastTrue); 460 } 461 462 static int maskFirstTrue(boolean[] a, int idx) { 463 int i = idx; 464 for (; i < idx + SPECIES.length(); i++) { 465 if (a[i]) { 466 break; 467 } 468 } 469 return i - idx; 470 } 471 472 @Test(dataProvider = "maskProvider") 473 static void maskFirstTrue$vectorteststype$SmokeTest(IntFunction<boolean[]> fa) { 474 boolean[] a = fa.apply(SPECIES.length()); 475 int[] r = new int[a.length]; 476 477 for (int ic = 0; ic < INVOC_COUNT * INVOC_COUNT; ic++) { 478 for (int i = 0; i < a.length; i += SPECIES.length()) { 479 var vmask = SPECIES.loadMask(a, i); 480 r[i] = vmask.firstTrue(); 481 } 482 } 483 484 assertMaskReductionArraysEquals(r, a, $vectorteststype$::maskFirstTrue); 485 } 486 487 #if[!MaxBit] 488 @DataProvider 489 public static Object[][] longMaskProvider() { 490 return new Object[][]{ 491 {0xFFFFFFFFFFFFFFFFL}, 492 {0x0000000000000000L}, 493 {0x5555555555555555L}, 494 {0x0123456789abcdefL}, 495 }; 496 } 497 498 @Test(dataProvider = "longMaskProvider") 499 static void maskFromToLong$vectorteststype$SmokeTest(long inputLong) { 500 var vmask = VectorMask.fromLong(SPECIES, inputLong); 501 long outputLong = vmask.toLong(); 502 Assert.assertEquals(outputLong, (inputLong & (((0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length())))))); 503 } 504 #end[!MaxBit] 505 506 @DataProvider 507 public static Object[][] offsetProvider() { 508 return new Object[][]{ 509 {0}, 510 {-1}, 511 {+1}, 512 {+2}, 513 {-2}, 514 }; 515 } 516 517 @Test(dataProvider = "offsetProvider") 518 static void indexInRange$vectorteststype$SmokeTest(int offset) { 519 int limit = SPECIES.length() * BUFFER_REPS; 520 for (int i = 0; i < limit; i += SPECIES.length()) { 521 var actualMask = SPECIES.indexInRange(i + offset, limit); 522 var expectedMask = SPECIES.maskAll(true).indexInRange(i + offset, limit); 523 assert(actualMask.equals(expectedMask)); 524 for (int j = 0; j < SPECIES.length(); j++) { 525 int index = i + j + offset; 526 Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); 527 } 528 } 529 } 530 531 @DataProvider 532 public static Object[][] lengthProvider() { 533 return new Object[][]{ 534 {0}, 535 {1}, 536 {32}, 537 {37}, 538 {1024}, 539 {1024+1}, 540 {1024+5}, 541 }; 542 } 543 544 @Test(dataProvider = "lengthProvider") 545 static void loopBound$vectorteststype$SmokeTest(int length) { 546 int actualLoopBound = SPECIES.loopBound(length); 547 int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); 548 Assert.assertEquals(actualLoopBound, expectedLoopBound); 549 } 550 551 @Test 552 static void ElementSize$vectorteststype$SmokeTest() { 553 $abstractvectortype$ av = $abstractvectortype$.zero(SPECIES); 554 int elsize = av.elementSize(); 555 Assert.assertEquals(elsize, $Wideboxtype$.SIZE); 556 } 557 558 @Test 559 static void VectorShape$vectorteststype$SmokeTest() { 560 $abstractvectortype$ av = $abstractvectortype$.zero(SPECIES); 561 VectorShape vsh = av.shape(); 562 assert(vsh.equals(VectorShape.$Shape$)); 563 } 564 565 @Test 566 static void ShapeWithLanes$vectorteststype$SmokeTest() { 567 $abstractvectortype$ av = $abstractvectortype$.zero(SPECIES); 568 VectorShape vsh = av.shape(); 569 VectorSpecies species = vsh.withLanes($type$.class); 570 assert(species.equals(SPECIES)); 571 } 572 573 @Test 574 static void ElementType$vectorteststype$SmokeTest() { 575 $abstractvectortype$ av = $abstractvectortype$.zero(SPECIES); 576 assert(av.species().elementType() == $type$.class); 577 } 578 579 @Test 580 static void SpeciesElementSize$vectorteststype$SmokeTest() { 581 $abstractvectortype$ av = $abstractvectortype$.zero(SPECIES); 582 assert(av.species().elementSize() == $Wideboxtype$.SIZE); 583 } 584 585 @Test 586 static void VectorType$vectorteststype$SmokeTest() { 587 $abstractvectortype$ av = $abstractvectortype$.zero(SPECIES); 588 assert(av.species().vectorType() == av.getClass()); 589 } 590 591 @Test 592 static void WithLanes$vectorteststype$SmokeTest() { 593 $abstractvectortype$ av = $abstractvectortype$.zero(SPECIES); 594 VectorSpecies species = av.species().withLanes($type$.class); 595 assert(species.equals(SPECIES)); 596 } 597 598 @Test 599 static void WithShape$vectorteststype$SmokeTest() { 600 $abstractvectortype$ av = $abstractvectortype$.zero(SPECIES); 601 VectorShape vsh = av.shape(); 602 VectorSpecies species = av.species().withShape(vsh); 603 assert(species.equals(SPECIES)); 604 } 605 606 @Test 607 static void MaskAllTrue$vectorteststype$SmokeTest() { 608 for (int ic = 0; ic < INVOC_COUNT; ic++) { 609 Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); 610 } 611 }