Add more vector unit tests

Add vadd, vmul, vmv, vsel, vshift, vslide tests

Change-Id: I0e589db089ace24b1dbecd038ebc72dd6b205524
diff --git a/tests/kelvin_isa/BUILD b/tests/kelvin_isa/BUILD
index dda8199..0ea0bc7 100644
--- a/tests/kelvin_isa/BUILD
+++ b/tests/kelvin_isa/BUILD
@@ -70,6 +70,16 @@
 )
 
 kelvin_test(
+    name = "vadd",
+    srcs = [
+        "vadd.cc",
+    ],
+    deps = [
+        ":kelvin_test",
+    ],
+)
+
+kelvin_test(
     name = "valu",
     srcs = [
         "valu.cc",
@@ -150,6 +160,27 @@
 )
 
 kelvin_test(
+    name = "vmul",
+    srcs = [
+        "vmul.cc",
+    ],
+    deps = [
+        ":kelvin_test",
+    ],
+)
+
+kelvin_test(
+    name = "vmv",
+    srcs = [
+        "vmv.cc",
+    ],
+    hw_test_size = "small",
+    deps = [
+        ":kelvin_test",
+    ],
+)
+
+kelvin_test(
     name = "vpadd",
     srcs = [
         "vpadd.cc",
@@ -159,3 +190,34 @@
         ":kelvin_test",
     ],
 )
+
+kelvin_test(
+    name = "vsel",
+    srcs = [
+        "vsel.cc",
+    ],
+    hw_test_size = "small",
+    deps = [
+        ":kelvin_test",
+    ],
+)
+
+kelvin_test(
+    name = "vshift",
+    srcs = [
+        "vshift.cc",
+    ],
+    deps = [
+        ":kelvin_test",
+    ],
+)
+
+kelvin_test(
+    name = "vslide",
+    srcs = [
+        "vslide.cc",
+    ],
+    deps = [
+        ":kelvin_test",
+    ],
+)
diff --git a/tests/kelvin_isa/CPPLINT.cfg b/tests/kelvin_isa/CPPLINT.cfg
new file mode 100644
index 0000000..65a05ca
--- /dev/null
+++ b/tests/kelvin_isa/CPPLINT.cfg
@@ -0,0 +1 @@
+filter=-readability/fn_size
diff --git a/tests/kelvin_isa/kelvin_test.h b/tests/kelvin_isa/kelvin_test.h
index 7ca4932..b0bff6f 100644
--- a/tests/kelvin_isa/kelvin_test.h
+++ b/tests/kelvin_isa/kelvin_test.h
@@ -234,7 +234,106 @@
     }                                                                       \
   }
 
+#define test_aluw_h_vv(op, in0, in1, ref)                                  \
+  {                                                                        \
+    uint16_t dut[VLENH] __attribute__((aligned(64))) = {0xcccc};           \
+    vdup_b_x(v0, in0);                                                     \
+    vdup_b_x(v1, in1);                                                     \
+    __asm__ __volatile__(ARGS_F_A_A_A(op, v2, v0, v1));                    \
+    vst_h_x(v2, dut);                                                      \
+    if (ref != dut[0]) {                                                   \
+      printf("**error(%d)[%s] %02x %02x : %04x %04x\n", __LINE__, op, in0, \
+             in1, ref, dut[0]);                                            \
+      exit(-1);                                                            \
+    }                                                                      \
+  }
+
+#define test_aluw_w_vv(op, in0, in1, ref)                                   \
+  {                                                                         \
+    uint32_t dut[VLENW] __attribute__((aligned(64))) = {0xcccccccc};        \
+    vdup_h_x(v0, in0);                                                      \
+    vdup_h_x(v1, in1);                                                      \
+    __asm__ __volatile__(ARGS_F_A_A_A(op, v2, v0, v1));                     \
+    vst_w_x(v2, dut);                                                       \
+    if (ref != dut[0]) {                                                    \
+      printf("**error(%d)[%s] %04x %04x : %08x %08lx\n", __LINE__, op, in0, \
+             in1, ref, dut[0]);                                             \
+      exit(-1);                                                             \
+    }                                                                       \
+  }
+
+#define test_alu_b_vv3(op, in0, in1, in2, ref)                             \
+  {                                                                        \
+    uint8_t dut[VLENW] __attribute__((aligned(64))) = {0xcc};              \
+    vdup_b_x(v0, in0);                                                     \
+    vdup_b_x(v1, in1);                                                     \
+    vdup_b_x(v2, in2);                                                     \
+    __asm__ __volatile__(ARGS_F_A_A_A(op, v2, v0, v1));                    \
+    vst_b_x(v2, dut);                                                      \
+    if (ref != dut[0]) {                                                   \
+      printf("**error(%d)[%s] %02x %02x %02x : %02x %02x\n", __LINE__, op, \
+             in0, in1, in2, ref, dut[0]);                                  \
+      exit(-1);                                                            \
+    }                                                                      \
+  }
+
+#define test_alu_h_vv3(op, in0, in1, in2, ref)                             \
+  {                                                                        \
+    uint16_t dut[VLENW] __attribute__((aligned(64))) = {0xcccc};           \
+    vdup_h_x(v0, in0);                                                     \
+    vdup_h_x(v1, in1);                                                     \
+    vdup_h_x(v2, in2);                                                     \
+    __asm__ __volatile__(ARGS_F_A_A_A(op, v2, v0, v1));                    \
+    vst_h_x(v2, dut);                                                      \
+    if (ref != dut[0]) {                                                   \
+      printf("**error(%d)[%s] %04x %04x %04x : %04x %04x\n", __LINE__, op, \
+             in0, in1, in2, ref, dut[0]);                                  \
+      exit(-1);                                                            \
+    }                                                                      \
+  }
+
+#define test_alu_w_vv3(op, in0, in1, in2, ref)                              \
+  {                                                                         \
+    uint32_t dut[VLENW] __attribute__((aligned(64))) = {0xcccccccc};        \
+    vdup_w_x(v0, in0);                                                      \
+    vdup_w_x(v1, in1);                                                      \
+    vdup_w_x(v2, in2);                                                      \
+    __asm__ __volatile__(ARGS_F_A_A_A(op, v2, v0, v1));                     \
+    vst_w_x(v2, dut);                                                       \
+    if (ref != dut[0]) {                                                    \
+      printf("**error(%d)[%s] %08x %08x %08x : %08x %08lx\n", __LINE__, op, \
+             in0, in1, in2, ref, dut[0]);                                   \
+      exit(-1);                                                             \
+    }                                                                       \
+  }
+
 // clang-format off
