< prev index next >

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

Print this page


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

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