< prev index next >

test/jdk/jdk/incubator/vector/templates/Unit-Reduction-Scalar-Masked-op.template

Print this page


 1     static $type$ [[TEST]]ReduceMasked($type$[] a, int idx, boolean[] mask) {
 2         $type$ res = [[TEST_INIT]];
 3         for (int i = idx; i < (idx + SPECIES.length()); i++) {
 4             if (mask[i % SPECIES.length()])
 5                 res [[TEST_OP]]= a[i];
 6         }
 7 
 8         return res;
 9     }
10 
11     static $type$ [[TEST]]ReduceAllMasked($type$[] a, boolean[] mask) {
12         $type$ res = [[TEST_INIT]];
13         for (int i = 0; i < a.length; i += SPECIES.length()) {
14             res [[TEST_OP]]= [[TEST]]ReduceMasked(a, i, mask);
15         }
16 
17         return res;
18     }

 1 
 2     static $type$ [[TEST]]ReduceMasked($type$[] a, int idx, boolean[] mask) {
 3         $type$ res = [[TEST_INIT]];
 4         for (int i = idx; i < (idx + SPECIES.length()); i++) {
 5             if (mask[i % SPECIES.length()])
 6                 res [[TEST_OP]]= a[i];
 7         }
 8 
 9         return res;
10     }
11 
12     static $type$ [[TEST]]ReduceAllMasked($type$[] a, boolean[] mask) {
13         $type$ res = [[TEST_INIT]];
14         for (int i = 0; i < a.length; i += SPECIES.length()) {
15             res [[TEST_OP]]= [[TEST]]ReduceMasked(a, i, mask);
16         }
17 
18         return res;
19     }
< prev index next >