+#define test_alu_b_vx(op, in0, in1, ref)                                   \
+  {                                                                        \
+    uint8_t dut[VLENB] __attribute__((aligned(64))) = {0xcc};              \
+    vdup_b_x(v0, in0);                                                     \
+    __asm__ __volatile__(ARGS_F_A_A_A(op, v2, v0, %0) : : "r"(in1));       \
+    vst_b_x(v2, dut);                                                      \
+    if (ref != dut[0]) {                                                   \
+      printf("**error(%d)[%s] %02x %02x : %02x %02x\n", __LINE__, op, in0, \
+             in1, ref, dut[0]);                                            \
+      exit(-1);                                                            \
+    }                                                                      \
+  }
+
+#define test_alu_h_vx(op, in0, in1, ref)                                   \
+  {                                                                        \
+    uint16_t dut[VLENH] __attribute__((aligned(64))) = {0xcccc};           \
+    vdup_h_x(v0, in0);                                                     \
+    __asm__ __volatile__(ARGS_F_A_A_A(op, v2, v0, %0) : : "r"(in1));       \
+    vst_h_x(v2, dut);                                                      \
+    if (ref != dut[0]) {                                                   \
+      printf("**error(%d)[%s] %04x %04x : %04x %04x\n", __LINE__, op, in0, \
+             in1, ref, dut[0]);                                            \
+      exit(-1);                                                            \
+    }                                                                      \
+  }
+
 #define test_alu_w_vx(op, in0, in1, ref)                                     \
   {                                                                          \
     uint32_t dut[VLENW] __attribute__((aligned(64))) = {0xcccccccc};         \
diff --git a/tests/kelvin_isa/vadd.cc b/tests/kelvin_isa/vadd.cc
new file mode 100644
index 0000000..b418f18
--- /dev/null
+++ b/tests/kelvin_isa/vadd.cc
@@ -0,0 +1,628 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "tests/kelvin_isa/kelvin_test.h"
+
+int main() {
+  test_alu_b_vv("vabsd.b.vv", 0x00, 0x00, 0x00);
+  test_alu_b_vv("vabsd.b.vv", 0x7f, 0x7f, 0x00);
+  test_alu_b_vv("vabsd.b.vv", 0x80, 0x80, 0x00);
+  test_alu_b_vv("vabsd.b.vv", 0xff, 0xff, 0x00);
+  test_alu_b_vv("vabsd.b.vv", 0x7f, 0x80, 0xff);
+  test_alu_b_vv("vabsd.b.vv", 0x80, 0x7f, 0xff);
+  test_alu_b_vv("vabsd.b.vv", 0x7f, 0xff, 0x80);
+  test_alu_b_vv("vabsd.b.vv", 0xff, 0x7f, 0x80);
+  test_alu_b_vv("vabsd.b.vv", 0x80, 0xff, 0x7f);
+  test_alu_b_vv("vabsd.b.vv", 0xff, 0x80, 0x7f);
+  test_alu_b_vv("vabsd.b.vv", 0xcc, 0x55, 0x89);
+  test_alu_b_vv("vabsd.b.vv", 0x55, 0xcc, 0x89);
+  test_alu_h_vv("vabsd.h.vv", 0x0000, 0x0000, 0x0000);
+  test_alu_h_vv("vabsd.h.vv", 0x7fff, 0x7fff, 0x0000);
+  test_alu_h_vv("vabsd.h.vv", 0x8000, 0x8000, 0x0000);
+  test_alu_h_vv("vabsd.h.vv", 0xffff, 0xffff, 0x0000);
+  test_alu_h_vv("vabsd.h.vv", 0x7fff, 0x8000, 0xffff);
+  test_alu_h_vv("vabsd.h.vv", 0x8000, 0x7fff, 0xffff);
+  test_alu_h_vv("vabsd.h.vv", 0x7fff, 0xffff, 0x8000);
+  test_alu_h_vv("vabsd.h.vv", 0xffff, 0x7fff, 0x8000);
+  test_alu_h_vv("vabsd.h.vv", 0x8000, 0xffff, 0x7fff);
+  test_alu_h_vv("vabsd.h.vv", 0xffff, 0x8000, 0x7fff);
+  test_alu_h_vv("vabsd.h.vv", 0xcccc, 0x5555, 0x8889);
+  test_alu_h_vv("vabsd.h.vv", 0x5555, 0xcccc, 0x8889);
+  test_alu_w_vv("vabsd.w.vv", 0x00000000, 0x00000000, 0x00000000);
+  test_alu_w_vv("vabsd.w.vv", 0x7fffffff, 0x7fffffff, 0x00000000);
+  test_alu_w_vv("vabsd.w.vv", 0x80000000, 0x80000000, 0x00000000);
+  test_alu_w_vv("vabsd.w.vv", 0xffffffff, 0xffffffff, 0x00000000);
+  test_alu_w_vv("vabsd.w.vv", 0x7fffffff, 0x80000000, 0xffffffff);
+  test_alu_w_vv("vabsd.w.vv", 0x80000000, 0x7fffffff, 0xffffffff);
+  test_alu_w_vv("vabsd.w.vv", 0x7fffffff, 0xffffffff, 0x80000000);
+  test_alu_w_vv("vabsd.w.vv", 0xffffffff, 0x7fffffff, 0x80000000);
+  test_alu_w_vv("vabsd.w.vv", 0x80000000, 0xffffffff, 0x7fffffff);
+  test_alu_w_vv("vabsd.w.vv", 0xffffffff, 0x80000000, 0x7fffffff);
+  test_alu_w_vv("vabsd.w.vv", 0xcccccccc, 0x55555555, 0x88888889);
+  test_alu_w_vv("vabsd.w.vv", 0x55555555, 0xcccccccc, 0x88888889);
+
+  test_alu_b_vv("vabsd.b.u.vv", 0x00, 0x00, 0x00);
+  test_alu_b_vv("vabsd.b.u.vv", 0x7f, 0x7f, 0x00);
+  test_alu_b_vv("vabsd.b.u.vv", 0x80, 0x80, 0x00);
+  test_alu_b_vv("vabsd.b.u.vv", 0xff, 0xff, 0x00);
+  test_alu_b_vv("vabsd.b.u.vv", 0x7f, 0x80, 0x01);
+  test_alu_b_vv("vabsd.b.u.vv", 0x80, 0x7f, 0x01);
+  test_alu_b_vv("vabsd.b.u.vv", 0x7f, 0xff, 0x80);
+  test_alu_b_vv("vabsd.b.u.vv", 0xff, 0x7f, 0x80);
+  test_alu_b_vv("vabsd.b.u.vv", 0x80, 0xff, 0x7f);
+  test_alu_b_vv("vabsd.b.u.vv", 0xff, 0x80, 0x7f);
+  test_alu_b_vv("vabsd.b.u.vv", 0xcc, 0x55, 0x77);
+  test_alu_b_vv("vabsd.b.u.vv", 0x55, 0xcc, 0x77);
+  test_alu_h_vv("vabsd.h.u.vv", 0x0000, 0x0000, 0x0000);
+  test_alu_h_vv("vabsd.h.u.vv", 0x7fff, 0x7fff, 0x0000);
+  test_alu_h_vv("vabsd.h.u.vv", 0x8000, 0x8000, 0x0000);
+  test_alu_h_vv("vabsd.h.u.vv", 0xffff, 0xffff, 0x0000);
+  test_alu_h_vv("vabsd.h.u.vv", 0x7fff, 0x8000, 0x0001);
+  test_alu_h_vv("vabsd.h.u.vv", 0x8000, 0x7fff, 0x0001);
+  test_alu_h_vv("vabsd.h.u.vv", 0x7fff, 0xffff, 0x8000);
+  test_alu_h_vv("vabsd.h.u.vv", 0xffff, 0x7fff, 0x8000);
+  test_alu_h_vv("vabsd.h.u.vv", 0x8000, 0xffff, 0x7fff);
+  test_alu_h_vv("vabsd.h.u.vv", 0xffff, 0x8000, 0x7fff);
+  test_alu_h_vv("vabsd.h.u.vv", 0xcccc, 0x5555, 0x7777);
+  test_alu_h_vv("vabsd.h.u.vv", 0x5555, 0xcccc, 0x7777);
+  test_alu_w_vv("vabsd.w.u.vv", 0x00000000, 0x00000000, 0x00000000);
+  test_alu_w_vv("vabsd.w.u.vv", 0x7fffffff, 0x7fffffff, 0x00000000);
+  test_alu_w_vv("vabsd.w.u.vv", 0x80000000, 0x80000000, 0x00000000);
+  test_alu_w_vv("vabsd.w.u.vv", 0xffffffff, 0xffffffff, 0x00000000);
+  test_alu_w_vv("vabsd.w.u.vv", 0x7fffffff, 0x80000000, 0x00000001);
+  test_alu_w_vv("vabsd.w.u.vv", 0x80000000, 0x7fffffff, 0x00000001);
+  test_alu_w_vv("vabsd.w.u.vv", 0x7fffffff, 0xffffffff, 0x80000000);
+  test_alu_w_vv("vabsd.w.u.vv", 0xffffffff, 0x7fffffff, 0x80000000);
+  test_alu_w_vv("vabsd.w.u.vv", 0x80000000, 0xffffffff, 0x7fffffff);
+  test_alu_w_vv("vabsd.w.u.vv", 0xffffffff, 0x80000000, 0x7fffffff);
+  test_alu_w_vv("vabsd.w.u.vv", 0xcccccccc, 0x55555555, 0x77777777);
+  test_alu_w_vv("vabsd.w.u.vv", 0x55555555, 0xcccccccc, 0x77777777);
+
+  test_alu_b_vv("vadd.b.vv", 0x00, 0x01, 0x01);
+  test_alu_b_vv("vadd.b.vv", 0xff, 0x01, 0x00);
+  test_alu_b_vv("vadd.b.vv", 0xa0, 0x5f, 0xff);
+  test_alu_h_vv("vadd.h.vv", 0x0000, 0x0001, 0x0001);
+  test_alu_h_vv("vadd.h.vv", 0x00ff, 0x0001, 0x0100);
+  test_alu_h_vv("vadd.h.vv", 0xffff, 0x0001, 0x0000);
+  test_alu_h_vv("vadd.h.vv", 0xa05f, 0x5fa0, 0xffff);
+  test_alu_w_vv("vadd.w.vv", 0x00000000, 0x00000001, 0x00000001);
+  test_alu_w_vv("vadd.w.vv", 0x000000ff, 0x00000001, 0x00000100);
+  test_alu_w_vv("vadd.w.vv", 0x0000ffff, 0x00000001, 0x00010000);
+  test_alu_w_vv("vadd.w.vv", 0xffffffff, 0x00000001, 0x00000000);
+  test_alu_w_vv("vadd.w.vv", 0xa05f1234, 0x5fa0edcb, 0xffffffff);
+
+  test_alu_b_vv("vadds.b.vv", 0x00, 0x01, 0x01);
+  test_alu_b_vv("vadds.b.vv", 0x7f, 0x01, 0x7f);
+  test_alu_b_vv("vadds.b.vv", 0xff, 0x01, 0x00);
+  test_alu_b_vv("vadds.b.vv", 0x80, 0x01, 0x81);
+  test_alu_b_vv("vadds.b.vv", 0x80, 0x80, 0x80);
+  test_alu_b_vv("vadds.b.vv", 0x80, 0xff, 0x80);
+  test_alu_b_vv("vadds.b.vv", 0x7f, 0x7f, 0x7f);
+  test_alu_b_vv("vadds.b.vv", 0x7f, 0x80, 0xff);
+  test_alu_b_vv("vadds.b.vv", 0x7f, 0xff, 0x7e);
+  test_alu_b_vv("vadds.b.vv", 0xff, 0xff, 0xfe);
+  test_alu_b_vv("vadds.b.vv", 0xa0, 0x5f, 0xff);
+  test_alu_h_vv("vadds.h.vv", 0x0000, 0x0001, 0x0001);
+  test_alu_h_vv("vadds.h.vv", 0x007f, 0x0001, 0x0080);
+  test_alu_h_vv("vadds.h.vv", 0x00ff, 0x0001, 0x0100);
+  test_alu_h_vv("vadds.h.vv", 0x7fff, 0x0001, 0x7fff);
+  test_alu_h_vv("vadds.h.vv", 0xffff, 0x0001, 0x0000);
+  test_alu_h_vv("vadds.h.vv", 0x0080, 0x0001, 0x0081);
+  test_alu_h_vv("vadds.h.vv", 0x0080, 0x00ff, 0x017f);
+  test_alu_h_vv("vadds.h.vv", 0x8000, 0x0001, 0x8001);
+  test_alu_h_vv("vadds.h.vv", 0x8000, 0x8000, 0x8000);
+  test_alu_h_vv("vadds.h.vv", 0x8000, 0xffff, 0x8000);
+  test_alu_h_vv("vadds.h.vv", 0x7fff, 0x7fff, 0x7fff);
+  test_alu_h_vv("vadds.h.vv", 0x7fff, 0x8000, 0xffff);
+  test_alu_h_vv("vadds.h.vv", 0x7fff, 0xffff, 0x7ffe);
+  test_alu_h_vv("vadds.h.vv", 0xffff, 0xffff, 0xfffe);
+  test_alu_h_vv("vadds.h.vv", 0xa05f, 0x5fa0, 0xffff);
+  test_alu_w_vv("vadds.w.vv", 0x00000000, 0x00000001, 0x00000001);
+  test_alu_w_vv("vadds.w.vv", 0x000000ff, 0x00000001, 0x00000100);
+  test_alu_w_vv("vadds.w.vv", 0x0000ffff, 0x00000001, 0x00010000);
+  test_alu_w_vv("vadds.w.vv", 0x7fffffff, 0x00000001, 0x7fffffff);
+  test_alu_w_vv("vadds.w.vv", 0xffffffff, 0x00000001, 0x00000000);
+  test_alu_w_vv("vadds.w.vv", 0x80000000, 0x00000001, 0x80000001);
+  test_alu_w_vv("vadds.w.vv", 0x80000000, 0x80000000, 0x80000000);
+  test_alu_w_vv("vadds.w.vv", 0x80000000, 0x7fffffff, 0xffffffff);
+  test_alu_w_vv("vadds.w.vv", 0x80000000, 0xffffffff, 0x80000000);
+  test_alu_w_vv("vadds.w.vv", 0x7fffffff, 0x80000000, 0xffffffff);
+  test_alu_w_vv("vadds.w.vv", 0x7fffffff, 0x7fffffff, 0x7fffffff);
+  test_alu_w_vv("vadds.w.vv", 0x7fffffff, 0xffffffff, 0x7ffffffe);
+  test_alu_w_vv("vadds.w.vv", 0xffffffff, 0xffffffff, 0xfffffffe);
+  test_alu_w_vv("vadds.w.vv", 0xa05f1234, 0x5fa0edcb, 0xffffffff);
+
+  test_alu_b_vv("vadds.b.u.vv", 0x00, 0x01, 0x01);
+  test_alu_b_vv("vadds.b.u.vv", 0x7f, 0x01, 0x80);
+  test_alu_b_vv("vadds.b.u.vv", 0xff, 0x01, 0xff);
+  test_alu_b_vv("vadds.b.u.vv", 0x80, 0x01, 0x81);
+  test_alu_b_vv("vadds.b.u.vv", 0x80, 0x80, 0xff);
+  test_alu_b_vv("vadds.b.u.vv", 0x80, 0xff, 0xff);
+  test_alu_b_vv("vadds.b.u.vv", 0x7f, 0x7f, 0xfe);
+  test_alu_b_vv("vadds.b.u.vv", 0x7f, 0x80, 0xff);
+  test_alu_b_vv("vadds.b.u.vv", 0x7f, 0xff, 0xff);
+  test_alu_b_vv("vadds.b.u.vv", 0xff, 0xff, 0xff);
+  test_alu_b_vv("vadds.b.u.vv", 0xa0, 0x5f, 0xff);
+  test_alu_h_vv("vadds.h.u.vv", 0x0000, 0x0001, 0x0001);
+  test_alu_h_vv("vadds.h.u.vv", 0x007f, 0x0001, 0x0080);
+  test_alu_h_vv("vadds.h.u.vv", 0x00ff, 0x0001, 0x0100);
+  test_alu_h_vv("vadds.h.u.vv", 0x7fff, 0x0001, 0x8000);
+  test_alu_h_vv("vadds.h.u.vv", 0xffff, 0x0001, 0xffff);
+  test_alu_h_vv("vadds.h.u.vv", 0x0080, 0x0001, 0x0081);
+  test_alu_h_vv("vadds.h.u.vv", 0x0080, 0x00ff, 0x017f);
+  test_alu_h_vv("vadds.h.u.vv", 0x8000, 0x0001, 0x8001);
+  test_alu_h_vv("vadds.h.u.vv", 0x8000, 0x8000, 0xffff);
+  test_alu_h_vv("vadds.h.u.vv", 0x8000, 0xffff, 0xffff);
+  test_alu_h_vv("vadds.h.u.vv", 0x7fff, 0x7fff, 0xfffe);
+  test_alu_h_vv("vadds.h.u.vv", 0x7fff, 0x8000, 0xffff);
+  test_alu_h_vv("vadds.h.u.vv", 0x7fff, 0xffff, 0xffff);
+  test_alu_h_vv("vadds.h.u.vv", 0xffff, 0xffff, 0xffff);
+  test_alu_h_vv("vadds.h.u.vv", 0xa05f, 0x5fa0, 0xffff);
+  test_alu_w_vv("vadds.w.u.vv", 0x00000000, 0x00000001, 0x00000001);
+  test_alu_w_vv("vadds.w.u.vv", 0x000000ff, 0x00000001, 0x00000100);
+  test_alu_w_vv("vadds.w.u.vv", 0x0000ffff, 0x00000001, 0x00010000);
+  test_alu_w_vv("vadds.w.u.vv", 0x7fffffff, 0x00000001, 0x80000000);
+  test_alu_w_vv("vadds.w.u.vv", 0xffffffff, 0x00000001, 0xffffffff);
+  test_alu_w_vv("vadds.w.u.vv", 0x80000000, 0x00000001, 0x80000001);
+  test_alu_w_vv("vadds.w.u.vv", 0x80000000, 0x80000000, 0xffffffff);
+  test_alu_w_vv("vadds.w.u.vv", 0x80000000, 0x7fffffff, 0xffffffff);
+  test_alu_w_vv("vadds.w.u.vv", 0x80000000, 0xffffffff, 0xffffffff);
+  test_alu_w_vv("vadds.w.u.vv", 0x7fffffff, 0x80000000, 0xffffffff);
+  test_alu_w_vv("vadds.w.u.vv", 0x7fffffff, 0x7fffffff, 0xfffffffe);
+  test_alu_w_vv("vadds.w.u.vv", 0x7fffffff, 0xffffffff, 0xffffffff);
+  test_alu_w_vv("vadds.w.u.vv", 0xffffffff, 0xffffffff, 0xffffffff);
+  test_alu_w_vv("vadds.w.u.vv", 0xa05f1234, 0x5fa0edcb, 0xffffffff);
+
+  test_aluw_h_vv("vaddw.h.vv", 0x00, 0x01, 0x0001);
+  test_aluw_h_vv("vaddw.h.vv", 0x7f, 0x01, 0x0080);
+  test_aluw_h_vv("vaddw.h.vv", 0xff, 0x01, 0x0000);
+  test_aluw_h_vv("vaddw.h.vv", 0x80, 0x01, 0xff81);
+  test_aluw_h_vv("vaddw.h.vv", 0x80, 0x80, 0xff00);
+  test_aluw_h_vv("vaddw.h.vv", 0x80, 0xff, 0xff7f);
+  test_aluw_h_vv("vaddw.h.vv", 0x7f, 0x7f, 0x00fe);
+  test_aluw_h_vv("vaddw.h.vv", 0x7f, 0x80, 0xffff);
+  test_aluw_h_vv("vaddw.h.vv", 0x7f, 0xff, 0x007e);
+  test_aluw_h_vv("vaddw.h.vv", 0xff, 0xff, 0xfffe);
+  test_aluw_h_vv("vaddw.h.vv", 0xa0, 0x5f, 0xffff);
+  test_aluw_w_vv("vaddw.w.vv", 0x0000, 0x0001, 0x00000001);
+  test_aluw_w_vv("vaddw.w.vv", 0x007f, 0x0001, 0x00000080);
+  test_aluw_w_vv("vaddw.w.vv", 0x00ff, 0x0001, 0x00000100);
+  test_aluw_w_vv("vaddw.w.vv", 0x7fff, 0x0001, 0x00008000);
+  test_aluw_w_vv("vaddw.w.vv", 0xffff, 0x0001, 0x00000000);
+  test_aluw_w_vv("vaddw.w.vv", 0x0080, 0x0001, 0x00000081);
+  test_aluw_w_vv("vaddw.w.vv", 0x0080, 0x00ff, 0x0000017f);
+  test_aluw_w_vv("vaddw.w.vv", 0x8000, 0x0001, 0xffff8001);
+  test_aluw_w_vv("vaddw.w.vv", 0x8000, 0x8000, 0xffff0000);
+  test_aluw_w_vv("vaddw.w.vv", 0x8000, 0xffff, 0xffff7fff);
+  test_aluw_w_vv("vaddw.w.vv", 0x7fff, 0x7fff, 0x0000fffe);
+  test_aluw_w_vv("vaddw.w.vv", 0x7fff, 0x8000, 0xffffffff);
+  test_aluw_w_vv("vaddw.w.vv", 0x7fff, 0xffff, 0x00007ffe);
+  test_aluw_w_vv("vaddw.w.vv", 0xffff, 0xffff, 0xfffffffe);
+  test_aluw_w_vv("vaddw.w.vv", 0xa05f, 0x5fa0, 0xffffffff);
+
+  test_aluw_h_vv("vaddw.h.u.vv", 0x00, 0x01, 0x0001);
+  test_aluw_h_vv("vaddw.h.u.vv", 0x7f, 0x01, 0x0080);
+  test_aluw_h_vv("vaddw.h.u.vv", 0xff, 0x01, 0x0100);
+  test_aluw_h_vv("vaddw.h.u.vv", 0x80, 0x01, 0x0081);
+  test_aluw_h_vv("vaddw.h.u.vv", 0x80, 0x80, 0x0100);
+  test_aluw_h_vv("vaddw.h.u.vv", 0x80, 0xff, 0x017f);
+  test_aluw_h_vv("vaddw.h.u.vv", 0x7f, 0x7f, 0x00fe);
+  test_aluw_h_vv("vaddw.h.u.vv", 0x7f, 0x80, 0x00ff);
+  test_aluw_h_vv("vaddw.h.u.vv", 0x7f, 0xff, 0x017e);
+  test_aluw_h_vv("vaddw.h.u.vv", 0xff, 0xff, 0x01fe);
+  test_aluw_h_vv("vaddw.h.u.vv", 0xa0, 0x5f, 0x00ff);
+  test_aluw_w_vv("vaddw.w.u.vv", 0x0000, 0x0001, 0x00000001);
+  test_aluw_w_vv("vaddw.w.u.vv", 0x007f, 0x0001, 0x00000080);
+  test_aluw_w_vv("vaddw.w.u.vv", 0x00ff, 0x0001, 0x00000100);
+  test_aluw_w_vv("vaddw.w.u.vv", 0x7fff, 0x0001, 0x00008000);
+  test_aluw_w_vv("vaddw.w.u.vv", 0xffff, 0x0001, 0x00010000);
+  test_aluw_w_vv("vaddw.w.u.vv", 0x0080, 0x0001, 0x00000081);
+  test_aluw_w_vv("vaddw.w.u.vv", 0x0080, 0x00ff, 0x0000017f);
+  test_aluw_w_vv("vaddw.w.u.vv", 0x8000, 0x0001, 0x00008001);
+  test_aluw_w_vv("vaddw.w.u.vv", 0x8000, 0x8000, 0x00010000);
+  test_aluw_w_vv("vaddw.w.u.vv", 0x8000, 0xffff, 0x00017fff);
+  test_aluw_w_vv("vaddw.w.u.vv", 0x7fff, 0x7fff, 0x0000fffe);
+  test_aluw_w_vv("vaddw.w.u.vv", 0x7fff, 0x8000, 0x0000ffff);
+  test_aluw_w_vv("vaddw.w.u.vv", 0x7fff, 0xffff, 0x00017ffe);
+  test_aluw_w_vv("vaddw.w.u.vv", 0xffff, 0xffff, 0x0001fffe);
+  test_aluw_w_vv("vaddw.w.u.vv", 0xa05f, 0x5fa0, 0x0000ffff);
+
+  test_alu_b_vv("vhadd.b.vv", 0x05, 0x08, 0x06);
+  test_alu_b_vv("vhadd.b.vv", 0x7e, 0x7f, 0x7e);
+  test_alu_b_vv("vhadd.b.vv", 0x7f, 0x80, 0xff);
+  test_alu_b_vv("vhadd.b.vv", 0xfe, 0xff, 0xfe);
+  test_alu_b_vv("vhadd.b.vv", 0x55, 0xaa, 0xff);
+  test_alu_b_vv("vhadd.b.vv", 0x33, 0x66, 0x4c);
+  test_alu_h_vv("vhadd.h.vv", 0x0055, 0x0088, 0x006e);
+  test_alu_h_vv("vhadd.h.vv", 0x7ffe, 0x7fff, 0x7ffe);
+  test_alu_h_vv("vhadd.h.vv", 0x7fff, 0x8000, 0xffff);
+  test_alu_h_vv("vhadd.h.vv", 0xfffe, 0xffff, 0xfffe);
+  test_alu_h_vv("vhadd.h.vv", 0x5555, 0xaaaa, 0xffff);
+  test_alu_h_vv("vhadd.h.vv", 0x3333, 0x6666, 0x4ccc);
+  test_alu_w_vv("vhadd.w.vv", 0x00000055, 0x00000088, 0x0000006e);
+  test_alu_w_vv("vhadd.w.vv", 0x7ffffffe, 0x7fffffff, 0x7ffffffe);
+  test_alu_w_vv("vhadd.w.vv", 0x7fffffff, 0x80000000, 0xffffffff);
+  test_alu_w_vv("vhadd.w.vv", 0xfffffffe, 0xffffffff, 0xfffffffe);
+  test_alu_w_vv("vhadd.w.vv", 0x55555555, 0xaaaaaaaa, 0xffffffff);
+  test_alu_w_vv("vhadd.w.vv", 0x33333333, 0x66666666, 0x4ccccccc);
+
+  test_alu_b_vv("vhadd.b.u.vv", 0x05, 0x08, 0x06);
+  test_alu_b_vv("vhadd.b.u.vv", 0x7e, 0x7f, 0x7e);
+  test_alu_b_vv("vhadd.b.u.vv", 0x7f, 0x80, 0x7f);
+  test_alu_b_vv("vhadd.b.u.vv", 0xfe, 0xff, 0xfe);
+  test_alu_b_vv("vhadd.b.u.vv", 0x55, 0xaa, 0x7f);
+  test_alu_b_vv("vhadd.b.u.vv", 0x33, 0x66, 0x4c);
+  test_alu_h_vv("vhadd.h.u.vv", 0x0055, 0x0088, 0x006e);
+  test_alu_h_vv("vhadd.h.u.vv", 0x7ffe, 0x7fff, 0x7ffe);
+  test_alu_h_vv("vhadd.h.u.vv", 0x7fff, 0x8000, 0x7fff);
+  test_alu_h_vv("vhadd.h.u.vv", 0xfffe, 0xffff, 0xfffe);
+  test_alu_h_vv("vhadd.h.u.vv", 0x5555, 0xaaaa, 0x7fff);
+  test_alu_h_vv("vhadd.h.u.vv", 0x3333, 0x6666, 0x4ccc);
+  test_alu_w_vv("vhadd.w.u.vv", 0x00000055, 0x00000088, 0x0000006e);
+  test_alu_w_vv("vhadd.w.u.vv", 0x7ffffffe, 0x7fffffff, 0x7ffffffe);
+  test_alu_w_vv("vhadd.w.u.vv", 0x7fffffff, 0x80000000, 0x7fffffff);
+  test_alu_w_vv("vhadd.w.u.vv", 0xfffffffe, 0xffffffff, 0xfffffffe);
+  test_alu_w_vv("vhadd.w.u.vv", 0x55555555, 0xaaaaaaaa, 0x7fffffff);
+  test_alu_w_vv("vhadd.w.u.vv", 0x33333333, 0x66666666, 0x4ccccccc);
+
+  test_alu_b_vv("vhadd.b.r.vv", 0x05, 0x08, 0x07);
+  test_alu_b_vv("vhadd.b.r.vv", 0x7e, 0x7f, 0x7f);
+  test_alu_b_vv("vhadd.b.r.vv", 0x7f, 0x80, 0x00);
+  test_alu_b_vv("vhadd.b.r.vv", 0xfe, 0xff, 0xff);
+  test_alu_b_vv("vhadd.b.r.vv", 0x55, 0xaa, 0x00);
+  test_alu_b_vv("vhadd.b.r.vv", 0x33, 0x66, 0x4d);
+  test_alu_h_vv("vhadd.h.r.vv", 0x0055, 0x0088, 0x006f);
+  test_alu_h_vv("vhadd.h.r.vv", 0x7ffe, 0x7fff, 0x7fff);
+  test_alu_h_vv("vhadd.h.r.vv", 0x7fff, 0x8000, 0x0000);
+  test_alu_h_vv("vhadd.h.r.vv", 0xfffe, 0xffff, 0xffff);
+  test_alu_h_vv("vhadd.h.r.vv", 0x5555, 0xaaaa, 0x0000);
+  test_alu_h_vv("vhadd.h.r.vv", 0x3333, 0x6666, 0x4ccd);
+  test_alu_w_vv("vhadd.w.r.vv", 0x00000055, 0x00000088, 0x0000006f);
+  test_alu_w_vv("vhadd.w.r.vv", 0x7ffffffe, 0x7fffffff, 0x7fffffff);
+  test_alu_w_vv("vhadd.w.r.vv", 0x7fffffff, 0x80000000, 0x00000000);
+  test_alu_w_vv("vhadd.w.r.vv", 0xfffffffe, 0xffffffff, 0xffffffff);
+  test_alu_w_vv("vhadd.w.r.vv", 0x55555555, 0xaaaaaaaa, 0x00000000);
+  test_alu_w_vv("vhadd.w.r.vv", 0x33333333, 0x66666666, 0x4ccccccd);
+
+  test_alu_b_vv("vhadd.b.ur.vv", 0x05, 0x08, 0x07);
+  test_alu_b_vv("vhadd.b.ur.vv", 0x7e, 0x7f, 0x7f);
+  test_alu_b_vv("vhadd.b.ur.vv", 0x7f, 0x80, 0x80);
+  test_alu_b_vv("vhadd.b.ur.vv", 0xfe, 0xff, 0xff);
+  test_alu_b_vv("vhadd.b.ur.vv", 0x55, 0xaa, 0x80);
+  test_alu_b_vv("vhadd.b.ur.vv", 0x33, 0x66, 0x4d);
+  test_alu_h_vv("vhadd.h.ur.vv", 0x0055, 0x0088, 0x006f);
+  test_alu_h_vv("vhadd.h.ur.vv", 0x7ffe, 0x7fff, 0x7fff);
+  test_alu_h_vv("vhadd.h.ur.vv", 0x7fff, 0x8000, 0x8000);
+  test_alu_h_vv("vhadd.h.ur.vv", 0xfffe, 0xffff, 0xffff);
+  test_alu_h_vv("vhadd.h.ur.vv", 0x5555, 0xaaaa, 0x8000);
+  test_alu_h_vv("vhadd.h.ur.vv", 0x3333, 0x6666, 0x4ccd);
+  test_alu_w_vv("vhadd.w.ur.vv", 0x00000055, 0x00000088, 0x0000006f);
+  test_alu_w_vv("vhadd.w.ur.vv", 0x7ffffffe, 0x7fffffff, 0x7fffffff);
+  test_alu_w_vv("vhadd.w.ur.vv", 0x7fffffff, 0x80000000, 0x80000000);
+  test_alu_w_vv("vhadd.w.ur.vv", 0xfffffffe, 0xffffffff, 0xffffffff);
+  test_alu_w_vv("vhadd.w.ur.vv", 0x55555555, 0xaaaaaaaa, 0x80000000);
+  test_alu_w_vv("vhadd.w.ur.vv", 0x33333333, 0x66666666, 0x4ccccccd);
+
+  test_alu_b_vv("vhsub.b.vv", 0x05, 0x08, 0xfe);
+  test_alu_b_vv("vhsub.b.vv", 0x7e, 0x7f, 0xff);
+  test_alu_b_vv("vhsub.b.vv", 0x7f, 0x80, 0x7f);
+  test_alu_b_vv("vhsub.b.vv", 0x80, 0x7f, 0x80);
+  test_alu_b_vv("vhsub.b.vv", 0xfe, 0xff, 0xff);
+  test_alu_b_vv("vhsub.b.vv", 0x55, 0xaa, 0x55);
+  test_alu_b_vv("vhsub.b.vv", 0x33, 0x66, 0xe6);
+  test_alu_h_vv("vhsub.h.vv", 0x0055, 0x0087, 0xffe7);
+  test_alu_h_vv("vhsub.h.vv", 0x7ffe, 0x7fff, 0xffff);
+  test_alu_h_vv("vhsub.h.vv", 0x7fff, 0x8000, 0x7fff);
+  test_alu_h_vv("vhsub.h.vv", 0x8000, 0x7fff, 0x8000);
+  test_alu_h_vv("vhsub.h.vv", 0xfffe, 0xffff, 0xffff);
+  test_alu_h_vv("vhsub.h.vv", 0x5555, 0xaaaa, 0x5555);
+  test_alu_h_vv("vhsub.h.vv", 0x3333, 0x6666, 0xe666);
+  test_alu_w_vv("vhsub.w.vv", 0x00000055, 0x00000088, 0xffffffe6);
+  test_alu_w_vv("vhsub.w.vv", 0x7ffffffe, 0x7fffffff, 0xffffffff);
+  test_alu_w_vv("vhsub.w.vv", 0x7fffffff, 0x80000000, 0x7fffffff);
+  test_alu_w_vv("vhsub.w.vv", 0x80000000, 0x7fffffff, 0x80000000);
+  test_alu_w_vv("vhsub.w.vv", 0xfffffffe, 0xffffffff, 0xffffffff);
+  test_alu_w_vv("vhsub.w.vv", 0x55555555, 0xaaaaaaaa, 0x55555555);
+  test_alu_w_vv("vhsub.w.vv", 0x33333333, 0x66666666, 0xe6666666);
+
+  test_alu_b_vv("vhsub.b.u.vv", 0x05, 0x07, 0xff);
+  test_alu_b_vv("vhsub.b.u.vv", 0x7e, 0x7f, 0xff);
+  test_alu_b_vv("vhsub.b.u.vv", 0x7f, 0x80, 0xff);
+  test_alu_b_vv("vhsub.b.u.vv", 0x80, 0x7f, 0x00);
+  test_alu_b_vv("vhsub.b.u.vv", 0xfe, 0xff, 0xff);
+  test_alu_b_vv("vhsub.b.u.vv", 0x55, 0xaa, 0xd5);
+  test_alu_b_vv("vhsub.b.u.vv", 0x33, 0x66, 0xe6);
+  test_alu_h_vv("vhsub.h.u.vv", 0x0055, 0x0087, 0xffe7);
+  test_alu_h_vv("vhsub.h.u.vv", 0x7ffe, 0x7fff, 0xffff);
+  test_alu_h_vv("vhsub.h.u.vv", 0x7fff, 0x8000, 0xffff);
+  test_alu_h_vv("vhsub.h.u.vv", 0x8000, 0x7fff, 0x0000);
+  test_alu_h_vv("vhsub.h.u.vv", 0xfffe, 0xffff, 0xffff);
+  test_alu_h_vv("vhsub.h.u.vv", 0x5555, 0xaaaa, 0xd555);
+  test_alu_h_vv("vhsub.h.u.vv", 0x3333, 0x6666, 0xe666);
+  test_alu_w_vv("vhsub.w.u.vv", 0x00000055, 0x00000087, 0xffffffe7);
+  test_alu_w_vv("vhsub.w.u.vv", 0x7ffffffe, 0x7fffffff, 0xffffffff);
+  test_alu_w_vv("vhsub.w.u.vv", 0x7fffffff, 0x80000000, 0xffffffff);
+  test_alu_w_vv("vhsub.w.u.vv", 0x80000000, 0x7fffffff, 0x00000000);
+  test_alu_w_vv("vhsub.w.u.vv", 0xfffffffe, 0xffffffff, 0xffffffff);
+  test_alu_w_vv("vhsub.w.u.vv", 0x55555555, 0xaaaaaaaa, 0xd5555555);
+  test_alu_w_vv("vhsub.w.u.vv", 0x33333333, 0x66666666, 0xe6666666);
+
+  test_alu_b_vv("vhsub.b.r.vv", 0x05, 0x07, 0xff);
+  test_alu_b_vv("vhsub.b.r.vv", 0x7e, 0x7f, 0x00);
+  test_alu_b_vv("vhsub.b.r.vv", 0x7f, 0x80, 0x80);
+  test_alu_b_vv("vhsub.b.r.vv", 0x80, 0x7f, 0x81);
+  test_alu_b_vv("vhsub.b.r.vv", 0xfe, 0xff, 0x00);
+  test_alu_b_vv("vhsub.b.r.vv", 0x55, 0xaa, 0x56);
+  test_alu_b_vv("vhsub.b.r.vv", 0x33, 0x66, 0xe7);
+  test_alu_h_vv("vhsub.h.r.vv", 0x0055, 0x0087, 0xffe7);
+  test_alu_h_vv("vhsub.h.r.vv", 0x7ffe, 0x7fff, 0x0000);
+  test_alu_h_vv("vhsub.h.r.vv", 0x7fff, 0x8000, 0x8000);
+  test_alu_h_vv("vhsub.h.r.vv", 0x8000, 0x7fff, 0x8001);
+  test_alu_h_vv("vhsub.h.r.vv", 0xfffe, 0xffff, 0x0000);
+  test_alu_h_vv("vhsub.h.r.vv", 0x5555, 0xaaaa, 0x5556);
+  test_alu_h_vv("vhsub.h.r.vv", 0x3333, 0x6666, 0xe667);
+  test_alu_w_vv("vhsub.w.r.vv", 0x00000055, 0x00000087, 0xffffffe7);
+  test_alu_w_vv("vhsub.w.r.vv", 0x7ffffffe, 0x7fffffff, 0x00000000);
+  test_alu_w_vv("vhsub.w.r.vv", 0x7fffffff, 0x80000000, 0x80000000);
+  test_alu_w_vv("vhsub.w.r.vv", 0x80000000, 0x7fffffff, 0x80000001);
+  test_alu_w_vv("vhsub.w.r.vv", 0xfffffffe, 0xffffffff, 0x00000000);
+  test_alu_w_vv("vhsub.w.r.vv", 0x55555555, 0xaaaaaaaa, 0x55555556);
+  test_alu_w_vv("vhsub.w.r.vv", 0x33333333, 0x66666666, 0xe6666667);
+
+  test_alu_b_vv("vhsub.b.ur.vv", 0x05, 0x07, 0xff);
+  test_alu_b_vv("vhsub.b.ur.vv", 0x7e, 0x7f, 0x00);
+  test_alu_b_vv("vhsub.b.ur.vv", 0x7f, 0x80, 0x00);
+  test_alu_b_vv("vhsub.b.ur.vv", 0x80, 0x7f, 0x01);
+  test_alu_b_vv("vhsub.b.ur.vv", 0xfe, 0xff, 0x00);
+  test_alu_b_vv("vhsub.b.ur.vv", 0x55, 0xaa, 0xd6);
+  test_alu_b_vv("vhsub.b.ur.vv", 0x33, 0x66, 0xe7);
+  test_alu_h_vv("vhsub.h.ur.vv", 0x0055, 0x0087, 0xffe7);
+  test_alu_h_vv("vhsub.h.ur.vv", 0x7ffe, 0x7fff, 0x0000);
+  test_alu_h_vv("vhsub.h.ur.vv", 0x7fff, 0x8000, 0x0000);
+  test_alu_h_vv("vhsub.h.ur.vv", 0x8000, 0x7fff, 0x0001);
+  test_alu_h_vv("vhsub.h.ur.vv", 0xfffe, 0xffff, 0x0000);
+  test_alu_h_vv("vhsub.h.ur.vv", 0x5555, 0xaaaa, 0xd556);
+  test_alu_h_vv("vhsub.h.ur.vv", 0x3333, 0x6666, 0xe667);
+  test_alu_w_vv("vhsub.w.ur.vv", 0x00000055, 0x00000087, 0xffffffe7);
+  test_alu_w_vv("vhsub.w.ur.vv", 0x7ffffffe, 0x7fffffff, 0x00000000);
+  test_alu_w_vv("vhsub.w.ur.vv", 0x7fffffff, 0x80000000, 0x00000000);
+  test_alu_w_vv("vhsub.w.ur.vv", 0x80000000, 0x7fffffff, 0x00000001);
+  test_alu_w_vv("vhsub.w.ur.vv", 0xfffffffe, 0xffffffff, 0x00000000);
+  test_alu_w_vv("vhsub.w.ur.vv", 0x55555555, 0xaaaaaaaa, 0xd5555556);
+  test_alu_w_vv("vhsub.w.ur.vv", 0x33333333, 0x66666666, 0xe6666667);
+
+  test_alu_b_vx("vrsub.b.vx", 0x00, 0x00, 0x00);
+  test_alu_b_vx("vrsub.b.vx", 0x12, 0x34, 0x22);
+  test_alu_b_vx("vrsub.b.vx", 0x34, 0x12, 0xde);
+  test_alu_b_vx("vrsub.b.vx", 0x00, 0x00, 0x00);
+  test_alu_b_vx("vrsub.b.vx", 0x00, 0x7f, 0x7f);
+  test_alu_b_vx("vrsub.b.vx", 0x00, 0x80, 0x80);
+  test_alu_b_vx("vrsub.b.vx", 0x00, 0xff, 0xff);
+  test_alu_b_vx("vrsub.b.vx", 0x7f, 0x00, 0x81);
+  test_alu_b_vx("vrsub.b.vx", 0x7f, 0x7f, 0x00);
+  test_alu_b_vx("vrsub.b.vx", 0x7f, 0x80, 0x01);
+  test_alu_b_vx("vrsub.b.vx", 0x7f, 0xff, 0x80);
+  test_alu_b_vx("vrsub.b.vx", 0x80, 0x00, 0x80);
+  test_alu_b_vx("vrsub.b.vx", 0x80, 0x7f, 0xff);
+  test_alu_b_vx("vrsub.b.vx", 0x80, 0x80, 0x00);
+  test_alu_b_vx("vrsub.b.vx", 0x80, 0xff, 0x7f);
+  test_alu_b_vx("vrsub.b.vx", 0xff, 0x00, 0x01);
+  test_alu_b_vx("vrsub.b.vx", 0xff, 0x7f, 0x80);
+  test_alu_b_vx("vrsub.b.vx", 0xff, 0x80, 0x81);
+  test_alu_b_vx("vrsub.b.vx", 0xff, 0xff, 0x00);
+  test_alu_h_vx("vrsub.h.vx", 0x0000, 0x0000, 0x0000);
+  test_alu_h_vx("vrsub.h.vx", 0x1234, 0x3456, 0x2222);
+  test_alu_h_vx("vrsub.h.vx", 0x3456, 0x1234, 0xddde);
+  test_alu_h_vx("vrsub.h.vx", 0x0000, 0x0000, 0x0000);
+  test_alu_h_vx("vrsub.h.vx", 0x0000, 0x7fff, 0x7fff);
+  test_alu_h_vx("vrsub.h.vx", 0x0000, 0x8000, 0x8000);
+  test_alu_h_vx("vrsub.h.vx", 0x0000, 0xffff, 0xffff);
+  test_alu_h_vx("vrsub.h.vx", 0x7fff, 0x0000, 0x8001);
+  test_alu_h_vx("vrsub.h.vx", 0x7fff, 0x7fff, 0x0000);
+  test_alu_h_vx("vrsub.h.vx", 0x7fff, 0x8000, 0x0001);
+  test_alu_h_vx("vrsub.h.vx", 0x7fff, 0xffff, 0x8000);
+  test_alu_h_vx("vrsub.h.vx", 0x8000, 0x0000, 0x8000);
+  test_alu_h_vx("vrsub.h.vx", 0x8000, 0x7fff, 0xffff);
+  test_alu_h_vx("vrsub.h.vx", 0x8000, 0x8000, 0x0000);
+  test_alu_h_vx("vrsub.h.vx", 0x8000, 0xffff, 0x7fff);
+  test_alu_h_vx("vrsub.h.vx", 0xffff, 0x0000, 0x0001);
+  test_alu_h_vx("vrsub.h.vx", 0xffff, 0x7fff, 0x8000);
+  test_alu_h_vx("vrsub.h.vx", 0xffff, 0x8000, 0x8001);
+  test_alu_h_vx("vrsub.h.vx", 0xffff, 0xffff, 0x0000);
+  test_alu_w_vx("vrsub.w.vx", 0x00000000, 0x00000000, 0x00000000);
+  test_alu_w_vx("vrsub.w.vx", 0x12345678, 0x3456789a, 0x22222222);
+  test_alu_w_vx("vrsub.w.vx", 0x3456789a, 0x12345678, 0xddddddde);
+  test_alu_w_vx("vrsub.w.vx", 0x00000000, 0x00000000, 0x00000000);
+  test_alu_w_vx("vrsub.w.vx", 0x00000000, 0x7fffffff, 0x7fffffff);
+  test_alu_w_vx("vrsub.w.vx", 0x00000000, 0x80000000, 0x80000000);
+  test_alu_w_vx("vrsub.w.vx", 0x00000000, 0xffffffff, 0xffffffff);
+  test_alu_w_vx("vrsub.w.vx", 0x7fffffff, 0x00000000, 0x80000001);
+  test_alu_w_vx("vrsub.w.vx", 0x7fffffff, 0x7fffffff, 0x00000000);
+  test_alu_w_vx("vrsub.w.vx", 0x7fffffff, 0x80000000, 0x00000001);
+  test_alu_w_vx("vrsub.w.vx", 0x7fffffff, 0xffffffff, 0x80000000);
+  test_alu_w_vx("vrsub.w.vx", 0x80000000, 0x00000000, 0x80000000);
+  test_alu_w_vx("vrsub.w.vx", 0x80000000, 0x7fffffff, 0xffffffff);
+  test_alu_w_vx("vrsub.w.vx", 0x80000000, 0x80000000, 0x00000000);
+  test_alu_w_vx("vrsub.w.vx", 0x80000000, 0xffffffff, 0x7fffffff);
+  test_alu_w_vx("vrsub.w.vx", 0xffffffff, 0x00000000, 0x00000001);
+  test_alu_w_vx("vrsub.w.vx", 0xffffffff, 0x7fffffff, 0x80000000);
+  test_alu_w_vx("vrsub.w.vx", 0xffffffff, 0x80000000, 0x80000001);
+  test_alu_w_vx("vrsub.w.vx", 0xffffffff, 0xffffffff, 0x00000000);
+
+  test_alu_b_vv("vsub.b.vv", 0x00, 0x01, 0xff);
+  test_alu_b_vv("vsub.b.vv", 0xff, 0x01, 0xfe);
+  test_alu_b_vv("vsub.b.vv", 0xa0, 0x5f, 0x41);
+  test_alu_h_vv("vsub.h.vv", 0x0000, 0x0001, 0xffff);
+  test_alu_h_vv("vsub.h.vv", 0x00ff, 0x0001, 0x00fe);
+  test_alu_h_vv("vsub.h.vv", 0xffff, 0x0001, 0xfffe);
+  test_alu_h_vv("vsub.h.vv", 0xa05f, 0x5fa0, 0x40bf);
+  test_alu_w_vv("vsub.w.vv", 0x00000000, 0x00000001, 0xffffffff);
+  test_alu_w_vv("vsub.w.vv", 0x000000ff, 0x00000001, 0x000000fe);
+  test_alu_w_vv("vsub.w.vv", 0x0000ffff, 0x00000001, 0x0000fffe);
+  test_alu_w_vv("vsub.w.vv", 0xffffffff, 0x00000001, 0xfffffffe);
+  test_alu_w_vv("vsub.w.vv", 0xa05f1234, 0x5fa0edcb, 0x40be2469);
+
+  test_alu_b_vv("vsubs.b.vv", 0x00, 0x01, 0xff);
+  test_alu_b_vv("vsubs.b.vv", 0x7f, 0x01, 0x7e);
+  test_alu_b_vv("vsubs.b.vv", 0x7f, 0x80, 0x7f);
+  test_alu_b_vv("vsubs.b.vv", 0xff, 0x01, 0xfe);
+  test_alu_b_vv("vsubs.b.vv", 0x80, 0x01, 0x80);
+  test_alu_b_vv("vsubs.b.vv", 0x80, 0x80, 0x00);
+  test_alu_b_vv("vsubs.b.vv", 0x80, 0xff, 0x81);
+  test_alu_b_vv("vsubs.b.vv", 0x7f, 0x7f, 0x00);
+  test_alu_b_vv("vsubs.b.vv", 0x7f, 0x80, 0x7f);
+  test_alu_b_vv("vsubs.b.vv", 0x7f, 0xff, 0x7f);
+  test_alu_b_vv("vsubs.b.vv", 0x80, 0x7f, 0x80);
+  test_alu_b_vv("vsubs.b.vv", 0xff, 0xff, 0x00);
+  test_alu_b_vv("vsubs.b.vv", 0xa0, 0x5f, 0x80);
+  test_alu_h_vv("vsubs.h.vv", 0x0000, 0x0001, 0xffff);
+  test_alu_h_vv("vsubs.h.vv", 0x007f, 0x0001, 0x007e);
+  test_alu_h_vv("vsubs.h.vv", 0x00ff, 0x0001, 0x00fe);
+  test_alu_h_vv("vsubs.h.vv", 0x7fff, 0x0001, 0x7ffe);
+  test_alu_h_vv("vsubs.h.vv", 0x7fff, 0x8000, 0x7fff);
+  test_alu_h_vv("vsubs.h.vv", 0xffff, 0x0001, 0xfffe);
+  test_alu_h_vv("vsubs.h.vv", 0x0080, 0x0001, 0x007f);
+  test_alu_h_vv("vsubs.h.vv", 0x0080, 0x00ff, 0xff81);
+  test_alu_h_vv("vsubs.h.vv", 0x8000, 0x7fff, 0x8000);
+  test_alu_h_vv("vsubs.h.vv", 0x8000, 0x0001, 0x8000);
+  test_alu_h_vv("vsubs.h.vv", 0x8000, 0x8000, 0x0000);
+  test_alu_h_vv("vsubs.h.vv", 0x8000, 0xffff, 0x8001);
+  test_alu_h_vv("vsubs.h.vv", 0x7fff, 0x7fff, 0x0000);
+  test_alu_h_vv("vsubs.h.vv", 0x7fff, 0x8000, 0x7fff);
+  test_alu_h_vv("vsubs.h.vv", 0x7fff, 0xffff, 0x7fff);
+  test_alu_h_vv("vsubs.h.vv", 0xffff, 0xffff, 0x0000);
+  test_alu_h_vv("vsubs.h.vv", 0xa05f, 0x5fa0, 0x8000);
+  test_alu_w_vv("vsubs.w.vv", 0x00000000, 0x00000001, 0xffffffff);
+  test_alu_w_vv("vsubs.w.vv", 0x000000ff, 0x00000001, 0x000000fe);
+  test_alu_w_vv("vsubs.w.vv", 0x0000ffff, 0x00000001, 0x0000fffe);
+  test_alu_w_vv("vsubs.w.vv", 0x7fffffff, 0x00000001, 0x7ffffffe);
+  test_alu_w_vv("vsubs.w.vv", 0x7fffffff, 0x80000000, 0x7fffffff);
+  test_alu_w_vv("vsubs.w.vv", 0xffffffff, 0x00000001, 0xfffffffe);
+  test_alu_w_vv("vsubs.w.vv", 0x80000000, 0x00000001, 0x80000000);
+  test_alu_w_vv("vsubs.w.vv", 0x80000000, 0x80000000, 0x00000000);
+  test_alu_w_vv("vsubs.w.vv", 0x80000000, 0x7fffffff, 0x80000000);
+  test_alu_w_vv("vsubs.w.vv", 0x80000000, 0xffffffff, 0x80000001);
+  test_alu_w_vv("vsubs.w.vv", 0x7fffffff, 0x80000000, 0x7fffffff);
+  test_alu_w_vv("vsubs.w.vv", 0x7fffffff, 0x7fffffff, 0x00000000);
+  test_alu_w_vv("vsubs.w.vv", 0x7fffffff, 0xffffffff, 0x7fffffff);
+  test_alu_w_vv("vsubs.w.vv", 0xffffffff, 0xffffffff, 0x00000000);
+  test_alu_w_vv("vsubs.w.vv", 0xa05f1234, 0x5fa0edcb, 0x80000000);
+
+  test_alu_b_vv("vsubs.b.u.vv", 0x00, 0x01, 0x00);
+  test_alu_b_vv("vsubs.b.u.vv", 0x7f, 0x01, 0x7e);
+  test_alu_b_vv("vsubs.b.u.vv", 0x80, 0x7f, 0x01);
+  test_alu_b_vv("vsubs.b.u.vv", 0xff, 0x01, 0xfe);
+  test_alu_b_vv("vsubs.b.u.vv", 0x80, 0x01, 0x7f);
+  test_alu_b_vv("vsubs.b.u.vv", 0x80, 0x80, 0x00);
+  test_alu_b_vv("vsubs.b.u.vv", 0x80, 0xff, 0x00);
+  test_alu_b_vv("vsubs.b.u.vv", 0x7f, 0x7f, 0x00);
+  test_alu_b_vv("vsubs.b.u.vv", 0x7f, 0x80, 0x00);
+  test_alu_b_vv("vsubs.b.u.vv", 0x7f, 0xff, 0x00);
+  test_alu_b_vv("vsubs.b.u.vv", 0xff, 0xff, 0x00);
+  test_alu_b_vv("vsubs.b.u.vv", 0xa0, 0x5f, 0x41);
+  test_alu_h_vv("vsubs.h.u.vv", 0x0000, 0x0001, 0x0000);
+  test_alu_h_vv("vsubs.h.u.vv", 0x007f, 0x0001, 0x007e);
+  test_alu_h_vv("vsubs.h.u.vv", 0x00ff, 0x0001, 0x00fe);
+  test_alu_h_vv("vsubs.h.u.vv", 0x7fff, 0x0001, 0x7ffe);
+  test_alu_h_vv("vsubs.h.u.vv", 0x7fff, 0x8000, 0x0000);
+  test_alu_h_vv("vsubs.h.u.vv", 0xffff, 0x0001, 0xfffe);
+  test_alu_h_vv("vsubs.h.u.vv", 0x0080, 0x0001, 0x007f);
+  test_alu_h_vv("vsubs.h.u.vv", 0x0080, 0x00ff, 0x0000);
+  test_alu_h_vv("vsubs.h.u.vv", 0x8000, 0x0001, 0x7fff);
+  test_alu_h_vv("vsubs.h.u.vv", 0x8000, 0x7fff, 0x0001);
+  test_alu_h_vv("vsubs.h.u.vv", 0x8000, 0x8000, 0x0000);
+  test_alu_h_vv("vsubs.h.u.vv", 0x8000, 0xffff, 0x0000);
+  test_alu_h_vv("vsubs.h.u.vv", 0x7fff, 0x7fff, 0x0000);
+  test_alu_h_vv("vsubs.h.u.vv", 0x7fff, 0x8000, 0x0000);
+  test_alu_h_vv("vsubs.h.u.vv", 0x7fff, 0xffff, 0x0000);
+  test_alu_h_vv("vsubs.h.u.vv", 0xffff, 0xffff, 0x0000);
+  test_alu_h_vv("vsubs.h.u.vv", 0xa05f, 0x5fa0, 0x40bf);
+  test_alu_w_vv("vsubs.w.u.vv", 0x00000000, 0x00000001, 0x00000000);
+  test_alu_w_vv("vsubs.w.u.vv", 0x000000ff, 0x00000001, 0x000000fe);
+  test_alu_w_vv("vsubs.w.u.vv", 0x0000ffff, 0x00000001, 0x0000fffe);
+  test_alu_w_vv("vsubs.w.u.vv", 0x7fffffff, 0x00000001, 0x7ffffffe);
+  test_alu_w_vv("vsubs.w.u.vv", 0x7fffffff, 0x80000000, 0x00000000);
+  test_alu_w_vv("vsubs.w.u.vv", 0xffffffff, 0x00000001, 0xfffffffe);
+  test_alu_w_vv("vsubs.w.u.vv", 0x80000000, 0x00000001, 0x7fffffff);
+  test_alu_w_vv("vsubs.w.u.vv", 0x80000000, 0x80000000, 0x00000000);
+  test_alu_w_vv("vsubs.w.u.vv", 0x80000000, 0x7fffffff, 0x00000001);
+  test_alu_w_vv("vsubs.w.u.vv", 0x80000000, 0xffffffff, 0x00000000);
+  test_alu_w_vv("vsubs.w.u.vv", 0x7fffffff, 0x80000000, 0x00000000);
+  test_alu_w_vv("vsubs.w.u.vv", 0x7fffffff, 0x7fffffff, 0x00000000);
+  test_alu_w_vv("vsubs.w.u.vv", 0x7fffffff, 0xffffffff, 0x00000000);
+  test_alu_w_vv("vsubs.w.u.vv", 0xffffffff, 0xffffffff, 0x00000000);
+  test_alu_w_vv("vsubs.w.u.vv", 0xa05f1234, 0x5fa0edcb, 0x40be2469);
+
+  test_aluw_h_vv("vsubw.h.vv", 0x00, 0x01, 0xffff);
+  test_aluw_h_vv("vsubw.h.vv", 0x7f, 0x01, 0x007e);
+  test_aluw_h_vv("vsubw.h.vv", 0x80, 0x7f, 0xff01);
+  test_aluw_h_vv("vsubw.h.vv", 0xff, 0x01, 0xfffe);
+  test_aluw_h_vv("vsubw.h.vv", 0x80, 0x01, 0xff7f);
+  test_aluw_h_vv("vsubw.h.vv", 0x80, 0x80, 0x0000);
+  test_aluw_h_vv("vsubw.h.vv", 0x80, 0xff, 0xff81);
+  test_aluw_h_vv("vsubw.h.vv", 0x7f, 0x7f, 0x0000);
+  test_aluw_h_vv("vsubw.h.vv", 0x7f, 0x80, 0x00ff);
+  test_aluw_h_vv("vsubw.h.vv", 0x7f, 0xff, 0x0080);
+  test_aluw_h_vv("vsubw.h.vv", 0xff, 0xff, 0x0000);
+  test_aluw_h_vv("vsubw.h.vv", 0xa0, 0x5f, 0xff41);
+  test_aluw_w_vv("vsubw.w.vv", 0x0000, 0x0001, 0xffffffff);
+  test_aluw_w_vv("vsubw.w.vv", 0x007f, 0x0001, 0x0000007e);
+  test_aluw_w_vv("vsubw.w.vv", 0x00ff, 0x0001, 0x000000fe);
+  test_aluw_w_vv("vsubw.w.vv", 0x7fff, 0x0001, 0x00007ffe);
+  test_aluw_w_vv("vsubw.w.vv", 0x8000, 0x7fff, 0xffff0001);
+  test_aluw_w_vv("vsubw.w.vv", 0xffff, 0x0001, 0xfffffffe);
+  test_aluw_w_vv("vsubw.w.vv", 0x0080, 0x0001, 0x0000007f);
+  test_aluw_w_vv("vsubw.w.vv", 0x0080, 0x00ff, 0xffffff81);
+  test_aluw_w_vv("vsubw.w.vv", 0x8000, 0x0001, 0xffff7fff);
+  test_aluw_w_vv("vsubw.w.vv", 0x8000, 0x8000, 0x00000000);
+  test_aluw_w_vv("vsubw.w.vv", 0x8000, 0xffff, 0xffff8001);
+  test_aluw_w_vv("vsubw.w.vv", 0x7fff, 0x7fff, 0x00000000);
+  test_aluw_w_vv("vsubw.w.vv", 0x7fff, 0x8000, 0x0000ffff);
+  test_aluw_w_vv("vsubw.w.vv", 0x7fff, 0xffff, 0x00008000);
+  test_aluw_w_vv("vsubw.w.vv", 0xffff, 0xffff, 0x00000000);
+  test_aluw_w_vv("vsubw.w.vv", 0xa05f, 0x5fa0, 0xffff40bf);
+
+  test_aluw_h_vv("vsubw.h.u.vv", 0x00, 0x01, 0xffff);
+  test_aluw_h_vv("vsubw.h.u.vv", 0x7f, 0x01, 0x007e);
+  test_aluw_h_vv("vsubw.h.u.vv", 0x80, 0x7f, 0x0001);
+  test_aluw_h_vv("vsubw.h.u.vv", 0xff, 0x01, 0x00fe);
+  test_aluw_h_vv("vsubw.h.u.vv", 0x80, 0x01, 0x007f);
+  test_aluw_h_vv("vsubw.h.u.vv", 0x80, 0x80, 0x0000);
+  test_aluw_h_vv("vsubw.h.u.vv", 0x80, 0xff, 0xff81);
+  test_aluw_h_vv("vsubw.h.u.vv", 0x7f, 0x7f, 0x0000);
+  test_aluw_h_vv("vsubw.h.u.vv", 0x7f, 0x80, 0xffff);
+  test_aluw_h_vv("vsubw.h.u.vv", 0x7f, 0xff, 0xff80);
+  test_aluw_h_vv("vsubw.h.u.vv", 0xff, 0xff, 0x0000);
+  test_aluw_h_vv("vsubw.h.u.vv", 0xa0, 0x5f, 0x0041);
+  test_aluw_w_vv("vsubw.w.u.vv", 0x0000, 0x0001, 0xffffffff);
+  test_aluw_w_vv("vsubw.w.u.vv", 0x007f, 0x0001, 0x0000007e);
+  test_aluw_w_vv("vsubw.w.u.vv", 0x00ff, 0x0001, 0x000000fe);
+  test_aluw_w_vv("vsubw.w.u.vv", 0x7fff, 0x0001, 0x00007ffe);
+  test_aluw_w_vv("vsubw.w.u.vv", 0xffff, 0x0001, 0x0000fffe);
+  test_aluw_w_vv("vsubw.w.u.vv", 0x0080, 0x0001, 0x0000007f);
+  test_aluw_w_vv("vsubw.w.u.vv", 0x0080, 0x00ff, 0xffffff81);
+  test_aluw_w_vv("vsubw.w.u.vv", 0x8000, 0x0001, 0x00007fff);
+  test_aluw_w_vv("vsubw.w.u.vv", 0x8000, 0x7fff, 0x00000001);
+  test_aluw_w_vv("vsubw.w.u.vv", 0x8000, 0x8000, 0x00000000);
+  test_aluw_w_vv("vsubw.w.u.vv", 0x8000, 0xffff, 0xffff8001);
+  test_aluw_w_vv("vsubw.w.u.vv", 0x7fff, 0x7fff, 0x00000000);
+  test_aluw_w_vv("vsubw.w.u.vv", 0x7fff, 0x8000, 0xffffffff);
+  test_aluw_w_vv("vsubw.w.u.vv", 0x7fff, 0xffff, 0xffff8000);
+  test_aluw_w_vv("vsubw.w.u.vv", 0xffff, 0xffff, 0x00000000);
+  test_aluw_w_vv("vsubw.w.u.vv", 0xa05f, 0x5fa0, 0x000040bf);
+
+  return 0;
+}
diff --git a/tests/kelvin_isa/vmul.cc b/tests/kelvin_isa/vmul.cc
new file mode 100644
index 0000000..2d869a6
--- /dev/null
+++ b/tests/kelvin_isa/vmul.cc
@@ -0,0 +1,728 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <cstdio>
+
+#include "tests/kelvin_isa/kelvin_test.h"
+
+void test_vdmulh() {
+  const uint32_t in0[4] = {0x23456789, 0x543210fe, 0x02305670, 0xedcba987};
+  const uint32_t ref[2][4] = {{0xea8d6858, 0xcccd6c0b, 0xfeab4536, 0x0b11daa9},
+                              {0x129163c0, 0x2c52cda5, 0x0126fb26, 0xf66aa338}};
+  uint32_t dut[2][4];
+
+  vdup_w_x(v16, in0[0]);
+  vdup_w_x(v17, in0[1]);
+  vdup_w_x(v18, in0[2]);
+  vdup_w_x(v19, in0[3]);
+
+  vdmulh_w_rn_vx_m(v0, v16, 0xb22a768b);
+  vdmulh_w_rn_vx_m(v4, v16, 0x43623453);
+
+  vst_w_l_xx(v0, dut[0] + 0, 1);
+  vst_w_l_xx(v1, dut[0] + 1, 1);
+  vst_w_l_xx(v2, dut[0] + 2, 1);
+  vst_w_l_xx(v3, dut[0] + 3, 1);
+  vst_w_l_xx(v4, dut[1] + 0, 1);
+  vst_w_l_xx(v5, dut[1] + 1, 1);
+  vst_w_l_xx(v6, dut[1] + 2, 1);
+  vst_w_l_xx(v7, dut[1] + 3, 1);
+
+  for (int j = 0; j < 2; ++j) {
+    for (int i = 0; i < 4; ++i) {
+      const uint32_t r = ref[j][i];
+      const uint32_t d = dut[j][i];
+      if (r != d) {
+        printf("**test_vdmulh(%d,%d) %08lx %08lx\n", j, i, r, d);
+        exit(-1);
+      }
+    }
+  }
+}
+
+int main() {
+  test_alu_b_vv("vmul.b.vv", 0x00, 0x00, 0x00);
+  test_alu_b_vv("vmul.b.vv", 0x55, 0x00, 0x00);
+  test_alu_b_vv("vmul.b.vv", 0x02, 0x03, 0x06);
+  test_alu_b_vv("vmul.b.vv", 0x12, 0x06, 0x6c);
+  test_alu_b_vv("vmul.b.vv", 0x12, 0x09, 0xa2);
+  test_alu_b_vv("vmul.b.vv", 0x55, 0x03, 0xff);
+  test_alu_b_vv("vmul.b.vv", 0x55, 0x05, 0xa9);
+  test_alu_b_vv("vmul.b.vv", 0x54, 0x32, 0x68);
+  test_alu_b_vv("vmul.b.vv", 0x80, 0x7f, 0x80);
+  test_alu_b_vv("vmul.b.vv", 0x80, 0x80, 0x00);
+  test_alu_b_vv("vmul.b.vv", 0x80, 0x81, 0x80);
+  test_alu_b_vv("vmul.b.vv", 0xed, 0x23, 0x67);
+  test_alu_b_vv("vmul.b.vv", 0x54, 0x89, 0xf4);
+  test_alu_b_vv("vmul.b.vv", 0xcb, 0x07, 0x8d);
+  test_alu_b_vv("vmul.b.vv", 0xcb, 0x98, 0x88);
+  test_alu_b_vv("vmul.b.vv", 0xcb, 0xde, 0x0a);
+  test_alu_h_vv("vmul.h.vv", 0x0000, 0x0000, 0x0000);
+  test_alu_h_vv("vmul.h.vv", 0x5555, 0x0000, 0x0000);
+  test_alu_h_vv("vmul.h.vv", 0x0002, 0x0003, 0x0006);
+  test_alu_h_vv("vmul.h.vv", 0x1234, 0x0006, 0x6d38);
+  test_alu_h_vv("vmul.h.vv", 0x1234, 0x0009, 0xa3d4);
+  test_alu_h_vv("vmul.h.vv", 0x5555, 0x0003, 0xffff);
+  test_alu_h_vv("vmul.h.vv", 0x5555, 0x0005, 0xaaa9);
+  test_alu_h_vv("vmul.h.vv", 0x5432, 0x1234, 0x9e28);
+  test_alu_h_vv("vmul.h.vv", 0x5432, 0x89ab, 0xff66);
+  test_alu_h_vv("vmul.h.vv", 0x8000, 0x7fff, 0x8000);
+  test_alu_h_vv("vmul.h.vv", 0x8000, 0x8000, 0x0000);
+  test_alu_h_vv("vmul.h.vv", 0x8000, 0x8001, 0x8000);
+  test_alu_h_vv("vmul.h.vv", 0xedcb, 0x1234, 0x933c);
+  test_alu_h_vv("vmul.h.vv", 0xedcb, 0x89ab, 0x7999);
+  test_alu_h_vv("vmul.h.vv", 0xcba9, 0x0007, 0x919f);
+  test_alu_h_vv("vmul.h.vv", 0xcb98, 0x9876, 0x1810);
+  test_alu_h_vv("vmul.h.vv", 0xcb98, 0xdef3, 0x1148);
+  test_alu_w_vv("vmul.w.vv", 0x00000000, 0x00000000, 0x00000000);
+  test_alu_w_vv("vmul.w.vv", 0x55555555, 0x00000000, 0x00000000);
+  test_alu_w_vv("vmul.w.vv", 0x00000002, 0x00000003, 0x00000006);
+  test_alu_w_vv("vmul.w.vv", 0x12345678, 0x00000006, 0x6d3a06d0);
+  test_alu_w_vv("vmul.w.vv", 0x12345678, 0x00000009, 0xa3d70a38);
+  test_alu_w_vv("vmul.w.vv", 0x55555555, 0x00000003, 0xffffffff);
+  test_alu_w_vv("vmul.w.vv", 0x55555555, 0x00000005, 0xaaaaaaa9);
+  test_alu_w_vv("vmul.w.vv", 0x23456789, 0x02305670, 0x3ad551f0);
+  test_alu_w_vv("vmul.w.vv", 0x543210fe, 0x12345678, 0x98c54b10);
+  test_alu_w_vv("vmul.w.vv", 0x543210fe, 0x89abcdef, 0xfa034322);
+  test_alu_w_vv("vmul.w.vv", 0x80000000, 0x7fffffff, 0x80000000);
+  test_alu_w_vv("vmul.w.vv", 0x80000000, 0x80000000, 0x00000000);
+  test_alu_w_vv("vmul.w.vv", 0x80000000, 0x80000001, 0x80000000);
+  test_alu_w_vv("vmul.w.vv", 0xedcba987, 0x12345678, 0xcfd6d148);
+  test_alu_w_vv("vmul.w.vv", 0xedcba987, 0x89abcdef, 0x94116009);
+  test_alu_w_vv("vmul.w.vv", 0xcba98765, 0x00000007, 0x91a2b3c3);
+  test_alu_w_vv("vmul.w.vv", 0xcba98765, 0x98765432, 0xc81795ba);
+  test_alu_w_vv("vmul.w.vv", 0xcba98765, 0xdef34567, 0xbd92b2a3);
+
+  test_alu_b_vv("vmulh.b.vv", 0x00, 0x00, 0x00);
+  test_alu_b_vv("vmulh.b.vv", 0x55, 0x00, 0x00);
+  test_alu_b_vv("vmulh.b.vv", 0x02, 0x03, 0x00);
+  test_alu_b_vv("vmulh.b.vv", 0x12, 0x06, 0x00);
+  test_alu_b_vv("vmulh.b.vv", 0x12, 0x09, 0x00);
+  test_alu_b_vv("vmulh.b.vv", 0x55, 0x03, 0x00);
+  test_alu_b_vv("vmulh.b.vv", 0x55, 0x05, 0x01);
+  test_alu_b_vv("vmulh.b.vv", 0x54, 0x32, 0x10);
+  test_alu_b_vv("vmulh.b.vv", 0xed, 0x23, 0xfd);
+  test_alu_b_vv("vmulh.b.vv", 0x54, 0x89, 0xd8);
+  test_alu_b_vv("vmulh.b.vv", 0x80, 0x7f, 0xc0);
+  test_alu_b_vv("vmulh.b.vv", 0x80, 0x80, 0x40);
+  test_alu_b_vv("vmulh.b.vv", 0x80, 0x81, 0x3f);
+  test_alu_b_vv("vmulh.b.vv", 0xcb, 0x07, 0xfe);
+  test_alu_b_vv("vmulh.b.vv", 0xcb, 0x98, 0x15);
+  test_alu_b_vv("vmulh.b.vv", 0xcb, 0xde, 0x07);
+  test_alu_h_vv("vmulh.h.vv", 0x0000, 0x0000, 0x0000);
+  test_alu_h_vv("vmulh.h.vv", 0x5555, 0x0000, 0x0000);
+  test_alu_h_vv("vmulh.h.vv", 0x0002, 0x0003, 0x0000);
+  test_alu_h_vv("vmulh.h.vv", 0x1234, 0x0006, 0x0000);
+  test_alu_h_vv("vmulh.h.vv", 0x1234, 0x0009, 0x0000);
+  test_alu_h_vv("vmulh.h.vv", 0x5555, 0x0003, 0x0000);
+  test_alu_h_vv("vmulh.h.vv", 0x5555, 0x0005, 0x0001);
+  test_alu_h_vv("vmulh.h.vv", 0x5432, 0x1234, 0x05fc);
+  test_alu_h_vv("vmulh.h.vv", 0x5432, 0x89ab, 0xd914);
+  test_alu_h_vv("vmulh.h.vv", 0x8000, 0x7fff, 0xc000);
+  test_alu_h_vv("vmulh.h.vv", 0x8000, 0x8000, 0x4000);
+  test_alu_h_vv("vmulh.h.vv", 0x8000, 0x8001, 0x3fff);
+  test_alu_h_vv("vmulh.h.vv", 0xedcb, 0x1234, 0xfeb4);
+  test_alu_h_vv("vmulh.h.vv", 0xedcb, 0x89ab, 0x086a);
+  test_alu_h_vv("vmulh.h.vv", 0xcba9, 0x0007, 0xfffe);
+  test_alu_h_vv("vmulh.h.vv", 0xcb98, 0x9876, 0x1532);
+  test_alu_h_vv("vmulh.h.vv", 0xcb98, 0xdef3, 0x06c4);
+  test_alu_w_vv("vmulh.w.vv", 0x00000000, 0x00000000, 0x00000000);
+  test_alu_w_vv("vmulh.w.vv", 0x55555555, 0x00000000, 0x00000000);
+  test_alu_w_vv("vmulh.w.vv", 0x00000002, 0x00000003, 0x00000000);
+  test_alu_w_vv("vmulh.w.vv", 0x12345678, 0x00000006, 0x00000000);
+  test_alu_w_vv("vmulh.w.vv", 0x12345678, 0x00000009, 0x00000000);
+  test_alu_w_vv("vmulh.w.vv", 0x55555555, 0x00000003, 0x00000000);
+  test_alu_w_vv("vmulh.w.vv", 0x55555555, 0x00000005, 0x00000001);
+  test_alu_w_vv("vmulh.w.vv", 0x23456789, 0x02305670, 0x004d33bb);
+  test_alu_w_vv("vmulh.w.vv", 0x543210fe, 0x12345678, 0x05fcbbcd);
+  test_alu_w_vv("vmulh.w.vv", 0x543210fe, 0x89abcdef, 0xd9153b45);
+  test_alu_w_vv("vmulh.w.vv", 0x80000000, 0x7fffffff, 0xc0000000);
+  test_alu_w_vv("vmulh.w.vv", 0x80000000, 0x80000000, 0x40000000);
+  test_alu_w_vv("vmulh.w.vv", 0x80000000, 0x80000001, 0x3fffffff);
+  test_alu_w_vv("vmulh.w.vv", 0xedcba987, 0x12345678, 0xfeb49923);
+  test_alu_w_vv("vmulh.w.vv", 0xedcba987, 0x89abcdef, 0x086a1c97);
+  test_alu_w_vv("vmulh.w.vv", 0xcba98765, 0x00000007, 0xfffffffe);
+  test_alu_w_vv("vmulh.w.vv", 0xcba98765, 0x98765432, 0x152aefec);
+  test_alu_w_vv("vmulh.w.vv", 0xcba98765, 0xdef34567, 0x06c1bfbf);
+
+  test_alu_b_vv("vmulh.b.r.vv", 0x00, 0x00, 0x00);
+  test_alu_b_vv("vmulh.b.r.vv", 0x55, 0x00, 0x00);
+  test_alu_b_vv("vmulh.b.r.vv", 0x02, 0x03, 0x00);
+  test_alu_b_vv("vmulh.b.r.vv", 0x12, 0x06, 0x00);
+  test_alu_b_vv("vmulh.b.r.vv", 0x12, 0x09, 0x01);
+  test_alu_b_vv("vmulh.b.r.vv", 0x55, 0x03, 0x01);
+  test_alu_b_vv("vmulh.b.r.vv", 0x55, 0x05, 0x02);
+  test_alu_b_vv("vmulh.b.r.vv", 0x54, 0x32, 0x10);
+  test_alu_b_vv("vmulh.b.r.vv", 0x80, 0x7f, 0xc1);
+  test_alu_b_vv("vmulh.b.r.vv", 0x80, 0x80, 0x40);
+  test_alu_b_vv("vmulh.b.r.vv", 0x80, 0x81, 0x40);
+  test_alu_b_vv("vmulh.b.r.vv", 0xed, 0x23, 0xfd);
+  test_alu_b_vv("vmulh.b.r.vv", 0x54, 0x89, 0xd9);
+  test_alu_b_vv("vmulh.b.r.vv", 0xcb, 0x07, 0xff);
+  test_alu_b_vv("vmulh.b.r.vv", 0xcb, 0x98, 0x16);
+  test_alu_b_vv("vmulh.b.r.vv", 0xcb, 0xde, 0x07);
+  test_alu_h_vv("vmulh.h.r.vv", 0x0000, 0x0000, 0x0000);
+  test_alu_h_vv("vmulh.h.r.vv", 0x5555, 0x0000, 0x0000);
+  test_alu_h_vv("vmulh.h.r.vv", 0x0002, 0x0003, 0x0000);
+  test_alu_h_vv("vmulh.h.r.vv", 0x1234, 0x0006, 0x0000);
+  test_alu_h_vv("vmulh.h.r.vv", 0x1234, 0x0009, 0x0001);
+  test_alu_h_vv("vmulh.h.r.vv", 0x5555, 0x0003, 0x0001);
+  test_alu_h_vv("vmulh.h.r.vv", 0x5555, 0x0005, 0x0002);
+  test_alu_h_vv("vmulh.h.r.vv", 0x5432, 0x1234, 0x05fd);
+  test_alu_h_vv("vmulh.h.r.vv", 0x5432, 0x89ab, 0xd915);
+  test_alu_h_vv("vmulh.h.r.vv", 0x8000, 0x7fff, 0xc001);
+  test_alu_h_vv("vmulh.h.r.vv", 0x8000, 0x8000, 0x4000);
+  test_alu_h_vv("vmulh.h.r.vv", 0x8000, 0x8001, 0x4000);
+  test_alu_h_vv("vmulh.h.r.vv", 0xedcb, 0x1234, 0xfeb5);
+  test_alu_h_vv("vmulh.h.r.vv", 0xedcb, 0x89ab, 0x086a);
+  test_alu_h_vv("vmulh.h.r.vv", 0xcba9, 0x0007, 0xffff);
+  test_alu_h_vv("vmulh.h.r.vv", 0xcb98, 0x9876, 0x1532);
+  test_alu_h_vv("vmulh.h.r.vv", 0xcb98, 0xdef3, 0x06c4);
+  test_alu_w_vv("vmulh.w.r.vv", 0x00000000, 0x00000000, 0x00000000);
+  test_alu_w_vv("vmulh.w.r.vv", 0x55555555, 0x00000000, 0x00000000);
+  test_alu_w_vv("vmulh.w.r.vv", 0x00000002, 0x00000003, 0x00000000);
+  test_alu_w_vv("vmulh.w.r.vv", 0x12345678, 0x00000006, 0x00000000);
+  test_alu_w_vv("vmulh.w.r.vv", 0x12345678, 0x00000009, 0x00000001);
+  test_alu_w_vv("vmulh.w.r.vv", 0x55555555, 0x00000003, 0x00000001);
+  test_alu_w_vv("vmulh.w.r.vv", 0x55555555, 0x00000005, 0x00000002);
+  test_alu_w_vv("vmulh.w.r.vv", 0x23456789, 0x02305670, 0x004d33bb);
+  test_alu_w_vv("vmulh.w.r.vv", 0x543210fe, 0x12345678, 0x05fcbbce);
+  test_alu_w_vv("vmulh.w.r.vv", 0x543210fe, 0x89abcdef, 0xd9153b46);
+  test_alu_w_vv("vmulh.w.r.vv", 0x80000000, 0x7fffffff, 0xc0000001);
+  test_alu_w_vv("vmulh.w.r.vv", 0x80000000, 0x80000000, 0x40000000);
+  test_alu_w_vv("vmulh.w.r.vv", 0x80000000, 0x80000001, 0x40000000);
+  test_alu_w_vv("vmulh.w.r.vv", 0xedcba987, 0x12345678, 0xfeb49924);
+  test_alu_w_vv("vmulh.w.r.vv", 0xedcba987, 0x89abcdef, 0x086a1c98);
+  test_alu_w_vv("vmulh.w.r.vv", 0xcba98765, 0x00000007, 0xffffffff);
+  test_alu_w_vv("vmulh.w.r.vv", 0xcba98765, 0x98765432, 0x152aefed);
+  test_alu_w_vv("vmulh.w.r.vv", 0xcba98765, 0xdef34567, 0x06c1bfc0);
+
+  test_alu_b_vv("vmulhu.b.vv", 0x00, 0x00, 0x00);
+  test_alu_b_vv("vmulhu.b.vv", 0x55, 0x00, 0x00);
+  test_alu_b_vv("vmulhu.b.vv", 0x02, 0x03, 0x00);
+  test_alu_b_vv("vmulhu.b.vv", 0x12, 0x06, 0x00);
+  test_alu_b_vv("vmulhu.b.vv", 0x12, 0x09, 0x00);
+  test_alu_b_vv("vmulhu.b.vv", 0x55, 0x03, 0x00);
+  test_alu_b_vv("vmulhu.b.vv", 0x55, 0x05, 0x01);
+  test_alu_b_vv("vmulhu.b.vv", 0x54, 0x32, 0x10);
+  test_alu_b_vv("vmulhu.b.vv", 0x80, 0x7f, 0x3f);
+  test_alu_b_vv("vmulhu.b.vv", 0x80, 0x80, 0x40);
+  test_alu_b_vv("vmulhu.b.vv", 0x80, 0x81, 0x40);
+  test_alu_b_vv("vmulhu.b.vv", 0xed, 0x23, 0x20);
+  test_alu_b_vv("vmulhu.b.vv", 0x54, 0x89, 0x2c);
+  test_alu_b_vv("vmulhu.b.vv", 0xcb, 0x07, 0x05);
+  test_alu_b_vv("vmulhu.b.vv", 0xcb, 0x98, 0x78);
+  test_alu_b_vv("vmulhu.b.vv", 0xcb, 0xde, 0xb0);
+  test_alu_h_vv("vmulhu.h.vv", 0x0000, 0x0000, 0x0000);
+  test_alu_h_vv("vmulhu.h.vv", 0x5555, 0x0000, 0x0000);
+  test_alu_h_vv("vmulhu.h.vv", 0x0002, 0x0003, 0x0000);
+  test_alu_h_vv("vmulhu.h.vv", 0x1234, 0x0006, 0x0000);
+  test_alu_h_vv("vmulhu.h.vv", 0x1234, 0x0009, 0x0000);
+  test_alu_h_vv("vmulhu.h.vv", 0x5555, 0x0003, 0x0000);
+  test_alu_h_vv("vmulhu.h.vv", 0x5555, 0x0005, 0x0001);
+  test_alu_h_vv("vmulhu.h.vv", 0x5432, 0x1234, 0x05fc);
+  test_alu_h_vv("vmulhu.h.vv", 0x5432, 0x89ab, 0x2d46);
+  test_alu_h_vv("vmulhu.h.vv", 0x8000, 0x7fff, 0x3fff);
+  test_alu_h_vv("vmulhu.h.vv", 0x8000, 0x8000, 0x4000);
+  test_alu_h_vv("vmulhu.h.vv", 0x8000, 0x8001, 0x4000);
+  test_alu_h_vv("vmulhu.h.vv", 0xedcb, 0x1234, 0x10e8);
+  test_alu_h_vv("vmulhu.h.vv", 0xedcb, 0x89ab, 0x7fe0);
+  test_alu_h_vv("vmulhu.h.vv", 0xcba9, 0x0007, 0x0005);
+  test_alu_h_vv("vmulhu.h.vv", 0xcb98, 0x9876, 0x7940);
+  test_alu_h_vv("vmulhu.h.vv", 0xcb98, 0xdef3, 0xb14f);
+  test_alu_w_vv("vmulhu.w.vv", 0x00000000, 0x00000000, 0x00000000);
+  test_alu_w_vv("vmulhu.w.vv", 0x55555555, 0x00000000, 0x00000000);
+  test_alu_w_vv("vmulhu.w.vv", 0x00000002, 0x00000003, 0x00000000);
+  test_alu_w_vv("vmulhu.w.vv", 0x12345678, 0x00000006, 0x00000000);
+  test_alu_w_vv("vmulhu.w.vv", 0x12345678, 0x00000009, 0x00000000);
+  test_alu_w_vv("vmulhu.w.vv", 0x55555555, 0x00000003, 0x00000000);
+  test_alu_w_vv("vmulhu.w.vv", 0x55555555, 0x00000005, 0x00000001);
+  test_alu_w_vv("vmulhu.w.vv", 0x23456789, 0x02305670, 0x004d33bb);
+  test_alu_w_vv("vmulhu.w.vv", 0x543210fe, 0x12345678, 0x05fcbbcd);
+  test_alu_w_vv("vmulhu.w.vv", 0x543210fe, 0x89abcdef, 0x2d474c43);
+  test_alu_w_vv("vmulhu.w.vv", 0x80000000, 0x7fffffff, 0x3fffffff);
+  test_alu_w_vv("vmulhu.w.vv", 0x80000000, 0x80000000, 0x40000000);
+  test_alu_w_vv("vmulhu.w.vv", 0x80000000, 0x80000001, 0x40000000);
+  test_alu_w_vv("vmulhu.w.vv", 0xedcba987, 0x12345678, 0x10e8ef9b);
+  test_alu_w_vv("vmulhu.w.vv", 0xedcba987, 0x89abcdef, 0x7fe1940d);
+  test_alu_w_vv("vmulhu.w.vv", 0xcba98765, 0x00000007, 0x00000005);
+  test_alu_w_vv("vmulhu.w.vv", 0xcba98765, 0x98765432, 0x794acb83);
+  test_alu_w_vv("vmulhu.w.vv", 0xcba98765, 0xdef34567, 0xb15e8c8b);
+
+  test_alu_b_vv("vmulhu.b.r.vv", 0x00, 0x00, 0x00);
+  test_alu_b_vv("vmulhu.b.r.vv", 0x55, 0x00, 0x00);
+  test_alu_b_vv("vmulhu.b.r.vv", 0x02, 0x03, 0x00);
+  test_alu_b_vv("vmulhu.b.r.vv", 0x12, 0x06, 0x00);
+  test_alu_b_vv("vmulhu.b.r.vv", 0x12, 0x09, 0x01);
+  test_alu_b_vv("vmulhu.b.r.vv", 0x55, 0x03, 0x01);
+  test_alu_b_vv("vmulhu.b.r.vv", 0x55, 0x05, 0x02);
+  test_alu_b_vv("vmulhu.b.r.vv", 0x54, 0x32, 0x10);
+  test_alu_b_vv("vmulhu.b.r.vv", 0xed, 0x23, 0x20);
+  test_alu_b_vv("vmulhu.b.r.vv", 0x54, 0x89, 0x2d);
+  test_alu_b_vv("vmulhu.b.r.vv", 0x80, 0x7f, 0x40);
+  test_alu_b_vv("vmulhu.b.r.vv", 0x80, 0x80, 0x40);
+  test_alu_b_vv("vmulhu.b.r.vv", 0x80, 0x81, 0x41);
+  test_alu_b_vv("vmulhu.b.r.vv", 0xcb, 0x07, 0x06);
+  test_alu_b_vv("vmulhu.b.r.vv", 0xcb, 0x98, 0x79);
+  test_alu_b_vv("vmulhu.b.r.vv", 0xcb, 0xde, 0xb0);
+  test_alu_h_vv("vmulhu.h.r.vv", 0x0000, 0x0000, 0x0000);
+  test_alu_h_vv("vmulhu.h.r.vv", 0x5555, 0x0000, 0x0000);
+  test_alu_h_vv("vmulhu.h.r.vv", 0x0002, 0x0003, 0x0000);
+  test_alu_h_vv("vmulhu.h.r.vv", 0x1234, 0x0006, 0x0000);
+  test_alu_h_vv("vmulhu.h.r.vv", 0x1234, 0x0009, 0x0001);
+  test_alu_h_vv("vmulhu.h.r.vv", 0x5555, 0x0003, 0x0001);
+  test_alu_h_vv("vmulhu.h.r.vv", 0x5555, 0x0005, 0x0002);
+  test_alu_h_vv("vmulhu.h.r.vv", 0x5432, 0x1234, 0x05fd);
+  test_alu_h_vv("vmulhu.h.r.vv", 0x5432, 0x89ab, 0x2d47);
+  test_alu_h_vv("vmulhu.h.r.vv", 0x8000, 0x7fff, 0x4000);
+  test_alu_h_vv("vmulhu.h.r.vv", 0x8000, 0x8000, 0x4000);
+  test_alu_h_vv("vmulhu.h.r.vv", 0x8000, 0x8001, 0x4001);
+  test_alu_h_vv("vmulhu.h.r.vv", 0xedcb, 0x1234, 0x10e9);
+  test_alu_h_vv("vmulhu.h.r.vv", 0xedcb, 0x89ab, 0x7fe0);
+  test_alu_h_vv("vmulhu.h.r.vv", 0xcba9, 0x0007, 0x0006);
+  test_alu_h_vv("vmulhu.h.r.vv", 0xcb98, 0x9876, 0x7940);
+  test_alu_h_vv("vmulhu.h.r.vv", 0xcb98, 0xdef3, 0xb14f);
+  test_alu_w_vv("vmulhu.w.r.vv", 0x00000000, 0x00000000, 0x00000000);
+  test_alu_w_vv("vmulhu.w.r.vv", 0x55555555, 0x00000000, 0x00000000);
+  test_alu_w_vv("vmulhu.w.r.vv", 0x00000002, 0x00000003, 0x00000000);
+  test_alu_w_vv("vmulhu.w.r.vv", 0x12345678, 0x00000006, 0x00000000);
+  test_alu_w_vv("vmulhu.w.r.vv", 0x12345678, 0x00000009, 0x00000001);
+  test_alu_w_vv("vmulhu.w.r.vv", 0x55555555, 0x00000003, 0x00000001);
+  test_alu_w_vv("vmulhu.w.r.vv", 0x55555555, 0x00000005, 0x00000002);
+  test_alu_w_vv("vmulhu.w.r.vv", 0x23456789, 0x02305670, 0x004d33bb);
+  test_alu_w_vv("vmulhu.w.r.vv", 0x543210fe, 0x12345678, 0x05fcbbce);
+  test_alu_w_vv("vmulhu.w.r.vv", 0x543210fe, 0x89abcdef, 0x2d474c44);
+  test_alu_w_vv("vmulhu.w.r.vv", 0x80000000, 0x7fffffff, 0x40000000);
+  test_alu_w_vv("vmulhu.w.r.vv", 0x80000000, 0x80000000, 0x40000000);
+  test_alu_w_vv("vmulhu.w.r.vv", 0x80000000, 0x80000001, 0x40000001);
+  test_alu_w_vv("vmulhu.w.r.vv", 0xedcba987, 0x12345678, 0x10e8ef9c);
+  test_alu_w_vv("vmulhu.w.r.vv", 0xedcba987, 0x89abcdef, 0x7fe1940e);
+  test_alu_w_vv("vmulhu.w.r.vv", 0xcba98765, 0x00000007, 0x00000006);
+  test_alu_w_vv("vmulhu.w.r.vv", 0xcba98765, 0x98765432, 0x794acb84);
+  test_alu_w_vv("vmulhu.w.r.vv", 0xcba98765, 0xdef34567, 0xb15e8c8c);
+
+  test_alu_b_vv("vmuls.b.vv", 0x00, 0x00, 0x00);
+  test_alu_b_vv("vmuls.b.vv", 0x55, 0x00, 0x00);
+  test_alu_b_vv("vmuls.b.vv", 0x02, 0x03, 0x06);
+  test_alu_b_vv("vmuls.b.vv", 0x12, 0x06, 0x6c);
+  test_alu_b_vv("vmuls.b.vv", 0x12, 0x09, 0x7f);
+  test_alu_b_vv("vmuls.b.vv", 0x55, 0x03, 0x7f);
+  test_alu_b_vv("vmuls.b.vv", 0x55, 0x05, 0x7f);
+  test_alu_b_vv("vmuls.b.vv", 0x54, 0x32, 0x7f);
+  test_alu_b_vv("vmuls.b.vv", 0xed, 0x23, 0x80);
+  test_alu_b_vv("vmuls.b.vv", 0x54, 0x89, 0x80);
+  test_alu_b_vv("vmuls.b.vv", 0x80, 0x7f, 0x80);
+  test_alu_b_vv("vmuls.b.vv", 0x80, 0x80, 0x7f);
+  test_alu_b_vv("vmuls.b.vv", 0x80, 0x81, 0x7f);
+  test_alu_b_vv("vmuls.b.vv", 0xcb, 0x07, 0x80);
+  test_alu_b_vv("vmuls.b.vv", 0xcb, 0x98, 0x7f);
+  test_alu_b_vv("vmuls.b.vv", 0xcb, 0xde, 0x7f);
+  test_alu_h_vv("vmuls.h.vv", 0x0000, 0x0000, 0x0000);
+  test_alu_h_vv("vmuls.h.vv", 0x5555, 0x0000, 0x0000);
+  test_alu_h_vv("vmuls.h.vv", 0x0002, 0x0003, 0x0006);
+  test_alu_h_vv("vmuls.h.vv", 0x1234, 0x0006, 0x6d38);
+  test_alu_h_vv("vmuls.h.vv", 0x1234, 0x0009, 0x7fff);
+  test_alu_h_vv("vmuls.h.vv", 0x5555, 0x0003, 0x7fff);
+  test_alu_h_vv("vmuls.h.vv", 0x5555, 0x0005, 0x7fff);
+  test_alu_h_vv("vmuls.h.vv", 0x5432, 0x1234, 0x7fff);
+  test_alu_h_vv("vmuls.h.vv", 0x5432, 0x89ab, 0x8000);
+  test_alu_h_vv("vmuls.h.vv", 0x8000, 0x7fff, 0x8000);
+  test_alu_h_vv("vmuls.h.vv", 0x8000, 0x8000, 0x7fff);
+  test_alu_h_vv("vmuls.h.vv", 0x8000, 0x8001, 0x7fff);
+  test_alu_h_vv("vmuls.h.vv", 0xedcb, 0x1234, 0x8000);
+  test_alu_h_vv("vmuls.h.vv", 0xedcb, 0x89ab, 0x7fff);
+  test_alu_h_vv("vmuls.h.vv", 0xcba9, 0x0007, 0x8000);
+  test_alu_h_vv("vmuls.h.vv", 0xcb98, 0x9876, 0x7fff);
+  test_alu_h_vv("vmuls.h.vv", 0xcb98, 0xdef3, 0x7fff);
+  test_alu_w_vv("vmuls.w.vv", 0x00000000, 0x00000000, 0x00000000);
+  test_alu_w_vv("vmuls.w.vv", 0x55555555, 0x00000000, 0x00000000);
+  test_alu_w_vv("vmuls.w.vv", 0x00000002, 0x00000003, 0x00000006);
+  test_alu_w_vv("vmuls.w.vv", 0x12345678, 0x00000006, 0x6d3a06d0);
+  test_alu_w_vv("vmuls.w.vv", 0x12345678, 0x00000009, 0x7fffffff);
+  test_alu_w_vv("vmuls.w.vv", 0x55555555, 0x00000003, 0x7fffffff);
+  test_alu_w_vv("vmuls.w.vv", 0x55555555, 0x00000005, 0x7fffffff);
+  test_alu_w_vv("vmuls.w.vv", 0x23456789, 0x02305670, 0x7fffffff);
+  test_alu_w_vv("vmuls.w.vv", 0x543210fe, 0x12345678, 0x7fffffff);
+  test_alu_w_vv("vmuls.w.vv", 0x543210fe, 0x89abcdef, 0x80000000);
+  test_alu_w_vv("vmuls.w.vv", 0x80000000, 0x7fffffff, 0x80000000);
+  test_alu_w_vv("vmuls.w.vv", 0x80000000, 0x80000000, 0x7fffffff);
+  test_alu_w_vv("vmuls.w.vv", 0x80000000, 0x80000001, 0x7fffffff);
+  test_alu_w_vv("vmuls.w.vv", 0xedcba987, 0x12345678, 0x80000000);
+  test_alu_w_vv("vmuls.w.vv", 0xedcba987, 0x89abcdef, 0x7fffffff);
+  test_alu_w_vv("vmuls.w.vv", 0xcba98765, 0x00000007, 0x80000000);
+  test_alu_w_vv("vmuls.w.vv", 0xcba98765, 0x98765432, 0x7fffffff);
+  test_alu_w_vv("vmuls.w.vv", 0xcba98765, 0xdef34567, 0x7fffffff);
+
+  test_alu_b_vv("vmuls.b.u.vv", 0x00, 0x00, 0x00);
+  test_alu_b_vv("vmuls.b.u.vv", 0x55, 0x00, 0x00);
+  test_alu_b_vv("vmuls.b.u.vv", 0x02, 0x03, 0x06);
+  test_alu_b_vv("vmuls.b.u.vv", 0x12, 0x06, 0x6c);
+  test_alu_b_vv("vmuls.b.u.vv", 0x12, 0x09, 0xa2);
+  test_alu_b_vv("vmuls.b.u.vv", 0x55, 0x03, 0xff);
+  test_alu_b_vv("vmuls.b.u.vv", 0x55, 0x05, 0xff);
+  test_alu_b_vv("vmuls.b.u.vv", 0x54, 0x32, 0xff);
+  test_alu_b_vv("vmuls.b.u.vv", 0xed, 0x23, 0xff);
+  test_alu_b_vv("vmuls.b.u.vv", 0x54, 0x89, 0xff);
+  test_alu_b_vv("vmuls.b.u.vv", 0x80, 0x7f, 0xff);
+  test_alu_b_vv("vmuls.b.u.vv", 0x80, 0x80, 0xff);
+  test_alu_b_vv("vmuls.b.u.vv", 0x80, 0x81, 0xff);
+  test_alu_b_vv("vmuls.b.u.vv", 0xcb, 0x07, 0xff);
+  test_alu_b_vv("vmuls.b.u.vv", 0xcb, 0x98, 0xff);
+  test_alu_b_vv("vmuls.b.u.vv", 0xcb, 0xde, 0xff);
+  test_alu_h_vv("vmuls.h.u.vv", 0x0000, 0x0000, 0x0000);
+  test_alu_h_vv("vmuls.h.u.vv", 0x5555, 0x0000, 0x0000);
+  test_alu_h_vv("vmuls.h.u.vv", 0x0002, 0x0003, 0x0006);
+  test_alu_h_vv("vmuls.h.u.vv", 0x1234, 0x0006, 0x6d38);
+  test_alu_h_vv("vmuls.h.u.vv", 0x1234, 0x0009, 0xa3d4);
+  test_alu_h_vv("vmuls.h.u.vv", 0x5555, 0x0003, 0xffff);
+  test_alu_h_vv("vmuls.h.u.vv", 0x5555, 0x0005, 0xffff);
+  test_alu_h_vv("vmuls.h.u.vv", 0x5432, 0x1234, 0xffff);
+  test_alu_h_vv("vmuls.h.u.vv", 0x5432, 0x89ab, 0xffff);
+  test_alu_h_vv("vmuls.h.u.vv", 0x8000, 0x7fff, 0xffff);
+  test_alu_h_vv("vmuls.h.u.vv", 0x8000, 0x8000, 0xffff);
+  test_alu_h_vv("vmuls.h.u.vv", 0x8000, 0x8001, 0xffff);
+  test_alu_h_vv("vmuls.h.u.vv", 0xedcb, 0x1234, 0xffff);
+  test_alu_h_vv("vmuls.h.u.vv", 0xedcb, 0x89ab, 0xffff);
+  test_alu_h_vv("vmuls.h.u.vv", 0xcba9, 0x0007, 0xffff);
+  test_alu_h_vv("vmuls.h.u.vv", 0xcb98, 0x9876, 0xffff);
+  test_alu_h_vv("vmuls.h.u.vv", 0xcb98, 0xdef3, 0xffff);
+  test_alu_w_vv("vmuls.w.u.vv", 0x00000000, 0x00000000, 0x00000000);
+  test_alu_w_vv("vmuls.w.u.vv", 0x55555555, 0x00000000, 0x00000000);
+  test_alu_w_vv("vmuls.w.u.vv", 0x00000002, 0x00000003, 0x00000006);
+  test_alu_w_vv("vmuls.w.u.vv", 0x12345678, 0x00000006, 0x6d3a06d0);
+  test_alu_w_vv("vmuls.w.u.vv", 0x12345678, 0x00000009, 0xa3d70a38);
+  test_alu_w_vv("vmuls.w.u.vv", 0x55555555, 0x00000003, 0xffffffff);
+  test_alu_w_vv("vmuls.w.u.vv", 0x55555555, 0x00000005, 0xffffffff);
+  test_alu_w_vv("vmuls.w.u.vv", 0x23456789, 0x02305670, 0xffffffff);
+  test_alu_w_vv("vmuls.w.u.vv", 0x543210fe, 0x12345678, 0xffffffff);
+  test_alu_w_vv("vmuls.w.u.vv", 0x543210fe, 0x89abcdef, 0xffffffff);
+  test_alu_w_vv("vmuls.w.u.vv", 0x80000000, 0x7fffffff, 0xffffffff);
+  test_alu_w_vv("vmuls.w.u.vv", 0x80000000, 0x80000000, 0xffffffff);
+  test_alu_w_vv("vmuls.w.u.vv", 0x80000000, 0x80000001, 0xffffffff);
+  test_alu_w_vv("vmuls.w.u.vv", 0xedcba987, 0x12345678, 0xffffffff);
+  test_alu_w_vv("vmuls.w.u.vv", 0xedcba987, 0x89abcdef, 0xffffffff);
+  test_alu_w_vv("vmuls.w.u.vv", 0xcba98765, 0x00000007, 0xffffffff);
+  test_alu_w_vv("vmuls.w.u.vv", 0xcba98765, 0x98765432, 0xffffffff);
+  test_alu_w_vv("vmuls.w.u.vv", 0xcba98765, 0xdef34567, 0xffffffff);
+
+  test_aluw_h_vv("vmulw.h.vv", 0x00, 0x00, 0x0000);
+  test_aluw_h_vv("vmulw.h.vv", 0x55, 0x00, 0x0000);
+  test_aluw_h_vv("vmulw.h.vv", 0x02, 0x03, 0x0006);
+  test_aluw_h_vv("vmulw.h.vv", 0x12, 0x06, 0x006c);
+  test_aluw_h_vv("vmulw.h.vv", 0x12, 0x09, 0x00a2);
+  test_aluw_h_vv("vmulw.h.vv", 0x55, 0x03, 0x00ff);
+  test_aluw_h_vv("vmulw.h.vv", 0x55, 0x05, 0x01a9);
+  test_aluw_h_vv("vmulw.h.vv", 0x54, 0x32, 0x1068);
+  test_aluw_h_vv("vmulw.h.vv", 0xed, 0x23, 0xfd67);
+  test_aluw_h_vv("vmulw.h.vv", 0x54, 0x89, 0xd8f4);
+  test_aluw_h_vv("vmulw.h.vv", 0x80, 0x7f, 0xc080);
+  test_aluw_h_vv("vmulw.h.vv", 0x80, 0x80, 0x4000);
+  test_aluw_h_vv("vmulw.h.vv", 0x80, 0x81, 0x3f80);
+  test_aluw_h_vv("vmulw.h.vv", 0xcb, 0x07, 0xfe8d);
+  test_aluw_h_vv("vmulw.h.vv", 0xcb, 0x98, 0x1588);
+  test_aluw_h_vv("vmulw.h.vv", 0xcb, 0xde, 0x070a);
+  test_aluw_w_vv("vmulw.w.vv", 0x0000, 0x0000, 0x00000000);
+  test_aluw_w_vv("vmulw.w.vv", 0x5555, 0x0000, 0x00000000);
+  test_aluw_w_vv("vmulw.w.vv", 0x0002, 0x0003, 0x00000006);
+  test_aluw_w_vv("vmulw.w.vv", 0x1234, 0x0006, 0x00006d38);
+  test_aluw_w_vv("vmulw.w.vv", 0x1234, 0x0009, 0x0000a3d4);
+  test_aluw_w_vv("vmulw.w.vv", 0x5555, 0x0003, 0x0000ffff);
+  test_aluw_w_vv("vmulw.w.vv", 0x5555, 0x0005, 0x0001aaa9);
+  test_aluw_w_vv("vmulw.w.vv", 0x5432, 0x1234, 0x05fc9e28);
+  test_aluw_w_vv("vmulw.w.vv", 0x5432, 0x89ab, 0xd914ff66);
+  test_aluw_w_vv("vmulw.w.vv", 0x8000, 0x7fff, 0xc0008000);
+  test_aluw_w_vv("vmulw.w.vv", 0x8000, 0x8000, 0x40000000);
+  test_aluw_w_vv("vmulw.w.vv", 0x8000, 0x8001, 0x3fff8000);
+  test_aluw_w_vv("vmulw.w.vv", 0xedcb, 0x1234, 0xfeb4933c);
+  test_aluw_w_vv("vmulw.w.vv", 0xedcb, 0x89ab, 0x086a7999);
+  test_aluw_w_vv("vmulw.w.vv", 0xcba9, 0x0007, 0xfffe919f);
+  test_aluw_w_vv("vmulw.w.vv", 0xcb98, 0x9876, 0x15321810);
+  test_aluw_w_vv("vmulw.w.vv", 0xcb98, 0xdef3, 0x06c41148);
+
+  test_aluw_h_vv("vmulw.h.u.vv", 0x00, 0x00, 0x0000);
+  test_aluw_h_vv("vmulw.h.u.vv", 0x55, 0x00, 0x0000);
+  test_aluw_h_vv("vmulw.h.u.vv", 0x02, 0x03, 0x0006);
+  test_aluw_h_vv("vmulw.h.u.vv", 0x12, 0x06, 0x006c);
+  test_aluw_h_vv("vmulw.h.u.vv", 0x12, 0x09, 0x00a2);
+  test_aluw_h_vv("vmulw.h.u.vv", 0x55, 0x03, 0x00ff);
+  test_aluw_h_vv("vmulw.h.u.vv", 0x55, 0x05, 0x01a9);
+  test_aluw_h_vv("vmulw.h.u.vv", 0x54, 0x32, 0x1068);
+  test_aluw_h_vv("vmulw.h.u.vv", 0xed, 0x23, 0x2067);
+  test_aluw_h_vv("vmulw.h.u.vv", 0x54, 0x89, 0x2cf4);
+  test_aluw_h_vv("vmulw.h.u.vv", 0x80, 0x7f, 0x3f80);
+  test_aluw_h_vv("vmulw.h.u.vv", 0x80, 0x80, 0x4000);
+  test_aluw_h_vv("vmulw.h.u.vv", 0x80, 0x81, 0x4080);
+  test_aluw_h_vv("vmulw.h.u.vv", 0xcb, 0x07, 0x058d);
+  test_aluw_h_vv("vmulw.h.u.vv", 0xcb, 0x98, 0x7888);
+  test_aluw_h_vv("vmulw.h.u.vv", 0xcb, 0xde, 0xb00a);
+  test_aluw_w_vv("vmulw.w.u.vv", 0x0000, 0x0000, 0x00000000);
+  test_aluw_w_vv("vmulw.w.u.vv", 0x5555, 0x0000, 0x00000000);
+  test_aluw_w_vv("vmulw.w.u.vv", 0x0002, 0x0003, 0x00000006);
+  test_aluw_w_vv("vmulw.w.u.vv", 0x1234, 0x0006, 0x00006d38);
+  test_aluw_w_vv("vmulw.w.u.vv", 0x1234, 0x0009, 0x0000a3d4);
+  test_aluw_w_vv("vmulw.w.u.vv", 0x5555, 0x0003, 0x0000ffff);
+  test_aluw_w_vv("vmulw.w.u.vv", 0x5555, 0x0005, 0x0001aaa9);
+  test_aluw_w_vv("vmulw.w.u.vv", 0x5432, 0x1234, 0x05fc9e28);
+  test_aluw_w_vv("vmulw.w.u.vv", 0x5432, 0x89ab, 0x2d46ff66);
+  test_aluw_w_vv("vmulw.w.u.vv", 0x8000, 0x7fff, 0x3fff8000);
+  test_aluw_w_vv("vmulw.w.u.vv", 0x8000, 0x8000, 0x40000000);
+  test_aluw_w_vv("vmulw.w.u.vv", 0x8000, 0x8001, 0x40008000);
+  test_aluw_w_vv("vmulw.w.u.vv", 0xedcb, 0x1234, 0x10e8933c);
+  test_aluw_w_vv("vmulw.w.u.vv", 0xedcb, 0x89ab, 0x7fe07999);
+  test_aluw_w_vv("vmulw.w.u.vv", 0xcba9, 0x0007, 0x0005919f);
+  test_aluw_w_vv("vmulw.w.u.vv", 0xcb98, 0x9876, 0x79401810);
+  test_aluw_w_vv("vmulw.w.u.vv", 0xcb98, 0xdef3, 0xb14f1148);
+
+  test_alu_b_vv("vdmulh.b.vv", 0x00, 0x00, 0x00);
+  test_alu_b_vv("vdmulh.b.vv", 0x55, 0x00, 0x00);
+  test_alu_b_vv("vdmulh.b.vv", 0x02, 0x03, 0x00);
+  test_alu_b_vv("vdmulh.b.vv", 0x12, 0x06, 0x00);
+  test_alu_b_vv("vdmulh.b.vv", 0x12, 0x09, 0x01);
+  test_alu_b_vv("vdmulh.b.vv", 0x55, 0x03, 0x01);
+  test_alu_b_vv("vdmulh.b.vv", 0x55, 0x05, 0x03);
+  test_alu_b_vv("vdmulh.b.vv", 0x54, 0x32, 0x20);
+  test_alu_b_vv("vdmulh.b.vv", 0xed, 0x23, 0xfa);
+  test_alu_b_vv("vdmulh.b.vv", 0x54, 0x89, 0xb1);
+  test_alu_b_vv("vdmulh.b.vv", 0xcb, 0x07, 0xfd);
+  test_alu_b_vv("vdmulh.b.vv", 0xcb, 0x98, 0x2b);
+  test_alu_b_vv("vdmulh.b.vv", 0xcb, 0xde, 0x0e);
+  test_alu_b_vv("vdmulh.b.vv", 0x40, 0x40, 0x20);
+  test_alu_b_vv("vdmulh.b.vv", 0x40, 0x80, 0xc0);
+  test_alu_b_vv("vdmulh.b.vv", 0x80, 0x3f, 0xc1);
+  test_alu_b_vv("vdmulh.b.vv", 0x80, 0x40, 0xc0);
+  test_alu_b_vv("vdmulh.b.vv", 0x80, 0x41, 0xbf);
+  test_alu_b_vv("vdmulh.b.vv", 0x80, 0x7f, 0x81);
+  test_alu_b_vv("vdmulh.b.vv", 0x80, 0x80, 0x7f);
+  test_alu_b_vv("vdmulh.b.vv", 0x80, 0x81, 0x7f);
+  test_alu_b_vv("vdmulh.b.vv", 0xff, 0xff, 0x00);
+  test_alu_h_vv("vdmulh.h.vv", 0x0000, 0x0000, 0x0000);
+  test_alu_h_vv("vdmulh.h.vv", 0x5555, 0x0000, 0x0000);
+  test_alu_h_vv("vdmulh.h.vv", 0x0002, 0x0003, 0x0000);
+  test_alu_h_vv("vdmulh.h.vv", 0x1234, 0x0006, 0x0000);
+  test_alu_h_vv("vdmulh.h.vv", 0x1234, 0x0009, 0x0001);
+  test_alu_h_vv("vdmulh.h.vv", 0x5555, 0x0003, 0x0001);
+  test_alu_h_vv("vdmulh.h.vv", 0x5555, 0x0005, 0x0003);
+  test_alu_h_vv("vdmulh.h.vv", 0x5432, 0x1234, 0x0bf9);
+  test_alu_h_vv("vdmulh.h.vv", 0x5432, 0x89ab, 0xb229);
+  test_alu_h_vv("vdmulh.h.vv", 0xedcb, 0x1234, 0xfd69);
+  test_alu_h_vv("vdmulh.h.vv", 0xedcb, 0x89ab, 0x10d4);
+  test_alu_h_vv("vdmulh.h.vv", 0xcba9, 0x0007, 0xfffd);
+  test_alu_h_vv("vdmulh.h.vv", 0xcb98, 0x9876, 0x2a64);
+  test_alu_h_vv("vdmulh.h.vv", 0xcb98, 0xdef3, 0x0d88);
+  test_alu_h_vv("vdmulh.h.vv", 0x4000, 0x4000, 0x2000);
+  test_alu_h_vv("vdmulh.h.vv", 0x4000, 0x8000, 0xc000);
+  test_alu_h_vv("vdmulh.h.vv", 0x8000, 0x3fff, 0xc001);
+  test_alu_h_vv("vdmulh.h.vv", 0x8000, 0x4000, 0xc000);
+  test_alu_h_vv("vdmulh.h.vv", 0x8000, 0x4001, 0xbfff);
+  test_alu_h_vv("vdmulh.h.vv", 0x8000, 0x7fff, 0x8001);
+  test_alu_h_vv("vdmulh.h.vv", 0x8000, 0x8000, 0x7fff);
+  test_alu_h_vv("vdmulh.h.vv", 0x8000, 0x8001, 0x7fff);
+  test_alu_h_vv("vdmulh.h.vv", 0xffff, 0xffff, 0x0000);
+  test_alu_w_vv("vdmulh.w.vv", 0x00000000, 0x00000000, 0x00000000);
+  test_alu_w_vv("vdmulh.w.vv", 0x55555555, 0x00000000, 0x00000000);
+  test_alu_w_vv("vdmulh.w.vv", 0x00000002, 0x00000003, 0x00000000);
+  test_alu_w_vv("vdmulh.w.vv", 0x12345678, 0x00000006, 0x00000000);
+  test_alu_w_vv("vdmulh.w.vv", 0x12345678, 0x00000009, 0x00000001);
+  test_alu_w_vv("vdmulh.w.vv", 0x55555555, 0x00000003, 0x00000001);
+  test_alu_w_vv("vdmulh.w.vv", 0x55555555, 0x00000005, 0x00000003);
+  test_alu_w_vv("vdmulh.w.vv", 0x23456789, 0x02305670, 0x009a6776);
+  test_alu_w_vv("vdmulh.w.vv", 0x543210fe, 0x12345678, 0x0bf9779b);
+  test_alu_w_vv("vdmulh.w.vv", 0x543210fe, 0x89abcdef, 0xb22a768b);
+  test_alu_w_vv("vdmulh.w.vv", 0xedcba987, 0x12345678, 0xfd693247);
+  test_alu_w_vv("vdmulh.w.vv", 0xedcba987, 0x89abcdef, 0x10d4392f);
+  test_alu_w_vv("vdmulh.w.vv", 0xcba98765, 0x00000007, 0xfffffffd);
+  test_alu_w_vv("vdmulh.w.vv", 0xcba98765, 0x98765432, 0x2a55dfd9);
+  test_alu_w_vv("vdmulh.w.vv", 0xcba98765, 0xdef34567, 0x0d837f7f);
+  test_alu_w_vv("vdmulh.w.vv", 0x40000000, 0x40000000, 0x20000000);
+  test_alu_w_vv("vdmulh.w.vv", 0x40000000, 0x80000000, 0xc0000000);
+  test_alu_w_vv("vdmulh.w.vv", 0x80000000, 0x3fffffff, 0xc0000001);
+  test_alu_w_vv("vdmulh.w.vv", 0x80000000, 0x40000000, 0xc0000000);
+  test_alu_w_vv("vdmulh.w.vv", 0x80000000, 0x40000001, 0xbfffffff);
+  test_alu_w_vv("vdmulh.w.vv", 0x80000000, 0x7fffffff, 0x80000001);
+  test_alu_w_vv("vdmulh.w.vv", 0x80000000, 0x80000000, 0x7fffffff);
+  test_alu_w_vv("vdmulh.w.vv", 0x80000000, 0x80000001, 0x7fffffff);
+  test_alu_w_vv("vdmulh.w.vv", 0xffffffff, 0xffffffff, 0x00000000);
+
+  test_alu_b_vv("vdmulh.b.r.vv", 0x00, 0x00, 0x00);
+  test_alu_b_vv("vdmulh.b.r.vv", 0x55, 0x00, 0x00);
+  test_alu_b_vv("vdmulh.b.r.vv", 0x02, 0x03, 0x00);
+  test_alu_b_vv("vdmulh.b.r.vv", 0x12, 0x06, 0x01);
+  test_alu_b_vv("vdmulh.b.r.vv", 0x12, 0x09, 0x01);
+  test_alu_b_vv("vdmulh.b.r.vv", 0x55, 0x03, 0x02);
+  test_alu_b_vv("vdmulh.b.r.vv", 0x55, 0x05, 0x03);
+  test_alu_b_vv("vdmulh.b.r.vv", 0x54, 0x32, 0x21);
+  test_alu_b_vv("vdmulh.b.r.vv", 0xed, 0x23, 0xfb);
+  test_alu_b_vv("vdmulh.b.r.vv", 0x54, 0x89, 0xb2);
+  test_alu_b_vv("vdmulh.b.r.vv", 0xcb, 0x07, 0xfd);
+  test_alu_b_vv("vdmulh.b.r.vv", 0xcb, 0x98, 0x2b);
+  test_alu_b_vv("vdmulh.b.r.vv", 0xcb, 0xde, 0x0e);
+  test_alu_b_vv("vdmulh.b.r.vv", 0x40, 0x40, 0x20);
+  test_alu_b_vv("vdmulh.b.r.vv", 0x40, 0x80, 0xc0);
+  test_alu_b_vv("vdmulh.b.r.vv", 0x80, 0x3f, 0xc1);
+  test_alu_b_vv("vdmulh.b.r.vv", 0x80, 0x40, 0xc0);
+  test_alu_b_vv("vdmulh.b.r.vv", 0x80, 0x41, 0xbf);
+  test_alu_b_vv("vdmulh.b.r.vv", 0x80, 0x7f, 0x81);
+  test_alu_b_vv("vdmulh.b.r.vv", 0x80, 0x80, 0x7f);
+  test_alu_b_vv("vdmulh.b.r.vv", 0x80, 0x81, 0x7f);
+  test_alu_b_vv("vdmulh.b.r.vv", 0xff, 0xff, 0x00);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x0000, 0x0000, 0x0000);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x5555, 0x0000, 0x0000);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x0002, 0x0003, 0x0000);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x1234, 0x0006, 0x0001);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x1234, 0x0009, 0x0001);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x5555, 0x0003, 0x0002);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x5555, 0x0005, 0x0003);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x5432, 0x1234, 0x0bf9);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x5432, 0x89ab, 0xb22a);
+  test_alu_h_vv("vdmulh.h.r.vv", 0xedcb, 0x1234, 0xfd69);
+  test_alu_h_vv("vdmulh.h.r.vv", 0xedcb, 0x89ab, 0x10d5);
+  test_alu_h_vv("vdmulh.h.r.vv", 0xcba9, 0x0007, 0xfffd);
+  test_alu_h_vv("vdmulh.h.r.vv", 0xcb98, 0x9876, 0x2a64);
+  test_alu_h_vv("vdmulh.h.r.vv", 0xcb98, 0xdef3, 0x0d88);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x4000, 0x4000, 0x2000);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x4000, 0x8000, 0xc000);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x8000, 0x3fff, 0xc001);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x8000, 0x4000, 0xc000);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x8000, 0x4001, 0xbfff);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x8000, 0x7fff, 0x8001);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x8000, 0x8000, 0x7fff);
+  test_alu_h_vv("vdmulh.h.r.vv", 0x8000, 0x8001, 0x7fff);
+  test_alu_h_vv("vdmulh.h.r.vv", 0xffff, 0xffff, 0x0000);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x00000000, 0x00000000, 0x00000000);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x55555555, 0x00000000, 0x00000000);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x00000002, 0x00000003, 0x00000000);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x12345678, 0x00000006, 0x00000001);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x12345678, 0x00000009, 0x00000001);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x55555555, 0x00000003, 0x00000002);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x55555555, 0x00000005, 0x00000003);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x23456789, 0x02305670, 0x009a6776);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x543210fe, 0x12345678, 0x0bf9779b);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x543210fe, 0x89abcdef, 0xb22a768c);
+  test_alu_w_vv("vdmulh.w.r.vv", 0xedcba987, 0x12345678, 0xfd693248);
+  test_alu_w_vv("vdmulh.w.r.vv", 0xedcba987, 0x89abcdef, 0x10d4392f);
+  test_alu_w_vv("vdmulh.w.r.vv", 0xcba98765, 0x00000007, 0xfffffffd);
+  test_alu_w_vv("vdmulh.w.r.vv", 0xcba98765, 0x98765432, 0x2a55dfda);
+  test_alu_w_vv("vdmulh.w.r.vv", 0xcba98765, 0xdef34567, 0x0d837f7f);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x40000000, 0x40000000, 0x20000000);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x40000000, 0x80000000, 0xc0000000);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x80000000, 0x3fffffff, 0xc0000001);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x80000000, 0x40000000, 0xc0000000);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x80000000, 0x40000001, 0xbfffffff);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x80000000, 0x7fffffff, 0x80000001);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x80000000, 0x80000000, 0x7fffffff);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x80000000, 0x80000001, 0x7fffffff);
+  test_alu_w_vv("vdmulh.w.r.vv", 0xffffffff, 0xffffffff, 0x00000000);
+
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x00, 0x00, 0x00);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x55, 0x00, 0x00);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x02, 0x03, 0x00);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x12, 0x06, 0x01);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x12, 0x09, 0x01);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x55, 0x03, 0x02);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x55, 0x05, 0x03);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x54, 0x32, 0x21);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0xed, 0x23, 0xfa);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x54, 0x89, 0xb1);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0xcb, 0x07, 0xfc);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0xcb, 0x98, 0x2b);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0xcb, 0xde, 0x0e);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x40, 0x40, 0x20);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x40, 0x80, 0xbf);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x80, 0x3f, 0xc0);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x80, 0x40, 0xbf);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x80, 0x41, 0xbe);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x80, 0x7f, 0x80);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x80, 0x80, 0x7f);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0x80, 0x81, 0x7f);
+  test_alu_b_vv("vdmulh.b.rn.vv", 0xff, 0xff, 0x00);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x0000, 0x0000, 0x0000);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x5555, 0x0000, 0x0000);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x0002, 0x0003, 0x0000);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x1234, 0x0006, 0x0001);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x1234, 0x0009, 0x0001);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x5555, 0x0003, 0x0002);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x5555, 0x0005, 0x0003);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x5432, 0x1234, 0x0bf9);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x5432, 0x89ab, 0xb229);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0xedcb, 0x1234, 0xfd68);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0xedcb, 0x89ab, 0x10d5);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0xcba9, 0x0007, 0xfffc);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0xcb98, 0x9876, 0x2a64);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0xcb98, 0xdef3, 0x0d88);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x4000, 0x4000, 0x2000);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x4000, 0x8000, 0xbfff);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x8000, 0x3fff, 0xc000);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x8000, 0x4000, 0xbfff);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x8000, 0x4001, 0xbffe);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x8000, 0x7fff, 0x8000);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x8000, 0x8000, 0x7fff);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0x8000, 0x8001, 0x7fff);
+  test_alu_h_vv("vdmulh.h.rn.vv", 0xffff, 0xffff, 0x0000);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x00000000, 0x00000000, 0x00000000);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x55555555, 0x00000000, 0x00000000);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x00000002, 0x00000003, 0x00000000);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x12345678, 0x00000006, 0x00000001);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x12345678, 0x00000009, 0x00000001);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x55555555, 0x00000003, 0x00000002);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x55555555, 0x00000005, 0x00000003);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x23456789, 0x02305670, 0x009a6776);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x543210fe, 0x12345678, 0x0bf9779b);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x543210fe, 0x89abcdef, 0xb22a768b);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0xedcba987, 0x12345678, 0xfd693247);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0xedcba987, 0x89abcdef, 0x10d4392f);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0xcba98765, 0x00000007, 0xfffffffc);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0xcba98765, 0x98765432, 0x2a55dfda);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0xcba98765, 0xdef34567, 0x0d837f7f);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0xcba98765, 0xdef34567, 0x0d837f7f);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x40000000, 0x40000000, 0x20000000);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x40000000, 0x80000000, 0xbfffffff);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x80000000, 0x3fffffff, 0xc0000000);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x80000000, 0x40000000, 0xbfffffff);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x80000000, 0x40000001, 0xbffffffe);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x80000000, 0x7fffffff, 0x80000000);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x80000000, 0x80000000, 0x7fffffff);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x80000000, 0x80000001, 0x7fffffff);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0xffffffff, 0xffffffff, 0x00000000);
+
+  test_alu_b_vv3("vmacc.b.vv", 0x02, 0x03, 0x04, 0x0a);
+  test_alu_h_vv3("vmacc.h.vv", 0x0002, 0x0003, 0x0004, 0x000a);
+  test_alu_w_vv3("vmacc.w.vv", 0x00000002, 0x00000003, 0x00000004, 0x0000000a);
+  test_alu_b_vv3("vmadd.b.vv", 0x02, 0x03, 0x04, 0x0e);
+  test_alu_h_vv3("vmadd.h.vv", 0x00000002, 0x0003, 0x0004, 0x000e);
+  test_alu_w_vv3("vmadd.w.vv", 0x00000002, 0x00000003, 0x00000004, 0x0000000e);
+
+  test_alu_w_vv("vdmulh.w.vv", 0xffffce81, 0x45393280, 0xffffe53b);
+  test_alu_w_vv("vdmulh.w.vv", 0x00001d92, 0x6ca85b00, 0x0000191a);
+  test_alu_w_vv("vdmulh.w.vv", 0x000085ac, 0x4fea6280, 0x00005374);
+  test_alu_w_vv("vdmulh.w.vv", 0x00005305, 0x4805ec00, 0x00002eb6);
+  test_alu_w_vv("vdmulh.w.vv", 0xffffd8b0, 0x70daa300, 0xffffdd56);
+
+  test_alu_w_vv("vdmulh.w.r.vv", 0xffffce81, 0x45393280, 0xffffe53b);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x00001d92, 0x6ca85b00, 0x0000191a);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x000085ac, 0x4fea6280, 0x00005375);
+  test_alu_w_vv("vdmulh.w.r.vv", 0x00005305, 0x4805ec00, 0x00002eb7);
+  test_alu_w_vv("vdmulh.w.r.vv", 0xffffd8b0, 0x70daa300, 0xffffdd57);
+
+  test_alu_w_vv("vdmulh.w.rn.vv", 0xffffce81, 0x45393280, 0xffffe53a);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x00001d92, 0x6ca85b00, 0x0000191a);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x000085ac, 0x4fea6280, 0x00005375);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0x00005305, 0x4805ec00, 0x00002eb7);
+  test_alu_w_vv("vdmulh.w.rn.vv", 0xffffd8b0, 0x70daa300, 0xffffdd56);
+
+  test_vdmulh();
+
+  return 0;
+}
diff --git a/tests/kelvin_isa/vmv.cc b/tests/kelvin_isa/vmv.cc
new file mode 100644
index 0000000..3789131
--- /dev/null
+++ b/tests/kelvin_isa/vmv.cc
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "crt/printf_traits.h"
+#include "tests/kelvin_isa/kelvin_test.h"
+
+#define vmvp_vx(T, Vd, Vs, t) \
+  {                           \
+    if (sizeof(T) == 1) {     \
+      vmvp_b_vx(Vd, Vs, t);   \
+    }                         \
+    if (sizeof(T) == 2) {     \
+      vmvp_h_vx(Vd, Vs, t);   \
+    }                         \
+    if (sizeof(T) == 4) {     \
+      vmvp_w_vx(Vd, Vs, t);   \
+    }                         \
+  }
+
+#define vmvp_vx_m(T, Vd, Vs, t) \
+  {                             \
+    if (sizeof(T) == 1) {       \
+      vmvp_b_vx_m(Vd, Vs, t);   \
+    }                           \
+    if (sizeof(T) == 2) {       \
+      vmvp_h_vx_m(Vd, Vs, t);   \
+    }                           \
+    if (sizeof(T) == 4) {       \
+      vmvp_w_vx_m(Vd, Vs, t);   \
+    }                           \
+  }
+
+template <int m>
+void test_vmv_v() {
+  int vlenb;
+  if (m)
+    getmaxvl_b_m(vlenb);
+  else
+    getmaxvl_b(vlenb);
+
+  uint8_t ref[vlenb] __attribute__((aligned(64)));
+  uint8_t dut[vlenb] __attribute__((aligned(64)));
+
+  for (int i = 0; i < vlenb; ++i) {
+    ref[i] = i;
+  }
+
+  if (m) {
+    vld_b_x_m(v8, ref);
+    vmv_v_m(v0, v8);
+    vst_b_x_m(v0, dut);
+  } else {
+    vld_b_x(v3, ref);
+    vmv_v(v0, v3);
+    vst_b_x(v0, dut);
+  }
+
+  for (int i = 0; i < vlenb; ++i) {
+    if (ref[i] != dut[i]) {
+      printf("**error vmv_v[%d][%d] %02x %02x\n", m, i, ref[i], dut[i]);
+      exit(-1);
+    }
+  }
+}
+
+template <int m>
+void test_vmvp_vv() {
+  int vlenb;
+  if (m)
+    getmaxvl_b_m(vlenb);
+  else
+    getmaxvl_b(vlenb);
+
+  uint8_t ref[2][vlenb] __attribute__((aligned(64)));
+  uint8_t dut[2][vlenb] __attribute__((aligned(64)));
+
+  for (int j = 0; j < 2; ++j) {
+    for (int i = 0; i < vlenb; ++i) {
+      ref[j][i] = i + (j << 7);
+    }
+  }
+
+  if (m) {
+    vld_b_x_m(v16, ref[0]);
+    vld_b_x_m(v32, ref[1]);
+    vmvp_vv_m(v0, v16, v32);
+    vst_b_x_m(v0, dut[0]);
+    vst_b_x_m(v4, dut[1]);
+  } else {
+    vld_b_x(v3, ref[0]);
+    vld_b_x(v5, ref[1]);
+    vmvp_vv(v0, v3, v5);
+    vst_b_x(v0, dut[0]);
+    vst_b_x(v1, dut[1]);
+  }
+
+  for (int j = 0; j < 2; ++j) {
+    for (int i = 0; i < vlenb; ++i) {
+      if (ref[j][i] != dut[j][i]) {
+        printf("**error vmvp_vv[%d][%d,%d] %02x %02x\n", m, j, i, ref[j][i],
+               dut[j][i]);
+        exit(-1);
+      }
+    }
+  }
+}
+
+template <int m, typename T>
+void test_vmvp_vx() {
+  int vlenb;
+  if (m) {
+    getmaxvl_m(T, vlenb);
+  } else {
+    getmaxvl(T, vlenb);
+  }
+
+  T ref[2][vlenb] __attribute__((aligned(64)));
+  T dut[2][vlenb] __attribute__((aligned(64)));
+  T scalar = T(0x12345678);
+
+  for (int i = 0; i < vlenb; ++i) {
+    ref[0][i] = i;
+    ref[1][i] = scalar;
+  }
+
+  if (m) {
+    vld_b_x_m(v16, ref[0]);
+    vmvp_vx_m(T, v0, v16, scalar);
+    vst_b_x_m(v0, dut[0]);
+    vst_b_x_m(v4, dut[1]);
+  } else {
+    vld_b_x(v3, ref[0]);
+    vmvp_vx(T, v0, v3, scalar);
+    vst_b_x(v0, dut[0]);
+    vst_b_x(v1, dut[1]);
+  }
+
+  for (int j = 0; j < 2; ++j) {
+    for (int i = 0; i < vlenb; ++i) {
+      if (ref[j][i] != dut[j][i]) {
+        printf("**error vmvp_vx[%d][%d,%d] ", m, j, i);
+        printf(PrintfTraits<T>::kFmtHex, ref[j][i]);
+        printf(" ");
+        printf(PrintfTraits<T>::kFmtHex, dut[j][i]);
+        printf("\n");
+      }
+    }
+  }
+}
+
+int main() {
+  test_vmv_v<0>();
+  test_vmv_v<1>();
+
+  test_vmvp_vv<0>();
+  test_vmvp_vv<1>();
+
+  test_vmvp_vx<0, uint8_t>();
+  test_vmvp_vx<0, uint16_t>();
+  test_vmvp_vx<0, uint32_t>();
+  test_vmvp_vx<1, uint8_t>();
+  test_vmvp_vx<1, uint16_t>();
+  test_vmvp_vx<1, uint32_t>();
+
+  return 0;
+}
diff --git a/tests/kelvin_isa/vsel.cc b/tests/kelvin_isa/vsel.cc
new file mode 100644
index 0000000..a28a293
--- /dev/null
+++ b/tests/kelvin_isa/vsel.cc
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <cstdio>
+
+#include "tests/kelvin_isa/kelvin_test.h"
+
+#define vsel_vv(T, Vd, Vs, Vt) \
+  {                            \
+    if (sizeof(T) == 1) {      \
+      vsel_b_vv(Vd, Vs, Vt);   \
+    }                          \
+    if (sizeof(T) == 2) {      \
+      vsel_h_vv(Vd, Vs, Vt);   \
+    }                          \
+    if (sizeof(T) == 4) {      \
+      vsel_w_vv(Vd, Vs, Vt);   \
+    }                          \
+  }
+
+#define vsel_vv_m(T, Vd, Vs, Vt) \
+  {                              \
+    if (sizeof(T) == 1) {        \
+      vsel_b_vv_m(Vd, Vs, Vt);   \
+    }                            \
+    if (sizeof(T) == 2) {        \
+      vsel_h_vv_m(Vd, Vs, Vt);   \
+    }                            \
+    if (sizeof(T) == 4) {        \
+      vsel_w_vv_m(Vd, Vs, Vt);   \
+    }                            \
+  }
+
+template <typename T>
+static void test_vsel() {
+  constexpr int n = sizeof(T);
+  int lanes;
+  getmaxvl(T, lanes);
+
+  T inp[3][lanes] __attribute__((aligned(64)));
+  T ref[lanes] __attribute__((aligned(64)));
+  T dut[lanes] __attribute__((aligned(64)));
+
+  for (int i = 0; i < lanes; ++i) {
+    inp[0][i] = (0x40 << (8 * (n - 1))) + i;
+    inp[1][i] = (0x80 << (8 * (n - 1))) + i;
+    inp[2][i] = krand();
+  }
+
+  for (int i = 0; i < lanes; ++i) {
+    ref[i] = inp[2][i] & 1 ? inp[0][i] : inp[1][i];
+  }
+
+  vld_x(T, v0, inp[0]);
+  vld_x(T, v1, inp[1]);
+  vld_x(T, v2, inp[2]);
+  vsel_vv(T, v0, v2, v1);
+  vst_x(T, v0, dut);
+
+  for (int i = 0; i < lanes; ++i) {
+    if (ref[i] != dut[i]) {
+      printf("**error vsel[%d]\n", i);
+      exit(-1);
+    }
+  }
+}
+
+template <typename T>
+static void test_vsel_m() {
+  constexpr int n = sizeof(T);
+  int lanes;
+  getmaxvl_m(T, lanes);
+
+  T inp[3][lanes * 2] __attribute__((aligned(64)));
+  T ref[lanes] __attribute__((aligned(64)));
+  T dut[lanes] __attribute__((aligned(64)));
+
+  for (int i = 0; i < lanes; ++i) {
+    inp[0][i] = (0x40 << (8 * (n - 1))) + i;
+    inp[1][i] = (0x80 << (8 * (n - 1))) + i;
+    inp[2][i] = krand();
+  }
+
+  for (int i = 0; i < lanes; ++i) {
+    ref[i] = inp[2][i] & 1 ? inp[0][i] : inp[1][i];
+  }
+
+  vld_x_m(T, v0, inp[0]);
+  vld_x_m(T, v4, inp[1]);
+  vld_x_m(T, v8, inp[2]);
+  vsel_vv_m(T, v0, v8, v4);
+  vst_x_m(T, v0, dut);
+
+  for (int i = 0; i < lanes; ++i) {
+    if (ref[i] != dut[i]) {
+      printf("**error vsel_m[%d]\n", i);
+      exit(-1);
+    }
+  }
+}
+
+int main() {
+  test_vsel<int8_t>();
+  test_vsel<int16_t>();
+  test_vsel<int32_t>();
+
+  test_vsel_m<int8_t>();
+  test_vsel_m<int16_t>();
+  test_vsel_m<int32_t>();
+
+  return 0;
+}
diff --git a/tests/kelvin_isa/vshift.cc b/tests/kelvin_isa/vshift.cc
new file mode 100644
index 0000000..de80ade
--- /dev/null
+++ b/tests/kelvin_isa/vshift.cc
@@ -0,0 +1,1124 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "tests/kelvin_isa/kelvin_test.h"
+
+int main() {
+  test_alu_b_vx("vsll.b.vx", 0x89, 0x00, 0x89);
+  test_alu_b_vx("vsll.b.vx", 0x89, 0x01, 0x12);
+  test_alu_b_vx("vsll.b.vx", 0x89, 0x02, 0x24);
+  test_alu_b_vx("vsll.b.vx", 0x89, 0x04, 0x90);
+  test_alu_b_vx("vsll.b.vx", 0x89, 0x07, 0x80);
+  test_alu_b_vx("vsll.b.vx", 0x89, 0xf8, 0x89);
+
+  test_alu_h_vx("vsll.h.vx", 0x6789, 0x00, 0x6789);
+  test_alu_h_vx("vsll.h.vx", 0x6789, 0x01, 0xcf12);
+  test_alu_h_vx("vsll.h.vx", 0x6789, 0x02, 0x9e24);
+  test_alu_h_vx("vsll.h.vx", 0x6789, 0x04, 0x7890);
+  test_alu_h_vx("vsll.h.vx", 0x6789, 0x08, 0x8900);
+  test_alu_h_vx("vsll.h.vx", 0x6789, 0x0f, 0x8000);
+  test_alu_h_vx("vsll.h.vx", 0x6789, 0xf0, 0x6789);
+
+  test_alu_w_vx("vsll.w.vx", 0x23456789, 0x00, 0x23456789);
+  test_alu_w_vx("vsll.w.vx", 0x23456789, 0x01, 0x468acf12);
+  test_alu_w_vx("vsll.w.vx", 0x23456789, 0x02, 0x8d159e24);
+  test_alu_w_vx("vsll.w.vx", 0x23456789, 0x04, 0x34567890);
+  test_alu_w_vx("vsll.w.vx", 0x23456789, 0x08, 0x45678900);
+  test_alu_w_vx("vsll.w.vx", 0x23456789, 0x10, 0x67890000);
+  test_alu_w_vx("vsll.w.vx", 0x23456789, 0x1f, 0x80000000);
+  test_alu_w_vx("vsll.w.vx", 0x23456789, 0xe0, 0x23456789);
+
+  test_alu_b_vx("vsra.b.vx", 0x67, 0x00, 0x67);
+  test_alu_b_vx("vsra.b.vx", 0x67, 0x01, 0x33);
+  test_alu_b_vx("vsra.b.vx", 0x67, 0x02, 0x19);
+  test_alu_b_vx("vsra.b.vx", 0x67, 0x04, 0x06);
+  test_alu_b_vx("vsra.b.vx", 0x67, 0x07, 0x00);
+  test_alu_b_vx("vsra.b.vx", 0x67, 0xf8, 0x67);
+  test_alu_b_vx("vsra.b.vx", 0x98, 0x00, 0x98);
+  test_alu_b_vx("vsra.b.vx", 0x98, 0x01, 0xcc);
+  test_alu_b_vx("vsra.b.vx", 0x98, 0x02, 0xe6);
+  test_alu_b_vx("vsra.b.vx", 0x98, 0x04, 0xf9);
+  test_alu_b_vx("vsra.b.vx", 0x98, 0x07, 0xff);
+  test_alu_b_vx("vsra.b.vx", 0x98, 0xf8, 0x98);
+
+  test_alu_h_vx("vsra.h.vx", 0x6789, 0x00, 0x6789);
+  test_alu_h_vx("vsra.h.vx", 0x6789, 0x01, 0x33c4);
+  test_alu_h_vx("vsra.h.vx", 0x6789, 0x02, 0x19e2);
+  test_alu_h_vx("vsra.h.vx", 0x6789, 0x04, 0x0678);
+  test_alu_h_vx("vsra.h.vx", 0x6789, 0x08, 0x0067);
+  test_alu_h_vx("vsra.h.vx", 0x6789, 0x0f, 0x0000);
+  test_alu_h_vx("vsra.h.vx", 0x6789, 0xf0, 0x6789);
+  test_alu_h_vx("vsra.h.vx", 0x9876, 0x00, 0x9876);
+  test_alu_h_vx("vsra.h.vx", 0x9876, 0x01, 0xcc3b);
+  test_alu_h_vx("vsra.h.vx", 0x9876, 0x02, 0xe61d);
+  test_alu_h_vx("vsra.h.vx", 0x9876, 0x04, 0xf987);
+  test_alu_h_vx("vsra.h.vx", 0x9876, 0x08, 0xff98);
+  test_alu_h_vx("vsra.h.vx", 0x9876, 0x0f, 0xffff);
+  test_alu_h_vx("vsra.h.vx", 0x9876, 0xf0, 0x9876);
+
+  test_alu_w_vx("vsra.w.vx", 0x23456789, 0x00, 0x23456789);
+  test_alu_w_vx("vsra.w.vx", 0x23456789, 0x01, 0x11a2b3c4);
+  test_alu_w_vx("vsra.w.vx", 0x23456789, 0x02, 0x08d159e2);
+  test_alu_w_vx("vsra.w.vx", 0x23456789, 0x04, 0x02345678);
+  test_alu_w_vx("vsra.w.vx", 0x23456789, 0x08, 0x00234567);
+  test_alu_w_vx("vsra.w.vx", 0x23456789, 0x10, 0x00002345);
+  test_alu_w_vx("vsra.w.vx", 0x23456789, 0x1f, 0x00000000);
+  test_alu_w_vx("vsra.w.vx", 0x23456789, 0xe0, 0x23456789);
+  test_alu_w_vx("vsra.w.vx", 0x98765432, 0x00, 0x98765432);
+  test_alu_w_vx("vsra.w.vx", 0x98765432, 0x01, 0xcc3b2a19);
+  test_alu_w_vx("vsra.w.vx", 0x98765432, 0x02, 0xe61d950c);
+  test_alu_w_vx("vsra.w.vx", 0x98765432, 0x04, 0xf9876543);
+  test_alu_w_vx("vsra.w.vx", 0x98765432, 0x08, 0xff987654);
+  test_alu_w_vx("vsra.w.vx", 0x98765432, 0x10, 0xffff9876);
+  test_alu_w_vx("vsra.w.vx", 0x98765432, 0x1f, 0xffffffff);
+  test_alu_w_vx("vsra.w.vx", 0x98765432, 0xe0, 0x98765432);
+
+  test_alu_b_vx("vsrl.b.vx", 0x67, 0x00, 0x67);
+  test_alu_b_vx("vsrl.b.vx", 0x67, 0x01, 0x33);
+  test_alu_b_vx("vsrl.b.vx", 0x67, 0x02, 0x19);
+  test_alu_b_vx("vsrl.b.vx", 0x67, 0x04, 0x06);
+  test_alu_b_vx("vsrl.b.vx", 0x67, 0x07, 0x00);
+  test_alu_b_vx("vsrl.b.vx", 0x67, 0xf8, 0x67);
+  test_alu_b_vx("vsrl.b.vx", 0x98, 0x00, 0x98);
+  test_alu_b_vx("vsrl.b.vx", 0x98, 0x01, 0x4c);
+  test_alu_b_vx("vsrl.b.vx", 0x98, 0x02, 0x26);
+  test_alu_b_vx("vsrl.b.vx", 0x98, 0x04, 0x09);
+  test_alu_b_vx("vsrl.b.vx", 0x98, 0x07, 0x01);
+  test_alu_b_vx("vsrl.b.vx", 0x98, 0xf8, 0x98);
+
+  test_alu_h_vx("vsrl.h.vx", 0x6789, 0x00, 0x6789);
+  test_alu_h_vx("vsrl.h.vx", 0x6789, 0x01, 0x33c4);
+  test_alu_h_vx("vsrl.h.vx", 0x6789, 0x02, 0x19e2);
+  test_alu_h_vx("vsrl.h.vx", 0x6789, 0x04, 0x0678);
+  test_alu_h_vx("vsrl.h.vx", 0x6789, 0x08, 0x0067);
+  test_alu_h_vx("vsrl.h.vx", 0x6789, 0x0f, 0x0000);
+  test_alu_h_vx("vsrl.h.vx", 0x6789, 0xf0, 0x6789);
+  test_alu_h_vx("vsrl.h.vx", 0x9876, 0x00, 0x9876);
+  test_alu_h_vx("vsrl.h.vx", 0x9876, 0x01, 0x4c3b);
+  test_alu_h_vx("vsrl.h.vx", 0x9876, 0x02, 0x261d);
+  test_alu_h_vx("vsrl.h.vx", 0x9876, 0x04, 0x0987);
+  test_alu_h_vx("vsrl.h.vx", 0x9876, 0x08, 0x0098);
+  test_alu_h_vx("vsrl.h.vx", 0x9876, 0x0f, 0x0001);
+  test_alu_h_vx("vsrl.h.vx", 0x9876, 0xf0, 0x9876);
+
+  test_alu_w_vx("vsrl.w.vx", 0x23456789, 0x00, 0x23456789);
+  test_alu_w_vx("vsrl.w.vx", 0x23456789, 0x01, 0x11a2b3c4);
+  test_alu_w_vx("vsrl.w.vx", 0x23456789, 0x02, 0x08d159e2);
+  test_alu_w_vx("vsrl.w.vx", 0x23456789, 0x04, 0x02345678);
+  test_alu_w_vx("vsrl.w.vx", 0x23456789, 0x08, 0x00234567);
+  test_alu_w_vx("vsrl.w.vx", 0x23456789, 0x10, 0x00002345);
+  test_alu_w_vx("vsrl.w.vx", 0x23456789, 0x1f, 0x00000000);
+  test_alu_w_vx("vsrl.w.vx", 0x23456789, 0xe0, 0x23456789);
+  test_alu_w_vx("vsrl.w.vx", 0x98765432, 0x00, 0x98765432);
+  test_alu_w_vx("vsrl.w.vx", 0x98765432, 0x01, 0x4c3b2a19);
+  test_alu_w_vx("vsrl.w.vx", 0x98765432, 0x02, 0x261d950c);
+  test_alu_w_vx("vsrl.w.vx", 0x98765432, 0x04, 0x09876543);
+  test_alu_w_vx("vsrl.w.vx", 0x98765432, 0x08, 0x00987654);
+  test_alu_w_vx("vsrl.w.vx", 0x98765432, 0x10, 0x00009876);
+  test_alu_w_vx("vsrl.w.vx", 0x98765432, 0x1f, 0x00000001);
+  test_alu_w_vx("vsrl.w.vx", 0x98765432, 0xe0, 0x98765432);
+
+  test_alu_b_vx("vsha.b.vx", 0x12, 0x00, 0x12);
+  test_alu_b_vx("vsha.b.vx", 0x12, 0x01, 0x09);
+  test_alu_b_vx("vsha.b.vx", 0x12, 0xff, 0x24);
+  test_alu_b_vx("vsha.b.vx", 0x12, 0x02, 0x04);
+  test_alu_b_vx("vsha.b.vx", 0x12, 0xfe, 0x48);
+  test_alu_b_vx("vsha.b.vx", 0x12, 0x04, 0x01);
+  test_alu_b_vx("vsha.b.vx", 0x12, 0xfc, 0x7f);
+  test_alu_b_vx("vsha.b.vx", 0x12, 0x07, 0x00);
+  test_alu_b_vx("vsha.b.vx", 0x12, 0xf9, 0x7f);
+  test_alu_b_vx("vsha.b.vx", 0x12, 0x08, 0x00);
+  test_alu_b_vx("vsha.b.vx", 0x12, 0xf8, 0x7f);
+  test_alu_b_vx("vsha.b.vx", 0x12, 0x09, 0x00);
+  test_alu_b_vx("vsha.b.vx", 0x12, 0xf7, 0x7f);
+  test_alu_b_vx("vsha.b.vx", 0xed, 0x00, 0xed);
+  test_alu_b_vx("vsha.b.vx", 0xed, 0x01, 0xf6);
+  test_alu_b_vx("vsha.b.vx", 0xed, 0xff, 0xda);
+  test_alu_b_vx("vsha.b.vx", 0xed, 0x02, 0xfb);
+  test_alu_b_vx("vsha.b.vx", 0xed, 0xfe, 0xb4);
+  test_alu_b_vx("vsha.b.vx", 0xed, 0x04, 0xfe);
+  test_alu_b_vx("vsha.b.vx", 0xed, 0xfc, 0x80);
+  test_alu_b_vx("vsha.b.vx", 0xed, 0x07, 0xff);
+  test_alu_b_vx("vsha.b.vx", 0xed, 0xf9, 0x80);
+  test_alu_b_vx("vsha.b.vx", 0xed, 0x08, 0xff);
+  test_alu_b_vx("vsha.b.vx", 0xed, 0xf8, 0x80);
+  test_alu_b_vx("vsha.b.vx", 0xed, 0x09, 0xff);
+  test_alu_b_vx("vsha.b.vx", 0xed, 0xf7, 0x80);
+  test_alu_b_vx("vsha.b.vx", 0x00, 0x07, 0x00);
+  test_alu_b_vx("vsha.b.vx", 0x00, 0xf9, 0x00);
+  test_alu_b_vx("vsha.b.vx", 0x00, 0x08, 0x00);
+  test_alu_b_vx("vsha.b.vx", 0x00, 0xf8, 0x00);
+  test_alu_b_vx("vsha.b.vx", 0x00, 0x09, 0x00);
+  test_alu_b_vx("vsha.b.vx", 0x00, 0xf7, 0x00);
+  test_alu_b_vx("vsha.b.vx", 0x01, 0x06, 0x00);
+  test_alu_b_vx("vsha.b.vx", 0x01, 0xfa, 0x40);
+  test_alu_b_vx("vsha.b.vx", 0x01, 0x07, 0x00);
+  test_alu_b_vx("vsha.b.vx", 0x01, 0xf9, 0x7f);
+  test_alu_b_vx("vsha.b.vx", 0x01, 0x08, 0x00);
+  test_alu_b_vx("vsha.b.vx", 0x01, 0xf8, 0x7f);
+  test_alu_b_vx("vsha.b.vx", 0x01, 0x09, 0x00);
+  test_alu_b_vx("vsha.b.vx", 0x01, 0xf7, 0x7f);
+  test_alu_b_vx("vsha.b.vx", 0xff, 0x06, 0xff);
+  test_alu_b_vx("vsha.b.vx", 0xff, 0xfa, 0xc0);
+  test_alu_b_vx("vsha.b.vx", 0xff, 0x07, 0xff);
+  test_alu_b_vx("vsha.b.vx", 0xff, 0xf9, 0x80);
+  test_alu_b_vx("vsha.b.vx", 0xff, 0x08, 0xff);
+  test_alu_b_vx("vsha.b.vx", 0xff, 0xf8, 0x80);
+  test_alu_b_vx("vsha.b.vx", 0xff, 0x09, 0xff);
+  test_alu_b_vx("vsha.b.vx", 0xff, 0xf7, 0x80);
+
+  test_alu_h_vx("vsha.h.vx", 0x0012, 0x0000, 0x0012);
+  test_alu_h_vx("vsha.h.vx", 0x0012, 0x0001, 0x0009);
+  test_alu_h_vx("vsha.h.vx", 0x0012, 0xffff, 0x0024);
+  test_alu_h_vx("vsha.h.vx", 0x0012, 0x0002, 0x0004);
+  test_alu_h_vx("vsha.h.vx", 0x0012, 0xfffe, 0x0048);
+  test_alu_h_vx("vsha.h.vx", 0x0012, 0x0004, 0x0001);
+  test_alu_h_vx("vsha.h.vx", 0x0012, 0xfffc, 0x0120);
+  test_alu_h_vx("vsha.h.vx", 0x0012, 0x0008, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0012, 0xfff8, 0x1200);
+  test_alu_h_vx("vsha.h.vx", 0x0012, 0x000f, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0012, 0xfff1, 0x7fff);
+  test_alu_h_vx("vsha.h.vx", 0x0012, 0x0010, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0012, 0xfff0, 0x7fff);
+  test_alu_h_vx("vsha.h.vx", 0x0012, 0x0011, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0012, 0xffef, 0x7fff);
+  test_alu_h_vx("vsha.h.vx", 0xffed, 0x0000, 0xffed);
+  test_alu_h_vx("vsha.h.vx", 0xffed, 0x0001, 0xfff6);
+  test_alu_h_vx("vsha.h.vx", 0xffed, 0xffff, 0xffda);
+  test_alu_h_vx("vsha.h.vx", 0xffed, 0x0002, 0xfffb);
+  test_alu_h_vx("vsha.h.vx", 0xffed, 0xfffe, 0xffb4);
+  test_alu_h_vx("vsha.h.vx", 0xffed, 0x0004, 0xfffe);
+  test_alu_h_vx("vsha.h.vx", 0xffed, 0xfffc, 0xfed0);
+  test_alu_h_vx("vsha.h.vx", 0xffed, 0x0008, 0xffff);
+  test_alu_h_vx("vsha.h.vx", 0xffed, 0xfff8, 0xed00);
+  test_alu_h_vx("vsha.h.vx", 0xffed, 0x000f, 0xffff);
+  test_alu_h_vx("vsha.h.vx", 0xffed, 0xfff1, 0x8000);
+  test_alu_h_vx("vsha.h.vx", 0xffed, 0x0010, 0xffff);
+  test_alu_h_vx("vsha.h.vx", 0xffed, 0xfff0, 0x8000);
+  test_alu_h_vx("vsha.h.vx", 0xffed, 0x0011, 0xffff);
+  test_alu_h_vx("vsha.h.vx", 0xffed, 0xffef, 0x8000);
+  test_alu_h_vx("vsha.h.vx", 0x0000, 0x0007, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0000, 0xfff9, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0000, 0x0008, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0000, 0xfff8, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0000, 0x0009, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0000, 0xfff7, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0000, 0x000e, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0000, 0xfff2, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0000, 0x000f, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0000, 0xfff1, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0000, 0x0010, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0000, 0xfff0, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0000, 0x0011, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0000, 0xffef, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0001, 0x0007, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0001, 0xfff9, 0x0080);
+  test_alu_h_vx("vsha.h.vx", 0x0001, 0x0008, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0001, 0xfff8, 0x0100);
+  test_alu_h_vx("vsha.h.vx", 0x0001, 0x0009, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0001, 0xfff7, 0x0200);
+  test_alu_h_vx("vsha.h.vx", 0x0001, 0x000e, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0001, 0xfff2, 0x4000);
+  test_alu_h_vx("vsha.h.vx", 0x0001, 0x000f, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0001, 0xfff1, 0x7fff);
+  test_alu_h_vx("vsha.h.vx", 0x0001, 0x0010, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0001, 0xfff0, 0x7fff);
+  test_alu_h_vx("vsha.h.vx", 0x0001, 0x0011, 0x0000);
+  test_alu_h_vx("vsha.h.vx", 0x0001, 0xffef, 0x7fff);
+  test_alu_h_vx("vsha.h.vx", 0xffff, 0x0007, 0xffff);
+  test_alu_h_vx("vsha.h.vx", 0xffff, 0xfff9, 0xff80);
+  test_alu_h_vx("vsha.h.vx", 0xffff, 0x0008, 0xffff);
+  test_alu_h_vx("vsha.h.vx", 0xffff, 0xfff8, 0xff00);
+  test_alu_h_vx("vsha.h.vx", 0xffff, 0x0009, 0xffff);
+  test_alu_h_vx("vsha.h.vx", 0xffff, 0xfff7, 0xfe00);
+  test_alu_h_vx("vsha.h.vx", 0xffff, 0x000e, 0xffff);
+  test_alu_h_vx("vsha.h.vx", 0xffff, 0xfff2, 0xc000);
+  test_alu_h_vx("vsha.h.vx", 0xffff, 0x000f, 0xffff);
+  test_alu_h_vx("vsha.h.vx", 0xffff, 0xfff1, 0x8000);
+  test_alu_h_vx("vsha.h.vx", 0xffff, 0x0010, 0xffff);
+  test_alu_h_vx("vsha.h.vx", 0xffff, 0xfff0, 0x8000);
+  test_alu_h_vx("vsha.h.vx", 0xffff, 0x0011, 0xffff);
+  test_alu_h_vx("vsha.h.vx", 0xffff, 0xffef, 0x8000);
+
+  test_alu_w_vx("vsha.w.vx", 0x00000012, 0x00000000, 0x00000012);
+  test_alu_w_vx("vsha.w.vx", 0x00000012, 0x00000001, 0x00000009);
+  test_alu_w_vx("vsha.w.vx", 0x00000012, 0xffffffff, 0x00000024);
+  test_alu_w_vx("vsha.w.vx", 0x00000012, 0x00000002, 0x00000004);
+  test_alu_w_vx("vsha.w.vx", 0x00000012, 0xfffffffe, 0x00000048);
+  test_alu_w_vx("vsha.w.vx", 0x00000012, 0x00000004, 0x00000001);
+  test_alu_w_vx("vsha.w.vx", 0x00000012, 0xfffffffc, 0x00000120);
+  test_alu_w_vx("vsha.w.vx", 0x00000012, 0x00000008, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000012, 0xfffffff8, 0x00001200);
+  test_alu_w_vx("vsha.w.vx", 0x00000012, 0x0000000f, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000012, 0xfffffff1, 0x00090000);
+  test_alu_w_vx("vsha.w.vx", 0x00000012, 0x00000010, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000012, 0xfffffff0, 0x00120000);
+  test_alu_w_vx("vsha.w.vx", 0x00000012, 0x00000011, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000012, 0xffffffef, 0x00240000);
+  test_alu_w_vx("vsha.w.vx", 0xffffffed, 0x00000000, 0xffffffed);
+  test_alu_w_vx("vsha.w.vx", 0xffffffed, 0x00000001, 0xfffffff6);
+  test_alu_w_vx("vsha.w.vx", 0xffffffed, 0xffffffff, 0xffffffda);
+  test_alu_w_vx("vsha.w.vx", 0xffffffed, 0x00000002, 0xfffffffb);
+  test_alu_w_vx("vsha.w.vx", 0xffffffed, 0xfffffffe, 0xffffffb4);
+  test_alu_w_vx("vsha.w.vx", 0xffffffed, 0x00000004, 0xfffffffe);
+  test_alu_w_vx("vsha.w.vx", 0xffffffed, 0xfffffffc, 0xfffffed0);
+  test_alu_w_vx("vsha.w.vx", 0xffffffed, 0x00000008, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffed, 0xfffffff8, 0xffffed00);
+  test_alu_w_vx("vsha.w.vx", 0xffffffed, 0x0000000f, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffed, 0xfffffff1, 0xfff68000);
+  test_alu_w_vx("vsha.w.vx", 0xffffffed, 0x00000010, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffed, 0xfffffff0, 0xffed0000);
+  test_alu_w_vx("vsha.w.vx", 0xffffffed, 0x00000011, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffed, 0xffffffef, 0xffda0000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0x00000007, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0xfffffff9, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0x00000008, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0xfffffff8, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0x00000009, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0xfffffff7, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0x0000000e, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0xfffffff2, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0x0000000f, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0xfffffff1, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0x00000010, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0xfffffff0, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0x00000011, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0xffffffef, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0x0000001e, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0xffffffe2, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0x0000001f, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0xffffffe1, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0x00000020, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0xffffffe0, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0x00000021, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0xffffffdf, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0x0000003e, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0xffffffc2, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0x0000003f, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0xffffffc1, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0x00000040, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0xffffffc0, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0x00000041, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000000, 0xffffffbf, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x00000001, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xffffffff, 0x00000002);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x00000002, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xfffffffe, 0x00000004);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x00000007, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xfffffff9, 0x00000080);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x00000008, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xfffffff8, 0x00000100);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x00000009, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xfffffff7, 0x00000200);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x0000000e, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xfffffff2, 0x00004000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x0000000f, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xfffffff1, 0x00008000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x00000010, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xfffffff0, 0x00010000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x00000011, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xffffffef, 0x00020000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x0000001e, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xffffffe2, 0x40000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x0000001f, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xffffffe1, 0x7fffffff);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x00000020, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xffffffe0, 0x7fffffff);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x00000021, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xffffffdf, 0x7fffffff);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x0000003e, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xffffffc2, 0x7fffffff);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x0000003f, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xffffffc1, 0x7fffffff);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x00000040, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xffffffc0, 0x7fffffff);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0x00000041, 0x00000000);
+  test_alu_w_vx("vsha.w.vx", 0x00000001, 0xffffffbf, 0x7fffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0x00000007, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0xfffffff9, 0xffffff80);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0x00000008, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0xfffffff8, 0xffffff00);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0x00000009, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0xfffffff7, 0xfffffe00);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0x0000000e, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0xfffffff2, 0xffffc000);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0x0000000f, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0xfffffff1, 0xffff8000);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0x00000010, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0xfffffff0, 0xffff0000);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0x00000011, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0xffffffef, 0xfffe0000);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0x0000001e, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0xffffffe2, 0xc0000000);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0x0000001f, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0xffffffe1, 0x80000000);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0x00000020, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0xffffffe0, 0x80000000);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0x00000021, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0xffffffdf, 0x80000000);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0x0000003e, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0xffffffc2, 0x80000000);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0x0000003f, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0xffffffc1, 0x80000000);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0x00000040, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0xffffffc0, 0x80000000);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0x00000041, 0xffffffff);
+  test_alu_w_vx("vsha.w.vx", 0xffffffff, 0xffffffbf, 0x80000000);
+
+  test_alu_b_vx("vsha.b.r.vx", 0x12, 0x00, 0x12);
+  test_alu_b_vx("vsha.b.r.vx", 0x12, 0x01, 0x09);
+  test_alu_b_vx("vsha.b.r.vx", 0x12, 0xff, 0x24);
+  test_alu_b_vx("vsha.b.r.vx", 0x12, 0x02, 0x05);
+  test_alu_b_vx("vsha.b.r.vx", 0x12, 0xfe, 0x48);
+  test_alu_b_vx("vsha.b.r.vx", 0x12, 0x04, 0x01);
+  test_alu_b_vx("vsha.b.r.vx", 0x12, 0xfc, 0x7f);
+  test_alu_b_vx("vsha.b.r.vx", 0x12, 0x07, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0x12, 0xf9, 0x7f);
+  test_alu_b_vx("vsha.b.r.vx", 0x12, 0x08, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0x12, 0xf8, 0x7f);
+  test_alu_b_vx("vsha.b.r.vx", 0x12, 0x09, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0x12, 0xf7, 0x7f);
+  test_alu_b_vx("vsha.b.r.vx", 0xed, 0x00, 0xed);
+  test_alu_b_vx("vsha.b.r.vx", 0xed, 0x01, 0xf7);
+  test_alu_b_vx("vsha.b.r.vx", 0xed, 0xff, 0xda);
+  test_alu_b_vx("vsha.b.r.vx", 0xed, 0x02, 0xfb);
+  test_alu_b_vx("vsha.b.r.vx", 0xed, 0xfe, 0xb4);
+  test_alu_b_vx("vsha.b.r.vx", 0xed, 0x04, 0xff);
+  test_alu_b_vx("vsha.b.r.vx", 0xed, 0xfc, 0x80);
+  test_alu_b_vx("vsha.b.r.vx", 0xed, 0x07, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0xed, 0xf9, 0x80);
+  test_alu_b_vx("vsha.b.r.vx", 0xed, 0x08, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0xed, 0xf8, 0x80);
+  test_alu_b_vx("vsha.b.r.vx", 0xed, 0x09, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0xed, 0xf7, 0x80);
+  test_alu_b_vx("vsha.b.r.vx", 0x00, 0x07, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0x00, 0xf9, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0x00, 0x08, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0x00, 0xf8, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0x00, 0x09, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0x00, 0xf7, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0x01, 0x06, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0x01, 0xfa, 0x40);
+  test_alu_b_vx("vsha.b.r.vx", 0x01, 0x07, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0x01, 0xf9, 0x7f);
+  test_alu_b_vx("vsha.b.r.vx", 0x01, 0x08, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0x01, 0xf8, 0x7f);
+  test_alu_b_vx("vsha.b.r.vx", 0x01, 0x09, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0x01, 0xf7, 0x7f);
+  test_alu_b_vx("vsha.b.r.vx", 0xff, 0x06, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0xff, 0xfa, 0xc0);
+  test_alu_b_vx("vsha.b.r.vx", 0xff, 0x07, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0xff, 0xf9, 0x80);
+  test_alu_b_vx("vsha.b.r.vx", 0xff, 0x08, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0xff, 0xf8, 0x80);
+  test_alu_b_vx("vsha.b.r.vx", 0xff, 0x09, 0x00);
+  test_alu_b_vx("vsha.b.r.vx", 0xff, 0xf7, 0x80);
+
+  test_alu_h_vx("vsha.h.r.vx", 0x0012, 0x0000, 0x0012);
+  test_alu_h_vx("vsha.h.r.vx", 0x0012, 0x0001, 0x0009);
+  test_alu_h_vx("vsha.h.r.vx", 0x0012, 0xffff, 0x0024);
+  test_alu_h_vx("vsha.h.r.vx", 0x0012, 0x0002, 0x0005);
+  test_alu_h_vx("vsha.h.r.vx", 0x0012, 0xfffe, 0x0048);
+  test_alu_h_vx("vsha.h.r.vx", 0x0012, 0x0004, 0x0001);
+  test_alu_h_vx("vsha.h.r.vx", 0x0012, 0xfffc, 0x0120);
+  test_alu_h_vx("vsha.h.r.vx", 0x0012, 0x0008, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0012, 0xfff8, 0x1200);
+  test_alu_h_vx("vsha.h.r.vx", 0x0012, 0x000f, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0012, 0xfff1, 0x7fff);
+  test_alu_h_vx("vsha.h.r.vx", 0x0012, 0x0010, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0012, 0xfff0, 0x7fff);
+  test_alu_h_vx("vsha.h.r.vx", 0x0012, 0x0011, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0012, 0xffef, 0x7fff);
+  test_alu_h_vx("vsha.h.r.vx", 0xffed, 0x0000, 0xffed);
+  test_alu_h_vx("vsha.h.r.vx", 0xffed, 0x0001, 0xfff7);
+  test_alu_h_vx("vsha.h.r.vx", 0xffed, 0xffff, 0xffda);
+  test_alu_h_vx("vsha.h.r.vx", 0xffed, 0x0002, 0xfffb);
+  test_alu_h_vx("vsha.h.r.vx", 0xffed, 0xfffe, 0xffb4);
+  test_alu_h_vx("vsha.h.r.vx", 0xffed, 0x0004, 0xffff);
+  test_alu_h_vx("vsha.h.r.vx", 0xffed, 0xfffc, 0xfed0);
+  test_alu_h_vx("vsha.h.r.vx", 0xffed, 0x0008, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0xffed, 0xfff8, 0xed00);
+  test_alu_h_vx("vsha.h.r.vx", 0xffed, 0x000f, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0xffed, 0xfff1, 0x8000);
+  test_alu_h_vx("vsha.h.r.vx", 0xffed, 0x0010, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0xffed, 0xfff0, 0x8000);
+  test_alu_h_vx("vsha.h.r.vx", 0xffed, 0x0011, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0xffed, 0xffef, 0x8000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0000, 0x0007, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0000, 0xfff9, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0000, 0x0008, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0000, 0xfff8, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0000, 0x0009, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0000, 0xfff7, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0000, 0x000e, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0000, 0xfff2, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0000, 0x000f, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0000, 0xfff1, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0000, 0x0010, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0000, 0xfff0, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0000, 0x0011, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0000, 0xffef, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0001, 0x0007, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0001, 0xfff9, 0x0080);
+  test_alu_h_vx("vsha.h.r.vx", 0x0001, 0x0008, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0001, 0xfff8, 0x0100);
+  test_alu_h_vx("vsha.h.r.vx", 0x0001, 0x0009, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0001, 0xfff7, 0x0200);
+  test_alu_h_vx("vsha.h.r.vx", 0x0001, 0x000e, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0001, 0xfff2, 0x4000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0001, 0x000f, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0001, 0xfff1, 0x7fff);
+  test_alu_h_vx("vsha.h.r.vx", 0x0001, 0x0010, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0001, 0xfff0, 0x7fff);
+  test_alu_h_vx("vsha.h.r.vx", 0x0001, 0x0011, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0x0001, 0xffef, 0x7fff);
+  test_alu_h_vx("vsha.h.r.vx", 0xffff, 0x0007, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0xffff, 0xfff9, 0xff80);
+  test_alu_h_vx("vsha.h.r.vx", 0xffff, 0x0008, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0xffff, 0xfff8, 0xff00);
+  test_alu_h_vx("vsha.h.r.vx", 0xffff, 0x0009, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0xffff, 0xfff7, 0xfe00);
+  test_alu_h_vx("vsha.h.r.vx", 0xffff, 0x000e, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0xffff, 0xfff2, 0xc000);
+  test_alu_h_vx("vsha.h.r.vx", 0xffff, 0x000f, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0xffff, 0xfff1, 0x8000);
+  test_alu_h_vx("vsha.h.r.vx", 0xffff, 0x0010, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0xffff, 0xfff0, 0x8000);
+  test_alu_h_vx("vsha.h.r.vx", 0xffff, 0x0011, 0x0000);
+  test_alu_h_vx("vsha.h.r.vx", 0xffff, 0xffef, 0x8000);
+
+  test_alu_w_vx("vsha.w.r.vx", 0x00000012, 0x00000000, 0x00000012);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000012, 0x00000001, 0x00000009);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000012, 0xffffffff, 0x00000024);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000012, 0x00000002, 0x00000005);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000012, 0xfffffffe, 0x00000048);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000012, 0x00000004, 0x00000001);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000012, 0xfffffffc, 0x00000120);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000012, 0x00000008, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000012, 0xfffffff8, 0x00001200);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000012, 0x0000000f, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000012, 0xfffffff1, 0x00090000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000012, 0x00000010, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000012, 0xfffffff0, 0x00120000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000012, 0x00000011, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000012, 0xffffffef, 0x00240000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffed, 0x00000000, 0xffffffed);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffed, 0x00000001, 0xfffffff7);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffed, 0xffffffff, 0xffffffda);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffed, 0x00000002, 0xfffffffb);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffed, 0xfffffffe, 0xffffffb4);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffed, 0x00000004, 0xffffffff);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffed, 0xfffffffc, 0xfffffed0);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffed, 0x00000008, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffed, 0xfffffff8, 0xffffed00);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffed, 0x0000000f, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffed, 0xfffffff1, 0xfff68000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffed, 0x00000010, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffed, 0xfffffff0, 0xffed0000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffed, 0x00000011, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffed, 0xffffffef, 0xffda0000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0x00000007, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0xfffffff9, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0x00000008, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0xfffffff8, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0x00000009, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0xfffffff7, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0x0000000e, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0xfffffff2, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0x0000000f, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0xfffffff1, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0x00000010, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0xfffffff0, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0x00000011, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0xffffffef, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0x0000001e, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0xffffffe2, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0x0000001f, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0xffffffe1, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0x00000020, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0xffffffe0, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0x00000021, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0xffffffdf, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0x0000003e, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0xffffffc2, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0x0000003f, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0xffffffc1, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0x00000040, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0xffffffc0, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0x00000041, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000000, 0xffffffbf, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x00000001, 0x00000001);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xffffffff, 0x00000002);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x00000002, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xfffffffe, 0x00000004);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x00000007, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xfffffff9, 0x00000080);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x00000008, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xfffffff8, 0x00000100);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x00000009, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xfffffff7, 0x00000200);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x0000000e, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xfffffff2, 0x00004000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x0000000f, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xfffffff1, 0x00008000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x00000010, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xfffffff0, 0x00010000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x00000011, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xffffffef, 0x00020000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x0000001e, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xffffffe2, 0x40000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x0000001f, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xffffffe1, 0x7fffffff);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x00000020, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xffffffe0, 0x7fffffff);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x00000021, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xffffffdf, 0x7fffffff);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xffffffc3, 0x7fffffff);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x0000003e, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xffffffc2, 0x7fffffff);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x0000003f, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xffffffc1, 0x7fffffff);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x00000040, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xffffffc0, 0x7fffffff);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0x00000041, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0x00000001, 0xffffffbf, 0x7fffffff);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0x00000007, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0xfffffff9, 0xffffff80);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0x00000008, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0xfffffff8, 0xffffff00);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0x00000009, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0xfffffff7, 0xfffffe00);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0x0000000e, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0xfffffff2, 0xffffc000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0x0000000f, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0xfffffff1, 0xffff8000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0x00000010, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0xfffffff0, 0xffff0000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0x00000011, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0xffffffef, 0xfffe0000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0x0000001e, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0xffffffe2, 0xc0000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0x0000001f, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0xffffffe1, 0x80000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0x00000020, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0xffffffe0, 0x80000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0x00000021, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0xffffffdf, 0x80000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0x0000003e, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0xffffffc2, 0x80000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0x0000003f, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0xffffffc1, 0x80000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0x00000040, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0xffffffc0, 0x80000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0x00000041, 0x00000000);
+  test_alu_w_vx("vsha.w.r.vx", 0xffffffff, 0xffffffbf, 0x80000000);
+
+  test_alu_b_vx("vshl.b.vx", 0x12, 0x00, 0x12);
+  test_alu_b_vx("vshl.b.vx", 0x12, 0x01, 0x09);
+  test_alu_b_vx("vshl.b.vx", 0x12, 0xff, 0x24);
+  test_alu_b_vx("vshl.b.vx", 0x12, 0x02, 0x04);
+  test_alu_b_vx("vshl.b.vx", 0x12, 0xfe, 0x48);
+  test_alu_b_vx("vshl.b.vx", 0x12, 0x04, 0x01);
+  test_alu_b_vx("vshl.b.vx", 0x12, 0xfc, 0xff);
+  test_alu_b_vx("vshl.b.vx", 0x12, 0x07, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0x12, 0xf9, 0xff);
+  test_alu_b_vx("vshl.b.vx", 0x12, 0x08, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0x12, 0xf8, 0xff);
+  test_alu_b_vx("vshl.b.vx", 0x12, 0x09, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0x12, 0xf7, 0xff);
+  test_alu_b_vx("vshl.b.vx", 0xed, 0x00, 0xed);
+  test_alu_b_vx("vshl.b.vx", 0xed, 0x01, 0x76);
+  test_alu_b_vx("vshl.b.vx", 0xed, 0xff, 0xff);
+  test_alu_b_vx("vshl.b.vx", 0xed, 0x02, 0x3b);
+  test_alu_b_vx("vshl.b.vx", 0xed, 0xfe, 0xff);
+  test_alu_b_vx("vshl.b.vx", 0xed, 0x04, 0x0e);
+  test_alu_b_vx("vshl.b.vx", 0xed, 0xfc, 0xff);
+  test_alu_b_vx("vshl.b.vx", 0xed, 0x07, 0x01);
+  test_alu_b_vx("vshl.b.vx", 0xed, 0xf9, 0xff);
+  test_alu_b_vx("vshl.b.vx", 0xed, 0x08, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0xed, 0xf8, 0xff);
+  test_alu_b_vx("vshl.b.vx", 0xed, 0x09, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0xed, 0xf7, 0xff);
+  test_alu_b_vx("vshl.b.vx", 0x00, 0x07, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0x00, 0xf9, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0x00, 0x08, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0x00, 0xf8, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0x00, 0x09, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0x00, 0xf7, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0x01, 0x06, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0x01, 0xfa, 0x40);
+  test_alu_b_vx("vshl.b.vx", 0x01, 0x07, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0x01, 0xf9, 0x80);
+  test_alu_b_vx("vshl.b.vx", 0x01, 0x08, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0x01, 0xf8, 0xff);
+  test_alu_b_vx("vshl.b.vx", 0x01, 0x09, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0x01, 0xf7, 0xff);
+  test_alu_b_vx("vshl.b.vx", 0xff, 0x06, 0x03);
+  test_alu_b_vx("vshl.b.vx", 0xff, 0xfa, 0xff);
+  test_alu_b_vx("vshl.b.vx", 0xff, 0x07, 0x01);
+  test_alu_b_vx("vshl.b.vx", 0xff, 0xf9, 0xff);
+  test_alu_b_vx("vshl.b.vx", 0xff, 0x08, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0xff, 0xf8, 0xff);
+  test_alu_b_vx("vshl.b.vx", 0xff, 0x09, 0x00);
+  test_alu_b_vx("vshl.b.vx", 0xff, 0xf7, 0xff);
+  test_alu_h_vx("vshl.h.vx", 0x0012, 0x0000, 0x0012);
+  test_alu_h_vx("vshl.h.vx", 0x0012, 0x0001, 0x0009);
+  test_alu_h_vx("vshl.h.vx", 0x0012, 0xffff, 0x0024);
+  test_alu_h_vx("vshl.h.vx", 0x0012, 0x0002, 0x0004);
+  test_alu_h_vx("vshl.h.vx", 0x0012, 0xfffe, 0x0048);
+  test_alu_h_vx("vshl.h.vx", 0x0012, 0x0004, 0x0001);
+  test_alu_h_vx("vshl.h.vx", 0x0012, 0xfffc, 0x0120);
+  test_alu_h_vx("vshl.h.vx", 0x0012, 0x0008, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0012, 0xfff8, 0x1200);
+  test_alu_h_vx("vshl.h.vx", 0x0012, 0x000f, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0012, 0xfff1, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0x0012, 0x0010, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0012, 0xfff0, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0x0012, 0x0011, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0012, 0xffef, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0xffed, 0x0000, 0xffed);
+  test_alu_h_vx("vshl.h.vx", 0xffed, 0x0001, 0x7ff6);
+  test_alu_h_vx("vshl.h.vx", 0xffed, 0xffff, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0xffed, 0x0002, 0x3ffb);
+  test_alu_h_vx("vshl.h.vx", 0xffed, 0xfffe, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0xffed, 0x0004, 0x0ffe);
+  test_alu_h_vx("vshl.h.vx", 0xffed, 0xfffc, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0xffed, 0x0008, 0x00ff);
+  test_alu_h_vx("vshl.h.vx", 0xffed, 0xfff8, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0xffed, 0x000f, 0x0001);
+  test_alu_h_vx("vshl.h.vx", 0xffed, 0xfff1, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0xffed, 0x0010, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0xffed, 0xfff0, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0xffed, 0x0011, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0xffed, 0xffef, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0x0000, 0x0007, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0000, 0xfff9, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0000, 0x0008, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0000, 0xfff8, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0000, 0x0009, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0000, 0xfff7, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0000, 0x000e, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0000, 0xfff2, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0000, 0x000f, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0000, 0xfff1, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0000, 0x0010, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0000, 0xfff0, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0000, 0x0011, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0000, 0xffef, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0001, 0x0007, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0001, 0xfff9, 0x0080);
+  test_alu_h_vx("vshl.h.vx", 0x0001, 0x0008, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0001, 0xfff8, 0x0100);
+  test_alu_h_vx("vshl.h.vx", 0x0001, 0x0009, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0001, 0xfff7, 0x0200);
+  test_alu_h_vx("vshl.h.vx", 0x0001, 0x000e, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0001, 0xfff2, 0x4000);
+  test_alu_h_vx("vshl.h.vx", 0x0001, 0x000f, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0001, 0xfff1, 0x8000);
+  test_alu_h_vx("vshl.h.vx", 0x0001, 0x0010, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0001, 0xfff0, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0x0001, 0x0011, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0x0001, 0xffef, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0xffff, 0x0007, 0x01ff);
+  test_alu_h_vx("vshl.h.vx", 0xffff, 0xfff9, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0xffff, 0x0008, 0x00ff);
+  test_alu_h_vx("vshl.h.vx", 0xffff, 0xfff8, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0xffff, 0x0009, 0x007f);
+  test_alu_h_vx("vshl.h.vx", 0xffff, 0xfff7, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0xffff, 0x000e, 0x0003);
+  test_alu_h_vx("vshl.h.vx", 0xffff, 0xfff2, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0xffff, 0x000f, 0x0001);
+  test_alu_h_vx("vshl.h.vx", 0xffff, 0xfff1, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0xffff, 0x0010, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0xffff, 0xfff0, 0xffff);
+  test_alu_h_vx("vshl.h.vx", 0xffff, 0x0011, 0x0000);
+  test_alu_h_vx("vshl.h.vx", 0xffff, 0xffef, 0xffff);
+  test_alu_w_vx("vshl.w.vx", 0x00000012, 0x00000000, 0x00000012);
+  test_alu_w_vx("vshl.w.vx", 0x00000012, 0x00000001, 0x00000009);
+  test_alu_w_vx("vshl.w.vx", 0x00000012, 0xffffffff, 0x00000024);
+  test_alu_w_vx("vshl.w.vx", 0x00000012, 0x00000002, 0x00000004);
+  test_alu_w_vx("vshl.w.vx", 0x00000012, 0xfffffffe, 0x00000048);
+  test_alu_w_vx("vshl.w.vx", 0x00000012, 0x00000004, 0x00000001);
+  test_alu_w_vx("vshl.w.vx", 0x00000012, 0xfffffffc, 0x00000120);
+  test_alu_w_vx("vshl.w.vx", 0x00000012, 0x00000008, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000012, 0xfffffff8, 0x00001200);
+  test_alu_w_vx("vshl.w.vx", 0x00000012, 0x0000000f, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000012, 0xfffffff1, 0x00090000);
+  test_alu_w_vx("vshl.w.vx", 0x00000012, 0x00000010, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000012, 0xfffffff0, 0x00120000);
+  test_alu_w_vx("vshl.w.vx", 0x00000012, 0x00000011, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000012, 0xffffffef, 0x00240000);
+  test_alu_w_vx("vshl.w.vx", 0xffffffed, 0x00000000, 0xffffffed);
+  test_alu_w_vx("vshl.w.vx", 0xffffffed, 0x00000001, 0x7ffffff6);
+  test_alu_w_vx("vshl.w.vx", 0xffffffed, 0xffffffff, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffed, 0x00000002, 0x3ffffffb);
+  test_alu_w_vx("vshl.w.vx", 0xffffffed, 0xfffffffe, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffed, 0x00000004, 0x0ffffffe);
+  test_alu_w_vx("vshl.w.vx", 0xffffffed, 0xfffffffc, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffed, 0x00000008, 0x00ffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffed, 0xfffffff8, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffed, 0x0000000f, 0x0001ffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffed, 0xfffffff1, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffed, 0x00000010, 0x0000ffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffed, 0xfffffff0, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffed, 0x00000011, 0x00007fff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffed, 0xffffffef, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0x00000007, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0xfffffff9, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0x00000008, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0xfffffff8, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0x00000009, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0xfffffff7, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0x0000000e, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0xfffffff2, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0x0000000f, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0xfffffff1, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0x00000010, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0xfffffff0, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0x00000011, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0xffffffef, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0x0000001e, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0xffffffe2, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0x0000001f, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0xffffffe1, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0x00000020, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0xffffffe0, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0x00000021, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0xffffffdf, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0x0000003e, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0xffffffc2, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0x0000003f, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0xffffffc1, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0x00000040, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0xffffffc0, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0x00000041, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000000, 0xffffffbf, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x00000001, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xffffffff, 0x00000002);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x00000002, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xfffffffe, 0x00000004);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x00000007, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xfffffff9, 0x00000080);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x00000008, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xfffffff8, 0x00000100);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x00000009, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xfffffff7, 0x00000200);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x0000000e, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xfffffff2, 0x00004000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x0000000f, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xfffffff1, 0x00008000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x00000010, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xfffffff0, 0x00010000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x00000011, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xffffffef, 0x00020000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x0000001e, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xffffffe2, 0x40000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x0000001f, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xffffffe1, 0x80000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x00000020, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xffffffe0, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x00000021, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xffffffdf, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x0000003e, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xffffffc2, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x0000003f, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xffffffc1, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x00000040, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xffffffc0, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0x00000041, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0x00000001, 0xffffffbf, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0x00000007, 0x01ffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0xfffffff9, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0x00000008, 0x00ffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0xfffffff8, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0x00000009, 0x007fffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0xfffffff7, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0x0000000e, 0x0003ffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0xfffffff2, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0x0000000f, 0x0001ffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0xfffffff1, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0x00000010, 0x0000ffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0xfffffff0, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0x00000011, 0x00007fff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0xffffffef, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0x0000001e, 0x00000003);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0xffffffe2, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0x0000001f, 0x00000001);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0xffffffe1, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0x00000020, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0xffffffe0, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0x00000021, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0xffffffdf, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0x0000003e, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0xffffffc2, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0x0000003f, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0xffffffc1, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0x00000040, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0xffffffc0, 0xffffffff);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0x00000041, 0x00000000);
+  test_alu_w_vx("vshl.w.vx", 0xffffffff, 0xffffffbf, 0xffffffff);
+  test_alu_b_vx("vshl.b.r.vx", 0x12, 0x00, 0x12);
+  test_alu_b_vx("vshl.b.r.vx", 0x12, 0x01, 0x09);
+  test_alu_b_vx("vshl.b.r.vx", 0x12, 0xff, 0x24);
+  test_alu_b_vx("vshl.b.r.vx", 0x12, 0x02, 0x05);
+  test_alu_b_vx("vshl.b.r.vx", 0x12, 0xfe, 0x48);
+  test_alu_b_vx("vshl.b.r.vx", 0x12, 0x04, 0x01);
+  test_alu_b_vx("vshl.b.r.vx", 0x12, 0xfc, 0xff);
+  test_alu_b_vx("vshl.b.r.vx", 0x12, 0x07, 0x00);
+  test_alu_b_vx("vshl.b.r.vx", 0x12, 0xf9, 0xff);
+  test_alu_b_vx("vshl.b.r.vx", 0x12, 0x08, 0x00);
+  test_alu_b_vx("vshl.b.r.vx", 0x12, 0xf8, 0xff);
+  test_alu_b_vx("vshl.b.r.vx", 0x12, 0x09, 0x00);
+  test_alu_b_vx("vshl.b.r.vx", 0x12, 0xf7, 0xff);
+  test_alu_b_vx("vshl.b.r.vx", 0xed, 0x00, 0xed);
+  test_alu_b_vx("vshl.b.r.vx", 0xed, 0x01, 0x77);
+  test_alu_b_vx("vshl.b.r.vx", 0xed, 0xff, 0xff);
+  test_alu_b_vx("vshl.b.r.vx", 0xed, 0x02, 0x3b);
+  test_alu_b_vx("vshl.b.r.vx", 0xed, 0xfe, 0xff);
+  test_alu_b_vx("vshl.b.r.vx", 0xed, 0x04, 0x0f);
+  test_alu_b_vx("vshl.b.r.vx", 0xed, 0xfc, 0xff);
+  test_alu_b_vx("vshl.b.r.vx", 0xed, 0x07, 0x02);
+  test_alu_b_vx("vshl.b.r.vx", 0xed, 0xf9, 0xff);
+  test_alu_b_vx("vshl.b.r.vx", 0xed, 0x08, 0x01);
+  test_alu_b_vx("vshl.b.r.vx", 0xed, 0xf8, 0xff);
+  test_alu_b_vx("vshl.b.r.vx", 0xed, 0x09, 0x00);
+  test_alu_b_vx("vshl.b.r.vx", 0xed, 0xf7, 0xff);
+  test_alu_b_vx("vshl.b.r.vx", 0x00, 0x07, 0x00);
+  test_alu_b_vx("vshl.b.r.vx", 0x00, 0xf9, 0x00);
+  test_alu_b_vx("vshl.b.r.vx", 0x00, 0x08, 0x00);
+  test_alu_b_vx("vshl.b.r.vx", 0x00, 0xf8, 0x00);
+  test_alu_b_vx("vshl.b.r.vx", 0x00, 0x09, 0x00);
+  test_alu_b_vx("vshl.b.r.vx", 0x00, 0xf7, 0x00);
+  test_alu_b_vx("vshl.b.r.vx", 0x01, 0x06, 0x00);
+  test_alu_b_vx("vshl.b.r.vx", 0x01, 0xfa, 0x40);
+  test_alu_b_vx("vshl.b.r.vx", 0x01, 0x07, 0x00);
+  test_alu_b_vx("vshl.b.r.vx", 0x01, 0xf9, 0x80);
+  test_alu_b_vx("vshl.b.r.vx", 0x01, 0x08, 0x00);
+  test_alu_b_vx("vshl.b.r.vx", 0x01, 0xf8, 0xff);
+  test_alu_b_vx("vshl.b.r.vx", 0x01, 0x09, 0x00);
+  test_alu_b_vx("vshl.b.r.vx", 0x01, 0xf7, 0xff);
+  test_alu_b_vx("vshl.b.r.vx", 0xff, 0x06, 0x04);
+  test_alu_b_vx("vshl.b.r.vx", 0xff, 0xfa, 0xff);
+  test_alu_b_vx("vshl.b.r.vx", 0xff, 0x07, 0x02);
+  test_alu_b_vx("vshl.b.r.vx", 0xff, 0xf9, 0xff);
+  test_alu_b_vx("vshl.b.r.vx", 0xff, 0x08, 0x01);
+  test_alu_b_vx("vshl.b.r.vx", 0xff, 0xf8, 0xff);
+  test_alu_b_vx("vshl.b.r.vx", 0xff, 0x09, 0x00);
+  test_alu_b_vx("vshl.b.r.vx", 0xff, 0xf7, 0xff);
+  test_alu_h_vx("vshl.h.r.vx", 0x0012, 0x0000, 0x0012);
+  test_alu_h_vx("vshl.h.r.vx", 0x0012, 0x0001, 0x0009);
+  test_alu_h_vx("vshl.h.r.vx", 0x0012, 0xffff, 0x0024);
+  test_alu_h_vx("vshl.h.r.vx", 0x0012, 0x0002, 0x0005);
+  test_alu_h_vx("vshl.h.r.vx", 0x0012, 0xfffe, 0x0048);
+  test_alu_h_vx("vshl.h.r.vx", 0x0012, 0x0004, 0x0001);
+  test_alu_h_vx("vshl.h.r.vx", 0x0012, 0xfffc, 0x0120);
+  test_alu_h_vx("vshl.h.r.vx", 0x0012, 0x0008, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0012, 0xfff8, 0x1200);
+  test_alu_h_vx("vshl.h.r.vx", 0x0012, 0x000f, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0012, 0xfff1, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0x0012, 0x0010, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0012, 0xfff0, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0x0012, 0x0011, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0012, 0xffef, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0xffed, 0x0000, 0xffed);
+  test_alu_h_vx("vshl.h.r.vx", 0xffed, 0x0001, 0x7ff7);
+  test_alu_h_vx("vshl.h.r.vx", 0xffed, 0xffff, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0xffed, 0x0002, 0x3ffb);
+  test_alu_h_vx("vshl.h.r.vx", 0xffed, 0xfffe, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0xffed, 0x0004, 0x0fff);
+  test_alu_h_vx("vshl.h.r.vx", 0xffed, 0xfffc, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0xffed, 0x0008, 0x0100);
+  test_alu_h_vx("vshl.h.r.vx", 0xffed, 0xfff8, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0xffed, 0x000f, 0x0002);
+  test_alu_h_vx("vshl.h.r.vx", 0xffed, 0xfff1, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0xffed, 0x0010, 0x0001);
+  test_alu_h_vx("vshl.h.r.vx", 0xffed, 0xfff0, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0xffed, 0x0011, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0xffed, 0xffef, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0x0000, 0x0007, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0000, 0xfff9, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0000, 0x0008, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0000, 0xfff8, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0000, 0x0009, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0000, 0xfff7, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0000, 0x000e, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0000, 0xfff2, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0000, 0x000f, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0000, 0xfff1, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0000, 0x0010, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0000, 0xfff0, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0000, 0x0011, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0000, 0xffef, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0001, 0x0007, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0001, 0xfff9, 0x0080);
+  test_alu_h_vx("vshl.h.r.vx", 0x0001, 0x0008, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0001, 0xfff8, 0x0100);
+  test_alu_h_vx("vshl.h.r.vx", 0x0001, 0x0009, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0001, 0xfff7, 0x0200);
+  test_alu_h_vx("vshl.h.r.vx", 0x0001, 0x000e, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0001, 0xfff2, 0x4000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0001, 0x000f, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0001, 0xfff1, 0x8000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0001, 0x0010, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0001, 0xfff0, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0x0001, 0x0011, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0x0001, 0xffef, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0xffff, 0x0007, 0x0200);
+  test_alu_h_vx("vshl.h.r.vx", 0xffff, 0xfff9, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0xffff, 0x0008, 0x0100);
+  test_alu_h_vx("vshl.h.r.vx", 0xffff, 0xfff8, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0xffff, 0x0009, 0x0080);
+  test_alu_h_vx("vshl.h.r.vx", 0xffff, 0xfff7, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0xffff, 0x000e, 0x0004);
+  test_alu_h_vx("vshl.h.r.vx", 0xffff, 0xfff2, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0xffff, 0x000f, 0x0002);
+  test_alu_h_vx("vshl.h.r.vx", 0xffff, 0xfff1, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0xffff, 0x0010, 0x0001);
+  test_alu_h_vx("vshl.h.r.vx", 0xffff, 0xfff0, 0xffff);
+  test_alu_h_vx("vshl.h.r.vx", 0xffff, 0x0011, 0x0000);
+  test_alu_h_vx("vshl.h.r.vx", 0xffff, 0xffef, 0xffff);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000012, 0x00000000, 0x00000012);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000012, 0x00000001, 0x00000009);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000012, 0xffffffff, 0x00000024);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000012, 0x00000002, 0x00000005);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000012, 0xfffffffe, 0x00000048);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000012, 0x00000004, 0x00000001);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000012, 0xfffffffc, 0x00000120);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000012, 0x00000008, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000012, 0xfffffff8, 0x00001200);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000012, 0x0000000f, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000012, 0xfffffff1, 0x00090000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000012, 0x00000010, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000012, 0xfffffff0, 0x00120000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000012, 0x00000011, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000012, 0xffffffef, 0x00240000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffed, 0x00000000, 0xffffffed);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffed, 0x00000001, 0x7ffffff7);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffed, 0xffffffff, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffed, 0x00000002, 0x3ffffffb);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffed, 0xfffffffe, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffed, 0x00000004, 0x0fffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffed, 0xfffffffc, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffed, 0x00000008, 0x01000000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffed, 0xfffffff8, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffed, 0x0000000f, 0x00020000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffed, 0xfffffff1, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffed, 0x00000010, 0x00010000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffed, 0xfffffff0, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffed, 0x00000011, 0x00008000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffed, 0xffffffef, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0x00000007, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0xfffffff9, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0x00000008, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0xfffffff8, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0x00000009, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0xfffffff7, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0x0000000e, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0xfffffff2, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0x0000000f, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0xfffffff1, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0x00000010, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0xfffffff0, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0x00000011, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0xffffffef, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0x0000001e, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0xffffffe2, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0x0000001f, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0xffffffe1, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0x00000020, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0xffffffe0, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0x00000021, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0xffffffdf, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0x0000003e, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0xffffffc2, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0x0000003f, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0xffffffc1, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0x00000040, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0xffffffc0, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0x00000041, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000000, 0xffffffbf, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x00000001, 0x00000001);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xffffffff, 0x00000002);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x00000002, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xfffffffe, 0x00000004);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x00000007, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xfffffff9, 0x00000080);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x00000008, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xfffffff8, 0x00000100);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x00000009, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xfffffff7, 0x00000200);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x0000000e, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xfffffff2, 0x00004000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x0000000f, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xfffffff1, 0x00008000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x00000010, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xfffffff0, 0x00010000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x00000011, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xffffffef, 0x00020000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x0000001e, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xffffffe2, 0x40000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x0000001f, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xffffffe1, 0x80000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x00000020, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xffffffe0, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x00000021, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xffffffdf, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xffffffc3, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x0000003e, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xffffffc2, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x0000003f, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xffffffc1, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x00000040, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xffffffc0, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0x00000041, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0x00000001, 0xffffffbf, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0x00000007, 0x02000000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0xfffffff9, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0x00000008, 0x01000000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0xfffffff8, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0x00000009, 0x00800000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0xfffffff7, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0x0000000e, 0x00040000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0xfffffff2, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0x0000000f, 0x00020000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0xfffffff1, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0x00000010, 0x00010000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0xfffffff0, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0x00000011, 0x00008000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0xffffffef, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0x0000001e, 0x00000004);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0xffffffe2, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0x0000001f, 0x00000002);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0xffffffe1, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0x00000020, 0x00000001);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0xffffffe0, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0x00000021, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0xffffffdf, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0x0000003e, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0xffffffc2, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0x0000003f, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0xffffffc1, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0x00000040, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0xffffffc0, 0xffffffff);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0x00000041, 0x00000000);
+  test_alu_w_vx("vshl.w.r.vx", 0xffffffff, 0xffffffbf, 0xffffffff);
+
+  // New tests.
+  test_alu_h_vx("vsha.h.vx", 0x85fb, 0x3bec, 0xffff);
+  test_alu_h_vx("vsha.h.r.vx", 0x85fb, 0x3bec, 0x0000);
+
+  return 0;
+}
diff --git a/tests/kelvin_isa/vslide.cc b/tests/kelvin_isa/vslide.cc
new file mode 100644
index 0000000..2603b72
--- /dev/null
+++ b/tests/kelvin_isa/vslide.cc
@@ -0,0 +1,645 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "crt/printf_traits.h"
+#include "tests/kelvin_isa/kelvin_test.h"
+
+#define vsliden_1_vv(T, Vd, Vs, Vt) \
+  {                                 \
+    if (sizeof(T) == 1) {           \
+      vsliden_b_1_vv(Vd, Vs, Vt);   \
+    }                               \
+    if (sizeof(T) == 2) {           \
+      vsliden_h_1_vv(Vd, Vs, Vt);   \
+    }                               \
+    if (sizeof(T) == 4) {           \
+      vsliden_w_1_vv(Vd, Vs, Vt);   \
+    }                               \
+  }
+#define vsliden_2_vv(T, Vd, Vs, Vt) \
+  {                                 \
+    if (sizeof(T) == 1) {           \
+      vsliden_b_2_vv(Vd, Vs, Vt);   \
+    }                               \
+    if (sizeof(T) == 2) {           \
+      vsliden_h_2_vv(Vd, Vs, Vt);   \
+    }                               \
+    if (sizeof(T) == 4) {           \
+      vsliden_w_2_vv(Vd, Vs, Vt);   \
+    }                               \
+  }
+#define vsliden_3_vv(T, Vd, Vs, Vt) \
+  {                                 \
+    if (sizeof(T) == 1) {           \
+      vsliden_b_3_vv(Vd, Vs, Vt);   \
+    }                               \
+    if (sizeof(T) == 2) {           \
+      vsliden_h_3_vv(Vd, Vs, Vt);   \
+    }                               \
+    if (sizeof(T) == 4) {           \
+      vsliden_w_3_vv(Vd, Vs, Vt);   \
+    }                               \
+  }
+#define vsliden_4_vv(T, Vd, Vs, Vt) \
+  {                                 \
+    if (sizeof(T) == 1) {           \
+      vsliden_b_4_vv(Vd, Vs, Vt);   \
+    }                               \
+    if (sizeof(T) == 2) {           \
+      vsliden_h_4_vv(Vd, Vs, Vt);   \
+    }                               \
+    if (sizeof(T) == 4) {           \
+      vsliden_w_4_vv(Vd, Vs, Vt);   \
+    }                               \
+  }
+#define vslidep_1_vv(T, Vd, Vs, Vt) \
+  {                                 \
+    if (sizeof(T) == 1) {           \
+      vslidep_b_1_vv(Vd, Vs, Vt);   \
+    }                               \
+    if (sizeof(T) == 2) {           \
+      vslidep_h_1_vv(Vd, Vs, Vt);   \
+    }                               \
+    if (sizeof(T) == 4) {           \
+      vslidep_w_1_vv(Vd, Vs, Vt);   \
+    }                               \
+  }
+#define vslidep_2_vv(T, Vd, Vs, Vt) \
+  {                                 \
+    if (sizeof(T) == 1) {           \
+      vslidep_b_2_vv(Vd, Vs, Vt);   \
+    }                               \
+    if (sizeof(T) == 2) {           \
+      vslidep_h_2_vv(Vd, Vs, Vt);   \
+    }                               \
+    if (sizeof(T) == 4) {           \
+      vslidep_w_2_vv(Vd, Vs, Vt);   \
+    }                               \
+  }
+#define vslidep_3_vv(T, Vd, Vs, Vt) \
+  {                                 \
+    if (sizeof(T) == 1) {           \
+      vslidep_b_3_vv(Vd, Vs, Vt);   \
+    }                               \
+    if (sizeof(T) == 2) {           \
+      vslidep_h_3_vv(Vd, Vs, Vt);   \
+    }                               \
+    if (sizeof(T) == 4) {           \
+      vslidep_w_3_vv(Vd, Vs, Vt);   \
+    }                               \
+  }
+#define vslidep_4_vv(T, Vd, Vs, Vt) \
+  {                                 \
+    if (sizeof(T) == 1) {           \
+      vslidep_b_4_vv(Vd, Vs, Vt);   \
+    }                               \
+    if (sizeof(T) == 2) {           \
+      vslidep_h_4_vv(Vd, Vs, Vt);   \
+    }                               \
+    if (sizeof(T) == 4) {           \
+      vslidep_w_4_vv(Vd, Vs, Vt);   \
+    }                               \
+  }
+
+#define vslidehn_1_vv_m(T, Vd, Vs, Vt) \
+  {                                    \
+    if (sizeof(T) == 1) {              \
+      vslidehn_b_1_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 2) {              \
+      vslidehn_h_1_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 4) {              \
+      vslidehn_w_1_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+  }
+#define vslidehn_2_vv_m(T, Vd, Vs, Vt) \
+  {                                    \
+    if (sizeof(T) == 1) {              \
+      vslidehn_b_2_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 2) {              \
+      vslidehn_h_2_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 4) {              \
+      vslidehn_w_2_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+  }
+#define vslidehn_3_vv_m(T, Vd, Vs, Vt) \
+  {                                    \
+    if (sizeof(T) == 1) {              \
+      vslidehn_b_3_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 2) {              \
+      vslidehn_h_3_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 4) {              \
+      vslidehn_w_3_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+  }
+#define vslidehn_4_vv_m(T, Vd, Vs, Vt) \
+  {                                    \
+    if (sizeof(T) == 1) {              \
+      vslidehn_b_4_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 2) {              \
+      vslidehn_h_4_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 4) {              \
+      vslidehn_w_4_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+  }
+#define vslidehp_1_vv_m(T, Vd, Vs, Vt) \
+  {                                    \
+    if (sizeof(T) == 1) {              \
+      vslidehp_b_1_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 2) {              \
+      vslidehp_h_1_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 4) {              \
+      vslidehp_w_1_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+  }
+#define vslidehp_2_vv_m(T, Vd, Vs, Vt) \
+  {                                    \
+    if (sizeof(T) == 1) {              \
+      vslidehp_b_2_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 2) {              \
+      vslidehp_h_2_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 4) {              \
+      vslidehp_w_2_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+  }
+#define vslidehp_3_vv_m(T, Vd, Vs, Vt) \
+  {                                    \
+    if (sizeof(T) == 1) {              \
+      vslidehp_b_3_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 2) {              \
+      vslidehp_h_3_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 4) {              \
+      vslidehp_w_3_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+  }
+#define vslidehp_4_vv_m(T, Vd, Vs, Vt) \
+  {                                    \
+    if (sizeof(T) == 1) {              \
+      vslidehp_b_4_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 2) {              \
+      vslidehp_h_4_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 4) {              \
+      vslidehp_w_4_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+  }
+
+#define vslidevn_1_vv_m(T, Vd, Vs, Vt) \
+  {                                    \
+    if (sizeof(T) == 1) {              \
+      vslidevn_b_1_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 2) {              \
+      vslidevn_h_1_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 4) {              \
+      vslidevn_w_1_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+  }
+#define vslidevn_2_vv_m(T, Vd, Vs, Vt) \
+  {                                    \
+    if (sizeof(T) == 1) {              \
+      vslidevn_b_2_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 2) {              \
+      vslidevn_h_2_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 4) {              \
+      vslidevn_w_2_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+  }
+#define vslidevn_3_vv_m(T, Vd, Vs, Vt) \
+  {                                    \
+    if (sizeof(T) == 1) {              \
+      vslidevn_b_3_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 2) {              \
+      vslidevn_h_3_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 4) {              \
+      vslidevn_w_3_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+  }
+#define vslidevn_4_vv_m(T, Vd, Vs, Vt) \
+  {                                    \
+    if (sizeof(T) == 1) {              \
+      vslidevn_b_4_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 2) {              \
+      vslidevn_h_4_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 4) {              \
+      vslidevn_w_4_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+  }
+#define vslidevp_1_vv_m(T, Vd, Vs, Vt) \
+  {                                    \
+    if (sizeof(T) == 1) {              \
+      vslidevp_b_1_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 2) {              \
+      vslidevp_h_1_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 4) {              \
+      vslidevp_w_1_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+  }
+#define vslidevp_2_vv_m(T, Vd, Vs, Vt) \
+  {                                    \
+    if (sizeof(T) == 1) {              \
+      vslidevp_b_2_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 2) {              \
+      vslidevp_h_2_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 4) {              \
+      vslidevp_w_2_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+  }
+#define vslidevp_3_vv_m(T, Vd, Vs, Vt) \
+  {                                    \
+    if (sizeof(T) == 1) {              \
+      vslidevp_b_3_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 2) {              \
+      vslidevp_h_3_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 4) {              \
+      vslidevp_w_3_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+  }
+#define vslidevp_4_vv_m(T, Vd, Vs, Vt) \
+  {                                    \
+    if (sizeof(T) == 1) {              \
+      vslidevp_b_4_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 2) {              \
+      vslidevp_h_4_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+    if (sizeof(T) == 4) {              \
+      vslidevp_w_4_vv_m(Vd, Vs, Vt);   \
+    }                                  \
+  }
+
+template <int s, typename T>
+void test_vsliden() {
+  int lanes;
+  getmaxvl(T, lanes);
+
+  T in0[lanes] __attribute__((aligned(64)));
+  T in1[lanes] __attribute__((aligned(64)));
+  T ref[lanes] __attribute__((aligned(64)));
+  T dut[lanes] __attribute__((aligned(64)));
+
+  for (int i = 0; i < lanes; ++i) {
+    in0[i] = krand();
+    in1[i] = krand();
+  }
+
+  for (int i = 0; i < lanes; ++i) {
+    ref[i] = i < (lanes - s) ? in0[i + s] : in1[i - (lanes - s)];
+  }
+
+  vld_x(T, v0, in0);
+  vld_x(T, v1, in1);
+  if (s == 1) vsliden_1_vv(T, v2, v0, v1);
+  if (s == 2) vsliden_2_vv(T, v2, v0, v1);
+  if (s == 3) vsliden_3_vv(T, v2, v0, v1);
+  if (s == 4) vsliden_4_vv(T, v2, v0, v1);
+  vst_x(T, v2, dut);
+
+  for (int i = 0; i < lanes; ++i) {
+    if (ref[i] != dut[i]) {
+      printf("**error vsliden<%d>[%d] ", s, i);
+      printf(PrintfTraits<T>::kFmtHex, ref[i]);
+      printf(" ");
+      printf(PrintfTraits<T>::kFmtHex, dut[i]);
+      printf("\n");
+      exit(-1);
+    }
+  }
+}
+
+template <int s, typename T>
+void test_vslidep() {
+  int lanes;
+  getmaxvl(T, lanes);
+
+  T in0[lanes] __attribute__((aligned(64)));
+  T in1[lanes] __attribute__((aligned(64)));
+  T ref[lanes] __attribute__((aligned(64)));
+  T dut[lanes] __attribute__((aligned(64)));
+
+  for (int i = 0; i < lanes; ++i) {
+    in0[i] = krand();
+    in1[i] = krand();
+  }
+
+  for (int i = 0; i < lanes; ++i) {
+    ref[i] = i - s < 0 ? in0[lanes + (i - s)] : in1[i - s];
+  }
+
+  vld_x(T, v0, in0);
+  vld_x(T, v1, in1);
+  if (s == 1) vslidep_1_vv(T, v2, v0, v1);
+  if (s == 2) vslidep_2_vv(T, v2, v0, v1);
+  if (s == 3) vslidep_3_vv(T, v2, v0, v1);
+  if (s == 4) vslidep_4_vv(T, v2, v0, v1);
+  vst_x(T, v2, dut);
+
+  for (int i = 0; i < lanes; ++i) {
+    if (ref[i] != dut[i]) {
+      printf("**error vslidep<%d>[%d] ", s, i);
+      printf(PrintfTraits<T>::kFmtHex, ref[i]);
+      printf(" ");
+      printf(PrintfTraits<T>::kFmtHex, dut[i]);
+      printf("\n");
+      exit(-1);
+    }
+  }
+}
+
+template <int s, typename T>
+void test_vslidehn_m() {
+  int lanes;
+  getmaxvl_m(T, lanes);
+
+  T in0[lanes] __attribute__((aligned(64)));
+  T in1[lanes] __attribute__((aligned(64)));
+  T ref[lanes] __attribute__((aligned(64)));
+  T dut[lanes] __attribute__((aligned(64)));
+
+  for (int i = 0; i < lanes; ++i) {
+    in0[i] = krand();
+    in1[i] = krand();
+  }
+
+  for (int i = 0; i < lanes; ++i) {
+    ref[i] = i < (lanes - s) ? in0[i + s] : in1[i - (lanes - s)];
+  }
+
+  vld_x_m(T, v0, in0);
+  vld_x_m(T, v4, in1);
+  if (s == 1) vslidehn_1_vv_m(T, v8, v0, v4);
+  if (s == 2) vslidehn_2_vv_m(T, v8, v0, v4);
+  if (s == 3) vslidehn_3_vv_m(T, v8, v0, v4);
+  if (s == 4) vslidehn_4_vv_m(T, v8, v0, v4);
+  vst_x_m(T, v8, dut);
+
+  for (int i = 0; i < lanes; ++i) {
+    if (ref[i] != dut[i]) {
+      printf("**error vslidehn_m<%d>[%d] ", s, i);
+      printf(PrintfTraits<T>::kFmtHex, ref[i]);
+      printf(" ");
+      printf(PrintfTraits<T>::kFmtHex, dut[i]);
+      printf("\n");
+      exit(-1);
+    }
+  }
+}
+
+template <int s, typename T>
+void test_vslidehp_m() {
+  int lanes;
+  getmaxvl_m(T, lanes);
+
+  T in0[lanes] __attribute__((aligned(64)));
+  T in1[lanes] __attribute__((aligned(64)));
+  T ref[lanes] __attribute__((aligned(64)));
+  T dut[lanes] __attribute__((aligned(64)));
+
+  for (int i = 0; i < lanes; ++i) {
+    in0[i] = krand();
+    in1[i] = krand();
+  }
+
+  for (int i = 0; i < lanes; ++i) {
+    ref[i] = i - s < 0 ? in0[lanes + (i - s)] : in1[i - s];
+  }
+
+  vld_x_m(T, v0, in0);
+  vld_x_m(T, v4, in1);
+  if (s == 1) vslidehp_1_vv_m(T, v8, v0, v4);
+  if (s == 2) vslidehp_2_vv_m(T, v8, v0, v4);
+  if (s == 3) vslidehp_3_vv_m(T, v8, v0, v4);
+  if (s == 4) vslidehp_4_vv_m(T, v8, v0, v4);
+  vst_x_m(T, v8, dut);
+
+  for (int i = 0; i < lanes; ++i) {
+    if (ref[i] != dut[i]) {
+      printf("**error vslidehp_m<%d>[%d] ", s, i);
+      printf(PrintfTraits<T>::kFmtHex, ref[i]);
+      printf(" ");
+      printf(PrintfTraits<T>::kFmtHex, dut[i]);
+      printf("\n");
+      exit(-1);
+    }
+  }
+}
+
+template <int s, typename T>
+void test_vslidevn_m() {
+  int lanes;
+  getmaxvl_m(T, lanes);
+
+  T in0[lanes] __attribute__((aligned(64)));
+  T in1[lanes] __attribute__((aligned(64)));
+  T ref[lanes] __attribute__((aligned(64)));
+  T dut[lanes] __attribute__((aligned(64)));
+
+  for (int i = 0; i < lanes; ++i) {
+    in0[i] = krand();
+    in1[i] = krand();
+  }
+
+  int k = lanes / 4;
+  for (int m = 0; m < 4; ++m) {
+    for (int i = 0; i < k; ++i) {
+      ref[m * k + i] =
+          i < (k - s) ? in0[m * k + i + s] : in1[m * k + i - (k - s)];
+    }
+  }
+
+  vld_x_m(T, v0, in0);
+  vld_x_m(T, v4, in1);
+  if (s == 1) vslidevn_1_vv_m(T, v8, v0, v4);
+  if (s == 2) vslidevn_2_vv_m(T, v8, v0, v4);
+  if (s == 3) vslidevn_3_vv_m(T, v8, v0, v4);
+  if (s == 4) vslidevn_4_vv_m(T, v8, v0, v4);
+  vst_x_m(T, v8, dut);
+
+  for (int i = 0; i < lanes; ++i) {
+    if (ref[i] != dut[i]) {
+      printf("**error vslidevn_m<%d>[%d] ", s, i);
+      printf(PrintfTraits<T>::kFmtHex, ref[i]);
+      printf(" ");
+      printf(PrintfTraits<T>::kFmtHex, dut[i]);
+      printf("\n");
+      exit(-1);
+    }
+  }
+}
+
+template <int s, typename T>
+void test_vslidevp_m() {
+  int lanes;
+  getmaxvl_m(T, lanes);
+
+  T in0[lanes] __attribute__((aligned(64)));
+  T in1[lanes] __attribute__((aligned(64)));
+  T ref[lanes] __attribute__((aligned(64)));
+  T dut[lanes] __attribute__((aligned(64)));
+
+  for (int i = 0; i < lanes; ++i) {
+    in0[i] = krand();
+    in1[i] = krand();
+  }
+
+  int k = lanes / 4;
+  for (int m = 0; m < 4; ++m) {
+    for (int i = 0; i < k; ++i) {
+      ref[m * k + i] =
+          i - s < 0 ? in0[k + (m * k + i - s)] : in1[m * k + i - s];
+    }
+  }
+
+  vld_x_m(T, v0, in0);
+  vld_x_m(T, v4, in1);
+  if (s == 1) vslidevp_1_vv_m(T, v8, v0, v4);
+  if (s == 2) vslidevp_2_vv_m(T, v8, v0, v4);
+  if (s == 3) vslidevp_3_vv_m(T, v8, v0, v4);
+  if (s == 4) vslidevp_4_vv_m(T, v8, v0, v4);
+  vst_x_m(T, v8, dut);
+
+  for (int i = 0; i < lanes; ++i) {
+    if (ref[i] != dut[i]) {
+      printf("**error vslidevp_m<%d>[%d] ", s, i);
+      printf(PrintfTraits<T>::kFmtHex, ref[i]);
+      printf(" ");
+      printf(PrintfTraits<T>::kFmtHex, dut[i]);
+      printf("\n");
+      exit(-1);
+    }
+  }
+}
+
+int main() {
+  test_vsliden<1, uint8_t>();
+  test_vsliden<2, uint8_t>();
+  test_vsliden<3, uint8_t>();
+  test_vsliden<4, uint8_t>();
+
+  test_vsliden<1, uint16_t>();
+  test_vsliden<2, uint16_t>();
+  test_vsliden<3, uint16_t>();
+  test_vsliden<4, uint16_t>();
+
+  test_vsliden<1, uint32_t>();
+  test_vsliden<2, uint32_t>();
+  test_vsliden<3, uint32_t>();
+  test_vsliden<4, uint32_t>();
+
+  test_vslidep<1, uint8_t>();
+  test_vslidep<2, uint8_t>();
+  test_vslidep<3, uint8_t>();
+  test_vslidep<4, uint8_t>();
+
+  test_vslidep<1, uint16_t>();
+  test_vslidep<2, uint16_t>();
+  test_vslidep<3, uint16_t>();
+  test_vslidep<4, uint16_t>();
+
+  test_vslidep<1, uint32_t>();
+  test_vslidep<2, uint32_t>();
+  test_vslidep<3, uint32_t>();
+  test_vslidep<4, uint32_t>();
+
+  test_vslidevn_m<1, uint8_t>();
+  test_vslidevn_m<2, uint8_t>();
+  test_vslidevn_m<3, uint8_t>();
+  test_vslidevn_m<4, uint8_t>();
+
+  test_vslidevn_m<1, uint16_t>();
+  test_vslidevn_m<2, uint16_t>();
+  test_vslidevn_m<3, uint16_t>();
+  test_vslidevn_m<4, uint16_t>();
+
+  test_vslidevn_m<1, uint32_t>();
+  test_vslidevn_m<2, uint32_t>();
+  test_vslidevn_m<3, uint32_t>();
+  test_vslidevn_m<4, uint32_t>();
+
+  test_vslidevp_m<1, uint8_t>();
+  test_vslidevp_m<2, uint8_t>();
+  test_vslidevp_m<3, uint8_t>();
+  test_vslidevp_m<4, uint8_t>();
+
+  test_vslidevp_m<1, uint16_t>();
+  test_vslidevp_m<2, uint16_t>();
+  test_vslidevp_m<3, uint16_t>();
+  test_vslidevp_m<4, uint16_t>();
+
+  test_vslidevp_m<1, uint32_t>();
+  test_vslidevp_m<2, uint32_t>();
+  test_vslidevp_m<3, uint32_t>();
+  test_vslidevp_m<4, uint32_t>();
+
+  test_vslidehn_m<1, uint8_t>();
+  test_vslidehn_m<2, uint8_t>();
+  test_vslidehn_m<3, uint8_t>();
+  test_vslidehn_m<4, uint8_t>();
+
+  test_vslidehn_m<1, uint16_t>();
+  test_vslidehn_m<2, uint16_t>();
+  test_vslidehn_m<3, uint16_t>();
+  test_vslidehn_m<4, uint16_t>();
+
+  test_vslidehn_m<1, uint32_t>();
+  test_vslidehn_m<2, uint32_t>();
+  test_vslidehn_m<3, uint32_t>();
+  test_vslidehn_m<4, uint32_t>();
+
+  test_vslidehp_m<1, uint8_t>();
+  test_vslidehp_m<2, uint8_t>();
+  test_vslidehp_m<3, uint8_t>();
+  test_vslidehp_m<4, uint8_t>();
+
+  test_vslidehp_m<1, uint16_t>();
+  test_vslidehp_m<2, uint16_t>();
+  test_vslidehp_m<3, uint16_t>();
+  test_vslidehp_m<4, uint16_t>();
+
+  test_vslidehp_m<1, uint32_t>();
+  test_vslidehp_m<2, uint32_t>();
+  test_vslidehp_m<3, uint32_t>();
+  test_vslidehp_m<4, uint32_t>();
+
+  return 0;
+}