Add more vector unit tests
Add vadd, vmul, vmv, vsel, vshift, vslide tests
Change-Id: I0e589db089ace24b1dbecd038ebc72dd6b205524
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;
+}