blob: 2d869a6069804c153be68fe08c0302c2eba7feac [file] [log] [blame]
Cindy Liu503e5ce2023-10-24 12:18:43 -07001/*
2 * Copyright 2023 Google LLC
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include <cstdio>
18
19#include "tests/kelvin_isa/kelvin_test.h"
20
21void test_vdmulh() {
22 const uint32_t in0[4] = {0x23456789, 0x543210fe, 0x02305670, 0xedcba987};
23 const uint32_t ref[2][4] = {{0xea8d6858, 0xcccd6c0b, 0xfeab4536, 0x0b11daa9},
24 {0x129163c0, 0x2c52cda5, 0x0126fb26, 0xf66aa338}};
25 uint32_t dut[2][4];
26
27 vdup_w_x(v16, in0[0]);
28 vdup_w_x(v17, in0[1]);
29 vdup_w_x(v18, in0[2]);
30 vdup_w_x(v19, in0[3]);
31
32 vdmulh_w_rn_vx_m(v0, v16, 0xb22a768b);
33 vdmulh_w_rn_vx_m(v4, v16, 0x43623453);
34
35 vst_w_l_xx(v0, dut[0] + 0, 1);
36 vst_w_l_xx(v1, dut[0] + 1, 1);
37 vst_w_l_xx(v2, dut[0] + 2, 1);
38 vst_w_l_xx(v3, dut[0] + 3, 1);
39 vst_w_l_xx(v4, dut[1] + 0, 1);
40 vst_w_l_xx(v5, dut[1] + 1, 1);
41 vst_w_l_xx(v6, dut[1] + 2, 1);
42 vst_w_l_xx(v7, dut[1] + 3, 1);
43
44 for (int j = 0; j < 2; ++j) {
45 for (int i = 0; i < 4; ++i) {
46 const uint32_t r = ref[j][i];
47 const uint32_t d = dut[j][i];
48 if (r != d) {
49 printf("**test_vdmulh(%d,%d) %08lx %08lx\n", j, i, r, d);
50 exit(-1);
51 }
52 }
53 }
54}
55
56int main() {
57 test_alu_b_vv("vmul.b.vv", 0x00, 0x00, 0x00);
58 test_alu_b_vv("vmul.b.vv", 0x55, 0x00, 0x00);
59 test_alu_b_vv("vmul.b.vv", 0x02, 0x03, 0x06);
60 test_alu_b_vv("vmul.b.vv", 0x12, 0x06, 0x6c);
61 test_alu_b_vv("vmul.b.vv", 0x12, 0x09, 0xa2);
62 test_alu_b_vv("vmul.b.vv", 0x55, 0x03, 0xff);
63 test_alu_b_vv("vmul.b.vv", 0x55, 0x05, 0xa9);
64 test_alu_b_vv("vmul.b.vv", 0x54, 0x32, 0x68);
65 test_alu_b_vv("vmul.b.vv", 0x80, 0x7f, 0x80);
66 test_alu_b_vv("vmul.b.vv", 0x80, 0x80, 0x00);
67 test_alu_b_vv("vmul.b.vv", 0x80, 0x81, 0x80);
68 test_alu_b_vv("vmul.b.vv", 0xed, 0x23, 0x67);
69 test_alu_b_vv("vmul.b.vv", 0x54, 0x89, 0xf4);
70 test_alu_b_vv("vmul.b.vv", 0xcb, 0x07, 0x8d);
71 test_alu_b_vv("vmul.b.vv", 0xcb, 0x98, 0x88);
72 test_alu_b_vv("vmul.b.vv", 0xcb, 0xde, 0x0a);
73 test_alu_h_vv("vmul.h.vv", 0x0000, 0x0000, 0x0000);
74 test_alu_h_vv("vmul.h.vv", 0x5555, 0x0000, 0x0000);
75 test_alu_h_vv("vmul.h.vv", 0x0002, 0x0003, 0x0006);
76 test_alu_h_vv("vmul.h.vv", 0x1234, 0x0006, 0x6d38);
77 test_alu_h_vv("vmul.h.vv", 0x1234, 0x0009, 0xa3d4);
78 test_alu_h_vv("vmul.h.vv", 0x5555, 0x0003, 0xffff);
79 test_alu_h_vv("vmul.h.vv", 0x5555, 0x0005, 0xaaa9);
80 test_alu_h_vv("vmul.h.vv", 0x5432, 0x1234, 0x9e28);
81 test_alu_h_vv("vmul.h.vv", 0x5432, 0x89ab, 0xff66);
82 test_alu_h_vv("vmul.h.vv", 0x8000, 0x7fff, 0x8000);
83 test_alu_h_vv("vmul.h.vv", 0x8000, 0x8000, 0x0000);
84 test_alu_h_vv("vmul.h.vv", 0x8000, 0x8001, 0x8000);
85 test_alu_h_vv("vmul.h.vv", 0xedcb, 0x1234, 0x933c);
86 test_alu_h_vv("vmul.h.vv", 0xedcb, 0x89ab, 0x7999);
87 test_alu_h_vv("vmul.h.vv", 0xcba9, 0x0007, 0x919f);
88 test_alu_h_vv("vmul.h.vv", 0xcb98, 0x9876, 0x1810);
89 test_alu_h_vv("vmul.h.vv", 0xcb98, 0xdef3, 0x1148);
90 test_alu_w_vv("vmul.w.vv", 0x00000000, 0x00000000, 0x00000000);
91 test_alu_w_vv("vmul.w.vv", 0x55555555, 0x00000000, 0x00000000);
92 test_alu_w_vv("vmul.w.vv", 0x00000002, 0x00000003, 0x00000006);
93 test_alu_w_vv("vmul.w.vv", 0x12345678, 0x00000006, 0x6d3a06d0);
94 test_alu_w_vv("vmul.w.vv", 0x12345678, 0x00000009, 0xa3d70a38);
95 test_alu_w_vv("vmul.w.vv", 0x55555555, 0x00000003, 0xffffffff);
96 test_alu_w_vv("vmul.w.vv", 0x55555555, 0x00000005, 0xaaaaaaa9);
97 test_alu_w_vv("vmul.w.vv", 0x23456789, 0x02305670, 0x3ad551f0);
98 test_alu_w_vv("vmul.w.vv", 0x543210fe, 0x12345678, 0x98c54b10);
99 test_alu_w_vv("vmul.w.vv", 0x543210fe, 0x89abcdef, 0xfa034322);
100 test_alu_w_vv("vmul.w.vv", 0x80000000, 0x7fffffff, 0x80000000);
101 test_alu_w_vv("vmul.w.vv", 0x80000000, 0x80000000, 0x00000000);
102 test_alu_w_vv("vmul.w.vv", 0x80000000, 0x80000001, 0x80000000);
103 test_alu_w_vv("vmul.w.vv", 0xedcba987, 0x12345678, 0xcfd6d148);
104 test_alu_w_vv("vmul.w.vv", 0xedcba987, 0x89abcdef, 0x94116009);
105 test_alu_w_vv("vmul.w.vv", 0xcba98765, 0x00000007, 0x91a2b3c3);
106 test_alu_w_vv("vmul.w.vv", 0xcba98765, 0x98765432, 0xc81795ba);
107 test_alu_w_vv("vmul.w.vv", 0xcba98765, 0xdef34567, 0xbd92b2a3);
108
109 test_alu_b_vv("vmulh.b.vv", 0x00, 0x00, 0x00);
110 test_alu_b_vv("vmulh.b.vv", 0x55, 0x00, 0x00);
111 test_alu_b_vv("vmulh.b.vv", 0x02, 0x03, 0x00);
112 test_alu_b_vv("vmulh.b.vv", 0x12, 0x06, 0x00);
113 test_alu_b_vv("vmulh.b.vv", 0x12, 0x09, 0x00);
114 test_alu_b_vv("vmulh.b.vv", 0x55, 0x03, 0x00);
115 test_alu_b_vv("vmulh.b.vv", 0x55, 0x05, 0x01);
116 test_alu_b_vv("vmulh.b.vv", 0x54, 0x32, 0x10);
117 test_alu_b_vv("vmulh.b.vv", 0xed, 0x23, 0xfd);
118 test_alu_b_vv("vmulh.b.vv", 0x54, 0x89, 0xd8);
119 test_alu_b_vv("vmulh.b.vv", 0x80, 0x7f, 0xc0);
120 test_alu_b_vv("vmulh.b.vv", 0x80, 0x80, 0x40);
121 test_alu_b_vv("vmulh.b.vv", 0x80, 0x81, 0x3f);
122 test_alu_b_vv("vmulh.b.vv", 0xcb, 0x07, 0xfe);
123 test_alu_b_vv("vmulh.b.vv", 0xcb, 0x98, 0x15);
124 test_alu_b_vv("vmulh.b.vv", 0xcb, 0xde, 0x07);
125 test_alu_h_vv("vmulh.h.vv", 0x0000, 0x0000, 0x0000);
126 test_alu_h_vv("vmulh.h.vv", 0x5555, 0x0000, 0x0000);
127 test_alu_h_vv("vmulh.h.vv", 0x0002, 0x0003, 0x0000);
128 test_alu_h_vv("vmulh.h.vv", 0x1234, 0x0006, 0x0000);
129 test_alu_h_vv("vmulh.h.vv", 0x1234, 0x0009, 0x0000);
130 test_alu_h_vv("vmulh.h.vv", 0x5555, 0x0003, 0x0000);
131 test_alu_h_vv("vmulh.h.vv", 0x5555, 0x0005, 0x0001);
132 test_alu_h_vv("vmulh.h.vv", 0x5432, 0x1234, 0x05fc);
133 test_alu_h_vv("vmulh.h.vv", 0x5432, 0x89ab, 0xd914);
134 test_alu_h_vv("vmulh.h.vv", 0x8000, 0x7fff, 0xc000);
135 test_alu_h_vv("vmulh.h.vv", 0x8000, 0x8000, 0x4000);
136 test_alu_h_vv("vmulh.h.vv", 0x8000, 0x8001, 0x3fff);
137 test_alu_h_vv("vmulh.h.vv", 0xedcb, 0x1234, 0xfeb4);
138 test_alu_h_vv("vmulh.h.vv", 0xedcb, 0x89ab, 0x086a);
139 test_alu_h_vv("vmulh.h.vv", 0xcba9, 0x0007, 0xfffe);
140 test_alu_h_vv("vmulh.h.vv", 0xcb98, 0x9876, 0x1532);
141 test_alu_h_vv("vmulh.h.vv", 0xcb98, 0xdef3, 0x06c4);
142 test_alu_w_vv("vmulh.w.vv", 0x00000000, 0x00000000, 0x00000000);
143 test_alu_w_vv("vmulh.w.vv", 0x55555555, 0x00000000, 0x00000000);
144 test_alu_w_vv("vmulh.w.vv", 0x00000002, 0x00000003, 0x00000000);
145 test_alu_w_vv("vmulh.w.vv", 0x12345678, 0x00000006, 0x00000000);
146 test_alu_w_vv("vmulh.w.vv", 0x12345678, 0x00000009, 0x00000000);
147 test_alu_w_vv("vmulh.w.vv", 0x55555555, 0x00000003, 0x00000000);
148 test_alu_w_vv("vmulh.w.vv", 0x55555555, 0x00000005, 0x00000001);
149 test_alu_w_vv("vmulh.w.vv", 0x23456789, 0x02305670, 0x004d33bb);
150 test_alu_w_vv("vmulh.w.vv", 0x543210fe, 0x12345678, 0x05fcbbcd);
151 test_alu_w_vv("vmulh.w.vv", 0x543210fe, 0x89abcdef, 0xd9153b45);
152 test_alu_w_vv("vmulh.w.vv", 0x80000000, 0x7fffffff, 0xc0000000);
153 test_alu_w_vv("vmulh.w.vv", 0x80000000, 0x80000000, 0x40000000);
154 test_alu_w_vv("vmulh.w.vv", 0x80000000, 0x80000001, 0x3fffffff);
155 test_alu_w_vv("vmulh.w.vv", 0xedcba987, 0x12345678, 0xfeb49923);
156 test_alu_w_vv("vmulh.w.vv", 0xedcba987, 0x89abcdef, 0x086a1c97);
157 test_alu_w_vv("vmulh.w.vv", 0xcba98765, 0x00000007, 0xfffffffe);
158 test_alu_w_vv("vmulh.w.vv", 0xcba98765, 0x98765432, 0x152aefec);
159 test_alu_w_vv("vmulh.w.vv", 0xcba98765, 0xdef34567, 0x06c1bfbf);
160
161 test_alu_b_vv("vmulh.b.r.vv", 0x00, 0x00, 0x00);
162 test_alu_b_vv("vmulh.b.r.vv", 0x55, 0x00, 0x00);
163 test_alu_b_vv("vmulh.b.r.vv", 0x02, 0x03, 0x00);
164 test_alu_b_vv("vmulh.b.r.vv", 0x12, 0x06, 0x00);
165 test_alu_b_vv("vmulh.b.r.vv", 0x12, 0x09, 0x01);
166 test_alu_b_vv("vmulh.b.r.vv", 0x55, 0x03, 0x01);
167 test_alu_b_vv("vmulh.b.r.vv", 0x55, 0x05, 0x02);
168 test_alu_b_vv("vmulh.b.r.vv", 0x54, 0x32, 0x10);
169 test_alu_b_vv("vmulh.b.r.vv", 0x80, 0x7f, 0xc1);
170 test_alu_b_vv("vmulh.b.r.vv", 0x80, 0x80, 0x40);
171 test_alu_b_vv("vmulh.b.r.vv", 0x80, 0x81, 0x40);
172 test_alu_b_vv("vmulh.b.r.vv", 0xed, 0x23, 0xfd);
173 test_alu_b_vv("vmulh.b.r.vv", 0x54, 0x89, 0xd9);
174 test_alu_b_vv("vmulh.b.r.vv", 0xcb, 0x07, 0xff);
175 test_alu_b_vv("vmulh.b.r.vv", 0xcb, 0x98, 0x16);
176 test_alu_b_vv("vmulh.b.r.vv", 0xcb, 0xde, 0x07);
177 test_alu_h_vv("vmulh.h.r.vv", 0x0000, 0x0000, 0x0000);
178 test_alu_h_vv("vmulh.h.r.vv", 0x5555, 0x0000, 0x0000);
179 test_alu_h_vv("vmulh.h.r.vv", 0x0002, 0x0003, 0x0000);
180 test_alu_h_vv("vmulh.h.r.vv", 0x1234, 0x0006, 0x0000);
181 test_alu_h_vv("vmulh.h.r.vv", 0x1234, 0x0009, 0x0001);
182 test_alu_h_vv("vmulh.h.r.vv", 0x5555, 0x0003, 0x0001);
183 test_alu_h_vv("vmulh.h.r.vv", 0x5555, 0x0005, 0x0002);
184 test_alu_h_vv("vmulh.h.r.vv", 0x5432, 0x1234, 0x05fd);
185 test_alu_h_vv("vmulh.h.r.vv", 0x5432, 0x89ab, 0xd915);
186 test_alu_h_vv("vmulh.h.r.vv", 0x8000, 0x7fff, 0xc001);
187 test_alu_h_vv("vmulh.h.r.vv", 0x8000, 0x8000, 0x4000);
188 test_alu_h_vv("vmulh.h.r.vv", 0x8000, 0x8001, 0x4000);
189 test_alu_h_vv("vmulh.h.r.vv", 0xedcb, 0x1234, 0xfeb5);
190 test_alu_h_vv("vmulh.h.r.vv", 0xedcb, 0x89ab, 0x086a);
191 test_alu_h_vv("vmulh.h.r.vv", 0xcba9, 0x0007, 0xffff);
192 test_alu_h_vv("vmulh.h.r.vv", 0xcb98, 0x9876, 0x1532);
193 test_alu_h_vv("vmulh.h.r.vv", 0xcb98, 0xdef3, 0x06c4);
194 test_alu_w_vv("vmulh.w.r.vv", 0x00000000, 0x00000000, 0x00000000);
195 test_alu_w_vv("vmulh.w.r.vv", 0x55555555, 0x00000000, 0x00000000);
196 test_alu_w_vv("vmulh.w.r.vv", 0x00000002, 0x00000003, 0x00000000);
197 test_alu_w_vv("vmulh.w.r.vv", 0x12345678, 0x00000006, 0x00000000);
198 test_alu_w_vv("vmulh.w.r.vv", 0x12345678, 0x00000009, 0x00000001);
199 test_alu_w_vv("vmulh.w.r.vv", 0x55555555, 0x00000003, 0x00000001);
200 test_alu_w_vv("vmulh.w.r.vv", 0x55555555, 0x00000005, 0x00000002);
201 test_alu_w_vv("vmulh.w.r.vv", 0x23456789, 0x02305670, 0x004d33bb);
202 test_alu_w_vv("vmulh.w.r.vv", 0x543210fe, 0x12345678, 0x05fcbbce);
203 test_alu_w_vv("vmulh.w.r.vv", 0x543210fe, 0x89abcdef, 0xd9153b46);
204 test_alu_w_vv("vmulh.w.r.vv", 0x80000000, 0x7fffffff, 0xc0000001);
205 test_alu_w_vv("vmulh.w.r.vv", 0x80000000, 0x80000000, 0x40000000);
206 test_alu_w_vv("vmulh.w.r.vv", 0x80000000, 0x80000001, 0x40000000);
207 test_alu_w_vv("vmulh.w.r.vv", 0xedcba987, 0x12345678, 0xfeb49924);
208 test_alu_w_vv("vmulh.w.r.vv", 0xedcba987, 0x89abcdef, 0x086a1c98);
209 test_alu_w_vv("vmulh.w.r.vv", 0xcba98765, 0x00000007, 0xffffffff);
210 test_alu_w_vv("vmulh.w.r.vv", 0xcba98765, 0x98765432, 0x152aefed);
211 test_alu_w_vv("vmulh.w.r.vv", 0xcba98765, 0xdef34567, 0x06c1bfc0);
212
213 test_alu_b_vv("vmulhu.b.vv", 0x00, 0x00, 0x00);
214 test_alu_b_vv("vmulhu.b.vv", 0x55, 0x00, 0x00);
215 test_alu_b_vv("vmulhu.b.vv", 0x02, 0x03, 0x00);
216 test_alu_b_vv("vmulhu.b.vv", 0x12, 0x06, 0x00);
217 test_alu_b_vv("vmulhu.b.vv", 0x12, 0x09, 0x00);
218 test_alu_b_vv("vmulhu.b.vv", 0x55, 0x03, 0x00);
219 test_alu_b_vv("vmulhu.b.vv", 0x55, 0x05, 0x01);
220 test_alu_b_vv("vmulhu.b.vv", 0x54, 0x32, 0x10);
221 test_alu_b_vv("vmulhu.b.vv", 0x80, 0x7f, 0x3f);
222 test_alu_b_vv("vmulhu.b.vv", 0x80, 0x80, 0x40);
223 test_alu_b_vv("vmulhu.b.vv", 0x80, 0x81, 0x40);
224 test_alu_b_vv("vmulhu.b.vv", 0xed, 0x23, 0x20);
225 test_alu_b_vv("vmulhu.b.vv", 0x54, 0x89, 0x2c);
226 test_alu_b_vv("vmulhu.b.vv", 0xcb, 0x07, 0x05);
227 test_alu_b_vv("vmulhu.b.vv", 0xcb, 0x98, 0x78);
228 test_alu_b_vv("vmulhu.b.vv", 0xcb, 0xde, 0xb0);
229 test_alu_h_vv("vmulhu.h.vv", 0x0000, 0x0000, 0x0000);
230 test_alu_h_vv("vmulhu.h.vv", 0x5555, 0x0000, 0x0000);
231 test_alu_h_vv("vmulhu.h.vv", 0x0002, 0x0003, 0x0000);
232 test_alu_h_vv("vmulhu.h.vv", 0x1234, 0x0006, 0x0000);
233 test_alu_h_vv("vmulhu.h.vv", 0x1234, 0x0009, 0x0000);
234 test_alu_h_vv("vmulhu.h.vv", 0x5555, 0x0003, 0x0000);
235 test_alu_h_vv("vmulhu.h.vv", 0x5555, 0x0005, 0x0001);
236 test_alu_h_vv("vmulhu.h.vv", 0x5432, 0x1234, 0x05fc);
237 test_alu_h_vv("vmulhu.h.vv", 0x5432, 0x89ab, 0x2d46);
238 test_alu_h_vv("vmulhu.h.vv", 0x8000, 0x7fff, 0x3fff);
239 test_alu_h_vv("vmulhu.h.vv", 0x8000, 0x8000, 0x4000);
240 test_alu_h_vv("vmulhu.h.vv", 0x8000, 0x8001, 0x4000);
241 test_alu_h_vv("vmulhu.h.vv", 0xedcb, 0x1234, 0x10e8);
242 test_alu_h_vv("vmulhu.h.vv", 0xedcb, 0x89ab, 0x7fe0);
243 test_alu_h_vv("vmulhu.h.vv", 0xcba9, 0x0007, 0x0005);
244 test_alu_h_vv("vmulhu.h.vv", 0xcb98, 0x9876, 0x7940);
245 test_alu_h_vv("vmulhu.h.vv", 0xcb98, 0xdef3, 0xb14f);
246 test_alu_w_vv("vmulhu.w.vv", 0x00000000, 0x00000000, 0x00000000);
247 test_alu_w_vv("vmulhu.w.vv", 0x55555555, 0x00000000, 0x00000000);
248 test_alu_w_vv("vmulhu.w.vv", 0x00000002, 0x00000003, 0x00000000);
249 test_alu_w_vv("vmulhu.w.vv", 0x12345678, 0x00000006, 0x00000000);
250 test_alu_w_vv("vmulhu.w.vv", 0x12345678, 0x00000009, 0x00000000);
251 test_alu_w_vv("vmulhu.w.vv", 0x55555555, 0x00000003, 0x00000000);
252 test_alu_w_vv("vmulhu.w.vv", 0x55555555, 0x00000005, 0x00000001);
253 test_alu_w_vv("vmulhu.w.vv", 0x23456789, 0x02305670, 0x004d33bb);
254 test_alu_w_vv("vmulhu.w.vv", 0x543210fe, 0x12345678, 0x05fcbbcd);
255 test_alu_w_vv("vmulhu.w.vv", 0x543210fe, 0x89abcdef, 0x2d474c43);
256 test_alu_w_vv("vmulhu.w.vv", 0x80000000, 0x7fffffff, 0x3fffffff);
257 test_alu_w_vv("vmulhu.w.vv", 0x80000000, 0x80000000, 0x40000000);
258 test_alu_w_vv("vmulhu.w.vv", 0x80000000, 0x80000001, 0x40000000);
259 test_alu_w_vv("vmulhu.w.vv", 0xedcba987, 0x12345678, 0x10e8ef9b);
260 test_alu_w_vv("vmulhu.w.vv", 0xedcba987, 0x89abcdef, 0x7fe1940d);
261 test_alu_w_vv("vmulhu.w.vv", 0xcba98765, 0x00000007, 0x00000005);
262 test_alu_w_vv("vmulhu.w.vv", 0xcba98765, 0x98765432, 0x794acb83);
263 test_alu_w_vv("vmulhu.w.vv", 0xcba98765, 0xdef34567, 0xb15e8c8b);
264
265 test_alu_b_vv("vmulhu.b.r.vv", 0x00, 0x00, 0x00);
266 test_alu_b_vv("vmulhu.b.r.vv", 0x55, 0x00, 0x00);
267 test_alu_b_vv("vmulhu.b.r.vv", 0x02, 0x03, 0x00);
268 test_alu_b_vv("vmulhu.b.r.vv", 0x12, 0x06, 0x00);
269 test_alu_b_vv("vmulhu.b.r.vv", 0x12, 0x09, 0x01);
270 test_alu_b_vv("vmulhu.b.r.vv", 0x55, 0x03, 0x01);
271 test_alu_b_vv("vmulhu.b.r.vv", 0x55, 0x05, 0x02);
272 test_alu_b_vv("vmulhu.b.r.vv", 0x54, 0x32, 0x10);
273 test_alu_b_vv("vmulhu.b.r.vv", 0xed, 0x23, 0x20);
274 test_alu_b_vv("vmulhu.b.r.vv", 0x54, 0x89, 0x2d);
275 test_alu_b_vv("vmulhu.b.r.vv", 0x80, 0x7f, 0x40);
276 test_alu_b_vv("vmulhu.b.r.vv", 0x80, 0x80, 0x40);
277 test_alu_b_vv("vmulhu.b.r.vv", 0x80, 0x81, 0x41);
278 test_alu_b_vv("vmulhu.b.r.vv", 0xcb, 0x07, 0x06);
279 test_alu_b_vv("vmulhu.b.r.vv", 0xcb, 0x98, 0x79);
280 test_alu_b_vv("vmulhu.b.r.vv", 0xcb, 0xde, 0xb0);
281 test_alu_h_vv("vmulhu.h.r.vv", 0x0000, 0x0000, 0x0000);
282 test_alu_h_vv("vmulhu.h.r.vv", 0x5555, 0x0000, 0x0000);
283 test_alu_h_vv("vmulhu.h.r.vv", 0x0002, 0x0003, 0x0000);
284 test_alu_h_vv("vmulhu.h.r.vv", 0x1234, 0x0006, 0x0000);
285 test_alu_h_vv("vmulhu.h.r.vv", 0x1234, 0x0009, 0x0001);
286 test_alu_h_vv("vmulhu.h.r.vv", 0x5555, 0x0003, 0x0001);
287 test_alu_h_vv("vmulhu.h.r.vv", 0x5555, 0x0005, 0x0002);
288 test_alu_h_vv("vmulhu.h.r.vv", 0x5432, 0x1234, 0x05fd);
289 test_alu_h_vv("vmulhu.h.r.vv", 0x5432, 0x89ab, 0x2d47);
290 test_alu_h_vv("vmulhu.h.r.vv", 0x8000, 0x7fff, 0x4000);
291 test_alu_h_vv("vmulhu.h.r.vv", 0x8000, 0x8000, 0x4000);
292 test_alu_h_vv("vmulhu.h.r.vv", 0x8000, 0x8001, 0x4001);
293 test_alu_h_vv("vmulhu.h.r.vv", 0xedcb, 0x1234, 0x10e9);
294 test_alu_h_vv("vmulhu.h.r.vv", 0xedcb, 0x89ab, 0x7fe0);
295 test_alu_h_vv("vmulhu.h.r.vv", 0xcba9, 0x0007, 0x0006);
296 test_alu_h_vv("vmulhu.h.r.vv", 0xcb98, 0x9876, 0x7940);
297 test_alu_h_vv("vmulhu.h.r.vv", 0xcb98, 0xdef3, 0xb14f);
298 test_alu_w_vv("vmulhu.w.r.vv", 0x00000000, 0x00000000, 0x00000000);
299 test_alu_w_vv("vmulhu.w.r.vv", 0x55555555, 0x00000000, 0x00000000);
300 test_alu_w_vv("vmulhu.w.r.vv", 0x00000002, 0x00000003, 0x00000000);
301 test_alu_w_vv("vmulhu.w.r.vv", 0x12345678, 0x00000006, 0x00000000);
302 test_alu_w_vv("vmulhu.w.r.vv", 0x12345678, 0x00000009, 0x00000001);
303 test_alu_w_vv("vmulhu.w.r.vv", 0x55555555, 0x00000003, 0x00000001);
304 test_alu_w_vv("vmulhu.w.r.vv", 0x55555555, 0x00000005, 0x00000002);
305 test_alu_w_vv("vmulhu.w.r.vv", 0x23456789, 0x02305670, 0x004d33bb);
306 test_alu_w_vv("vmulhu.w.r.vv", 0x543210fe, 0x12345678, 0x05fcbbce);
307 test_alu_w_vv("vmulhu.w.r.vv", 0x543210fe, 0x89abcdef, 0x2d474c44);
308 test_alu_w_vv("vmulhu.w.r.vv", 0x80000000, 0x7fffffff, 0x40000000);
309 test_alu_w_vv("vmulhu.w.r.vv", 0x80000000, 0x80000000, 0x40000000);
310 test_alu_w_vv("vmulhu.w.r.vv", 0x80000000, 0x80000001, 0x40000001);
311 test_alu_w_vv("vmulhu.w.r.vv", 0xedcba987, 0x12345678, 0x10e8ef9c);
312 test_alu_w_vv("vmulhu.w.r.vv", 0xedcba987, 0x89abcdef, 0x7fe1940e);
313 test_alu_w_vv("vmulhu.w.r.vv", 0xcba98765, 0x00000007, 0x00000006);
314 test_alu_w_vv("vmulhu.w.r.vv", 0xcba98765, 0x98765432, 0x794acb84);
315 test_alu_w_vv("vmulhu.w.r.vv", 0xcba98765, 0xdef34567, 0xb15e8c8c);
316
317 test_alu_b_vv("vmuls.b.vv", 0x00, 0x00, 0x00);
318 test_alu_b_vv("vmuls.b.vv", 0x55, 0x00, 0x00);
319 test_alu_b_vv("vmuls.b.vv", 0x02, 0x03, 0x06);
320 test_alu_b_vv("vmuls.b.vv", 0x12, 0x06, 0x6c);
321 test_alu_b_vv("vmuls.b.vv", 0x12, 0x09, 0x7f);
322 test_alu_b_vv("vmuls.b.vv", 0x55, 0x03, 0x7f);
323 test_alu_b_vv("vmuls.b.vv", 0x55, 0x05, 0x7f);
324 test_alu_b_vv("vmuls.b.vv", 0x54, 0x32, 0x7f);
325 test_alu_b_vv("vmuls.b.vv", 0xed, 0x23, 0x80);
326 test_alu_b_vv("vmuls.b.vv", 0x54, 0x89, 0x80);
327 test_alu_b_vv("vmuls.b.vv", 0x80, 0x7f, 0x80);
328 test_alu_b_vv("vmuls.b.vv", 0x80, 0x80, 0x7f);
329 test_alu_b_vv("vmuls.b.vv", 0x80, 0x81, 0x7f);
330 test_alu_b_vv("vmuls.b.vv", 0xcb, 0x07, 0x80);
331 test_alu_b_vv("vmuls.b.vv", 0xcb, 0x98, 0x7f);
332 test_alu_b_vv("vmuls.b.vv", 0xcb, 0xde, 0x7f);
333 test_alu_h_vv("vmuls.h.vv", 0x0000, 0x0000, 0x0000);
334 test_alu_h_vv("vmuls.h.vv", 0x5555, 0x0000, 0x0000);
335 test_alu_h_vv("vmuls.h.vv", 0x0002, 0x0003, 0x0006);
336 test_alu_h_vv("vmuls.h.vv", 0x1234, 0x0006, 0x6d38);
337 test_alu_h_vv("vmuls.h.vv", 0x1234, 0x0009, 0x7fff);
338 test_alu_h_vv("vmuls.h.vv", 0x5555, 0x0003, 0x7fff);
339 test_alu_h_vv("vmuls.h.vv", 0x5555, 0x0005, 0x7fff);
340 test_alu_h_vv("vmuls.h.vv", 0x5432, 0x1234, 0x7fff);
341 test_alu_h_vv("vmuls.h.vv", 0x5432, 0x89ab, 0x8000);
342 test_alu_h_vv("vmuls.h.vv", 0x8000, 0x7fff, 0x8000);
343 test_alu_h_vv("vmuls.h.vv", 0x8000, 0x8000, 0x7fff);
344 test_alu_h_vv("vmuls.h.vv", 0x8000, 0x8001, 0x7fff);
345 test_alu_h_vv("vmuls.h.vv", 0xedcb, 0x1234, 0x8000);
346 test_alu_h_vv("vmuls.h.vv", 0xedcb, 0x89ab, 0x7fff);
347 test_alu_h_vv("vmuls.h.vv", 0xcba9, 0x0007, 0x8000);
348 test_alu_h_vv("vmuls.h.vv", 0xcb98, 0x9876, 0x7fff);
349 test_alu_h_vv("vmuls.h.vv", 0xcb98, 0xdef3, 0x7fff);
350 test_alu_w_vv("vmuls.w.vv", 0x00000000, 0x00000000, 0x00000000);
351 test_alu_w_vv("vmuls.w.vv", 0x55555555, 0x00000000, 0x00000000);
352 test_alu_w_vv("vmuls.w.vv", 0x00000002, 0x00000003, 0x00000006);
353 test_alu_w_vv("vmuls.w.vv", 0x12345678, 0x00000006, 0x6d3a06d0);
354 test_alu_w_vv("vmuls.w.vv", 0x12345678, 0x00000009, 0x7fffffff);
355 test_alu_w_vv("vmuls.w.vv", 0x55555555, 0x00000003, 0x7fffffff);
356 test_alu_w_vv("vmuls.w.vv", 0x55555555, 0x00000005, 0x7fffffff);
357 test_alu_w_vv("vmuls.w.vv", 0x23456789, 0x02305670, 0x7fffffff);
358 test_alu_w_vv("vmuls.w.vv", 0x543210fe, 0x12345678, 0x7fffffff);
359 test_alu_w_vv("vmuls.w.vv", 0x543210fe, 0x89abcdef, 0x80000000);
360 test_alu_w_vv("vmuls.w.vv", 0x80000000, 0x7fffffff, 0x80000000);
361 test_alu_w_vv("vmuls.w.vv", 0x80000000, 0x80000000, 0x7fffffff);
362 test_alu_w_vv("vmuls.w.vv", 0x80000000, 0x80000001, 0x7fffffff);
363 test_alu_w_vv("vmuls.w.vv", 0xedcba987, 0x12345678, 0x80000000);
364 test_alu_w_vv("vmuls.w.vv", 0xedcba987, 0x89abcdef, 0x7fffffff);
365 test_alu_w_vv("vmuls.w.vv", 0xcba98765, 0x00000007, 0x80000000);
366 test_alu_w_vv("vmuls.w.vv", 0xcba98765, 0x98765432, 0x7fffffff);
367 test_alu_w_vv("vmuls.w.vv", 0xcba98765, 0xdef34567, 0x7fffffff);
368
369 test_alu_b_vv("vmuls.b.u.vv", 0x00, 0x00, 0x00);
370 test_alu_b_vv("vmuls.b.u.vv", 0x55, 0x00, 0x00);
371 test_alu_b_vv("vmuls.b.u.vv", 0x02, 0x03, 0x06);
372 test_alu_b_vv("vmuls.b.u.vv", 0x12, 0x06, 0x6c);
373 test_alu_b_vv("vmuls.b.u.vv", 0x12, 0x09, 0xa2);
374 test_alu_b_vv("vmuls.b.u.vv", 0x55, 0x03, 0xff);
375 test_alu_b_vv("vmuls.b.u.vv", 0x55, 0x05, 0xff);
376 test_alu_b_vv("vmuls.b.u.vv", 0x54, 0x32, 0xff);
377 test_alu_b_vv("vmuls.b.u.vv", 0xed, 0x23, 0xff);
378 test_alu_b_vv("vmuls.b.u.vv", 0x54, 0x89, 0xff);
379 test_alu_b_vv("vmuls.b.u.vv", 0x80, 0x7f, 0xff);
380 test_alu_b_vv("vmuls.b.u.vv", 0x80, 0x80, 0xff);
381 test_alu_b_vv("vmuls.b.u.vv", 0x80, 0x81, 0xff);
382 test_alu_b_vv("vmuls.b.u.vv", 0xcb, 0x07, 0xff);
383 test_alu_b_vv("vmuls.b.u.vv", 0xcb, 0x98, 0xff);
384 test_alu_b_vv("vmuls.b.u.vv", 0xcb, 0xde, 0xff);
385 test_alu_h_vv("vmuls.h.u.vv", 0x0000, 0x0000, 0x0000);
386 test_alu_h_vv("vmuls.h.u.vv", 0x5555, 0x0000, 0x0000);
387 test_alu_h_vv("vmuls.h.u.vv", 0x0002, 0x0003, 0x0006);
388 test_alu_h_vv("vmuls.h.u.vv", 0x1234, 0x0006, 0x6d38);
389 test_alu_h_vv("vmuls.h.u.vv", 0x1234, 0x0009, 0xa3d4);
390 test_alu_h_vv("vmuls.h.u.vv", 0x5555, 0x0003, 0xffff);
391 test_alu_h_vv("vmuls.h.u.vv", 0x5555, 0x0005, 0xffff);
392 test_alu_h_vv("vmuls.h.u.vv", 0x5432, 0x1234, 0xffff);
393 test_alu_h_vv("vmuls.h.u.vv", 0x5432, 0x89ab, 0xffff);
394 test_alu_h_vv("vmuls.h.u.vv", 0x8000, 0x7fff, 0xffff);
395 test_alu_h_vv("vmuls.h.u.vv", 0x8000, 0x8000, 0xffff);
396 test_alu_h_vv("vmuls.h.u.vv", 0x8000, 0x8001, 0xffff);
397 test_alu_h_vv("vmuls.h.u.vv", 0xedcb, 0x1234, 0xffff);
398 test_alu_h_vv("vmuls.h.u.vv", 0xedcb, 0x89ab, 0xffff);
399 test_alu_h_vv("vmuls.h.u.vv", 0xcba9, 0x0007, 0xffff);
400 test_alu_h_vv("vmuls.h.u.vv", 0xcb98, 0x9876, 0xffff);
401 test_alu_h_vv("vmuls.h.u.vv", 0xcb98, 0xdef3, 0xffff);
402 test_alu_w_vv("vmuls.w.u.vv", 0x00000000, 0x00000000, 0x00000000);
403 test_alu_w_vv("vmuls.w.u.vv", 0x55555555, 0x00000000, 0x00000000);
404 test_alu_w_vv("vmuls.w.u.vv", 0x00000002, 0x00000003, 0x00000006);
405 test_alu_w_vv("vmuls.w.u.vv", 0x12345678, 0x00000006, 0x6d3a06d0);
406 test_alu_w_vv("vmuls.w.u.vv", 0x12345678, 0x00000009, 0xa3d70a38);
407 test_alu_w_vv("vmuls.w.u.vv", 0x55555555, 0x00000003, 0xffffffff);
408 test_alu_w_vv("vmuls.w.u.vv", 0x55555555, 0x00000005, 0xffffffff);
409 test_alu_w_vv("vmuls.w.u.vv", 0x23456789, 0x02305670, 0xffffffff);
410 test_alu_w_vv("vmuls.w.u.vv", 0x543210fe, 0x12345678, 0xffffffff);
411 test_alu_w_vv("vmuls.w.u.vv", 0x543210fe, 0x89abcdef, 0xffffffff);
412 test_alu_w_vv("vmuls.w.u.vv", 0x80000000, 0x7fffffff, 0xffffffff);
413 test_alu_w_vv("vmuls.w.u.vv", 0x80000000, 0x80000000, 0xffffffff);
414 test_alu_w_vv("vmuls.w.u.vv", 0x80000000, 0x80000001, 0xffffffff);
415 test_alu_w_vv("vmuls.w.u.vv", 0xedcba987, 0x12345678, 0xffffffff);
416 test_alu_w_vv("vmuls.w.u.vv", 0xedcba987, 0x89abcdef, 0xffffffff);
417 test_alu_w_vv("vmuls.w.u.vv", 0xcba98765, 0x00000007, 0xffffffff);
418 test_alu_w_vv("vmuls.w.u.vv", 0xcba98765, 0x98765432, 0xffffffff);
419 test_alu_w_vv("vmuls.w.u.vv", 0xcba98765, 0xdef34567, 0xffffffff);
420
421 test_aluw_h_vv("vmulw.h.vv", 0x00, 0x00, 0x0000);
422 test_aluw_h_vv("vmulw.h.vv", 0x55, 0x00, 0x0000);
423 test_aluw_h_vv("vmulw.h.vv", 0x02, 0x03, 0x0006);
424 test_aluw_h_vv("vmulw.h.vv", 0x12, 0x06, 0x006c);
425 test_aluw_h_vv("vmulw.h.vv", 0x12, 0x09, 0x00a2);
426 test_aluw_h_vv("vmulw.h.vv", 0x55, 0x03, 0x00ff);
427 test_aluw_h_vv("vmulw.h.vv", 0x55, 0x05, 0x01a9);
428 test_aluw_h_vv("vmulw.h.vv", 0x54, 0x32, 0x1068);
429 test_aluw_h_vv("vmulw.h.vv", 0xed, 0x23, 0xfd67);
430 test_aluw_h_vv("vmulw.h.vv", 0x54, 0x89, 0xd8f4);
431 test_aluw_h_vv("vmulw.h.vv", 0x80, 0x7f, 0xc080);
432 test_aluw_h_vv("vmulw.h.vv", 0x80, 0x80, 0x4000);
433 test_aluw_h_vv("vmulw.h.vv", 0x80, 0x81, 0x3f80);
434 test_aluw_h_vv("vmulw.h.vv", 0xcb, 0x07, 0xfe8d);
435 test_aluw_h_vv("vmulw.h.vv", 0xcb, 0x98, 0x1588);
436 test_aluw_h_vv("vmulw.h.vv", 0xcb, 0xde, 0x070a);
437 test_aluw_w_vv("vmulw.w.vv", 0x0000, 0x0000, 0x00000000);
438 test_aluw_w_vv("vmulw.w.vv", 0x5555, 0x0000, 0x00000000);
439 test_aluw_w_vv("vmulw.w.vv", 0x0002, 0x0003, 0x00000006);
440 test_aluw_w_vv("vmulw.w.vv", 0x1234, 0x0006, 0x00006d38);
441 test_aluw_w_vv("vmulw.w.vv", 0x1234, 0x0009, 0x0000a3d4);
442 test_aluw_w_vv("vmulw.w.vv", 0x5555, 0x0003, 0x0000ffff);
443 test_aluw_w_vv("vmulw.w.vv", 0x5555, 0x0005, 0x0001aaa9);
444 test_aluw_w_vv("vmulw.w.vv", 0x5432, 0x1234, 0x05fc9e28);
445 test_aluw_w_vv("vmulw.w.vv", 0x5432, 0x89ab, 0xd914ff66);
446 test_aluw_w_vv("vmulw.w.vv", 0x8000, 0x7fff, 0xc0008000);
447 test_aluw_w_vv("vmulw.w.vv", 0x8000, 0x8000, 0x40000000);
448 test_aluw_w_vv("vmulw.w.vv", 0x8000, 0x8001, 0x3fff8000);
449 test_aluw_w_vv("vmulw.w.vv", 0xedcb, 0x1234, 0xfeb4933c);
450 test_aluw_w_vv("vmulw.w.vv", 0xedcb, 0x89ab, 0x086a7999);
451 test_aluw_w_vv("vmulw.w.vv", 0xcba9, 0x0007, 0xfffe919f);
452 test_aluw_w_vv("vmulw.w.vv", 0xcb98, 0x9876, 0x15321810);
453 test_aluw_w_vv("vmulw.w.vv", 0xcb98, 0xdef3, 0x06c41148);
454
455 test_aluw_h_vv("vmulw.h.u.vv", 0x00, 0x00, 0x0000);
456 test_aluw_h_vv("vmulw.h.u.vv", 0x55, 0x00, 0x0000);
457 test_aluw_h_vv("vmulw.h.u.vv", 0x02, 0x03, 0x0006);
458 test_aluw_h_vv("vmulw.h.u.vv", 0x12, 0x06, 0x006c);
459 test_aluw_h_vv("vmulw.h.u.vv", 0x12, 0x09, 0x00a2);
460 test_aluw_h_vv("vmulw.h.u.vv", 0x55, 0x03, 0x00ff);
461 test_aluw_h_vv("vmulw.h.u.vv", 0x55, 0x05, 0x01a9);
462 test_aluw_h_vv("vmulw.h.u.vv", 0x54, 0x32, 0x1068);
463 test_aluw_h_vv("vmulw.h.u.vv", 0xed, 0x23, 0x2067);
464 test_aluw_h_vv("vmulw.h.u.vv", 0x54, 0x89, 0x2cf4);
465 test_aluw_h_vv("vmulw.h.u.vv", 0x80, 0x7f, 0x3f80);
466 test_aluw_h_vv("vmulw.h.u.vv", 0x80, 0x80, 0x4000);
467 test_aluw_h_vv("vmulw.h.u.vv", 0x80, 0x81, 0x4080);
468 test_aluw_h_vv("vmulw.h.u.vv", 0xcb, 0x07, 0x058d);
469 test_aluw_h_vv("vmulw.h.u.vv", 0xcb, 0x98, 0x7888);
470 test_aluw_h_vv("vmulw.h.u.vv", 0xcb, 0xde, 0xb00a);
471 test_aluw_w_vv("vmulw.w.u.vv", 0x0000, 0x0000, 0x00000000);
472 test_aluw_w_vv("vmulw.w.u.vv", 0x5555, 0x0000, 0x00000000);
473 test_aluw_w_vv("vmulw.w.u.vv", 0x0002, 0x0003, 0x00000006);
474 test_aluw_w_vv("vmulw.w.u.vv", 0x1234, 0x0006, 0x00006d38);
475 test_aluw_w_vv("vmulw.w.u.vv", 0x1234, 0x0009, 0x0000a3d4);
476 test_aluw_w_vv("vmulw.w.u.vv", 0x5555, 0x0003, 0x0000ffff);
477 test_aluw_w_vv("vmulw.w.u.vv", 0x5555, 0x0005, 0x0001aaa9);
478 test_aluw_w_vv("vmulw.w.u.vv", 0x5432, 0x1234, 0x05fc9e28);
479 test_aluw_w_vv("vmulw.w.u.vv", 0x5432, 0x89ab, 0x2d46ff66);
480 test_aluw_w_vv("vmulw.w.u.vv", 0x8000, 0x7fff, 0x3fff8000);
481 test_aluw_w_vv("vmulw.w.u.vv", 0x8000, 0x8000, 0x40000000);
482 test_aluw_w_vv("vmulw.w.u.vv", 0x8000, 0x8001, 0x40008000);
483 test_aluw_w_vv("vmulw.w.u.vv", 0xedcb, 0x1234, 0x10e8933c);
484 test_aluw_w_vv("vmulw.w.u.vv", 0xedcb, 0x89ab, 0x7fe07999);
485 test_aluw_w_vv("vmulw.w.u.vv", 0xcba9, 0x0007, 0x0005919f);
486 test_aluw_w_vv("vmulw.w.u.vv", 0xcb98, 0x9876, 0x79401810);
487 test_aluw_w_vv("vmulw.w.u.vv", 0xcb98, 0xdef3, 0xb14f1148);
488
489 test_alu_b_vv("vdmulh.b.vv", 0x00, 0x00, 0x00);
490 test_alu_b_vv("vdmulh.b.vv", 0x55, 0x00, 0x00);
491 test_alu_b_vv("vdmulh.b.vv", 0x02, 0x03, 0x00);
492 test_alu_b_vv("vdmulh.b.vv", 0x12, 0x06, 0x00);
493 test_alu_b_vv("vdmulh.b.vv", 0x12, 0x09, 0x01);
494 test_alu_b_vv("vdmulh.b.vv", 0x55, 0x03, 0x01);
495 test_alu_b_vv("vdmulh.b.vv", 0x55, 0x05, 0x03);
496 test_alu_b_vv("vdmulh.b.vv", 0x54, 0x32, 0x20);
497 test_alu_b_vv("vdmulh.b.vv", 0xed, 0x23, 0xfa);
498 test_alu_b_vv("vdmulh.b.vv", 0x54, 0x89, 0xb1);
499 test_alu_b_vv("vdmulh.b.vv", 0xcb, 0x07, 0xfd);
500 test_alu_b_vv("vdmulh.b.vv", 0xcb, 0x98, 0x2b);
501 test_alu_b_vv("vdmulh.b.vv", 0xcb, 0xde, 0x0e);
502 test_alu_b_vv("vdmulh.b.vv", 0x40, 0x40, 0x20);
503 test_alu_b_vv("vdmulh.b.vv", 0x40, 0x80, 0xc0);
504 test_alu_b_vv("vdmulh.b.vv", 0x80, 0x3f, 0xc1);
505 test_alu_b_vv("vdmulh.b.vv", 0x80, 0x40, 0xc0);
506 test_alu_b_vv("vdmulh.b.vv", 0x80, 0x41, 0xbf);
507 test_alu_b_vv("vdmulh.b.vv", 0x80, 0x7f, 0x81);
508 test_alu_b_vv("vdmulh.b.vv", 0x80, 0x80, 0x7f);
509 test_alu_b_vv("vdmulh.b.vv", 0x80, 0x81, 0x7f);
510 test_alu_b_vv("vdmulh.b.vv", 0xff, 0xff, 0x00);
511 test_alu_h_vv("vdmulh.h.vv", 0x0000, 0x0000, 0x0000);
512 test_alu_h_vv("vdmulh.h.vv", 0x5555, 0x0000, 0x0000);
513 test_alu_h_vv("vdmulh.h.vv", 0x0002, 0x0003, 0x0000);
514 test_alu_h_vv("vdmulh.h.vv", 0x1234, 0x0006, 0x0000);
515 test_alu_h_vv("vdmulh.h.vv", 0x1234, 0x0009, 0x0001);
516 test_alu_h_vv("vdmulh.h.vv", 0x5555, 0x0003, 0x0001);
517 test_alu_h_vv("vdmulh.h.vv", 0x5555, 0x0005, 0x0003);
518 test_alu_h_vv("vdmulh.h.vv", 0x5432, 0x1234, 0x0bf9);
519 test_alu_h_vv("vdmulh.h.vv", 0x5432, 0x89ab, 0xb229);
520 test_alu_h_vv("vdmulh.h.vv", 0xedcb, 0x1234, 0xfd69);
521 test_alu_h_vv("vdmulh.h.vv", 0xedcb, 0x89ab, 0x10d4);
522 test_alu_h_vv("vdmulh.h.vv", 0xcba9, 0x0007, 0xfffd);
523 test_alu_h_vv("vdmulh.h.vv", 0xcb98, 0x9876, 0x2a64);
524 test_alu_h_vv("vdmulh.h.vv", 0xcb98, 0xdef3, 0x0d88);
525 test_alu_h_vv("vdmulh.h.vv", 0x4000, 0x4000, 0x2000);
526 test_alu_h_vv("vdmulh.h.vv", 0x4000, 0x8000, 0xc000);
527 test_alu_h_vv("vdmulh.h.vv", 0x8000, 0x3fff, 0xc001);
528 test_alu_h_vv("vdmulh.h.vv", 0x8000, 0x4000, 0xc000);
529 test_alu_h_vv("vdmulh.h.vv", 0x8000, 0x4001, 0xbfff);
530 test_alu_h_vv("vdmulh.h.vv", 0x8000, 0x7fff, 0x8001);
531 test_alu_h_vv("vdmulh.h.vv", 0x8000, 0x8000, 0x7fff);
532 test_alu_h_vv("vdmulh.h.vv", 0x8000, 0x8001, 0x7fff);
533 test_alu_h_vv("vdmulh.h.vv", 0xffff, 0xffff, 0x0000);
534 test_alu_w_vv("vdmulh.w.vv", 0x00000000, 0x00000000, 0x00000000);
535 test_alu_w_vv("vdmulh.w.vv", 0x55555555, 0x00000000, 0x00000000);
536 test_alu_w_vv("vdmulh.w.vv", 0x00000002, 0x00000003, 0x00000000);
537 test_alu_w_vv("vdmulh.w.vv", 0x12345678, 0x00000006, 0x00000000);
538 test_alu_w_vv("vdmulh.w.vv", 0x12345678, 0x00000009, 0x00000001);
539 test_alu_w_vv("vdmulh.w.vv", 0x55555555, 0x00000003, 0x00000001);
540 test_alu_w_vv("vdmulh.w.vv", 0x55555555, 0x00000005, 0x00000003);
541 test_alu_w_vv("vdmulh.w.vv", 0x23456789, 0x02305670, 0x009a6776);
542 test_alu_w_vv("vdmulh.w.vv", 0x543210fe, 0x12345678, 0x0bf9779b);
543 test_alu_w_vv("vdmulh.w.vv", 0x543210fe, 0x89abcdef, 0xb22a768b);
544 test_alu_w_vv("vdmulh.w.vv", 0xedcba987, 0x12345678, 0xfd693247);
545 test_alu_w_vv("vdmulh.w.vv", 0xedcba987, 0x89abcdef, 0x10d4392f);
546 test_alu_w_vv("vdmulh.w.vv", 0xcba98765, 0x00000007, 0xfffffffd);
547 test_alu_w_vv("vdmulh.w.vv", 0xcba98765, 0x98765432, 0x2a55dfd9);
548 test_alu_w_vv("vdmulh.w.vv", 0xcba98765, 0xdef34567, 0x0d837f7f);
549 test_alu_w_vv("vdmulh.w.vv", 0x40000000, 0x40000000, 0x20000000);
550 test_alu_w_vv("vdmulh.w.vv", 0x40000000, 0x80000000, 0xc0000000);
551 test_alu_w_vv("vdmulh.w.vv", 0x80000000, 0x3fffffff, 0xc0000001);
552 test_alu_w_vv("vdmulh.w.vv", 0x80000000, 0x40000000, 0xc0000000);
553 test_alu_w_vv("vdmulh.w.vv", 0x80000000, 0x40000001, 0xbfffffff);
554 test_alu_w_vv("vdmulh.w.vv", 0x80000000, 0x7fffffff, 0x80000001);
555 test_alu_w_vv("vdmulh.w.vv", 0x80000000, 0x80000000, 0x7fffffff);
556 test_alu_w_vv("vdmulh.w.vv", 0x80000000, 0x80000001, 0x7fffffff);
557 test_alu_w_vv("vdmulh.w.vv", 0xffffffff, 0xffffffff, 0x00000000);
558
559 test_alu_b_vv("vdmulh.b.r.vv", 0x00, 0x00, 0x00);
560 test_alu_b_vv("vdmulh.b.r.vv", 0x55, 0x00, 0x00);
561 test_alu_b_vv("vdmulh.b.r.vv", 0x02, 0x03, 0x00);
562 test_alu_b_vv("vdmulh.b.r.vv", 0x12, 0x06, 0x01);
563 test_alu_b_vv("vdmulh.b.r.vv", 0x12, 0x09, 0x01);
564 test_alu_b_vv("vdmulh.b.r.vv", 0x55, 0x03, 0x02);
565 test_alu_b_vv("vdmulh.b.r.vv", 0x55, 0x05, 0x03);
566 test_alu_b_vv("vdmulh.b.r.vv", 0x54, 0x32, 0x21);
567 test_alu_b_vv("vdmulh.b.r.vv", 0xed, 0x23, 0xfb);
568 test_alu_b_vv("vdmulh.b.r.vv", 0x54, 0x89, 0xb2);
569 test_alu_b_vv("vdmulh.b.r.vv", 0xcb, 0x07, 0xfd);
570 test_alu_b_vv("vdmulh.b.r.vv", 0xcb, 0x98, 0x2b);
571 test_alu_b_vv("vdmulh.b.r.vv", 0xcb, 0xde, 0x0e);
572 test_alu_b_vv("vdmulh.b.r.vv", 0x40, 0x40, 0x20);
573 test_alu_b_vv("vdmulh.b.r.vv", 0x40, 0x80, 0xc0);
574 test_alu_b_vv("vdmulh.b.r.vv", 0x80, 0x3f, 0xc1);
575 test_alu_b_vv("vdmulh.b.r.vv", 0x80, 0x40, 0xc0);
576 test_alu_b_vv("vdmulh.b.r.vv", 0x80, 0x41, 0xbf);
577 test_alu_b_vv("vdmulh.b.r.vv", 0x80, 0x7f, 0x81);
578 test_alu_b_vv("vdmulh.b.r.vv", 0x80, 0x80, 0x7f);
579 test_alu_b_vv("vdmulh.b.r.vv", 0x80, 0x81, 0x7f);
580 test_alu_b_vv("vdmulh.b.r.vv", 0xff, 0xff, 0x00);
581 test_alu_h_vv("vdmulh.h.r.vv", 0x0000, 0x0000, 0x0000);
582 test_alu_h_vv("vdmulh.h.r.vv", 0x5555, 0x0000, 0x0000);
583 test_alu_h_vv("vdmulh.h.r.vv", 0x0002, 0x0003, 0x0000);
584 test_alu_h_vv("vdmulh.h.r.vv", 0x1234, 0x0006, 0x0001);
585 test_alu_h_vv("vdmulh.h.r.vv", 0x1234, 0x0009, 0x0001);
586 test_alu_h_vv("vdmulh.h.r.vv", 0x5555, 0x0003, 0x0002);
587 test_alu_h_vv("vdmulh.h.r.vv", 0x5555, 0x0005, 0x0003);
588 test_alu_h_vv("vdmulh.h.r.vv", 0x5432, 0x1234, 0x0bf9);
589 test_alu_h_vv("vdmulh.h.r.vv", 0x5432, 0x89ab, 0xb22a);
590 test_alu_h_vv("vdmulh.h.r.vv", 0xedcb, 0x1234, 0xfd69);
591 test_alu_h_vv("vdmulh.h.r.vv", 0xedcb, 0x89ab, 0x10d5);
592 test_alu_h_vv("vdmulh.h.r.vv", 0xcba9, 0x0007, 0xfffd);
593 test_alu_h_vv("vdmulh.h.r.vv", 0xcb98, 0x9876, 0x2a64);
594 test_alu_h_vv("vdmulh.h.r.vv", 0xcb98, 0xdef3, 0x0d88);
595 test_alu_h_vv("vdmulh.h.r.vv", 0x4000, 0x4000, 0x2000);
596 test_alu_h_vv("vdmulh.h.r.vv", 0x4000, 0x8000, 0xc000);
597 test_alu_h_vv("vdmulh.h.r.vv", 0x8000, 0x3fff, 0xc001);
598 test_alu_h_vv("vdmulh.h.r.vv", 0x8000, 0x4000, 0xc000);
599 test_alu_h_vv("vdmulh.h.r.vv", 0x8000, 0x4001, 0xbfff);
600 test_alu_h_vv("vdmulh.h.r.vv", 0x8000, 0x7fff, 0x8001);
601 test_alu_h_vv("vdmulh.h.r.vv", 0x8000, 0x8000, 0x7fff);
602 test_alu_h_vv("vdmulh.h.r.vv", 0x8000, 0x8001, 0x7fff);
603 test_alu_h_vv("vdmulh.h.r.vv", 0xffff, 0xffff, 0x0000);
604 test_alu_w_vv("vdmulh.w.r.vv", 0x00000000, 0x00000000, 0x00000000);
605 test_alu_w_vv("vdmulh.w.r.vv", 0x55555555, 0x00000000, 0x00000000);
606 test_alu_w_vv("vdmulh.w.r.vv", 0x00000002, 0x00000003, 0x00000000);
607 test_alu_w_vv("vdmulh.w.r.vv", 0x12345678, 0x00000006, 0x00000001);
608 test_alu_w_vv("vdmulh.w.r.vv", 0x12345678, 0x00000009, 0x00000001);
609 test_alu_w_vv("vdmulh.w.r.vv", 0x55555555, 0x00000003, 0x00000002);
610 test_alu_w_vv("vdmulh.w.r.vv", 0x55555555, 0x00000005, 0x00000003);
611 test_alu_w_vv("vdmulh.w.r.vv", 0x23456789, 0x02305670, 0x009a6776);
612 test_alu_w_vv("vdmulh.w.r.vv", 0x543210fe, 0x12345678, 0x0bf9779b);
613 test_alu_w_vv("vdmulh.w.r.vv", 0x543210fe, 0x89abcdef, 0xb22a768c);
614 test_alu_w_vv("vdmulh.w.r.vv", 0xedcba987, 0x12345678, 0xfd693248);
615 test_alu_w_vv("vdmulh.w.r.vv", 0xedcba987, 0x89abcdef, 0x10d4392f);
616 test_alu_w_vv("vdmulh.w.r.vv", 0xcba98765, 0x00000007, 0xfffffffd);
617 test_alu_w_vv("vdmulh.w.r.vv", 0xcba98765, 0x98765432, 0x2a55dfda);
618 test_alu_w_vv("vdmulh.w.r.vv", 0xcba98765, 0xdef34567, 0x0d837f7f);
619 test_alu_w_vv("vdmulh.w.r.vv", 0x40000000, 0x40000000, 0x20000000);
620 test_alu_w_vv("vdmulh.w.r.vv", 0x40000000, 0x80000000, 0xc0000000);
621 test_alu_w_vv("vdmulh.w.r.vv", 0x80000000, 0x3fffffff, 0xc0000001);
622 test_alu_w_vv("vdmulh.w.r.vv", 0x80000000, 0x40000000, 0xc0000000);
623 test_alu_w_vv("vdmulh.w.r.vv", 0x80000000, 0x40000001, 0xbfffffff);
624 test_alu_w_vv("vdmulh.w.r.vv", 0x80000000, 0x7fffffff, 0x80000001);
625 test_alu_w_vv("vdmulh.w.r.vv", 0x80000000, 0x80000000, 0x7fffffff);
626 test_alu_w_vv("vdmulh.w.r.vv", 0x80000000, 0x80000001, 0x7fffffff);
627 test_alu_w_vv("vdmulh.w.r.vv", 0xffffffff, 0xffffffff, 0x00000000);
628
629 test_alu_b_vv("vdmulh.b.rn.vv", 0x00, 0x00, 0x00);
630 test_alu_b_vv("vdmulh.b.rn.vv", 0x55, 0x00, 0x00);
631 test_alu_b_vv("vdmulh.b.rn.vv", 0x02, 0x03, 0x00);
632 test_alu_b_vv("vdmulh.b.rn.vv", 0x12, 0x06, 0x01);
633 test_alu_b_vv("vdmulh.b.rn.vv", 0x12, 0x09, 0x01);
634 test_alu_b_vv("vdmulh.b.rn.vv", 0x55, 0x03, 0x02);
635 test_alu_b_vv("vdmulh.b.rn.vv", 0x55, 0x05, 0x03);
636 test_alu_b_vv("vdmulh.b.rn.vv", 0x54, 0x32, 0x21);
637 test_alu_b_vv("vdmulh.b.rn.vv", 0xed, 0x23, 0xfa);
638 test_alu_b_vv("vdmulh.b.rn.vv", 0x54, 0x89, 0xb1);
639 test_alu_b_vv("vdmulh.b.rn.vv", 0xcb, 0x07, 0xfc);
640 test_alu_b_vv("vdmulh.b.rn.vv", 0xcb, 0x98, 0x2b);
641 test_alu_b_vv("vdmulh.b.rn.vv", 0xcb, 0xde, 0x0e);
642 test_alu_b_vv("vdmulh.b.rn.vv", 0x40, 0x40, 0x20);
643 test_alu_b_vv("vdmulh.b.rn.vv", 0x40, 0x80, 0xbf);
644 test_alu_b_vv("vdmulh.b.rn.vv", 0x80, 0x3f, 0xc0);
645 test_alu_b_vv("vdmulh.b.rn.vv", 0x80, 0x40, 0xbf);
646 test_alu_b_vv("vdmulh.b.rn.vv", 0x80, 0x41, 0xbe);
647 test_alu_b_vv("vdmulh.b.rn.vv", 0x80, 0x7f, 0x80);
648 test_alu_b_vv("vdmulh.b.rn.vv", 0x80, 0x80, 0x7f);
649 test_alu_b_vv("vdmulh.b.rn.vv", 0x80, 0x81, 0x7f);
650 test_alu_b_vv("vdmulh.b.rn.vv", 0xff, 0xff, 0x00);
651 test_alu_h_vv("vdmulh.h.rn.vv", 0x0000, 0x0000, 0x0000);
652 test_alu_h_vv("vdmulh.h.rn.vv", 0x5555, 0x0000, 0x0000);
653 test_alu_h_vv("vdmulh.h.rn.vv", 0x0002, 0x0003, 0x0000);
654 test_alu_h_vv("vdmulh.h.rn.vv", 0x1234, 0x0006, 0x0001);
655 test_alu_h_vv("vdmulh.h.rn.vv", 0x1234, 0x0009, 0x0001);
656 test_alu_h_vv("vdmulh.h.rn.vv", 0x5555, 0x0003, 0x0002);
657 test_alu_h_vv("vdmulh.h.rn.vv", 0x5555, 0x0005, 0x0003);
658 test_alu_h_vv("vdmulh.h.rn.vv", 0x5432, 0x1234, 0x0bf9);
659 test_alu_h_vv("vdmulh.h.rn.vv", 0x5432, 0x89ab, 0xb229);
660 test_alu_h_vv("vdmulh.h.rn.vv", 0xedcb, 0x1234, 0xfd68);
661 test_alu_h_vv("vdmulh.h.rn.vv", 0xedcb, 0x89ab, 0x10d5);
662 test_alu_h_vv("vdmulh.h.rn.vv", 0xcba9, 0x0007, 0xfffc);
663 test_alu_h_vv("vdmulh.h.rn.vv", 0xcb98, 0x9876, 0x2a64);
664 test_alu_h_vv("vdmulh.h.rn.vv", 0xcb98, 0xdef3, 0x0d88);
665 test_alu_h_vv("vdmulh.h.rn.vv", 0x4000, 0x4000, 0x2000);
666 test_alu_h_vv("vdmulh.h.rn.vv", 0x4000, 0x8000, 0xbfff);
667 test_alu_h_vv("vdmulh.h.rn.vv", 0x8000, 0x3fff, 0xc000);
668 test_alu_h_vv("vdmulh.h.rn.vv", 0x8000, 0x4000, 0xbfff);
669 test_alu_h_vv("vdmulh.h.rn.vv", 0x8000, 0x4001, 0xbffe);
670 test_alu_h_vv("vdmulh.h.rn.vv", 0x8000, 0x7fff, 0x8000);
671 test_alu_h_vv("vdmulh.h.rn.vv", 0x8000, 0x8000, 0x7fff);
672 test_alu_h_vv("vdmulh.h.rn.vv", 0x8000, 0x8001, 0x7fff);
673 test_alu_h_vv("vdmulh.h.rn.vv", 0xffff, 0xffff, 0x0000);
674 test_alu_w_vv("vdmulh.w.rn.vv", 0x00000000, 0x00000000, 0x00000000);
675 test_alu_w_vv("vdmulh.w.rn.vv", 0x55555555, 0x00000000, 0x00000000);
676 test_alu_w_vv("vdmulh.w.rn.vv", 0x00000002, 0x00000003, 0x00000000);
677 test_alu_w_vv("vdmulh.w.rn.vv", 0x12345678, 0x00000006, 0x00000001);
678 test_alu_w_vv("vdmulh.w.rn.vv", 0x12345678, 0x00000009, 0x00000001);
679 test_alu_w_vv("vdmulh.w.rn.vv", 0x55555555, 0x00000003, 0x00000002);
680 test_alu_w_vv("vdmulh.w.rn.vv", 0x55555555, 0x00000005, 0x00000003);
681 test_alu_w_vv("vdmulh.w.rn.vv", 0x23456789, 0x02305670, 0x009a6776);
682 test_alu_w_vv("vdmulh.w.rn.vv", 0x543210fe, 0x12345678, 0x0bf9779b);
683 test_alu_w_vv("vdmulh.w.rn.vv", 0x543210fe, 0x89abcdef, 0xb22a768b);
684 test_alu_w_vv("vdmulh.w.rn.vv", 0xedcba987, 0x12345678, 0xfd693247);
685 test_alu_w_vv("vdmulh.w.rn.vv", 0xedcba987, 0x89abcdef, 0x10d4392f);
686 test_alu_w_vv("vdmulh.w.rn.vv", 0xcba98765, 0x00000007, 0xfffffffc);
687 test_alu_w_vv("vdmulh.w.rn.vv", 0xcba98765, 0x98765432, 0x2a55dfda);
688 test_alu_w_vv("vdmulh.w.rn.vv", 0xcba98765, 0xdef34567, 0x0d837f7f);
689 test_alu_w_vv("vdmulh.w.rn.vv", 0xcba98765, 0xdef34567, 0x0d837f7f);
690 test_alu_w_vv("vdmulh.w.rn.vv", 0x40000000, 0x40000000, 0x20000000);
691 test_alu_w_vv("vdmulh.w.rn.vv", 0x40000000, 0x80000000, 0xbfffffff);
692 test_alu_w_vv("vdmulh.w.rn.vv", 0x80000000, 0x3fffffff, 0xc0000000);
693 test_alu_w_vv("vdmulh.w.rn.vv", 0x80000000, 0x40000000, 0xbfffffff);
694 test_alu_w_vv("vdmulh.w.rn.vv", 0x80000000, 0x40000001, 0xbffffffe);
695 test_alu_w_vv("vdmulh.w.rn.vv", 0x80000000, 0x7fffffff, 0x80000000);
696 test_alu_w_vv("vdmulh.w.rn.vv", 0x80000000, 0x80000000, 0x7fffffff);
697 test_alu_w_vv("vdmulh.w.rn.vv", 0x80000000, 0x80000001, 0x7fffffff);
698 test_alu_w_vv("vdmulh.w.rn.vv", 0xffffffff, 0xffffffff, 0x00000000);
699
700 test_alu_b_vv3("vmacc.b.vv", 0x02, 0x03, 0x04, 0x0a);
701 test_alu_h_vv3("vmacc.h.vv", 0x0002, 0x0003, 0x0004, 0x000a);
702 test_alu_w_vv3("vmacc.w.vv", 0x00000002, 0x00000003, 0x00000004, 0x0000000a);
703 test_alu_b_vv3("vmadd.b.vv", 0x02, 0x03, 0x04, 0x0e);
704 test_alu_h_vv3("vmadd.h.vv", 0x00000002, 0x0003, 0x0004, 0x000e);
705 test_alu_w_vv3("vmadd.w.vv", 0x00000002, 0x00000003, 0x00000004, 0x0000000e);
706
707 test_alu_w_vv("vdmulh.w.vv", 0xffffce81, 0x45393280, 0xffffe53b);
708 test_alu_w_vv("vdmulh.w.vv", 0x00001d92, 0x6ca85b00, 0x0000191a);
709 test_alu_w_vv("vdmulh.w.vv", 0x000085ac, 0x4fea6280, 0x00005374);
710 test_alu_w_vv("vdmulh.w.vv", 0x00005305, 0x4805ec00, 0x00002eb6);
711 test_alu_w_vv("vdmulh.w.vv", 0xffffd8b0, 0x70daa300, 0xffffdd56);
712
713 test_alu_w_vv("vdmulh.w.r.vv", 0xffffce81, 0x45393280, 0xffffe53b);
714 test_alu_w_vv("vdmulh.w.r.vv", 0x00001d92, 0x6ca85b00, 0x0000191a);
715 test_alu_w_vv("vdmulh.w.r.vv", 0x000085ac, 0x4fea6280, 0x00005375);
716 test_alu_w_vv("vdmulh.w.r.vv", 0x00005305, 0x4805ec00, 0x00002eb7);
717 test_alu_w_vv("vdmulh.w.r.vv", 0xffffd8b0, 0x70daa300, 0xffffdd57);
718
719 test_alu_w_vv("vdmulh.w.rn.vv", 0xffffce81, 0x45393280, 0xffffe53a);
720 test_alu_w_vv("vdmulh.w.rn.vv", 0x00001d92, 0x6ca85b00, 0x0000191a);
721 test_alu_w_vv("vdmulh.w.rn.vv", 0x000085ac, 0x4fea6280, 0x00005375);
722 test_alu_w_vv("vdmulh.w.rn.vv", 0x00005305, 0x4805ec00, 0x00002eb7);
723 test_alu_w_vv("vdmulh.w.rn.vv", 0xffffd8b0, 0x70daa300, 0xffffdd56);
724
725 test_vdmulh();
726
727 return 0;
728}