diff a/test/jdk/jdk/incubator/vector/templates/Perf-header.template b/test/jdk/jdk/incubator/vector/templates/Perf-header.template
--- /dev/null
+++ b/test/jdk/jdk/incubator/vector/templates/Perf-header.template
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package org.openjdk.bench.jdk.incubator.vector.operation;
+
+#warn This file is preprocessed before being compiled
+
+import jdk.incubator.vector.Vector;
+import jdk.incubator.vector.VectorMask;
+import jdk.incubator.vector.VectorOperators;
+import jdk.incubator.vector.VectorShape;
+import jdk.incubator.vector.VectorSpecies;
+import jdk.incubator.vector.VectorShuffle;
+import jdk.incubator.vector.$Type$Vector;
+
+import java.util.concurrent.TimeUnit;
+import java.util.function.BiFunction;
+import java.util.function.IntFunction;
+
+import org.openjdk.jmh.annotations.*;
+import org.openjdk.jmh.infra.Blackhole;
+
+@BenchmarkMode(Mode.Throughput)
+@OutputTimeUnit(TimeUnit.MILLISECONDS)
+@State(Scope.Benchmark)
+@Warmup(iterations = 3, time = 1)
+@Measurement(iterations = 5, time = 1)
+@Fork(value = 1, jvmArgsPrepend = {"--add-modules=jdk.incubator.vector"})
+public class $vectorbenchtype$ extends AbstractVectorBenchmark {
+#if[MaxBit]
+    static final VectorSpecies<$Wideboxtype$> SPECIES = $Type$Vector.SPECIES_MAX;
+#else[MaxBit]
+    static final VectorSpecies<$Wideboxtype$> SPECIES = $Type$Vector.SPECIES_$bits$;
+#end[MaxBit]
+
+    static final int INVOC_COUNT = 1; // get rid of outer loop
+
+#if[BITWISE]
+    static void replaceZero($type$[] a, $type$ v) {
+        for (int i = 0; i < a.length; i++) {
+            if (a[i] == 0) {
+                a[i] = v;
+            }
+        }
+    }
+
+    static void replaceZero($type$[] a, boolean[] mask, $type$ v) {
+        for (int i = 0; i < a.length; i++) {
+            if (mask[i % mask.length] && a[i] == 0) {
+                a[i] = v;
+            }
+        }
+    }
+#end[BITWISE]
+
+    static $type$ firstNonZero($type$ a, $type$ b) {
+        return $Boxtype$.compare(a, ($type$) 0) != 0 ? a : b;
+    }
+
+#if[BITWISE]
+    private static final $type$ CONST_SHIFT = $Boxtype$.SIZE / 2;
+#end[BITWISE]
+
+    @Param("1024")
+    int size;
+
+    $type$[] fill(IntFunction<$Wideboxtype$> f) {
+        $type$[] array = new $type$[size];
+        for (int i = 0; i < array.length; i++) {
+            array[i] = f.apply(i);
+        }
+        return array;
+    }
+
+    $type$[] a, b, c, r;
+    boolean[] m, mt, rm;
+    int[] s;
+
+    @Setup
+    public void init() {
+        size += size % SPECIES.length(); // FIXME: add post-loops
+
+        a = fill(i -> ($type$)(2*i));
+        b = fill(i -> ($type$)(i+1));
+        c = fill(i -> ($type$)(i+5));
+        r = fill(i -> ($type$)0);
+
+        m = fillMask(size, i -> (i % 2) == 0);
+        mt = fillMask(size, i -> true);
+        rm = fillMask(size, i -> false);
+
+        s = fillInt(size, i -> RANDOM.nextInt(SPECIES.length()));
+    }
+
+    final IntFunction<$type$[]> fa = vl -> a;
+    final IntFunction<$type$[]> fb = vl -> b;
+    final IntFunction<$type$[]> fc = vl -> c;
+    final IntFunction<$type$[]> fr = vl -> r;
+    final IntFunction<boolean[]> fm = vl -> m;
+    final IntFunction<boolean[]> fmt = vl -> mt;
+    final IntFunction<boolean[]> fmr = vl -> rm;
+    final BiFunction<Integer,Integer,int[]> fs = (i,j) -> s;
+
