< prev index next >

test/jdk/jdk/incubator/vector/templates/Perf-Scalar-Shift-Masked-op.template

Print this page
rev 55606 : 8221812: Fine-tune jmh test for vector api
Summary: To compare performance of vector api and auto vectorization, vector
api and scalar test cases are updated to keep aligned.
Reviewed-by: duke

*** 1,17 **** @Benchmark ! public Object [[TEST]][[TEST_TYPE]][[OP_NAME]]() { $type$[] as = fa.apply(size); $type$[] bs = fb.apply(size); $type$[] rs = fr.apply(size); boolean[] ms = fm.apply(size); for (int i = 0; i < as.length; i++) { $type$ a = as[i]; $type$ b = bs[i]; boolean m = ms[i % ms.length]; rs[i] = (m ? ($type$)([[TEST_OP]]) : a); } ! return rs; } --- 1,19 ---- @Benchmark ! public void [[TEST]][[TEST_TYPE]][[OP_NAME]](Blackhole bh) { $type$[] as = fa.apply(size); $type$[] bs = fb.apply(size); $type$[] rs = fr.apply(size); boolean[] ms = fm.apply(size); + for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < as.length; i++) { $type$ a = as[i]; $type$ b = bs[i]; boolean m = ms[i % ms.length]; rs[i] = (m ? ($type$)([[TEST_OP]]) : a); } + } ! bh.consume(rs); }
< prev index next >