< prev index next >

test/jdk/jdk/incubator/vector/templates/Perf-Scalar-Compare.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,14 +1,17 @@
 
     @Benchmark
-    public boolean [[TEST]][[TEST_TYPE]][[OP_NAME]]() {
+    public void [[TEST]][[TEST_TYPE]][[OP_NAME]](Blackhole bh) {
         $type$[] as = fa.apply(size);
         $type$[] bs = fb.apply(size);
 
         boolean r = false;
+        for (int ic = 0; ic < INVOC_COUNT; ic++) {
+            r = false;
         for (int i = 0; i < as.length; i++) {
             boolean m = (as[i] [[TEST_OP]] bs[i]);
             r |= m; // accumulate so JIT can't eliminate the computation
         }
+        }
 
-        return r;
+        bh.consume(r);
     }
< prev index next >