1 2 @Test(dataProvider = "$type$CompareOpProvider") 3 static void [[TEST]]$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.compare(VectorOperators.[[TEST]], 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] [[TEST_OP]] b[i]); 14 } 15 } 16 } 17 18 19 @Test(dataProvider = "$type$CompareOpMaskProvider") 20 static void [[TEST]]$vectorteststype$BroadcastMaskedSmokeTest(IntFunction<$type$[]> fa, 21 IntFunction<$type$[]> fb, IntFunction<boolean[]> fm) { 22 $type$[] a = fa.apply(SPECIES.length()); 23 $type$[] b = fb.apply(SPECIES.length()); 24 boolean[] mask = fm.apply(SPECIES.length()); 25 26 VectorMask<$Wideboxtype$> vmask = VectorMask.fromArray(SPECIES, mask, 0); 27 28 for (int i = 0; i < a.length; i += SPECIES.length()) { 29 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 30 VectorMask<$Wideboxtype$> mv = av.compare(VectorOperators.[[TEST]], b[i], vmask); 31 32 // Check results as part of computation. 33 for (int j = 0; j < SPECIES.length(); j++) { 34 Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] [[TEST_OP]] b[i])); 35 } 36 } 37 } 38 39 #if[!Long] 40 @Test(dataProvider = "$type$CompareOpProvider") 41 static void [[TEST]]$vectorteststype$BroadcastLongSmokeTest(IntFunction<$type$[]> fa, IntFunction<$type$[]> fb) { 42 $type$[] a = fa.apply(SPECIES.length()); 43 $type$[] b = fb.apply(SPECIES.length()); 44 45 for (int i = 0; i < a.length; i += SPECIES.length()) { 46 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 47 VectorMask<$Wideboxtype$> mv = av.compare(VectorOperators.[[TEST]], (long)b[i]); 48 49 // Check results as part of computation. 50 for (int j = 0; j < SPECIES.length(); j++) { 51 Assert.assertEquals(mv.laneIsSet(j), a[i + j] [[TEST_OP]] ($type$)((long)b[i])); 52 } 53 } 54 } 55 56 57 @Test(dataProvider = "$type$CompareOpMaskProvider") 58 static void [[TEST]]$vectorteststype$BroadcastLongMaskedSmokeTest(IntFunction<$type$[]> fa, 59 IntFunction<$type$[]> fb, IntFunction<boolean[]> fm) { 60 $type$[] a = fa.apply(SPECIES.length()); 61 $type$[] b = fb.apply(SPECIES.length()); 62 boolean[] mask = fm.apply(SPECIES.length()); 63 64 VectorMask<$Wideboxtype$> vmask = VectorMask.fromArray(SPECIES, mask, 0); 65 66 for (int i = 0; i < a.length; i += SPECIES.length()) { 67 $abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i); 68 VectorMask<$Wideboxtype$> mv = av.compare(VectorOperators.[[TEST]], (long)b[i], vmask); 69 70 // Check results as part of computation. 71 for (int j = 0; j < SPECIES.length(); j++) { 72 Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] [[TEST_OP]] ($type$)((long)b[i]))); 73 } 74 } 75 } 76 #end[!Long]