Debian Codegraph @

internal/engine/wazevo/backend/isa/arm64/instr_encoding_test.go

raw
1 package arm64
2
3 import (
4 "encoding/binary"
5 "encoding/hex"
6 "fmt"
7 "math"
8 "testing"
9
10 "github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc"
11 "github.com/tetratelabs/wazero/internal/engine/wazevo/ssa"
12 "github.com/tetratelabs/wazero/internal/testing/require"
13 )
14
15 func Test_dummy(t *testing.T) {
16 require.Equal(t, dummyInstruction, encodeUnconditionalBranch(false, 0))
17 }
18
19 func TestInstruction_encode(t *testing.T) {
20 m := NewBackend().(*machine)
21 dummyLabel := label(1)
22 for _, tc := range []struct {
23 setup func(*instruction)
24 want string
25 }{
26 {want: "3f441bd5", setup: func(i *instruction) { i.asMovToFPSR(xzrVReg) }},
27 {want: "21441bd5", setup: func(i *instruction) { i.asMovToFPSR(x1VReg) }},
28 {want: "21443bd5", setup: func(i *instruction) { i.asMovFromFPSR(x1VReg) }},
29 {want: "2f08417a", setup: func(i *instruction) { i.asCCmpImm(operandNR(x1VReg), 1, eq, 0b1111, false) }},
30 {want: "201841fa", setup: func(i *instruction) { i.asCCmpImm(operandNR(x1VReg), 1, ne, 0, true) }},
31 {want: "410c010e", setup: func(i *instruction) { i.asVecDup(v1VReg, operandNR(v2VReg), vecArrangement8B) }},
32 {want: "410c014e", setup: func(i *instruction) { i.asVecDup(v1VReg, operandNR(v2VReg), vecArrangement16B) }},
33 {want: "410c020e", setup: func(i *instruction) { i.asVecDup(v1VReg, operandNR(v2VReg), vecArrangement4H) }},
34 {want: "410c024e", setup: func(i *instruction) { i.asVecDup(v1VReg, operandNR(v2VReg), vecArrangement8H) }},
35 {want: "410c040e", setup: func(i *instruction) { i.asVecDup(v1VReg, operandNR(v2VReg), vecArrangement2S) }},
36 {want: "410c044e", setup: func(i *instruction) { i.asVecDup(v1VReg, operandNR(v2VReg), vecArrangement4S) }},
37 {want: "410c084e", setup: func(i *instruction) { i.asVecDup(v1VReg, operandNR(v2VReg), vecArrangement2D) }},
38 {want: "4104034e", setup: func(i *instruction) { i.asVecDupElement(v1VReg, operandNR(v2VReg), vecArrangementB, 1) }},
39 {want: "4104064e", setup: func(i *instruction) { i.asVecDupElement(v1VReg, operandNR(v2VReg), vecArrangementH, 1) }},
40 {want: "41040c4e", setup: func(i *instruction) { i.asVecDupElement(v1VReg, operandNR(v2VReg), vecArrangementS, 1) }},
41 {want: "4104184e", setup: func(i *instruction) { i.asVecDupElement(v1VReg, operandNR(v2VReg), vecArrangementD, 1) }},
42 {want: "4138032e", setup: func(i *instruction) {
43 i.asVecExtract(v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B, 7)
44 }},
45 {want: "4138036e", setup: func(i *instruction) {
46 i.asVecExtract(v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B, 7)
47 }},
48 {want: "410c036e", setup: func(i *instruction) { i.asVecMovElement(v1VReg, operandNR(v2VReg), vecArrangementB, 1, 1) }},
49 {want: "4114066e", setup: func(i *instruction) { i.asVecMovElement(v1VReg, operandNR(v2VReg), vecArrangementH, 1, 1) }},
50 {want: "41240c6e", setup: func(i *instruction) { i.asVecMovElement(v1VReg, operandNR(v2VReg), vecArrangementS, 1, 1) }},
51 {want: "4144186e", setup: func(i *instruction) { i.asVecMovElement(v1VReg, operandNR(v2VReg), vecArrangementD, 1, 1) }},
52 {want: "4104090f", setup: func(i *instruction) {
53 i.asVecShiftImm(vecOpSshr, v1VReg, operandNR(v2VReg), operandShiftImm(7), vecArrangement8B)
54 }},
55 {want: "4104094f", setup: func(i *instruction) {
56 i.asVecShiftImm(vecOpSshr, v1VReg, operandNR(v2VReg), operandShiftImm(7), vecArrangement16B)
57 }},
58 {want: "4104190f", setup: func(i *instruction) {
59 i.asVecShiftImm(vecOpSshr, v1VReg, operandNR(v2VReg), operandShiftImm(7), vecArrangement4H)
60 }},
61 {want: "4104194f", setup: func(i *instruction) {
62 i.asVecShiftImm(vecOpSshr, v1VReg, operandNR(v2VReg), operandShiftImm(7), vecArrangement8H)
63 }},
64 {want: "4104390f", setup: func(i *instruction) {
65 i.asVecShiftImm(vecOpSshr, v1VReg, operandNR(v2VReg), operandShiftImm(7), vecArrangement2S)
66 }},
67 {want: "4104394f", setup: func(i *instruction) {
68 i.asVecShiftImm(vecOpSshr, v1VReg, operandNR(v2VReg), operandShiftImm(7), vecArrangement4S)
69 }},
70 {want: "4104794f", setup: func(i *instruction) {
71 i.asVecShiftImm(vecOpSshr, v1VReg, operandNR(v2VReg), operandShiftImm(7), vecArrangement2D)
72 }},
73
74 {want: "41a40d0f", setup: func(i *instruction) {
75 i.asVecShiftImm(vecOpSshll, v1VReg, operandNR(v2VReg), operandShiftImm(3), vecArrangement8B)
76 }},
77 {want: "41a40d4f", setup: func(i *instruction) { // sshll2
78 i.asVecShiftImm(vecOpSshll, v1VReg, operandNR(v2VReg), operandShiftImm(3), vecArrangement16B)
79 }},
80 {want: "41a41d0f", setup: func(i *instruction) {
81 i.asVecShiftImm(vecOpSshll, v1VReg, operandNR(v2VReg), operandShiftImm(3), vecArrangement4H)
82 }},
83 {want: "41a41d4f", setup: func(i *instruction) { // sshll2
84 i.asVecShiftImm(vecOpSshll, v1VReg, operandNR(v2VReg), operandShiftImm(3), vecArrangement8H)
85 }},
86 {want: "41a43d0f", setup: func(i *instruction) {
87 i.asVecShiftImm(vecOpSshll, v1VReg, operandNR(v2VReg), operandShiftImm(3), vecArrangement2S)
88 }},
89 {want: "41a43d4f", setup: func(i *instruction) { // sshll2
90 i.asVecShiftImm(vecOpSshll, v1VReg, operandNR(v2VReg), operandShiftImm(3), vecArrangement4S)
91 }},
92 {want: "41a40d2f", setup: func(i *instruction) {
93 i.asVecShiftImm(vecOpUshll, v1VReg, operandNR(v2VReg), operandShiftImm(3), vecArrangement8B)
94 }},
95 {want: "41a40d6f", setup: func(i *instruction) { // ushll2
96 i.asVecShiftImm(vecOpUshll, v1VReg, operandNR(v2VReg), operandShiftImm(3), vecArrangement16B)
97 }},
98 {want: "41a41d2f", setup: func(i *instruction) {
99 i.asVecShiftImm(vecOpUshll, v1VReg, operandNR(v2VReg), operandShiftImm(3), vecArrangement4H)
100 }},
101 {want: "41a41d6f", setup: func(i *instruction) { // ushll2
102 i.asVecShiftImm(vecOpUshll, v1VReg, operandNR(v2VReg), operandShiftImm(3), vecArrangement8H)
103 }},
104 {want: "41a43d2f", setup: func(i *instruction) {
105 i.asVecShiftImm(vecOpUshll, v1VReg, operandNR(v2VReg), operandShiftImm(3), vecArrangement2S)
106 }},
107 {want: "41a43d6f", setup: func(i *instruction) { // ushll2
108 i.asVecShiftImm(vecOpUshll, v1VReg, operandNR(v2VReg), operandShiftImm(3), vecArrangement4S)
109 }},
110 {want: "4100030e", setup: func(i *instruction) {
111 i.asVecTbl(1, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
112 }},
113 {want: "4100034e", setup: func(i *instruction) {
114 i.asVecTbl(1, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
115 }},
116 {want: "4120040e", setup: func(i *instruction) {
117 i.asVecTbl(2, v1VReg, operandNR(v2VReg), operandNR(v4VReg), vecArrangement8B)
118 }},
119 {want: "4120044e", setup: func(i *instruction) {
120 i.asVecTbl(2, v1VReg, operandNR(v2VReg), operandNR(v4VReg), vecArrangement16B)
121 }},
122 {want: "4138030e", setup: func(i *instruction) {
123 i.asVecPermute(vecOpZip1, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
124 }},
125 {want: "4138034e", setup: func(i *instruction) {
126 i.asVecPermute(vecOpZip1, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
127 }},
128 {want: "4138430e", setup: func(i *instruction) {
129 i.asVecPermute(vecOpZip1, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
130 }},
131 {want: "4138434e", setup: func(i *instruction) {
132 i.asVecPermute(vecOpZip1, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
133 }},
134 {want: "4138830e", setup: func(i *instruction) {
135 i.asVecPermute(vecOpZip1, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
136 }},
137 {want: "4138834e", setup: func(i *instruction) {
138 i.asVecPermute(vecOpZip1, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
139 }},
140 {want: "4138c34e", setup: func(i *instruction) {
141 i.asVecPermute(vecOpZip1, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
142 }},
143 {want: "411ca32e", setup: func(i *instruction) {
144 i.asVecRRRRewrite(vecOpBit, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
145 }},
146 {want: "411ca36e", setup: func(i *instruction) {
147 i.asVecRRRRewrite(vecOpBit, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
148 }},
149 {want: "411c236e", setup: func(i *instruction) {
150 i.asVecRRR(vecOpEOR, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
151 }},
152 {want: "411c232e", setup: func(i *instruction) {
153 i.asVecRRR(vecOpEOR, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
154 }},
155 {want: "4184234e", setup: func(i *instruction) {
156 i.asVecRRR(vecOpAdd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
157 }},
158 {want: "4184a34e", setup: func(i *instruction) {
159 i.asVecRRR(vecOpAdd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
160 }},
161 {want: "4184e34e", setup: func(i *instruction) {
162 i.asVecRRR(vecOpAdd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
163 }},
164 {want: "410c230e", setup: func(i *instruction) {
165 i.asVecRRR(vecOpSqadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
166 }},
167 {want: "410c234e", setup: func(i *instruction) {
168 i.asVecRRR(vecOpSqadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
169 }},
170 {want: "410c630e", setup: func(i *instruction) {
171 i.asVecRRR(vecOpSqadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
172 }},
173 {want: "410c634e", setup: func(i *instruction) {
174 i.asVecRRR(vecOpSqadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
175 }},
176 {want: "410ca30e", setup: func(i *instruction) {
177 i.asVecRRR(vecOpSqadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
178 }},
179 {want: "410ca34e", setup: func(i *instruction) {
180 i.asVecRRR(vecOpSqadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
181 }},
182 {want: "410ce34e", setup: func(i *instruction) {
183 i.asVecRRR(vecOpSqadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
184 }},
185 {want: "410c232e", setup: func(i *instruction) {
186 i.asVecRRR(vecOpUqadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
187 }},
188 {want: "410c236e", setup: func(i *instruction) {
189 i.asVecRRR(vecOpUqadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
190 }},
191 {want: "410c632e", setup: func(i *instruction) {
192 i.asVecRRR(vecOpUqadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
193 }},
194 {want: "410c636e", setup: func(i *instruction) {
195 i.asVecRRR(vecOpUqadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
196 }},
197 {want: "410ca32e", setup: func(i *instruction) {
198 i.asVecRRR(vecOpUqadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
199 }},
200 {want: "410ca36e", setup: func(i *instruction) {
201 i.asVecRRR(vecOpUqadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
202 }},
203 {want: "410ce36e", setup: func(i *instruction) {
204 i.asVecRRR(vecOpUqadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
205 }},
206 {want: "412c230e", setup: func(i *instruction) {
207 i.asVecRRR(vecOpSqsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
208 }},
209 {want: "412c234e", setup: func(i *instruction) {
210 i.asVecRRR(vecOpSqsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
211 }},
212 {want: "412c630e", setup: func(i *instruction) {
213 i.asVecRRR(vecOpSqsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
214 }},
215 {want: "412c634e", setup: func(i *instruction) {
216 i.asVecRRR(vecOpSqsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
217 }},
218 {want: "412ca30e", setup: func(i *instruction) {
219 i.asVecRRR(vecOpSqsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
220 }},
221 {want: "412ca34e", setup: func(i *instruction) {
222 i.asVecRRR(vecOpSqsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
223 }},
224 {want: "412ce34e", setup: func(i *instruction) {
225 i.asVecRRR(vecOpSqsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
226 }},
227 {want: "412c232e", setup: func(i *instruction) {
228 i.asVecRRR(vecOpUqsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
229 }},
230 {want: "412c236e", setup: func(i *instruction) {
231 i.asVecRRR(vecOpUqsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
232 }},
233 {want: "412c632e", setup: func(i *instruction) {
234 i.asVecRRR(vecOpUqsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
235 }},
236 {want: "412c636e", setup: func(i *instruction) {
237 i.asVecRRR(vecOpUqsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
238 }},
239 {want: "412ca32e", setup: func(i *instruction) {
240 i.asVecRRR(vecOpUqsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
241 }},
242 {want: "412ca36e", setup: func(i *instruction) {
243 i.asVecRRR(vecOpUqsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
244 }},
245 {want: "412ce36e", setup: func(i *instruction) {
246 i.asVecRRR(vecOpUqsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
247 }},
248 {want: "4184232e", setup: func(i *instruction) {
249 i.asVecRRR(vecOpSub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
250 }},
251 {want: "4184236e", setup: func(i *instruction) {
252 i.asVecRRR(vecOpSub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
253 }},
254 {want: "4184632e", setup: func(i *instruction) {
255 i.asVecRRR(vecOpSub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
256 }},
257 {want: "4184636e", setup: func(i *instruction) {
258 i.asVecRRR(vecOpSub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
259 }},
260 {want: "4184a32e", setup: func(i *instruction) {
261 i.asVecRRR(vecOpSub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
262 }},
263 {want: "4184a36e", setup: func(i *instruction) {
264 i.asVecRRR(vecOpSub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
265 }},
266 {want: "4184e36e", setup: func(i *instruction) {
267 i.asVecRRR(vecOpSub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
268 }},
269 {want: "41bc230e", setup: func(i *instruction) {
270 i.asVecRRR(vecOpAddp, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
271 }},
272 {want: "41bc234e", setup: func(i *instruction) {
273 i.asVecRRR(vecOpAddp, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
274 }},
275 {want: "41bc630e", setup: func(i *instruction) {
276 i.asVecRRR(vecOpAddp, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
277 }},
278 {want: "41bc634e", setup: func(i *instruction) {
279 i.asVecRRR(vecOpAddp, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
280 }},
281 {want: "41bca30e", setup: func(i *instruction) {
282 i.asVecRRR(vecOpAddp, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
283 }},
284 {want: "41bca34e", setup: func(i *instruction) {
285 i.asVecRRR(vecOpAddp, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
286 }},
287 {want: "41bce34e", setup: func(i *instruction) {
288 i.asVecRRR(vecOpAddp, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
289 }},
290 {want: "41bc230e", setup: func(i *instruction) {
291 i.asVecRRR(vecOpAddp, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
292 }},
293 {want: "41b8314e", setup: func(i *instruction) {
294 i.asVecLanes(vecOpAddv, v1VReg, operandNR(v2VReg), vecArrangement16B)
295 }},
296 {want: "41b8710e", setup: func(i *instruction) {
297 i.asVecLanes(vecOpAddv, v1VReg, operandNR(v2VReg), vecArrangement4H)
298 }},
299 {want: "41b8714e", setup: func(i *instruction) {
300 i.asVecLanes(vecOpAddv, v1VReg, operandNR(v2VReg), vecArrangement8H)
301 }},
302 {want: "41b8b14e", setup: func(i *instruction) {
303 i.asVecLanes(vecOpAddv, v1VReg, operandNR(v2VReg), vecArrangement4S)
304 }},
305 {want: "416c230e", setup: func(i *instruction) {
306 i.asVecRRR(vecOpSmin, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
307 }},
308 {want: "416c234e", setup: func(i *instruction) {
309 i.asVecRRR(vecOpSmin, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
310 }},
311 {want: "416c630e", setup: func(i *instruction) {
312 i.asVecRRR(vecOpSmin, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
313 }},
314 {want: "416c634e", setup: func(i *instruction) {
315 i.asVecRRR(vecOpSmin, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
316 }},
317 {want: "416ca30e", setup: func(i *instruction) {
318 i.asVecRRR(vecOpSmin, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
319 }},
320 {want: "416ca34e", setup: func(i *instruction) {
321 i.asVecRRR(vecOpSmin, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
322 }},
323 {want: "416c232e", setup: func(i *instruction) {
324 i.asVecRRR(vecOpUmin, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
325 }},
326 {want: "416c236e", setup: func(i *instruction) {
327 i.asVecRRR(vecOpUmin, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
328 }},
329 {want: "416c632e", setup: func(i *instruction) {
330 i.asVecRRR(vecOpUmin, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
331 }},
332 {want: "416c636e", setup: func(i *instruction) {
333 i.asVecRRR(vecOpUmin, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
334 }},
335 {want: "416ca32e", setup: func(i *instruction) {
336 i.asVecRRR(vecOpUmin, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
337 }},
338 {want: "416ca36e", setup: func(i *instruction) {
339 i.asVecRRR(vecOpUmin, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
340 }},
341 {want: "4164230e", setup: func(i *instruction) {
342 i.asVecRRR(vecOpSmax, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
343 }},
344 {want: "4164234e", setup: func(i *instruction) {
345 i.asVecRRR(vecOpSmax, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
346 }},
347 {want: "4164630e", setup: func(i *instruction) {
348 i.asVecRRR(vecOpSmax, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
349 }},
350 {want: "4164634e", setup: func(i *instruction) {
351 i.asVecRRR(vecOpSmax, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
352 }},
353 {want: "4164a30e", setup: func(i *instruction) {
354 i.asVecRRR(vecOpSmax, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
355 }},
356 {want: "4164a34e", setup: func(i *instruction) {
357 i.asVecRRR(vecOpSmax, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
358 }},
359 {want: "4164232e", setup: func(i *instruction) {
360 i.asVecRRR(vecOpUmax, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
361 }},
362 {want: "4164236e", setup: func(i *instruction) {
363 i.asVecRRR(vecOpUmax, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
364 }},
365 {want: "4164632e", setup: func(i *instruction) {
366 i.asVecRRR(vecOpUmax, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
367 }},
368 {want: "4164636e", setup: func(i *instruction) {
369 i.asVecRRR(vecOpUmax, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
370 }},
371 {want: "4164a32e", setup: func(i *instruction) {
372 i.asVecRRR(vecOpUmax, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
373 }},
374 {want: "4164a36e", setup: func(i *instruction) {
375 i.asVecRRR(vecOpUmax, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
376 }},
377 {want: "41a4232e", setup: func(i *instruction) {
378 i.asVecRRR(vecOpUmaxp, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
379 }},
380 {want: "41a4236e", setup: func(i *instruction) {
381 i.asVecRRR(vecOpUmaxp, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
382 }},
383 {want: "41a4632e", setup: func(i *instruction) {
384 i.asVecRRR(vecOpUmaxp, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
385 }},
386 {want: "41a4636e", setup: func(i *instruction) {
387 i.asVecRRR(vecOpUmaxp, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
388 }},
389 {want: "41a4a32e", setup: func(i *instruction) {
390 i.asVecRRR(vecOpUmaxp, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
391 }},
392 {want: "41a8312e", setup: func(i *instruction) {
393 i.asVecLanes(vecOpUminv, v1VReg, operandNR(v2VReg), vecArrangement8B)
394 }},
395 {want: "41a8316e", setup: func(i *instruction) {
396 i.asVecLanes(vecOpUminv, v1VReg, operandNR(v2VReg), vecArrangement16B)
397 }},
398 {want: "41a8712e", setup: func(i *instruction) {
399 i.asVecLanes(vecOpUminv, v1VReg, operandNR(v2VReg), vecArrangement4H)
400 }},
401 {want: "41a8716e", setup: func(i *instruction) {
402 i.asVecLanes(vecOpUminv, v1VReg, operandNR(v2VReg), vecArrangement8H)
403 }},
404 {want: "41a8b16e", setup: func(i *instruction) {
405 i.asVecLanes(vecOpUminv, v1VReg, operandNR(v2VReg), vecArrangement4S)
406 }},
407 {want: "4114232e", setup: func(i *instruction) {
408 i.asVecRRR(vecOpUrhadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
409 }},
410 {want: "4114236e", setup: func(i *instruction) {
411 i.asVecRRR(vecOpUrhadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
412 }},
413 {want: "4114632e", setup: func(i *instruction) {
414 i.asVecRRR(vecOpUrhadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
415 }},
416 {want: "4114636e", setup: func(i *instruction) {
417 i.asVecRRR(vecOpUrhadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
418 }},
419 {want: "4114a32e", setup: func(i *instruction) {
420 i.asVecRRR(vecOpUrhadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
421 }},
422 {want: "4114a36e", setup: func(i *instruction) {
423 i.asVecRRR(vecOpUrhadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
424 }},
425 {want: "419c230e", setup: func(i *instruction) {
426 i.asVecRRR(vecOpMul, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
427 }},
428 {want: "419c234e", setup: func(i *instruction) {
429 i.asVecRRR(vecOpMul, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
430 }},
431 {want: "419c630e", setup: func(i *instruction) {
432 i.asVecRRR(vecOpMul, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
433 }},
434 {want: "419c634e", setup: func(i *instruction) {
435 i.asVecRRR(vecOpMul, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
436 }},
437 {want: "419ca30e", setup: func(i *instruction) {
438 i.asVecRRR(vecOpMul, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
439 }},
440 {want: "419ca34e", setup: func(i *instruction) {
441 i.asVecRRR(vecOpMul, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
442 }},
443 {want: "4198200e", setup: func(i *instruction) {
444 i.asVecMisc(vecOpCmeq0, v1VReg, operandNR(v2VReg), vecArrangement8B)
445 }},
446 {want: "4198204e", setup: func(i *instruction) {
447 i.asVecMisc(vecOpCmeq0, v1VReg, operandNR(v2VReg), vecArrangement16B)
448 }},
449 {want: "4198600e", setup: func(i *instruction) {
450 i.asVecMisc(vecOpCmeq0, v1VReg, operandNR(v2VReg), vecArrangement4H)
451 }},
452 {want: "4198604e", setup: func(i *instruction) {
453 i.asVecMisc(vecOpCmeq0, v1VReg, operandNR(v2VReg), vecArrangement8H)
454 }},
455 {want: "4198a00e", setup: func(i *instruction) {
456 i.asVecMisc(vecOpCmeq0, v1VReg, operandNR(v2VReg), vecArrangement2S)
457 }},
458 {want: "4198a04e", setup: func(i *instruction) {
459 i.asVecMisc(vecOpCmeq0, v1VReg, operandNR(v2VReg), vecArrangement4S)
460 }},
461 {want: "4198e04e", setup: func(i *instruction) {
462 i.asVecMisc(vecOpCmeq0, v1VReg, operandNR(v2VReg), vecArrangement2D)
463 }},
464 {want: "418c232e", setup: func(i *instruction) {
465 i.asVecRRR(vecOpCmeq, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
466 }},
467 {want: "418c236e", setup: func(i *instruction) {
468 i.asVecRRR(vecOpCmeq, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
469 }},
470 {want: "418c632e", setup: func(i *instruction) {
471 i.asVecRRR(vecOpCmeq, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
472 }},
473 {want: "418c636e", setup: func(i *instruction) {
474 i.asVecRRR(vecOpCmeq, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
475 }},
476 {want: "418ca32e", setup: func(i *instruction) {
477 i.asVecRRR(vecOpCmeq, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
478 }},
479 {want: "418ca36e", setup: func(i *instruction) {
480 i.asVecRRR(vecOpCmeq, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
481 }},
482 {want: "418ce36e", setup: func(i *instruction) {
483 i.asVecRRR(vecOpCmeq, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
484 }},
485 {want: "4134230e", setup: func(i *instruction) {
486 i.asVecRRR(vecOpCmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
487 }},
488 {want: "4134234e", setup: func(i *instruction) {
489 i.asVecRRR(vecOpCmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
490 }},
491 {want: "4134630e", setup: func(i *instruction) {
492 i.asVecRRR(vecOpCmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
493 }},
494 {want: "4134634e", setup: func(i *instruction) {
495 i.asVecRRR(vecOpCmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
496 }},
497 {want: "4134a30e", setup: func(i *instruction) {
498 i.asVecRRR(vecOpCmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
499 }},
500 {want: "4134a34e", setup: func(i *instruction) {
501 i.asVecRRR(vecOpCmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
502 }},
503 {want: "4134e34e", setup: func(i *instruction) {
504 i.asVecRRR(vecOpCmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
505 }},
506 {want: "4134232e", setup: func(i *instruction) {
507 i.asVecRRR(vecOpCmhi, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
508 }},
509 {want: "4134236e", setup: func(i *instruction) {
510 i.asVecRRR(vecOpCmhi, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
511 }},
512 {want: "4134632e", setup: func(i *instruction) {
513 i.asVecRRR(vecOpCmhi, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
514 }},
515 {want: "4134636e", setup: func(i *instruction) {
516 i.asVecRRR(vecOpCmhi, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
517 }},
518 {want: "4134a32e", setup: func(i *instruction) {
519 i.asVecRRR(vecOpCmhi, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
520 }},
521 {want: "4134a36e", setup: func(i *instruction) {
522 i.asVecRRR(vecOpCmhi, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
523 }},
524 {want: "4134e36e", setup: func(i *instruction) {
525 i.asVecRRR(vecOpCmhi, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
526 }},
527 {want: "413c230e", setup: func(i *instruction) {
528 i.asVecRRR(vecOpCmge, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
529 }},
530 {want: "413c234e", setup: func(i *instruction) {
531 i.asVecRRR(vecOpCmge, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
532 }},
533 {want: "413c630e", setup: func(i *instruction) {
534 i.asVecRRR(vecOpCmge, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
535 }},
536 {want: "413c634e", setup: func(i *instruction) {
537 i.asVecRRR(vecOpCmge, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
538 }},
539 {want: "413ca30e", setup: func(i *instruction) {
540 i.asVecRRR(vecOpCmge, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
541 }},
542 {want: "413ca34e", setup: func(i *instruction) {
543 i.asVecRRR(vecOpCmge, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
544 }},
545 {want: "413ce34e", setup: func(i *instruction) {
546 i.asVecRRR(vecOpCmge, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
547 }},
548 {want: "4134230e", setup: func(i *instruction) {
549 i.asVecRRR(vecOpCmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
550 }},
551 {want: "4134234e", setup: func(i *instruction) {
552 i.asVecRRR(vecOpCmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
553 }},
554 {want: "4134630e", setup: func(i *instruction) {
555 i.asVecRRR(vecOpCmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
556 }},
557 {want: "4134634e", setup: func(i *instruction) {
558 i.asVecRRR(vecOpCmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
559 }},
560 {want: "4134a30e", setup: func(i *instruction) {
561 i.asVecRRR(vecOpCmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
562 }},
563 {want: "4134a34e", setup: func(i *instruction) {
564 i.asVecRRR(vecOpCmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
565 }},
566 {want: "4134e34e", setup: func(i *instruction) {
567 i.asVecRRR(vecOpCmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
568 }},
569 {want: "4134232e", setup: func(i *instruction) {
570 i.asVecRRR(vecOpCmhi, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
571 }},
572 {want: "4134236e", setup: func(i *instruction) {
573 i.asVecRRR(vecOpCmhi, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
574 }},
575 {want: "4134632e", setup: func(i *instruction) {
576 i.asVecRRR(vecOpCmhi, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
577 }},
578 {want: "4134636e", setup: func(i *instruction) {
579 i.asVecRRR(vecOpCmhi, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
580 }},
581 {want: "4134a32e", setup: func(i *instruction) {
582 i.asVecRRR(vecOpCmhi, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
583 }},
584 {want: "4134a36e", setup: func(i *instruction) {
585 i.asVecRRR(vecOpCmhi, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
586 }},
587 {want: "4134e36e", setup: func(i *instruction) {
588 i.asVecRRR(vecOpCmhi, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
589 }},
590 {want: "413c232e", setup: func(i *instruction) {
591 i.asVecRRR(vecOpCmhs, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
592 }},
593 {want: "413c236e", setup: func(i *instruction) {
594 i.asVecRRR(vecOpCmhs, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
595 }},
596 {want: "413c632e", setup: func(i *instruction) {
597 i.asVecRRR(vecOpCmhs, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
598 }},
599 {want: "413c636e", setup: func(i *instruction) {
600 i.asVecRRR(vecOpCmhs, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
601 }},
602 {want: "413ca32e", setup: func(i *instruction) {
603 i.asVecRRR(vecOpCmhs, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
604 }},
605 {want: "413ca36e", setup: func(i *instruction) {
606 i.asVecRRR(vecOpCmhs, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
607 }},
608 {want: "413ce36e", setup: func(i *instruction) {
609 i.asVecRRR(vecOpCmhs, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
610 }},
611 {want: "41f4230e", setup: func(i *instruction) {
612 i.asVecRRR(vecOpFmax, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
613 }},
614 {want: "41f4234e", setup: func(i *instruction) {
615 i.asVecRRR(vecOpFmax, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
616 }},
617 {want: "41f4634e", setup: func(i *instruction) {
618 i.asVecRRR(vecOpFmax, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
619 }},
620 {want: "41f4a30e", setup: func(i *instruction) {
621 i.asVecRRR(vecOpFmin, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
622 }},
623 {want: "41f4a34e", setup: func(i *instruction) {
624 i.asVecRRR(vecOpFmin, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
625 }},
626 {want: "41f4e34e", setup: func(i *instruction) {
627 i.asVecRRR(vecOpFmin, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
628 }},
629 {want: "41d4230e", setup: func(i *instruction) {
630 i.asVecRRR(vecOpFadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
631 }},
632 {want: "41d4234e", setup: func(i *instruction) {
633 i.asVecRRR(vecOpFadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
634 }},
635 {want: "41d4634e", setup: func(i *instruction) {
636 i.asVecRRR(vecOpFadd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
637 }},
638 {want: "41d4a30e", setup: func(i *instruction) {
639 i.asVecRRR(vecOpFsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
640 }},
641 {want: "41d4a34e", setup: func(i *instruction) {
642 i.asVecRRR(vecOpFsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
643 }},
644 {want: "41d4e34e", setup: func(i *instruction) {
645 i.asVecRRR(vecOpFsub, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
646 }},
647 {want: "41dc232e", setup: func(i *instruction) {
648 i.asVecRRR(vecOpFmul, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
649 }},
650 {want: "41dc236e", setup: func(i *instruction) {
651 i.asVecRRR(vecOpFmul, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
652 }},
653 {want: "41dc636e", setup: func(i *instruction) {
654 i.asVecRRR(vecOpFmul, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
655 }},
656 {want: "41b4636e", setup: func(i *instruction) {
657 i.asVecRRR(vecOpSqrdmulh, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
658 }},
659 {want: "41b4632e", setup: func(i *instruction) {
660 i.asVecRRR(vecOpSqrdmulh, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
661 }},
662 {want: "41b4a32e", setup: func(i *instruction) {
663 i.asVecRRR(vecOpSqrdmulh, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
664 }},
665 {want: "41b4a36e", setup: func(i *instruction) {
666 i.asVecRRR(vecOpSqrdmulh, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
667 }},
668 {want: "41fc232e", setup: func(i *instruction) {
669 i.asVecRRR(vecOpFdiv, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
670 }},
671 {want: "41fc236e", setup: func(i *instruction) {
672 i.asVecRRR(vecOpFdiv, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
673 }},
674 {want: "41fc636e", setup: func(i *instruction) {
675 i.asVecRRR(vecOpFdiv, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
676 }},
677 {want: "41e4230e", setup: func(i *instruction) {
678 i.asVecRRR(vecOpFcmeq, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
679 }},
680 {want: "41e4234e", setup: func(i *instruction) {
681 i.asVecRRR(vecOpFcmeq, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
682 }},
683 {want: "41e4634e", setup: func(i *instruction) {
684 i.asVecRRR(vecOpFcmeq, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
685 }},
686 {want: "41e4a32e", setup: func(i *instruction) {
687 i.asVecRRR(vecOpFcmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
688 }},
689 {want: "41e4a36e", setup: func(i *instruction) {
690 i.asVecRRR(vecOpFcmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
691 }},
692 {want: "41e4e36e", setup: func(i *instruction) {
693 i.asVecRRR(vecOpFcmgt, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
694 }},
695 {want: "41e4232e", setup: func(i *instruction) {
696 i.asVecRRR(vecOpFcmge, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
697 }},
698 {want: "41e4236e", setup: func(i *instruction) {
699 i.asVecRRR(vecOpFcmge, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
700 }},
701 {want: "41e4636e", setup: func(i *instruction) {
702 i.asVecRRR(vecOpFcmge, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
703 }},
704 {want: "4198210e", setup: func(i *instruction) {
705 i.asVecMisc(vecOpFrintm, v1VReg, operandNR(v2VReg), vecArrangement2S)
706 }},
707 {want: "4198214e", setup: func(i *instruction) {
708 i.asVecMisc(vecOpFrintm, v1VReg, operandNR(v2VReg), vecArrangement4S)
709 }},
710 {want: "4198614e", setup: func(i *instruction) {
711 i.asVecMisc(vecOpFrintm, v1VReg, operandNR(v2VReg), vecArrangement2D)
712 }},
713 {want: "4188210e", setup: func(i *instruction) {
714 i.asVecMisc(vecOpFrintn, v1VReg, operandNR(v2VReg), vecArrangement2S)
715 }},
716 {want: "4188214e", setup: func(i *instruction) {
717 i.asVecMisc(vecOpFrintn, v1VReg, operandNR(v2VReg), vecArrangement4S)
718 }},
719 {want: "4188614e", setup: func(i *instruction) {
720 i.asVecMisc(vecOpFrintn, v1VReg, operandNR(v2VReg), vecArrangement2D)
721 }},
722 {want: "4188a10e", setup: func(i *instruction) {
723 i.asVecMisc(vecOpFrintp, v1VReg, operandNR(v2VReg), vecArrangement2S)
724 }},
725 {want: "4188a14e", setup: func(i *instruction) {
726 i.asVecMisc(vecOpFrintp, v1VReg, operandNR(v2VReg), vecArrangement4S)
727 }},
728 {want: "4188e14e", setup: func(i *instruction) {
729 i.asVecMisc(vecOpFrintp, v1VReg, operandNR(v2VReg), vecArrangement2D)
730 }},
731 {want: "4198a10e", setup: func(i *instruction) {
732 i.asVecMisc(vecOpFrintz, v1VReg, operandNR(v2VReg), vecArrangement2S)
733 }},
734 {want: "4198a14e", setup: func(i *instruction) {
735 i.asVecMisc(vecOpFrintz, v1VReg, operandNR(v2VReg), vecArrangement4S)
736 }},
737 {want: "4198e14e", setup: func(i *instruction) {
738 i.asVecMisc(vecOpFrintz, v1VReg, operandNR(v2VReg), vecArrangement2D)
739 }},
740 {want: "4178610e", setup: func(i *instruction) {
741 i.asVecMisc(vecOpFcvtl, v1VReg, operandNR(v2VReg), vecArrangement2S)
742 }},
743 {want: "4178210e", setup: func(i *instruction) {
744 i.asVecMisc(vecOpFcvtl, v1VReg, operandNR(v2VReg), vecArrangement4H)
745 }},
746 {want: "4168610e", setup: func(i *instruction) {
747 i.asVecMisc(vecOpFcvtn, v1VReg, operandNR(v2VReg), vecArrangement2S)
748 }},
749 {want: "4168210e", setup: func(i *instruction) {
750 i.asVecMisc(vecOpFcvtn, v1VReg, operandNR(v2VReg), vecArrangement4H)
751 }},
752 {want: "41b8a10e", setup: func(i *instruction) {
753 i.asVecMisc(vecOpFcvtzs, v1VReg, operandNR(v2VReg), vecArrangement2S)
754 }},
755 {want: "41b8a14e", setup: func(i *instruction) {
756 i.asVecMisc(vecOpFcvtzs, v1VReg, operandNR(v2VReg), vecArrangement4S)
757 }},
758 {want: "41b8e14e", setup: func(i *instruction) {
759 i.asVecMisc(vecOpFcvtzs, v1VReg, operandNR(v2VReg), vecArrangement2D)
760 }},
761 {want: "41b8a12e", setup: func(i *instruction) {
762 i.asVecMisc(vecOpFcvtzu, v1VReg, operandNR(v2VReg), vecArrangement2S)
763 }},
764 {want: "41b8a16e", setup: func(i *instruction) {
765 i.asVecMisc(vecOpFcvtzu, v1VReg, operandNR(v2VReg), vecArrangement4S)
766 }},
767 {want: "41b8e16e", setup: func(i *instruction) {
768 i.asVecMisc(vecOpFcvtzu, v1VReg, operandNR(v2VReg), vecArrangement2D)
769 }},
770 {want: "41d8210e", setup: func(i *instruction) {
771 i.asVecMisc(vecOpScvtf, v1VReg, operandNR(v2VReg), vecArrangement2S)
772 }},
773 {want: "41d8214e", setup: func(i *instruction) {
774 i.asVecMisc(vecOpScvtf, v1VReg, operandNR(v2VReg), vecArrangement4S)
775 }},
776 {want: "41d8614e", setup: func(i *instruction) {
777 i.asVecMisc(vecOpScvtf, v1VReg, operandNR(v2VReg), vecArrangement2D)
778 }},
779 {want: "41d8212e", setup: func(i *instruction) {
780 i.asVecMisc(vecOpUcvtf, v1VReg, operandNR(v2VReg), vecArrangement2S)
781 }},
782 {want: "41d8216e", setup: func(i *instruction) {
783 i.asVecMisc(vecOpUcvtf, v1VReg, operandNR(v2VReg), vecArrangement4S)
784 }},
785 {want: "41d8616e", setup: func(i *instruction) {
786 i.asVecMisc(vecOpUcvtf, v1VReg, operandNR(v2VReg), vecArrangement2D)
787 }},
788 {want: "4148210e", setup: func(i *instruction) {
789 i.asVecMisc(vecOpSqxtn, v1VReg, operandNR(v2VReg), vecArrangement8B)
790 }},
791 {want: "4148214e", setup: func(i *instruction) { // sqxtn2
792 i.asVecMisc(vecOpSqxtn, v1VReg, operandNR(v2VReg), vecArrangement16B)
793 }},
794 {want: "4148610e", setup: func(i *instruction) {
795 i.asVecMisc(vecOpSqxtn, v1VReg, operandNR(v2VReg), vecArrangement4H)
796 }},
797 {want: "4148614e", setup: func(i *instruction) { // sqxtn2
798 i.asVecMisc(vecOpSqxtn, v1VReg, operandNR(v2VReg), vecArrangement8H)
799 }},
800 {want: "4148a10e", setup: func(i *instruction) {
801 i.asVecMisc(vecOpSqxtn, v1VReg, operandNR(v2VReg), vecArrangement2S)
802 }},
803 {want: "4148a14e", setup: func(i *instruction) { // sqxtun2
804 i.asVecMisc(vecOpSqxtn, v1VReg, operandNR(v2VReg), vecArrangement4S)
805 }},
806 {want: "4128212e", setup: func(i *instruction) {
807 i.asVecMisc(vecOpSqxtun, v1VReg, operandNR(v2VReg), vecArrangement8B)
808 }},
809 {want: "4128216e", setup: func(i *instruction) { // uqxtun2
810 i.asVecMisc(vecOpSqxtun, v1VReg, operandNR(v2VReg), vecArrangement16B)
811 }},
812 {want: "4128612e", setup: func(i *instruction) {
813 i.asVecMisc(vecOpSqxtun, v1VReg, operandNR(v2VReg), vecArrangement4H)
814 }},
815 {want: "4128616e", setup: func(i *instruction) { // sqxtun2
816 i.asVecMisc(vecOpSqxtun, v1VReg, operandNR(v2VReg), vecArrangement8H)
817 }},
818 {want: "4128a12e", setup: func(i *instruction) {
819 i.asVecMisc(vecOpSqxtun, v1VReg, operandNR(v2VReg), vecArrangement2S)
820 }},
821 {want: "4128a16e", setup: func(i *instruction) { // sqxtun2
822 i.asVecMisc(vecOpSqxtun, v1VReg, operandNR(v2VReg), vecArrangement4S)
823 }},
824 {want: "4148212e", setup: func(i *instruction) {
825 i.asVecMisc(vecOpUqxtn, v1VReg, operandNR(v2VReg), vecArrangement8B)
826 }},
827 {want: "4148216e", setup: func(i *instruction) { // uqxtn2
828 i.asVecMisc(vecOpUqxtn, v1VReg, operandNR(v2VReg), vecArrangement16B)
829 }},
830 {want: "4148612e", setup: func(i *instruction) {
831 i.asVecMisc(vecOpUqxtn, v1VReg, operandNR(v2VReg), vecArrangement4H)
832 }},
833 {want: "4148616e", setup: func(i *instruction) { // sqxtn2
834 i.asVecMisc(vecOpUqxtn, v1VReg, operandNR(v2VReg), vecArrangement8H)
835 }},
836 {want: "4148a12e", setup: func(i *instruction) {
837 i.asVecMisc(vecOpUqxtn, v1VReg, operandNR(v2VReg), vecArrangement2S)
838 }},
839 {want: "4148a16e", setup: func(i *instruction) { // sqxtn2
840 i.asVecMisc(vecOpUqxtn, v1VReg, operandNR(v2VReg), vecArrangement4S)
841 }},
842 {want: "41b8200e", setup: func(i *instruction) {
843 i.asVecMisc(vecOpAbs, v1VReg, operandNR(v2VReg), vecArrangement8B)
844 }},
845 {want: "41b8204e", setup: func(i *instruction) {
846 i.asVecMisc(vecOpAbs, v1VReg, operandNR(v2VReg), vecArrangement16B)
847 }},
848 {want: "41b8600e", setup: func(i *instruction) {
849 i.asVecMisc(vecOpAbs, v1VReg, operandNR(v2VReg), vecArrangement4H)
850 }},
851 {want: "41b8604e", setup: func(i *instruction) {
852 i.asVecMisc(vecOpAbs, v1VReg, operandNR(v2VReg), vecArrangement8H)
853 }},
854 {want: "41b8a00e", setup: func(i *instruction) {
855 i.asVecMisc(vecOpAbs, v1VReg, operandNR(v2VReg), vecArrangement2S)
856 }},
857 {want: "41b8a04e", setup: func(i *instruction) {
858 i.asVecMisc(vecOpAbs, v1VReg, operandNR(v2VReg), vecArrangement4S)
859 }},
860 {want: "41b8e04e", setup: func(i *instruction) {
861 i.asVecMisc(vecOpAbs, v1VReg, operandNR(v2VReg), vecArrangement2D)
862 }},
863 {want: "41f8a00e", setup: func(i *instruction) {
864 i.asVecMisc(vecOpFabs, v1VReg, operandNR(v2VReg), vecArrangement2S)
865 }},
866 {want: "41f8a04e", setup: func(i *instruction) {
867 i.asVecMisc(vecOpFabs, v1VReg, operandNR(v2VReg), vecArrangement4S)
868 }},
869 {want: "41f8e04e", setup: func(i *instruction) {
870 i.asVecMisc(vecOpFabs, v1VReg, operandNR(v2VReg), vecArrangement2D)
871 }},
872 {want: "41b8202e", setup: func(i *instruction) {
873 i.asVecMisc(vecOpNeg, v1VReg, operandNR(v2VReg), vecArrangement8B)
874 }},
875 {want: "41b8206e", setup: func(i *instruction) {
876 i.asVecMisc(vecOpNeg, v1VReg, operandNR(v2VReg), vecArrangement16B)
877 }},
878 {want: "41b8602e", setup: func(i *instruction) {
879 i.asVecMisc(vecOpNeg, v1VReg, operandNR(v2VReg), vecArrangement4H)
880 }},
881 {want: "41b8606e", setup: func(i *instruction) {
882 i.asVecMisc(vecOpNeg, v1VReg, operandNR(v2VReg), vecArrangement8H)
883 }},
884 {want: "41b8a02e", setup: func(i *instruction) {
885 i.asVecMisc(vecOpNeg, v1VReg, operandNR(v2VReg), vecArrangement2S)
886 }},
887 {want: "41b8a06e", setup: func(i *instruction) {
888 i.asVecMisc(vecOpNeg, v1VReg, operandNR(v2VReg), vecArrangement4S)
889 }},
890 {want: "41b8e06e", setup: func(i *instruction) {
891 i.asVecMisc(vecOpNeg, v1VReg, operandNR(v2VReg), vecArrangement2D)
892 }},
893 {want: "4128a10e", setup: func(i *instruction) {
894 i.asVecMisc(vecOpXtn, v1VReg, operandNR(v2VReg), vecArrangement2S)
895 }},
896 {want: "4128a10e", setup: func(i *instruction) {
897 i.asVecMisc(vecOpXtn, v1VReg, operandNR(v2VReg), vecArrangement2S)
898 }},
899 {want: "41f8a02e", setup: func(i *instruction) {
900 i.asVecMisc(vecOpFneg, v1VReg, operandNR(v2VReg), vecArrangement2S)
901 }},
902 {want: "41f8a06e", setup: func(i *instruction) {
903 i.asVecMisc(vecOpFneg, v1VReg, operandNR(v2VReg), vecArrangement4S)
904 }},
905 {want: "41f8e06e", setup: func(i *instruction) {
906 i.asVecMisc(vecOpFneg, v1VReg, operandNR(v2VReg), vecArrangement2D)
907 }},
908 {want: "41f8a12e", setup: func(i *instruction) {
909 i.asVecMisc(vecOpFsqrt, v1VReg, operandNR(v2VReg), vecArrangement2S)
910 }},
911 {want: "41f8a16e", setup: func(i *instruction) {
912 i.asVecMisc(vecOpFsqrt, v1VReg, operandNR(v2VReg), vecArrangement4S)
913 }},
914 {want: "41f8e16e", setup: func(i *instruction) {
915 i.asVecMisc(vecOpFsqrt, v1VReg, operandNR(v2VReg), vecArrangement2D)
916 }},
917 {want: "4100839a", setup: func(i *instruction) { i.asCSel(x1VReg, operandNR(x2VReg), operandNR(x3VReg), eq, true) }},
918 {want: "4110839a", setup: func(i *instruction) { i.asCSel(x1VReg, operandNR(x2VReg), operandNR(x3VReg), ne, true) }},
919 {want: "4100831a", setup: func(i *instruction) { i.asCSel(x1VReg, operandNR(x2VReg), operandNR(x3VReg), eq, false) }},
920 {want: "4110831a", setup: func(i *instruction) { i.asCSel(x1VReg, operandNR(x2VReg), operandNR(x3VReg), ne, false) }},
921 {want: "41cc631e", setup: func(i *instruction) { i.asFpuCSel(v1VReg, operandNR(v2VReg), operandNR(v3VReg), gt, true) }},
922 {want: "41bc631e", setup: func(i *instruction) { i.asFpuCSel(v1VReg, operandNR(v2VReg), operandNR(v3VReg), lt, true) }},
923 {want: "41cc231e", setup: func(i *instruction) { i.asFpuCSel(v1VReg, operandNR(v2VReg), operandNR(v3VReg), gt, false) }},
924 {want: "41bc231e", setup: func(i *instruction) { i.asFpuCSel(v1VReg, operandNR(v2VReg), operandNR(v3VReg), lt, false) }},
925 {want: "411c014e", setup: func(i *instruction) { i.asMovToVec(v1VReg, operandNR(x2VReg), vecArrangementB, 0) }},
926 {want: "411c024e", setup: func(i *instruction) { i.asMovToVec(v1VReg, operandNR(x2VReg), vecArrangementH, 0) }},
927 {want: "411c044e", setup: func(i *instruction) { i.asMovToVec(v1VReg, operandNR(x2VReg), vecArrangementS, 0) }},
928 {want: "411c084e", setup: func(i *instruction) { i.asMovToVec(v1VReg, operandNR(x2VReg), vecArrangementD, 0) }},
929 {want: "413c010e", setup: func(i *instruction) { i.asMovFromVec(x1VReg, operandNR(v2VReg), vecArrangementB, 0, false) }},
930 {want: "413c020e", setup: func(i *instruction) { i.asMovFromVec(x1VReg, operandNR(v2VReg), vecArrangementH, 0, false) }},
931 {want: "413c040e", setup: func(i *instruction) { i.asMovFromVec(x1VReg, operandNR(v2VReg), vecArrangementS, 0, false) }},
932 {want: "413c084e", setup: func(i *instruction) { i.asMovFromVec(x1VReg, operandNR(v2VReg), vecArrangementD, 0, false) }},
933 {want: "412c030e", setup: func(i *instruction) { i.asMovFromVec(x1VReg, operandNR(v2VReg), vecArrangementB, 1, true) }},
934 {want: "412c060e", setup: func(i *instruction) { i.asMovFromVec(x1VReg, operandNR(v2VReg), vecArrangementH, 1, true) }},
935 {want: "412c0c4e", setup: func(i *instruction) { i.asMovFromVec(x1VReg, operandNR(v2VReg), vecArrangementS, 1, true) }},
936 {want: "410c084e", setup: func(i *instruction) { i.asVecDup(x1VReg, operandNR(v2VReg), vecArrangement2D) }},
937 {want: "4140036e", setup: func(i *instruction) { // 4140036e
938 i.asVecExtract(x1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B, 8)
939 }},
940 {want: "4138034e", setup: func(i *instruction) {
941 i.asVecPermute(vecOpZip1, x1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
942 }},
943 {want: "4104214f", setup: func(i *instruction) {
944 i.asVecShiftImm(vecOpSshr, x1VReg, operandNR(x2VReg), operandShiftImm(31), vecArrangement4S)
945 }},
946 {want: "5b28030b", setup: func(i *instruction) {
947 i.asALU(aluOpAdd, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSL), false)
948 }},
949 {want: "5b28038b", setup: func(i *instruction) {
950 i.asALU(aluOpAdd, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSL), true)
951 }},
952 {want: "5b28032b", setup: func(i *instruction) {
953 i.asALU(aluOpAddS, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSL), false)
954 }},
955 {want: "5b2803ab", setup: func(i *instruction) {
956 i.asALU(aluOpAddS, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSL), true)
957 }},
958 {want: "5b28430b", setup: func(i *instruction) {
959 i.asALU(aluOpAdd, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSR), false)
960 }},
961 {want: "5b28438b", setup: func(i *instruction) {
962 i.asALU(aluOpAdd, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSR), true)
963 }},
964 {want: "5b28432b", setup: func(i *instruction) {
965 i.asALU(aluOpAddS, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSR), false)
966 }},
967 {want: "5b2843ab", setup: func(i *instruction) {
968 i.asALU(aluOpAddS, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSR), true)
969 }},
970 {want: "5b28830b", setup: func(i *instruction) {
971 i.asALU(aluOpAdd, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpASR), false)
972 }},
973 {want: "5b28838b", setup: func(i *instruction) {
974 i.asALU(aluOpAdd, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpASR), true)
975 }},
976 {want: "5b28832b", setup: func(i *instruction) {
977 i.asALU(aluOpAddS, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpASR), false)
978 }},
979 {want: "5b2883ab", setup: func(i *instruction) {
980 i.asALU(aluOpAddS, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpASR), true)
981 }},
982 {want: "5b28034b", setup: func(i *instruction) {
983 i.asALU(aluOpSub, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSL), false)
984 }},
985 {want: "5b2803cb", setup: func(i *instruction) {
986 i.asALU(aluOpSub, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSL), true)
987 }},
988 {want: "5b28036b", setup: func(i *instruction) {
989 i.asALU(aluOpSubS, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSL), false)
990 }},
991 {want: "5b2803eb", setup: func(i *instruction) {
992 i.asALU(aluOpSubS, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSL), true)
993 }},
994 {want: "5b28434b", setup: func(i *instruction) {
995 i.asALU(aluOpSub, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSR), false)
996 }},
997 {want: "5b2843cb", setup: func(i *instruction) {
998 i.asALU(aluOpSub, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSR), true)
999 }},
1000 {want: "5b28436b", setup: func(i *instruction) {
1001 i.asALU(aluOpSubS, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSR), false)
1002 }},
1003 {want: "5b2843eb", setup: func(i *instruction) {
1004 i.asALU(aluOpSubS, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSR), true)
1005 }},
1006 {want: "5b28834b", setup: func(i *instruction) {
1007 i.asALU(aluOpSub, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpASR), false)
1008 }},
1009 {want: "5b2883cb", setup: func(i *instruction) {
1010 i.asALU(aluOpSub, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpASR), true)
1011 }},
1012 {want: "5b28836b", setup: func(i *instruction) {
1013 i.asALU(aluOpSubS, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpASR), false)
1014 }},
1015 {want: "5b2883eb", setup: func(i *instruction) {
1016 i.asALU(aluOpSubS, tmpRegVReg, operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpASR), true)
1017 }},
1018 {want: "60033fd6", setup: func(i *instruction) {
1019 i.asCallIndirect(tmpRegVReg, nil)
1020 }},
1021 {want: "fb633bcb", setup: func(i *instruction) {
1022 i.asALU(aluOpSub, tmpRegVReg, operandNR(spVReg), operandNR(tmpRegVReg), true)
1023 }},
1024 {want: "fb633b8b", setup: func(i *instruction) {
1025 i.asALU(aluOpAdd, tmpRegVReg, operandNR(spVReg), operandNR(tmpRegVReg), true)
1026 }},
1027 {want: "2000020a", setup: func(i *instruction) {
1028 i.asALU(aluOpAnd, x0VReg, operandNR(x1VReg), operandNR(x2VReg), false)
1029 }},
1030 {want: "2000028a", setup: func(i *instruction) {
1031 i.asALU(aluOpAnd, x0VReg, operandNR(x1VReg), operandNR(x2VReg), true)
1032 }},
1033 {want: "2010028a", setup: func(i *instruction) {
1034 i.asALU(aluOpAnd, x0VReg, operandNR(x1VReg), operandSR(x2VReg, 4, shiftOpLSL), true)
1035 }},
1036 {want: "2030428a", setup: func(i *instruction) {
1037 i.asALU(aluOpAnd, x0VReg, operandNR(x1VReg), operandSR(x2VReg, 12, shiftOpLSR), true)
1038 }},
1039 {want: "2000026a", setup: func(i *instruction) {
1040 i.asALU(aluOpAnds, x0VReg, operandNR(x1VReg), operandNR(x2VReg), false)
1041 }},
1042 {want: "200002ea", setup: func(i *instruction) {
1043 i.asALU(aluOpAnds, x0VReg, operandNR(x1VReg), operandNR(x2VReg), true)
1044 }},
1045 {want: "201002ea", setup: func(i *instruction) {
1046 i.asALU(aluOpAnds, x0VReg, operandNR(x1VReg), operandSR(x2VReg, 4, shiftOpLSL), true)
1047 }},
1048 {want: "203042ea", setup: func(i *instruction) {
1049 i.asALU(aluOpAnds, x0VReg, operandNR(x1VReg), operandSR(x2VReg, 12, shiftOpLSR), true)
1050 }},
1051 {want: "2000022a", setup: func(i *instruction) {
1052 i.asALU(aluOpOrr, x0VReg, operandNR(x1VReg), operandNR(x2VReg), false)
1053 }},
1054 {want: "200002aa", setup: func(i *instruction) {
1055 i.asALU(aluOpOrr, x0VReg, operandNR(x1VReg), operandNR(x2VReg), true)
1056 }},
1057 {want: "201002aa", setup: func(i *instruction) {
1058 i.asALU(aluOpOrr, x0VReg, operandNR(x1VReg), operandSR(x2VReg, 4, shiftOpLSL), true)
1059 }},
1060 {want: "201082aa", setup: func(i *instruction) {
1061 i.asALU(aluOpOrr, x0VReg, operandNR(x1VReg), operandSR(x2VReg, 4, shiftOpASR), true)
1062 }},
1063 {want: "2000024a", setup: func(i *instruction) {
1064 i.asALU(aluOpEor, x0VReg, operandNR(x1VReg), operandNR(x2VReg), false)
1065 }},
1066 {want: "200002ca", setup: func(i *instruction) {
1067 i.asALU(aluOpEor, x0VReg, operandNR(x1VReg), operandNR(x2VReg), true)
1068 }},
1069 {want: "201002ca", setup: func(i *instruction) {
1070 i.asALU(aluOpEor, x0VReg, operandNR(x1VReg), operandSR(x2VReg, 4, shiftOpLSL), true)
1071 }},
1072 {want: "202cc21a", setup: func(i *instruction) {
1073 i.asALU(aluOpRotR, x0VReg, operandNR(x1VReg), operandNR(x2VReg), false)
1074 }},
1075 {want: "202cc29a", setup: func(i *instruction) {
1076 i.asALU(aluOpRotR, x0VReg, operandNR(x1VReg), operandNR(x2VReg), true)
1077 }},
1078 {want: "2000222a", setup: func(i *instruction) {
1079 i.asALU(aluOpOrn, x0VReg, operandNR(x1VReg), operandNR(x2VReg), false)
1080 }},
1081 {want: "200022aa", setup: func(i *instruction) {
1082 i.asALU(aluOpOrn, x0VReg, operandNR(x1VReg), operandNR(x2VReg), true)
1083 }},
1084 {want: "30000010", setup: func(i *instruction) { i.asAdr(v16VReg, 4) }},
1085 {want: "50050030", setup: func(i *instruction) { i.asAdr(v16VReg, 169) }},
1086 {want: "101e302e", setup: func(i *instruction) { i.asLoadFpuConst32(v16VReg, uint64(math.Float32bits(0))) }},
1087 {want: "5000001c020000140000803f", setup: func(i *instruction) {
1088 i.asLoadFpuConst32(v16VReg, uint64(math.Float32bits(1.0)))
1089 }},
1090 {want: "101e302e", setup: func(i *instruction) { i.asLoadFpuConst64(v16VReg, uint64(math.Float32bits(0))) }},
1091 {want: "5000005c03000014000000000000f03f", setup: func(i *instruction) {
1092 i.asLoadFpuConst64(v16VReg, math.Float64bits(1.0))
1093 }},
1094 {want: "101e306e", setup: func(i *instruction) { i.asLoadFpuConst128(v16VReg, 0, 0) }},
1095 {want: "5000009c05000014ffffffffffffffffaaaaaaaaaaaaaaaa", setup: func(i *instruction) { i.asLoadFpuConst128(v16VReg, 0xffffffff_ffffffff, 0xaaaaaaaa_aaaaaaaa) }},
1096 {want: "8220061b", setup: func(i *instruction) {
1097 i.asALURRRR(aluOpMAdd, x2VReg, operandNR(x4VReg), operandNR(x6VReg), x8VReg, false)
1098 }},
1099 {want: "8220069b", setup: func(i *instruction) {
1100 i.asALURRRR(aluOpMAdd, x2VReg, operandNR(x4VReg), operandNR(x6VReg), x8VReg, true)
1101 }},
1102 {want: "82a0061b", setup: func(i *instruction) {
1103 i.asALURRRR(aluOpMSub, x2VReg, operandNR(x4VReg), operandNR(x6VReg), x8VReg, false)
1104 }},
1105 {want: "82a0069b", setup: func(i *instruction) {
1106 i.asALURRRR(aluOpMSub, x2VReg, operandNR(x4VReg), operandNR(x6VReg), x8VReg, true)
1107 }},
1108 {want: "00213f1e", setup: func(i *instruction) { i.asFpuCmp(operandNR(v8VReg), operandNR(v31VReg), false) }},
1109 {want: "00217f1e", setup: func(i *instruction) { i.asFpuCmp(operandNR(v8VReg), operandNR(v31VReg), true) }},
1110 {want: "b21c0053", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 8, 32, false) }},
1111 {want: "b23c0053", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 16, 32, false) }},
1112 {want: "b21c0053", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 8, 64, false) }},
1113 {want: "b23c0053", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 16, 64, false) }},
1114 {want: "f203052a", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 32, 64, false) }},
1115 {want: "b21c0013", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 8, 32, true) }},
1116 {want: "b23c0013", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 16, 32, true) }},
1117 {want: "b21c4093", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 8, 64, true) }},
1118 {want: "b23c4093", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 16, 64, true) }},
1119 {want: "b27c4093", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 32, 64, true) }},
1120 {want: "f2079f9a", setup: func(i *instruction) { i.asCSet(x18VReg, false, ne) }},
1121 {want: "f2179f9a", setup: func(i *instruction) { i.asCSet(x18VReg, false, eq) }},
1122 {want: "e0039fda", setup: func(i *instruction) { i.asCSet(x0VReg, true, ne) }},
1123 {want: "f2139fda", setup: func(i *instruction) { i.asCSet(x18VReg, true, eq) }},
1124 {want: "32008012", setup: func(i *instruction) { i.asMOVN(x18VReg, 1, 0, false) }},
1125 {want: "52559512", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xaaaa, 0, false) }},
1126 {want: "f2ff9f12", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xffff, 0, false) }},
1127 {want: "3200a012", setup: func(i *instruction) { i.asMOVN(x18VReg, 1, 1, false) }},
1128 {want: "5255b512", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xaaaa, 1, false) }},
1129 {want: "f2ffbf12", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xffff, 1, false) }},
1130 {want: "32008092", setup: func(i *instruction) { i.asMOVN(x18VReg, 1, 0, true) }},
1131 {want: "52559592", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xaaaa, 0, true) }},
1132 {want: "f2ff9f92", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xffff, 0, true) }},
1133 {want: "3200a092", setup: func(i *instruction) { i.asMOVN(x18VReg, 1, 1, true) }},
1134 {want: "5255b592", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xaaaa, 1, true) }},
1135 {want: "f2ffbf92", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xffff, 1, true) }},
1136 {want: "3200c092", setup: func(i *instruction) { i.asMOVN(x18VReg, 1, 2, true) }},
1137 {want: "5255d592", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xaaaa, 2, true) }},
1138 {want: "f2ffdf92", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xffff, 2, true) }},
1139 {want: "3200e092", setup: func(i *instruction) { i.asMOVN(x18VReg, 1, 3, true) }},
1140 {want: "5255f592", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xaaaa, 3, true) }},
1141 {want: "f2ffff92", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xffff, 3, true) }},
1142 {want: "5255b572", setup: func(i *instruction) { i.asMOVK(x18VReg, 0xaaaa, 1, false) }},
1143 {want: "5255f5f2", setup: func(i *instruction) { i.asMOVK(x18VReg, 0xaaaa, 3, true) }},
1144 {want: "5255b552", setup: func(i *instruction) { i.asMOVZ(x18VReg, 0xaaaa, 1, false) }},
1145 {want: "5255f5d2", setup: func(i *instruction) { i.asMOVZ(x18VReg, 0xaaaa, 3, true) }},
1146 {want: "4f020012", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x1, false) }},
1147 {want: "4f0a0012", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x7, false) }},
1148 {want: "4f0e0012", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0xf, false) }},
1149 {want: "4f120012", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x1f, false) }},
1150 {want: "4f160012", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x3f, false) }},
1151 {want: "4f021112", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x8000, false) }},
1152 {want: "4f721f12", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x3ffffffe, false) }},
1153 {want: "4f7a1f12", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0xfffffffe, false) }},
1154 {want: "4f024092", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x1, true) }},
1155 {want: "4f0a4092", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x7, true) }},
1156 {want: "4f0e4092", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0xf, true) }},
1157 {want: "4f124092", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x1f, true) }},
1158 {want: "4f164092", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x3f, true) }},
1159 {want: "4f4e4092", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0xfffff, true) }},
1160 {want: "4f7e7092", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0xffffffff0000, true) }},
1161 {want: "4f7a4092", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x7fffffff, true) }},
1162 {want: "4f767f92", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x7ffffffe, true) }},
1163 {want: "4fba7f92", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0xfffffffffffe, true) }},
1164 {want: "4f020032", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x1, false) }},
1165 {want: "4f0a0032", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x7, false) }},
1166 {want: "4f0e0032", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0xf, false) }},
1167 {want: "4f120032", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x1f, false) }},
1168 {want: "4f160032", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x3f, false) }},
1169 {want: "4f021132", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x8000, false) }},
1170 {want: "4f721f32", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x3ffffffe, false) }},
1171 {want: "4f7a1f32", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0xfffffffe, false) }},
1172 {want: "4f0240b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x1, true) }},
1173 {want: "4f0a40b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x7, true) }},
1174 {want: "4f0e40b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0xf, true) }},
1175 {want: "4f1240b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x1f, true) }},
1176 {want: "4f1640b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x3f, true) }},
1177 {want: "4f4e40b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0xfffff, true) }},
1178 {want: "4f7e70b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0xffffffff0000, true) }},
1179 {want: "4f7a40b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x7fffffff, true) }},
1180 {want: "4f767fb2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x7ffffffe, true) }},
1181 {want: "4fba7fb2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0xfffffffffffe, true) }},
1182 {want: "4f020052", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x1, false) }},
1183 {want: "4f0a0052", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x7, false) }},
1184 {want: "4f0e0052", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0xf, false) }},
1185 {want: "4f120052", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x1f, false) }},
1186 {want: "4f160052", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x3f, false) }},
1187 {want: "4f021152", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x8000, false) }},
1188 {want: "4f721f52", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x3ffffffe, false) }},
1189 {want: "4f7a1f52", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0xfffffffe, false) }},
1190 {want: "4f0240d2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x1, true) }},
1191 {want: "4f0a40d2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x7, true) }},
1192 {want: "4f0e40d2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0xf, true) }},
1193 {want: "4f1240d2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x1f, true) }},
1194 {want: "4f1640d2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x3f, true) }},
1195 {want: "4f4e40d2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0xfffff, true) }},
1196 {want: "4f7e70d2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0xffffffff0000, true) }},
1197 {want: "4f7a40d2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x7fffffff, true) }},
1198 {want: "4f767fd2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x7ffffffe, true) }},
1199 {want: "4fba7fd2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0xfffffffffffe, true) }},
1200 {want: "f20300b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x18VReg, xzrVReg, 0x100000001, true) }},
1201 {want: "f21fbf0e", setup: func(i *instruction) { i.asFpuMov64(v18VReg, v31VReg) }},
1202 {want: "f21fbf4e", setup: func(i *instruction) { i.asFpuMov128(v18VReg, v31VReg) }},
1203 {want: "40a034ab", setup: func(i *instruction) {
1204 i.asALU(aluOpAddS, x0VReg, operandNR(x2VReg), operandER(x20VReg, extendOpSXTH, 64), false)
1205 }},
1206 {want: "4080348b", setup: func(i *instruction) {
1207 i.asALU(aluOpAdd, x0VReg, operandNR(x2VReg), operandER(x20VReg, extendOpSXTB, 64), false)
1208 }},
1209 {want: "40a0348b", setup: func(i *instruction) {
1210 i.asALU(aluOpAdd, x0VReg, operandNR(x2VReg), operandER(x20VReg, extendOpSXTH, 64), false)
1211 }},
1212 {want: "40c0348b", setup: func(i *instruction) {
1213 i.asALU(aluOpAdd, x0VReg, operandNR(x2VReg), operandER(x20VReg, extendOpSXTW, 64), false)
1214 }},
1215 {want: "4080340b", setup: func(i *instruction) {
1216 i.asALU(aluOpAdd, x0VReg, operandNR(x2VReg), operandER(x20VReg, extendOpSXTB, 32), false)
1217 }},
1218 {want: "40a0340b", setup: func(i *instruction) {
1219 i.asALU(aluOpAdd, x0VReg, operandNR(x2VReg), operandER(x20VReg, extendOpSXTH, 32), false)
1220 }},
1221 {want: "40c0340b", setup: func(i *instruction) {
1222 i.asALU(aluOpAdd, x0VReg, operandNR(x2VReg), operandER(x20VReg, extendOpSXTW, 32), false)
1223 }},
1224 {want: "400034eb", setup: func(i *instruction) {
1225 i.asALU(aluOpSubS, x0VReg, operandNR(x2VReg), operandER(x20VReg, extendOpUXTB, 64), false)
1226 }},
1227 {want: "400034cb", setup: func(i *instruction) {
1228 i.asALU(aluOpSub, x0VReg, operandNR(x2VReg), operandER(x20VReg, extendOpUXTB, 64), false)
1229 }},
1230 {want: "402034cb", setup: func(i *instruction) {
1231 i.asALU(aluOpSub, x0VReg, operandNR(x2VReg), operandER(x20VReg, extendOpUXTH, 64), false)
1232 }},
1233 {want: "404034cb", setup: func(i *instruction) {
1234 i.asALU(aluOpSub, x0VReg, operandNR(x2VReg), operandER(x20VReg, extendOpUXTW, 64), false)
1235 }},
1236 {want: "4000344b", setup: func(i *instruction) {
1237 i.asALU(aluOpSub, x0VReg, operandNR(x2VReg), operandER(x20VReg, extendOpUXTB, 32), false)
1238 }},
1239 {want: "4020344b", setup: func(i *instruction) {
1240 i.asALU(aluOpSub, x0VReg, operandNR(x2VReg), operandER(x20VReg, extendOpUXTH, 32), false)
1241 }},
1242 {want: "4040344b", setup: func(i *instruction) {
1243 i.asALU(aluOpSub, x0VReg, operandNR(x2VReg), operandER(x20VReg, extendOpUXTW, 32), false)
1244 }},
1245 {want: "4000140b", setup: func(i *instruction) {
1246 i.asALU(aluOpAdd, x0VReg, operandNR(x2VReg), operandNR(x20VReg), false)
1247 }},
1248 {want: "4000148b", setup: func(i *instruction) {
1249 i.asALU(aluOpAdd, x0VReg, operandNR(x2VReg), operandNR(x20VReg), true)
1250 }},
1251 {want: "40001f8b", setup: func(i *instruction) {
1252 i.asALU(aluOpAdd, x0VReg, operandNR(x2VReg), operandNR(xzrVReg), true)
1253 }},
1254 {want: "4000142b", setup: func(i *instruction) {
1255 i.asALU(aluOpAddS, x0VReg, operandNR(x2VReg), operandNR(x20VReg), false)
1256 }},
1257 {want: "400014ab", setup: func(i *instruction) {
1258 i.asALU(aluOpAddS, x0VReg, operandNR(x2VReg), operandNR(x20VReg), true)
1259 }},
1260 {want: "4000144b", setup: func(i *instruction) {
1261 i.asALU(aluOpSub, x0VReg, operandNR(x2VReg), operandNR(x20VReg), false)
1262 }},
1263 {want: "400014cb", setup: func(i *instruction) {
1264 i.asALU(aluOpSub, x0VReg, operandNR(x2VReg), operandNR(x20VReg), true)
1265 }},
1266 {want: "40001fcb", setup: func(i *instruction) {
1267 i.asALU(aluOpSub, x0VReg, operandNR(x2VReg), operandNR(xzrVReg), true)
1268 }},
1269 {want: "400014eb", setup: func(i *instruction) {
1270 i.asALU(aluOpSubS, x0VReg, operandNR(x2VReg), operandNR(x20VReg), true)
1271 }},
1272 {want: "40001feb", setup: func(i *instruction) {
1273 i.asALU(aluOpSubS, x0VReg, operandNR(x2VReg), operandNR(xzrVReg), true)
1274 }},
1275 {want: "c0035fd6", setup: func(i *instruction) { i.asRet() }},
1276 {want: "e303042a", setup: func(i *instruction) { i.asMove32(x3VReg, x4VReg) }},
1277 {want: "fe03002a", setup: func(i *instruction) { i.asMove32(x30VReg, x0VReg) }},
1278 {want: "e30304aa", setup: func(i *instruction) { i.asMove64(x3VReg, x4VReg) }},
1279 {want: "fe0300aa", setup: func(i *instruction) { i.asMove64(x30VReg, x0VReg) }},
1280 {want: "9f000091", setup: func(i *instruction) { i.asMove64(spVReg, x4VReg) }},
1281 {want: "e0030091", setup: func(i *instruction) { i.asMove64(x0VReg, spVReg) }},
1282 {want: "e17bc1a8", setup: func(i *instruction) {
1283 i.asLoadPair64(x1VReg, x30VReg, addressModePreOrPostIndex(m, spVReg, 16, false))
1284 }},
1285 {want: "e17bc1a9", setup: func(i *instruction) {
1286 i.asLoadPair64(x1VReg, x30VReg, addressModePreOrPostIndex(m, spVReg, 16, true))
1287 }},
1288 {want: "e17b81a8", setup: func(i *instruction) {
1289 i.asStorePair64(x1VReg, x30VReg, addressModePreOrPostIndex(m, spVReg, 16, false))
1290 }},
1291 {want: "e17b81a9", setup: func(i *instruction) {
1292 i.asStorePair64(x1VReg, x30VReg, addressModePreOrPostIndex(m, spVReg, 16, true))
1293 }},
1294 {want: "e17f81a9", setup: func(i *instruction) {
1295 i.asStorePair64(x1VReg, xzrVReg, addressModePreOrPostIndex(m, spVReg, 16, true))
1296 }},
1297 {want: "ff7f81a9", setup: func(i *instruction) {
1298 i.asStorePair64(xzrVReg, xzrVReg, addressModePreOrPostIndex(m, spVReg, 16, true))
1299 }},
1300 {want: "20000014", setup: func(i *instruction) {
1301 i.asBr(dummyLabel)
1302 i.brOffsetResolve(0x80)
1303 }},
1304 {want: "01040034", setup: func(i *instruction) {
1305 i.asCondBr(registerAsRegZeroCond(x1VReg), dummyLabel, false)
1306 i.condBrOffsetResolve(0x80)
1307 }},
1308 {want: "010400b4", setup: func(i *instruction) {
1309 i.asCondBr(registerAsRegZeroCond(x1VReg), dummyLabel, true)
1310 i.condBrOffsetResolve(0x80)
1311 }},
1312 {want: "01040035", setup: func(i *instruction) {
1313 i.asCondBr(registerAsRegNotZeroCond(x1VReg), dummyLabel, false)
1314 i.condBrOffsetResolve(0x80)
1315 }},
1316 {want: "010400b5", setup: func(i *instruction) {
1317 i.asCondBr(registerAsRegNotZeroCond(x1VReg), dummyLabel, true)
1318 i.condBrOffsetResolve(0x80)
1319 }},
1320 {want: "8328321e", setup: func(i *instruction) {
1321 i.asFpuRRR(fpuBinOpAdd, v3VReg, operandNR(v4VReg), operandNR(v18VReg), false)
1322 }},
1323 {want: "8328721e", setup: func(i *instruction) {
1324 i.asFpuRRR(fpuBinOpAdd, v3VReg, operandNR(v4VReg), operandNR(v18VReg), true)
1325 }},
1326 {want: "8338321e", setup: func(i *instruction) {
1327 i.asFpuRRR(fpuBinOpSub, v3VReg, operandNR(v4VReg), operandNR(v18VReg), false)
1328 }},
1329 {want: "8338721e", setup: func(i *instruction) {
1330 i.asFpuRRR(fpuBinOpSub, v3VReg, operandNR(v4VReg), operandNR(v18VReg), true)
1331 }},
1332 {want: "8308321e", setup: func(i *instruction) {
1333 i.asFpuRRR(fpuBinOpMul, v3VReg, operandNR(v4VReg), operandNR(v18VReg), false)
1334 }},
1335 {want: "8308721e", setup: func(i *instruction) {
1336 i.asFpuRRR(fpuBinOpMul, v3VReg, operandNR(v4VReg), operandNR(v18VReg), true)
1337 }},
1338 {want: "8318321e", setup: func(i *instruction) {
1339 i.asFpuRRR(fpuBinOpDiv, v3VReg, operandNR(v4VReg), operandNR(v18VReg), false)
1340 }},
1341 {want: "8318721e", setup: func(i *instruction) {
1342 i.asFpuRRR(fpuBinOpDiv, v3VReg, operandNR(v4VReg), operandNR(v18VReg), true)
1343 }},
1344 {want: "8348321e", setup: func(i *instruction) {
1345 i.asFpuRRR(fpuBinOpMax, v3VReg, operandNR(v4VReg), operandNR(v18VReg), false)
1346 }},
1347 {want: "8348721e", setup: func(i *instruction) {
1348 i.asFpuRRR(fpuBinOpMax, v3VReg, operandNR(v4VReg), operandNR(v18VReg), true)
1349 }},
1350 {want: "8358321e", setup: func(i *instruction) {
1351 i.asFpuRRR(fpuBinOpMin, v3VReg, operandNR(v4VReg), operandNR(v18VReg), false)
1352 }},
1353 {want: "8358721e", setup: func(i *instruction) {
1354 i.asFpuRRR(fpuBinOpMin, v3VReg, operandNR(v4VReg), operandNR(v18VReg), true)
1355 }},
1356 {want: "49fd7f11", setup: func(i *instruction) {
1357 i.asALU(aluOpAdd, x9VReg, operandNR(x10VReg), operandImm12(0b111111111111, 0b1), false)
1358 }},
1359 {want: "e9ff7f91", setup: func(i *instruction) {
1360 i.asALU(aluOpAdd, x9VReg, operandNR(spVReg), operandImm12(0b111111111111, 0b1), true)
1361 }},
1362 {want: "49fd3f11", setup: func(i *instruction) {
1363 i.asALU(aluOpAdd, x9VReg, operandNR(x10VReg), operandImm12(0b111111111111, 0b0), false)
1364 }},
1365 {want: "5ffd3f91", setup: func(i *instruction) {
1366 i.asALU(aluOpAdd, spVReg, operandNR(x10VReg), operandImm12(0b111111111111, 0b0), true)
1367 }},
1368 {want: "49fd7f31", setup: func(i *instruction) {
1369 i.asALU(aluOpAddS, x9VReg, operandNR(x10VReg), operandImm12(0b111111111111, 0b1), false)
1370 }},
1371 {want: "49fd7fb1", setup: func(i *instruction) {
1372 i.asALU(aluOpAddS, x9VReg, operandNR(x10VReg), operandImm12(0b111111111111, 0b1), true)
1373 }},
1374 {want: "49fd3f31", setup: func(i *instruction) {
1375 i.asALU(aluOpAddS, x9VReg, operandNR(x10VReg), operandImm12(0b111111111111, 0b0), false)
1376 }},
1377 {want: "49fd3fb1", setup: func(i *instruction) {
1378 i.asALU(aluOpAddS, x9VReg, operandNR(x10VReg), operandImm12(0b111111111111, 0b0), true)
1379 }},
1380 {want: "49fd7f51", setup: func(i *instruction) {
1381 i.asALU(aluOpSub, x9VReg, operandNR(x10VReg), operandImm12(0b111111111111, 0b1), false)
1382 }},
1383 {want: "e9ff7fd1", setup: func(i *instruction) {
1384 i.asALU(aluOpSub, x9VReg, operandNR(spVReg), operandImm12(0b111111111111, 0b1), true)
1385 }},
1386 {want: "49fd3f51", setup: func(i *instruction) {
1387 i.asALU(aluOpSub, x9VReg, operandNR(x10VReg), operandImm12(0b111111111111, 0b0), false)
1388 }},
1389 {want: "5ffd3fd1", setup: func(i *instruction) {
1390 i.asALU(aluOpSub, spVReg, operandNR(x10VReg), operandImm12(0b111111111111, 0b0), true)
1391 }},
1392 {want: "49fd7f71", setup: func(i *instruction) {
1393 i.asALU(aluOpSubS, x9VReg, operandNR(x10VReg), operandImm12(0b111111111111, 0b1), false)
1394 }},
1395 {want: "49fd7ff1", setup: func(i *instruction) {
1396 i.asALU(aluOpSubS, x9VReg, operandNR(x10VReg), operandImm12(0b111111111111, 0b1), true)
1397 }},
1398 {want: "49fd3f71", setup: func(i *instruction) {
1399 i.asALU(aluOpSubS, x9VReg, operandNR(x10VReg), operandImm12(0b111111111111, 0b0), false)
1400 }},
1401 {want: "49fd3ff1", setup: func(i *instruction) {
1402 i.asALU(aluOpSubS, x9VReg, operandNR(x10VReg), operandImm12(0b111111111111, 0b0), true)
1403 }},
1404 {want: "4020d41a", setup: func(i *instruction) {
1405 i.asALU(aluOpLsl, x0VReg, operandNR(x2VReg), operandNR(x20VReg), false)
1406 }},
1407 {want: "4020d49a", setup: func(i *instruction) {
1408 i.asALU(aluOpLsl, x0VReg, operandNR(x2VReg), operandNR(x20VReg), true)
1409 }},
1410 {want: "4024d41a", setup: func(i *instruction) {
1411 i.asALU(aluOpLsr, x0VReg, operandNR(x2VReg), operandNR(x20VReg), false)
1412 }},
1413 {want: "4024d49a", setup: func(i *instruction) {
1414 i.asALU(aluOpLsr, x0VReg, operandNR(x2VReg), operandNR(x20VReg), true)
1415 }},
1416 {want: "4028d41a", setup: func(i *instruction) {
1417 i.asALU(aluOpAsr, x0VReg, operandNR(x2VReg), operandNR(x20VReg), false)
1418 }},
1419 {want: "4028d49a", setup: func(i *instruction) {
1420 i.asALU(aluOpAsr, x0VReg, operandNR(x2VReg), operandNR(x20VReg), true)
1421 }},
1422 {want: "400cd49a", setup: func(i *instruction) {
1423 i.asALU(aluOpSDiv, x0VReg, operandNR(x2VReg), operandNR(x20VReg), true)
1424 }},
1425 {want: "400cd41a", setup: func(i *instruction) {
1426 i.asALU(aluOpSDiv, x0VReg, operandNR(x2VReg), operandNR(x20VReg), false)
1427 }},
1428 {want: "4008d49a", setup: func(i *instruction) {
1429 i.asALU(aluOpUDiv, x0VReg, operandNR(x2VReg), operandNR(x20VReg), true)
1430 }},
1431 {want: "4008d41a", setup: func(i *instruction) {
1432 i.asALU(aluOpUDiv, x0VReg, operandNR(x2VReg), operandNR(x20VReg), false)
1433 }},
1434 {want: "407c0013", setup: func(i *instruction) {
1435 i.asALUShift(aluOpAsr, x0VReg, operandNR(x2VReg), operandShiftImm(0), false)
1436 }},
1437 {want: "40fc4093", setup: func(i *instruction) {
1438 i.asALUShift(aluOpAsr, x0VReg, operandNR(x2VReg), operandShiftImm(0), true)
1439 }},
1440 {want: "407c0113", setup: func(i *instruction) {
1441 i.asALUShift(aluOpAsr, x0VReg, operandNR(x2VReg), operandShiftImm(1), false)
1442 }},
1443 {want: "407c1f13", setup: func(i *instruction) {
1444 i.asALUShift(aluOpAsr, x0VReg, operandNR(x2VReg), operandShiftImm(31), false)
1445 }},
1446 {want: "40fc4193", setup: func(i *instruction) {
1447 i.asALUShift(aluOpAsr, x0VReg, operandNR(x2VReg), operandShiftImm(1), true)
1448 }},
1449 {want: "40fc5f93", setup: func(i *instruction) {
1450 i.asALUShift(aluOpAsr, x0VReg, operandNR(x2VReg), operandShiftImm(31), true)
1451 }},
1452 {want: "40fc7f93", setup: func(i *instruction) {
1453 i.asALUShift(aluOpAsr, x0VReg, operandNR(x2VReg), operandShiftImm(63), true)
1454 }},
1455 {want: "407c0153", setup: func(i *instruction) {
1456 i.asALUShift(aluOpLsr, x0VReg, operandNR(x2VReg), operandShiftImm(1), false)
1457 }},
1458 {want: "407c1f53", setup: func(i *instruction) {
1459 i.asALUShift(aluOpLsr, x0VReg, operandNR(x2VReg), operandShiftImm(31), false)
1460 }},
1461 {want: "40fc41d3", setup: func(i *instruction) {
1462 i.asALUShift(aluOpLsr, x0VReg, operandNR(x2VReg), operandShiftImm(1), true)
1463 }},
1464 {want: "40fc5fd3", setup: func(i *instruction) {
1465 i.asALUShift(aluOpLsr, x0VReg, operandNR(x2VReg), operandShiftImm(31), true)
1466 }},
1467 {want: "40fc7fd3", setup: func(i *instruction) {
1468 i.asALUShift(aluOpLsr, x0VReg, operandNR(x2VReg), operandShiftImm(63), true)
1469 }},
1470 {want: "407c0053", setup: func(i *instruction) {
1471 i.asALUShift(aluOpLsl, x0VReg, operandNR(x2VReg), operandShiftImm(0), false)
1472 }},
1473 {want: "40fc40d3", setup: func(i *instruction) {
1474 i.asALUShift(aluOpLsl, x0VReg, operandNR(x2VReg), operandShiftImm(0), true)
1475 }},
1476 {want: "40781f53", setup: func(i *instruction) {
1477 i.asALUShift(aluOpLsl, x0VReg, operandNR(x2VReg), operandShiftImm(1), false)
1478 }},
1479 {want: "40000153", setup: func(i *instruction) {
1480 i.asALUShift(aluOpLsl, x0VReg, operandNR(x2VReg), operandShiftImm(31), false)
1481 }},
1482 {want: "40f87fd3", setup: func(i *instruction) {
1483 i.asALUShift(aluOpLsl, x0VReg, operandNR(x2VReg), operandShiftImm(1), true)
1484 }},
1485 {want: "408061d3", setup: func(i *instruction) {
1486 i.asALUShift(aluOpLsl, x0VReg, operandNR(x2VReg), operandShiftImm(31), true)
1487 }},
1488 {want: "400041d3", setup: func(i *instruction) {
1489 i.asALUShift(aluOpLsl, x0VReg, operandNR(x2VReg), operandShiftImm(63), true)
1490 }},
1491 {want: "4000c05a", setup: func(i *instruction) { i.asBitRR(bitOpRbit, x0VReg, x2VReg, false) }},
1492 {want: "4000c0da", setup: func(i *instruction) { i.asBitRR(bitOpRbit, x0VReg, x2VReg, true) }},
1493 {want: "4010c05a", setup: func(i *instruction) { i.asBitRR(bitOpClz, x0VReg, x2VReg, false) }},
1494 {want: "4010c0da", setup: func(i *instruction) { i.asBitRR(bitOpClz, x0VReg, x2VReg, true) }},
1495 {want: "4138302e", setup: func(i *instruction) {
1496 i.asVecLanes(vecOpUaddlv, v1VReg, operandNR(v2VReg), vecArrangement8B)
1497 }},
1498 {want: "4138306e", setup: func(i *instruction) {
1499 i.asVecLanes(vecOpUaddlv, v1VReg, operandNR(v2VReg), vecArrangement16B)
1500 }},
1501 {want: "4138702e", setup: func(i *instruction) {
1502 i.asVecLanes(vecOpUaddlv, v1VReg, operandNR(v2VReg), vecArrangement4H)
1503 }},
1504 {want: "4138706e", setup: func(i *instruction) {
1505 i.asVecLanes(vecOpUaddlv, v1VReg, operandNR(v2VReg), vecArrangement8H)
1506 }},
1507 {want: "4138b06e", setup: func(i *instruction) {
1508 i.asVecLanes(vecOpUaddlv, v1VReg, operandNR(v2VReg), vecArrangement4S)
1509 }},
1510 {want: "41c0230e", setup: func(i *instruction) {
1511 i.asVecRRR(vecOpSmull, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
1512 }},
1513 {want: "41c0630e", setup: func(i *instruction) {
1514 i.asVecRRR(vecOpSmull, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
1515 }},
1516 {want: "41c0a30e", setup: func(i *instruction) {
1517 i.asVecRRR(vecOpSmull, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
1518 }},
1519 {want: "41c0234e", setup: func(i *instruction) {
1520 i.asVecRRR(vecOpSmull2, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
1521 }},
1522 {want: "41c0634e", setup: func(i *instruction) {
1523 i.asVecRRR(vecOpSmull2, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
1524 }},
1525 {want: "41c0a34e", setup: func(i *instruction) {
1526 i.asVecRRR(vecOpSmull2, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S)
1527 }},
1528 {want: "411c630e", setup: func(i *instruction) {
1529 i.asVecRRR(vecOpBic, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
1530 }},
1531 {want: "411c634e", setup: func(i *instruction) {
1532 i.asVecRRR(vecOpBic, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
1533 }},
1534 {want: "411c632e", setup: func(i *instruction) {
1535 i.asVecRRRRewrite(vecOpBsl, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
1536 }},
1537 {want: "411c636e", setup: func(i *instruction) {
1538 i.asVecRRRRewrite(vecOpBsl, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
1539 }},
1540 {want: "4158202e", setup: func(i *instruction) {
1541 i.asVecMisc(vecOpNot, v1VReg, operandNR(v2VReg), vecArrangement8B)
1542 }},
1543 {want: "4158206e", setup: func(i *instruction) {
1544 i.asVecMisc(vecOpNot, v1VReg, operandNR(v2VReg), vecArrangement16B)
1545 }},
1546 {want: "411c230e", setup: func(i *instruction) {
1547 i.asVecRRR(vecOpAnd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
1548 }},
1549 {want: "411c234e", setup: func(i *instruction) {
1550 i.asVecRRR(vecOpAnd, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
1551 }},
1552 {want: "411ca30e", setup: func(i *instruction) {
1553 i.asVecRRR(vecOpOrr, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
1554 }},
1555 {want: "411ca34e", setup: func(i *instruction) {
1556 i.asVecRRR(vecOpOrr, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
1557 }},
1558 {want: "4144230e", setup: func(i *instruction) {
1559 i.asVecRRR(vecOpSshl, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
1560 }},
1561 {want: "4144234e", setup: func(i *instruction) {
1562 i.asVecRRR(vecOpSshl, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
1563 }},
1564 {want: "4144630e", setup: func(i *instruction) {
1565 i.asVecRRR(vecOpSshl, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
1566 }},
1567 {want: "4144634e", setup: func(i *instruction) {
1568 i.asVecRRR(vecOpSshl, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
1569 }},
1570 {want: "4144a30e", setup: func(i *instruction) {
1571 i.asVecRRR(vecOpSshl, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
1572 }},
1573 {want: "4144e34e", setup: func(i *instruction) {
1574 i.asVecRRR(vecOpSshl, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
1575 }},
1576 {want: "4144a30e", setup: func(i *instruction) {
1577 i.asVecRRR(vecOpSshl, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
1578 }},
1579 {want: "4144232e", setup: func(i *instruction) {
1580 i.asVecRRR(vecOpUshl, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B)
1581 }},
1582 {want: "4144236e", setup: func(i *instruction) {
1583 i.asVecRRR(vecOpUshl, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B)
1584 }},
1585 {want: "4144632e", setup: func(i *instruction) {
1586 i.asVecRRR(vecOpUshl, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H)
1587 }},
1588 {want: "4144636e", setup: func(i *instruction) {
1589 i.asVecRRR(vecOpUshl, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H)
1590 }},
1591 {want: "4144a32e", setup: func(i *instruction) {
1592 i.asVecRRR(vecOpUshl, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
1593 }},
1594 {want: "4144e36e", setup: func(i *instruction) {
1595 i.asVecRRR(vecOpUshl, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D)
1596 }},
1597 {want: "4144a30e", setup: func(i *instruction) {
1598 i.asVecRRR(vecOpSshl, v1VReg, operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S)
1599 }},
1600 {want: "4158200e", setup: func(i *instruction) { i.asVecMisc(vecOpCnt, v1VReg, operandNR(v2VReg), vecArrangement8B) }},
1601 {want: "4158204e", setup: func(i *instruction) { i.asVecMisc(vecOpCnt, v1VReg, operandNR(v2VReg), vecArrangement16B) }},
1602 {want: "41c0221e", setup: func(i *instruction) {
1603 i.asFpuRR(fpuUniOpCvt32To64, v1VReg, operandNR(v2VReg), true)
1604 }},
1605 {want: "4140621e", setup: func(i *instruction) {
1606 i.asFpuRR(fpuUniOpCvt64To32, v1VReg, operandNR(v2VReg), true)
1607 }},
1608 {want: "4140211e", setup: func(i *instruction) {
1609 i.asFpuRR(fpuUniOpNeg, v1VReg, operandNR(v2VReg), false)
1610 }},
1611
1612 {want: "41c0211e", setup: func(i *instruction) {
1613 i.asFpuRR(fpuUniOpSqrt, v1VReg, operandNR(v2VReg), false)
1614 }},
1615 {want: "41c0611e", setup: func(i *instruction) {
1616 i.asFpuRR(fpuUniOpSqrt, v1VReg, operandNR(v2VReg), true)
1617 }},
1618 {want: "41c0241e", setup: func(i *instruction) {
1619 i.asFpuRR(fpuUniOpRoundPlus, v1VReg, operandNR(v2VReg), false)
1620 }},
1621 {want: "41c0641e", setup: func(i *instruction) {
1622 i.asFpuRR(fpuUniOpRoundPlus, v1VReg, operandNR(v2VReg), true)
1623 }},
1624 {want: "4140251e", setup: func(i *instruction) {
1625 i.asFpuRR(fpuUniOpRoundMinus, v1VReg, operandNR(v2VReg), false)
1626 }},
1627 {want: "4140651e", setup: func(i *instruction) {
1628 i.asFpuRR(fpuUniOpRoundMinus, v1VReg, operandNR(v2VReg), true)
1629 }},
1630 {want: "41c0251e", setup: func(i *instruction) {
1631 i.asFpuRR(fpuUniOpRoundZero, v1VReg, operandNR(v2VReg), false)
1632 }},
1633 {want: "41c0651e", setup: func(i *instruction) {
1634 i.asFpuRR(fpuUniOpRoundZero, v1VReg, operandNR(v2VReg), true)
1635 }},
1636 {want: "4140241e", setup: func(i *instruction) {
1637 i.asFpuRR(fpuUniOpRoundNearest, v1VReg, operandNR(v2VReg), false)
1638 }},
1639 {want: "4140641e", setup: func(i *instruction) {
1640 i.asFpuRR(fpuUniOpRoundNearest, v1VReg, operandNR(v2VReg), true)
1641 }},
1642 {want: "4140611e", setup: func(i *instruction) { i.asFpuRR(fpuUniOpNeg, v1VReg, operandNR(v2VReg), true) }},
1643 {want: "41c0404d", setup: func(i *instruction) { i.asVecLoad1R(v1VReg, operandNR(x2VReg), vecArrangement16B) }},
1644 {want: "41c4404d", setup: func(i *instruction) { i.asVecLoad1R(v1VReg, operandNR(x2VReg), vecArrangement8H) }},
1645 {want: "41c8404d", setup: func(i *instruction) { i.asVecLoad1R(v1VReg, operandNR(x2VReg), vecArrangement4S) }},
1646 {want: "41cc404d", setup: func(i *instruction) { i.asVecLoad1R(v1VReg, operandNR(x2VReg), vecArrangement2D) }},
1647 {want: "0200e1b8", setup: func(i *instruction) {
1648 i.asAtomicRmw(atomicRmwOpAdd, x0VReg, x1VReg, x2VReg, 4)
1649 }},
1650 {want: "0200e178", setup: func(i *instruction) {
1651 i.asAtomicRmw(atomicRmwOpAdd, x0VReg, x1VReg, x2VReg, 2)
1652 }},
1653 {want: "0200e138", setup: func(i *instruction) {
1654 i.asAtomicRmw(atomicRmwOpAdd, x0VReg, x1VReg, x2VReg, 1)
1655 }},
1656 {want: "0200e1f8", setup: func(i *instruction) {
1657 i.asAtomicRmw(atomicRmwOpAdd, x0VReg, x1VReg, x2VReg, 8)
1658 }},
1659 {want: "0200e1b8", setup: func(i *instruction) {
1660 i.asAtomicRmw(atomicRmwOpAdd, x0VReg, x1VReg, x2VReg, 4)
1661 }},
1662 {want: "0200e178", setup: func(i *instruction) {
1663 i.asAtomicRmw(atomicRmwOpAdd, x0VReg, x1VReg, x2VReg, 2)
1664 }},
1665 {want: "0200e138", setup: func(i *instruction) {
1666 i.asAtomicRmw(atomicRmwOpAdd, x0VReg, x1VReg, x2VReg, 1)
1667 }},
1668 {want: "0210e1b8", setup: func(i *instruction) {
1669 i.asAtomicRmw(atomicRmwOpClr, x0VReg, x1VReg, x2VReg, 4)
1670 }},
1671 {want: "0210e178", setup: func(i *instruction) {
1672 i.asAtomicRmw(atomicRmwOpClr, x0VReg, x1VReg, x2VReg, 2)
1673 }},
1674 {want: "0210e138", setup: func(i *instruction) {
1675 i.asAtomicRmw(atomicRmwOpClr, x0VReg, x1VReg, x2VReg, 1)
1676 }},
1677 {want: "0210e1f8", setup: func(i *instruction) {
1678 i.asAtomicRmw(atomicRmwOpClr, x0VReg, x1VReg, x2VReg, 8)
1679 }},
1680 {want: "0210e1b8", setup: func(i *instruction) {
1681 i.asAtomicRmw(atomicRmwOpClr, x0VReg, x1VReg, x2VReg, 4)
1682 }},
1683 {want: "0210e178", setup: func(i *instruction) {
1684 i.asAtomicRmw(atomicRmwOpClr, x0VReg, x1VReg, x2VReg, 2)
1685 }},
1686 {want: "0210e138", setup: func(i *instruction) {
1687 i.asAtomicRmw(atomicRmwOpClr, x0VReg, x1VReg, x2VReg, 1)
1688 }},
1689 {want: "0230e1b8", setup: func(i *instruction) {
1690 i.asAtomicRmw(atomicRmwOpSet, x0VReg, x1VReg, x2VReg, 4)
1691 }},
1692 {want: "0230e178", setup: func(i *instruction) {
1693 i.asAtomicRmw(atomicRmwOpSet, x0VReg, x1VReg, x2VReg, 2)
1694 }},
1695 {want: "0230e138", setup: func(i *instruction) {
1696 i.asAtomicRmw(atomicRmwOpSet, x0VReg, x1VReg, x2VReg, 1)
1697 }},
1698 {want: "0230e1f8", setup: func(i *instruction) {
1699 i.asAtomicRmw(atomicRmwOpSet, x0VReg, x1VReg, x2VReg, 8)
1700 }},
1701 {want: "0230e1b8", setup: func(i *instruction) {
1702 i.asAtomicRmw(atomicRmwOpSet, x0VReg, x1VReg, x2VReg, 4)
1703 }},
1704 {want: "0230e178", setup: func(i *instruction) {
1705 i.asAtomicRmw(atomicRmwOpSet, x0VReg, x1VReg, x2VReg, 2)
1706 }},
1707 {want: "0230e138", setup: func(i *instruction) {
1708 i.asAtomicRmw(atomicRmwOpSet, x0VReg, x1VReg, x2VReg, 1)
1709 }},
1710 {want: "0220e1b8", setup: func(i *instruction) {
1711 i.asAtomicRmw(atomicRmwOpEor, x0VReg, x1VReg, x2VReg, 4)
1712 }},
1713 {want: "0220e178", setup: func(i *instruction) {
1714 i.asAtomicRmw(atomicRmwOpEor, x0VReg, x1VReg, x2VReg, 2)
1715 }},
1716 {want: "0220e138", setup: func(i *instruction) {
1717 i.asAtomicRmw(atomicRmwOpEor, x0VReg, x1VReg, x2VReg, 1)
1718 }},
1719 {want: "0220e1f8", setup: func(i *instruction) {
1720 i.asAtomicRmw(atomicRmwOpEor, x0VReg, x1VReg, x2VReg, 8)
1721 }},
1722 {want: "0220e1b8", setup: func(i *instruction) {
1723 i.asAtomicRmw(atomicRmwOpEor, x0VReg, x1VReg, x2VReg, 4)
1724 }},
1725 {want: "0220e178", setup: func(i *instruction) {
1726 i.asAtomicRmw(atomicRmwOpEor, x0VReg, x1VReg, x2VReg, 2)
1727 }},
1728 {want: "0220e138", setup: func(i *instruction) {
1729 i.asAtomicRmw(atomicRmwOpEor, x0VReg, x1VReg, x2VReg, 1)
1730 }},
1731 {want: "0280e1b8", setup: func(i *instruction) {
1732 i.asAtomicRmw(atomicRmwOpSwp, x0VReg, x1VReg, x2VReg, 4)
1733 }},
1734 {want: "0280e178", setup: func(i *instruction) {
1735 i.asAtomicRmw(atomicRmwOpSwp, x0VReg, x1VReg, x2VReg, 2)
1736 }},
1737 {want: "0280e138", setup: func(i *instruction) {
1738 i.asAtomicRmw(atomicRmwOpSwp, x0VReg, x1VReg, x2VReg, 1)
1739 }},
1740 {want: "0280e1f8", setup: func(i *instruction) {
1741 i.asAtomicRmw(atomicRmwOpSwp, x0VReg, x1VReg, x2VReg, 8)
1742 }},
1743 {want: "0280e1b8", setup: func(i *instruction) {
1744 i.asAtomicRmw(atomicRmwOpSwp, x0VReg, x1VReg, x2VReg, 4)
1745 }},
1746 {want: "0280e178", setup: func(i *instruction) {
1747 i.asAtomicRmw(atomicRmwOpSwp, x0VReg, x1VReg, x2VReg, 2)
1748 }},
1749 {want: "0280e138", setup: func(i *instruction) {
1750 i.asAtomicRmw(atomicRmwOpSwp, x0VReg, x1VReg, x2VReg, 1)
1751 }},
1752 {want: "02fce188", setup: func(i *instruction) {
1753 i.asAtomicCas(x0VReg, x1VReg, x2VReg, 4)
1754 }},
1755 {want: "02fce148", setup: func(i *instruction) {
1756 i.asAtomicCas(x0VReg, x1VReg, x2VReg, 2)
1757 }},
1758 {want: "02fce108", setup: func(i *instruction) {
1759 i.asAtomicCas(x0VReg, x1VReg, x2VReg, 1)
1760 }},
1761 {want: "02fce1c8", setup: func(i *instruction) {
1762 i.asAtomicCas(x0VReg, x1VReg, x2VReg, 8)
1763 }},
1764 {want: "02fce188", setup: func(i *instruction) {
1765 i.asAtomicCas(x0VReg, x1VReg, x2VReg, 4)
1766 }},
1767 {want: "02fce148", setup: func(i *instruction) {
1768 i.asAtomicCas(x0VReg, x1VReg, x2VReg, 2)
1769 }},
1770 {want: "02fce108", setup: func(i *instruction) {
1771 i.asAtomicCas(x0VReg, x1VReg, x2VReg, 1)
1772 }},
1773 {want: "01fcdf88", setup: func(i *instruction) {
1774 i.asAtomicLoad(x0VReg, x1VReg, 4)
1775 }},
1776 {want: "01fcdf48", setup: func(i *instruction) {
1777 i.asAtomicLoad(x0VReg, x1VReg, 2)
1778 }},
1779 {want: "01fcdf08", setup: func(i *instruction) {
1780 i.asAtomicLoad(x0VReg, x1VReg, 1)
1781 }},
1782 {want: "01fcdfc8", setup: func(i *instruction) {
1783 i.asAtomicLoad(x0VReg, x1VReg, 8)
1784 }},
1785 {want: "01fcdf88", setup: func(i *instruction) {
1786 i.asAtomicLoad(x0VReg, x1VReg, 4)
1787 }},
1788 {want: "01fcdf48", setup: func(i *instruction) {
1789 i.asAtomicLoad(x0VReg, x1VReg, 2)
1790 }},
1791 {want: "01fcdf08", setup: func(i *instruction) {
1792 i.asAtomicLoad(x0VReg, x1VReg, 1)
1793 }},
1794 {want: "01fc9f88", setup: func(i *instruction) {
1795 i.asAtomicStore(operandNR(x0VReg), operandNR(x1VReg), 4)
1796 }},
1797 {want: "01fc9f48", setup: func(i *instruction) {
1798 i.asAtomicStore(operandNR(x0VReg), operandNR(x1VReg), 2)
1799 }},
1800 {want: "01fc9f08", setup: func(i *instruction) {
1801 i.asAtomicStore(operandNR(x0VReg), operandNR(x1VReg), 1)
1802 }},
1803 {want: "01fc9fc8", setup: func(i *instruction) {
1804 i.asAtomicStore(operandNR(x0VReg), operandNR(x1VReg), 8)
1805 }},
1806 {want: "01fc9f88", setup: func(i *instruction) {
1807 i.asAtomicStore(operandNR(x0VReg), operandNR(x1VReg), 4)
1808 }},
1809 {want: "01fc9f48", setup: func(i *instruction) {
1810 i.asAtomicStore(operandNR(x0VReg), operandNR(x1VReg), 2)
1811 }},
1812 {want: "01fc9f08", setup: func(i *instruction) {
1813 i.asAtomicStore(operandNR(x0VReg), operandNR(x1VReg), 1)
1814 }},
1815 {want: "bf3b03d5", setup: func(i *instruction) {
1816 i.asDMB()
1817 }},
1818 {want: "4201231e4201631e4201239e4201639e4201221e4201621e4201229e4201629e", setup: func(i *instruction) {
1819 i.asNop0()
1820 cur := i
1821 trueFalse := []bool{false, true}
1822 for _, rnSigned := range trueFalse {
1823 for _, src64bit := range trueFalse {
1824 for _, dst64bit := range trueFalse {
1825 i := &instruction{prev: cur}
1826 cur.next = i
1827 i.asIntToFpu(v2VReg, operandNR(x10VReg), rnSigned, src64bit, dst64bit)
1828 cur = i
1829 }
1830 }
1831 }
1832 }},
1833 {want: "4201391e4201399e4201791e4201799e4201381e4201389e4201781e4201789e", setup: func(i *instruction) {
1834 i.asNop0()
1835 cur := i
1836 trueFalse := []bool{false, true}
1837 for _, rnSigned := range trueFalse {
1838 for _, src64bit := range trueFalse {
1839 for _, dst64bit := range trueFalse {
1840 i := &instruction{prev: cur}
1841 cur.next = i
1842 i.asFpuToInt(v2VReg, operandNR(x10VReg), rnSigned, src64bit, dst64bit)
1843 cur = i
1844 }
1845 }
1846 }
1847 }},
1848 } {
1849 tc := tc
1850 t.Run(tc.want, func(t *testing.T) {
1851 i := &instruction{}
1852 tc.setup(i)
1853
1854 mc := &mockCompiler{}
1855 m := &machine{compiler: mc}
1856 m.encode(i)
1857 // Note: for quick iteration we can use golang.org/x/arch package to verify the encoding.
1858 // but wazero doesn't add even a test dependency to it, so commented out.
1859 // inst, err := arm64asm.Decode(m.buf)
1860 // require.NoError(t, err, hex.EncodeToString(m.buf))
1861 // fmt.Println(inst.String())
1862 require.Equal(t, tc.want, hex.EncodeToString(mc.buf))
1863
1864 var actualSize int
1865 for cur := i; cur != nil; cur = cur.next {
1866 actualSize += int(cur.size())
1867 }
1868 require.Equal(t, len(tc.want)/2, actualSize)
1869 })
1870 }
1871 }
1872
1873 func TestInstruction_encode_call(t *testing.T) {
1874 _, _, m := newSetupWithMockContext()
1875 mock := m.compiler.(*mockCompiler)
1876 mock.buf = make([]byte, 128)
1877 i := &instruction{}
1878 i.asCall(ssa.FuncRef(555), nil)
1879 i.encode(m)
1880 buf := mock.buf[128:]
1881 require.Equal(t, "00000094", hex.EncodeToString(buf))
1882 require.Equal(t, 1, len(mock.relocs))
1883 require.Equal(t, ssa.FuncRef(555), mock.relocs[0].FuncRef)
1884 require.Equal(t, int64(128), mock.relocs[0].Offset)
1885 }
1886
1887 func TestInstruction_encode_br_condflag(t *testing.T) {
1888 for _, tc := range []struct {
1889 c condFlag
1890 want string
1891 }{
1892 {c: eq, want: "80070054"},
1893 {c: ne, want: "81070054"},
1894 {c: hs, want: "82070054"},
1895 {c: lo, want: "83070054"},
1896 {c: mi, want: "84070054"},
1897 {c: pl, want: "85070054"},
1898 {c: vs, want: "86070054"},
1899 {c: vc, want: "87070054"},
1900 {c: hi, want: "88070054"},
1901 {c: ls, want: "89070054"},
1902 {c: ge, want: "8a070054"},
1903 {c: lt, want: "8b070054"},
1904 {c: gt, want: "8c070054"},
1905 {c: le, want: "8d070054"},
1906 {c: al, want: "8e070054"},
1907 {c: nv, want: "8f070054"},
1908 } {
1909 i := &instruction{}
1910 i.asCondBr(tc.c.asCond(), label(1), false)
1911 i.condBrOffsetResolve(0xf0)
1912 _, _, m := newSetupWithMockContext()
1913 i.encode(m)
1914 // Note: for quick iteration we can use golang.org/x/arch package to verify the encoding.
1915 // but wazero doesn't add even a test dependency to it, so commented out.
1916 // inst, err := arm64asm.Decode(m.buf)
1917 // require.NoError(t, err)
1918 // fmt.Println(inst.String())
1919 require.Equal(t, tc.want, hex.EncodeToString(m.compiler.Buf()))
1920 }
1921 }
1922
1923 func TestInstruction_encoding_store_encoding(t *testing.T) {
1924 amodeRegScaledExtended1 := addressMode{kind: addressModeKindRegScaledExtended, rn: x30VReg, rm: x1VReg, extOp: extendOpUXTW}
1925 amodeRegScaledExtended2 := addressMode{kind: addressModeKindRegScaledExtended, rn: spVReg, rm: x1VReg, extOp: extendOpSXTW}
1926 amodeRegScaled1 := addressMode{kind: addressModeKindRegScaled, rn: x30VReg, rm: x1VReg}
1927 amodeRegScaled2 := addressMode{kind: addressModeKindRegScaled, rn: spVReg, rm: x1VReg}
1928 amodeRegExtended1 := addressMode{kind: addressModeKindRegExtended, rn: x30VReg, rm: x1VReg, extOp: extendOpUXTW}
1929 amodeRegExtended2 := addressMode{kind: addressModeKindRegExtended, rn: spVReg, rm: x1VReg, extOp: extendOpSXTW}
1930 amodeRegReg1 := addressMode{kind: addressModeKindRegReg, rn: x30VReg, rm: x1VReg}
1931 amodeRegReg2 := addressMode{kind: addressModeKindRegReg, rn: spVReg, rm: x1VReg}
1932 amodeRegSignedImm9_1 := addressMode{kind: addressModeKindRegSignedImm9, rn: x30VReg, imm: 10}
1933 amodeRegSignedImm9_2 := addressMode{kind: addressModeKindRegSignedImm9, rn: spVReg, imm: 0b111111111}
1934 amodePostIndex1 := addressMode{kind: addressModeKindPostIndex, rn: x30VReg, imm: 10}
1935 amodePostIndex2 := addressMode{kind: addressModeKindPostIndex, rn: spVReg, imm: 0b100000000}
1936 amodePreIndex1 := addressMode{kind: addressModeKindPreIndex, rn: x30VReg, imm: 10}
1937 amodePreIndex2 := addressMode{kind: addressModeKindPreIndex, rn: spVReg, imm: 0b100000000}
1938 amodeUnsignedImm12_1 := addressMode{kind: addressModeKindRegUnsignedImm12, rn: x30VReg}
1939 amodeUnsignedImm12_2 := addressMode{kind: addressModeKindRegUnsignedImm12, rn: spVReg}
1940 setImm := func(amode addressMode, imm int64) addressMode {
1941 amode.imm = imm
1942 return amode
1943 }
1944 for _, tc := range []struct {
1945 k instructionKind
1946 amode addressMode
1947 rn regalloc.VReg
1948 want string
1949 }{
1950 // addressModeKindRegScaledExtended.
1951 {k: store8, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55b2138"},
1952 {k: store8, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5db2138"},
1953 {k: store16, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55b2178"},
1954 {k: store16, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5db2178"},
1955 {k: store32, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55b21b8"},
1956 {k: store32, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5db21b8"},
1957 {k: store64, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55b21f8"},
1958 {k: store64, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5db21f8"},
1959 {k: fpuStore32, amode: amodeRegScaledExtended1, rn: v5VReg, want: "c55b21bc"},
1960 {k: fpuStore32, amode: amodeRegScaledExtended2, rn: v5VReg, want: "e5db21bc"},
1961 {k: fpuStore64, amode: amodeRegScaledExtended1, rn: v5VReg, want: "c55b21fc"},
1962 {k: fpuStore64, amode: amodeRegScaledExtended2, rn: v5VReg, want: "e5db21fc"},
1963 {k: fpuStore128, amode: amodeRegScaledExtended1, rn: v5VReg, want: "c55ba13c"},
1964 {k: fpuStore128, amode: amodeRegScaledExtended2, rn: v5VReg, want: "e5dba13c"},
1965 {k: uLoad8, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55b6138"},
1966 {k: uLoad8, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5db6138"},
1967 {k: uLoad16, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55b6178"},
1968 {k: uLoad16, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5db6178"},
1969 {k: uLoad32, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55b61b8"},
1970 {k: uLoad32, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5db61b8"},
1971 {k: uLoad64, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55b61f8"},
1972 {k: uLoad64, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5db61f8"},
1973 {k: sLoad8, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55ba138"},
1974 {k: sLoad8, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5dba138"},
1975 {k: sLoad16, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55ba178"},
1976 {k: sLoad16, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5dba178"},
1977 {k: sLoad32, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55ba1b8"},
1978 {k: sLoad32, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5dba1b8"},
1979 {k: fpuLoad32, amode: amodeRegScaledExtended1, rn: v5VReg, want: "c55b61bc"},
1980 {k: fpuLoad32, amode: amodeRegScaledExtended2, rn: v5VReg, want: "e5db61bc"},
1981 {k: fpuLoad64, amode: amodeRegScaledExtended1, rn: v5VReg, want: "c55b61fc"},
1982 {k: fpuLoad64, amode: amodeRegScaledExtended2, rn: v5VReg, want: "e5db61fc"},
1983 {k: fpuLoad128, amode: amodeRegScaledExtended1, rn: v5VReg, want: "c55be13c"},
1984 {k: fpuLoad128, amode: amodeRegScaledExtended2, rn: v5VReg, want: "e5dbe13c"},
1985 // addressModeKindRegScaled.
1986 {k: store8, amode: amodeRegScaled1, rn: x5VReg, want: "c5fb2138"},
1987 {k: store8, amode: amodeRegScaled2, rn: x5VReg, want: "e5fb2138"},
1988 {k: store16, amode: amodeRegScaled1, rn: x5VReg, want: "c5fb2178"},
1989 {k: store16, amode: amodeRegScaled2, rn: x5VReg, want: "e5fb2178"},
1990 {k: store32, amode: amodeRegScaled1, rn: x5VReg, want: "c5fb21b8"},
1991 {k: store32, amode: amodeRegScaled2, rn: x5VReg, want: "e5fb21b8"},
1992 {k: store64, amode: amodeRegScaled1, rn: x5VReg, want: "c5fb21f8"},
1993 {k: store64, amode: amodeRegScaled2, rn: x5VReg, want: "e5fb21f8"},
1994 {k: fpuStore32, amode: amodeRegScaled1, rn: v5VReg, want: "c5fb21bc"},
1995 {k: fpuStore32, amode: amodeRegScaled2, rn: v5VReg, want: "e5fb21bc"},
1996 {k: fpuStore64, amode: amodeRegScaled1, rn: v5VReg, want: "c5fb21fc"},
1997 {k: fpuStore64, amode: amodeRegScaled2, rn: v5VReg, want: "e5fb21fc"},
1998 {k: fpuStore128, amode: amodeRegScaled1, rn: v5VReg, want: "c5fba13c"},
1999 {k: fpuStore128, amode: amodeRegScaled2, rn: v5VReg, want: "e5fba13c"},
2000 {k: uLoad8, amode: amodeRegScaled1, rn: x5VReg, want: "c5fb6138"},
2001 {k: uLoad8, amode: amodeRegScaled2, rn: x5VReg, want: "e5fb6138"},
2002 {k: uLoad16, amode: amodeRegScaled1, rn: x5VReg, want: "c5fb6178"},
2003 {k: uLoad16, amode: amodeRegScaled2, rn: x5VReg, want: "e5fb6178"},
2004 {k: uLoad32, amode: amodeRegScaled1, rn: x5VReg, want: "c5fb61b8"},
2005 {k: uLoad32, amode: amodeRegScaled2, rn: x5VReg, want: "e5fb61b8"},
2006 {k: uLoad64, amode: amodeRegScaled1, rn: x5VReg, want: "c5fb61f8"},
2007 {k: uLoad64, amode: amodeRegScaled2, rn: x5VReg, want: "e5fb61f8"},
2008 {k: sLoad8, amode: amodeRegScaled1, rn: x5VReg, want: "c5fba138"},
2009 {k: sLoad8, amode: amodeRegScaled2, rn: x5VReg, want: "e5fba138"},
2010 {k: sLoad16, amode: amodeRegScaled1, rn: x5VReg, want: "c5fba178"},
2011 {k: sLoad16, amode: amodeRegScaled2, rn: x5VReg, want: "e5fba178"},
2012 {k: sLoad32, amode: amodeRegScaled1, rn: x5VReg, want: "c5fba1b8"},
2013 {k: sLoad32, amode: amodeRegScaled2, rn: x5VReg, want: "e5fba1b8"},
2014 {k: fpuLoad32, amode: amodeRegScaled1, rn: v5VReg, want: "c5fb61bc"},
2015 {k: fpuLoad32, amode: amodeRegScaled2, rn: v5VReg, want: "e5fb61bc"},
2016 {k: fpuLoad64, amode: amodeRegScaled1, rn: v5VReg, want: "c5fb61fc"},
2017 {k: fpuLoad64, amode: amodeRegScaled2, rn: v5VReg, want: "e5fb61fc"},
2018 {k: fpuLoad128, amode: amodeRegScaled1, rn: v5VReg, want: "c5fbe13c"},
2019 {k: fpuLoad128, amode: amodeRegScaled2, rn: v5VReg, want: "e5fbe13c"},
2020 // addressModeKindRegExtended.
2021 {k: store8, amode: amodeRegExtended1, rn: x5VReg, want: "c54b2138"},
2022 {k: store8, amode: amodeRegExtended2, rn: x5VReg, want: "e5cb2138"},
2023 {k: store16, amode: amodeRegExtended1, rn: x5VReg, want: "c54b2178"},
2024 {k: store16, amode: amodeRegExtended2, rn: x5VReg, want: "e5cb2178"},
2025 {k: store32, amode: amodeRegExtended1, rn: x5VReg, want: "c54b21b8"},
2026 {k: store32, amode: amodeRegExtended2, rn: x5VReg, want: "e5cb21b8"},
2027 {k: store64, amode: amodeRegExtended1, rn: x5VReg, want: "c54b21f8"},
2028 {k: store64, amode: amodeRegExtended2, rn: x5VReg, want: "e5cb21f8"},
2029 {k: fpuStore32, amode: amodeRegExtended1, rn: v5VReg, want: "c54b21bc"},
2030 {k: fpuStore32, amode: amodeRegExtended2, rn: v5VReg, want: "e5cb21bc"},
2031 {k: fpuStore64, amode: amodeRegExtended1, rn: v5VReg, want: "c54b21fc"},
2032 {k: fpuStore64, amode: amodeRegExtended2, rn: v5VReg, want: "e5cb21fc"},
2033 {k: fpuStore128, amode: amodeRegExtended1, rn: v5VReg, want: "c54ba13c"},
2034 {k: fpuStore128, amode: amodeRegExtended2, rn: v5VReg, want: "e5cba13c"},
2035 {k: uLoad8, amode: amodeRegExtended1, rn: x5VReg, want: "c54b6138"},
2036 {k: uLoad8, amode: amodeRegExtended2, rn: x5VReg, want: "e5cb6138"},
2037 {k: uLoad16, amode: amodeRegExtended1, rn: x5VReg, want: "c54b6178"},
2038 {k: uLoad16, amode: amodeRegExtended2, rn: x5VReg, want: "e5cb6178"},
2039 {k: uLoad32, amode: amodeRegExtended1, rn: x5VReg, want: "c54b61b8"},
2040 {k: uLoad32, amode: amodeRegExtended2, rn: x5VReg, want: "e5cb61b8"},
2041 {k: uLoad64, amode: amodeRegExtended1, rn: x5VReg, want: "c54b61f8"},
2042 {k: uLoad64, amode: amodeRegExtended2, rn: x5VReg, want: "e5cb61f8"},
2043 {k: sLoad8, amode: amodeRegExtended1, rn: x5VReg, want: "c54ba138"},
2044 {k: sLoad8, amode: amodeRegExtended2, rn: x5VReg, want: "e5cba138"},
2045 {k: sLoad16, amode: amodeRegExtended1, rn: x5VReg, want: "c54ba178"},
2046 {k: sLoad16, amode: amodeRegExtended2, rn: x5VReg, want: "e5cba178"},
2047 {k: sLoad32, amode: amodeRegExtended1, rn: x5VReg, want: "c54ba1b8"},
2048 {k: sLoad32, amode: amodeRegExtended2, rn: x5VReg, want: "e5cba1b8"},
2049 {k: fpuLoad32, amode: amodeRegExtended1, rn: v5VReg, want: "c54b61bc"},
2050 {k: fpuLoad32, amode: amodeRegExtended2, rn: v5VReg, want: "e5cb61bc"},
2051 {k: fpuLoad64, amode: amodeRegExtended1, rn: v5VReg, want: "c54b61fc"},
2052 {k: fpuLoad64, amode: amodeRegExtended2, rn: v5VReg, want: "e5cb61fc"},
2053 {k: fpuLoad128, amode: amodeRegExtended1, rn: v5VReg, want: "c54be13c"},
2054 {k: fpuLoad128, amode: amodeRegExtended2, rn: v5VReg, want: "e5cbe13c"},
2055 // addressModeKindRegReg.
2056 {k: store8, amode: amodeRegReg1, rn: x5VReg, want: "c5eb2138"},
2057 {k: store8, amode: amodeRegReg2, rn: x5VReg, want: "e5eb2138"},
2058 {k: store16, amode: amodeRegReg1, rn: x5VReg, want: "c5eb2178"},
2059 {k: store16, amode: amodeRegReg2, rn: x5VReg, want: "e5eb2178"},
2060 {k: store32, amode: amodeRegReg1, rn: x5VReg, want: "c5eb21b8"},
2061 {k: store32, amode: amodeRegReg2, rn: x5VReg, want: "e5eb21b8"},
2062 {k: store64, amode: amodeRegReg1, rn: x5VReg, want: "c5eb21f8"},
2063 {k: store64, amode: amodeRegReg2, rn: x5VReg, want: "e5eb21f8"},
2064 {k: fpuStore32, amode: amodeRegReg1, rn: v5VReg, want: "c5eb21bc"},
2065 {k: fpuStore32, amode: amodeRegReg2, rn: v5VReg, want: "e5eb21bc"},
2066 {k: fpuStore64, amode: amodeRegReg1, rn: v5VReg, want: "c5eb21fc"},
2067 {k: fpuStore64, amode: amodeRegReg2, rn: v5VReg, want: "e5eb21fc"},
2068 {k: fpuStore128, amode: amodeRegReg1, rn: v5VReg, want: "c5eba13c"},
2069 {k: fpuStore128, amode: amodeRegReg2, rn: v5VReg, want: "e5eba13c"},
2070 {k: uLoad8, amode: amodeRegReg1, rn: x5VReg, want: "c5eb6138"},
2071 {k: uLoad8, amode: amodeRegReg2, rn: x5VReg, want: "e5eb6138"},
2072 {k: uLoad16, amode: amodeRegReg1, rn: x5VReg, want: "c5eb6178"},
2073 {k: uLoad16, amode: amodeRegReg2, rn: x5VReg, want: "e5eb6178"},
2074 {k: uLoad32, amode: amodeRegReg1, rn: x5VReg, want: "c5eb61b8"},
2075 {k: uLoad32, amode: amodeRegReg2, rn: x5VReg, want: "e5eb61b8"},
2076 {k: uLoad64, amode: amodeRegReg1, rn: x5VReg, want: "c5eb61f8"},
2077 {k: uLoad64, amode: amodeRegReg2, rn: x5VReg, want: "e5eb61f8"},
2078 {k: sLoad8, amode: amodeRegReg1, rn: x5VReg, want: "c5eba138"},
2079 {k: sLoad8, amode: amodeRegReg2, rn: x5VReg, want: "e5eba138"},
2080 {k: sLoad16, amode: amodeRegReg1, rn: x5VReg, want: "c5eba178"},
2081 {k: sLoad16, amode: amodeRegReg2, rn: x5VReg, want: "e5eba178"},
2082 {k: sLoad32, amode: amodeRegReg1, rn: x5VReg, want: "c5eba1b8"},
2083 {k: sLoad32, amode: amodeRegReg2, rn: x5VReg, want: "e5eba1b8"},
2084 {k: fpuLoad32, amode: amodeRegReg1, rn: v5VReg, want: "c5eb61bc"},
2085 {k: fpuLoad32, amode: amodeRegReg2, rn: v5VReg, want: "e5eb61bc"},
2086 {k: fpuLoad64, amode: amodeRegReg1, rn: v5VReg, want: "c5eb61fc"},
2087 {k: fpuLoad64, amode: amodeRegReg2, rn: v5VReg, want: "e5eb61fc"},
2088 {k: fpuLoad128, amode: amodeRegReg1, rn: v5VReg, want: "c5ebe13c"},
2089 {k: fpuLoad128, amode: amodeRegReg2, rn: v5VReg, want: "e5ebe13c"},
2090 // addressModeKindRegSignedImm9.
2091 {k: store8, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a30038"},
2092 {k: store8, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f31f38"},
2093 {k: store16, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a30078"},
2094 {k: store16, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f31f78"},
2095 {k: store32, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a300b8"},
2096 {k: store32, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f31fb8"},
2097 {k: store64, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a300f8"},
2098 {k: store64, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f31ff8"},
2099 {k: fpuStore32, amode: amodeRegSignedImm9_1, rn: v5VReg, want: "c5a300bc"},
2100 {k: fpuStore32, amode: amodeRegSignedImm9_2, rn: v5VReg, want: "e5f31fbc"},
2101 {k: fpuStore64, amode: amodeRegSignedImm9_1, rn: v5VReg, want: "c5a300fc"},
2102 {k: fpuStore64, amode: amodeRegSignedImm9_2, rn: v5VReg, want: "e5f31ffc"},
2103 {k: fpuStore128, amode: amodeRegSignedImm9_1, rn: v5VReg, want: "c5a3803c"},
2104 {k: fpuStore128, amode: amodeRegSignedImm9_2, rn: v5VReg, want: "e5f39f3c"},
2105 {k: uLoad8, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a34038"},
2106 {k: uLoad8, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f35f38"},
2107 {k: uLoad16, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a34078"},
2108 {k: uLoad16, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f35f78"},
2109 {k: uLoad32, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a340b8"},
2110 {k: uLoad32, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f35fb8"},
2111 {k: uLoad64, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a340f8"},
2112 {k: uLoad64, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f35ff8"},
2113 {k: sLoad8, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a38038"},
2114 {k: sLoad8, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f39f38"},
2115 {k: sLoad16, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a38078"},
2116 {k: sLoad16, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f39f78"},
2117 {k: sLoad32, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a380b8"},
2118 {k: sLoad32, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f39fb8"},
2119 {k: fpuLoad32, amode: amodeRegSignedImm9_1, rn: v5VReg, want: "c5a340bc"},
2120 {k: fpuLoad32, amode: amodeRegSignedImm9_2, rn: v5VReg, want: "e5f35fbc"},
2121 {k: fpuLoad64, amode: amodeRegSignedImm9_1, rn: v5VReg, want: "c5a340fc"},
2122 {k: fpuLoad64, amode: amodeRegSignedImm9_2, rn: v5VReg, want: "e5f35ffc"},
2123 {k: fpuLoad128, amode: amodeRegSignedImm9_1, rn: v5VReg, want: "c5a3c03c"},
2124 {k: fpuLoad128, amode: amodeRegSignedImm9_2, rn: v5VReg, want: "e5f3df3c"},
2125 // addressModeKindPostIndex.
2126 {k: store8, amode: amodePostIndex1, rn: x5VReg, want: "c5a70038"},
2127 {k: store8, amode: amodePostIndex2, rn: x5VReg, want: "e5071038"},
2128 {k: store16, amode: amodePostIndex1, rn: x5VReg, want: "c5a70078"},
2129 {k: store16, amode: amodePostIndex2, rn: x5VReg, want: "e5071078"},
2130 {k: store32, amode: amodePostIndex1, rn: x5VReg, want: "c5a700b8"},
2131 {k: store32, amode: amodePostIndex2, rn: x5VReg, want: "e50710b8"},
2132 {k: store64, amode: amodePostIndex1, rn: x5VReg, want: "c5a700f8"},
2133 {k: store64, amode: amodePostIndex2, rn: x5VReg, want: "e50710f8"},
2134 {k: fpuStore32, amode: amodePostIndex1, rn: v5VReg, want: "c5a700bc"},
2135 {k: fpuStore32, amode: amodePostIndex2, rn: v5VReg, want: "e50710bc"},
2136 {k: fpuStore64, amode: amodePostIndex1, rn: v5VReg, want: "c5a700fc"},
2137 {k: fpuStore64, amode: amodePostIndex2, rn: v5VReg, want: "e50710fc"},
2138 {k: fpuStore128, amode: amodePostIndex1, rn: v5VReg, want: "c5a7803c"},
2139 {k: fpuStore128, amode: amodePostIndex2, rn: v5VReg, want: "e507903c"},
2140 {k: uLoad8, amode: amodePostIndex1, rn: x5VReg, want: "c5a74038"},
2141 {k: uLoad8, amode: amodePostIndex2, rn: x5VReg, want: "e5075038"},
2142 {k: uLoad16, amode: amodePostIndex1, rn: x5VReg, want: "c5a74078"},
2143 {k: uLoad16, amode: amodePostIndex2, rn: x5VReg, want: "e5075078"},
2144 {k: uLoad32, amode: amodePostIndex1, rn: x5VReg, want: "c5a740b8"},
2145 {k: uLoad32, amode: amodePostIndex2, rn: x5VReg, want: "e50750b8"},
2146 {k: uLoad64, amode: amodePostIndex1, rn: x5VReg, want: "c5a740f8"},
2147 {k: uLoad64, amode: amodePostIndex2, rn: x5VReg, want: "e50750f8"},
2148 {k: sLoad8, amode: amodePostIndex1, rn: x5VReg, want: "c5a78038"},
2149 {k: sLoad8, amode: amodePostIndex2, rn: x5VReg, want: "e5079038"},
2150 {k: sLoad16, amode: amodePostIndex1, rn: x5VReg, want: "c5a78078"},
2151 {k: sLoad16, amode: amodePostIndex2, rn: x5VReg, want: "e5079078"},
2152 {k: sLoad32, amode: amodePostIndex1, rn: x5VReg, want: "c5a780b8"},
2153 {k: sLoad32, amode: amodePostIndex2, rn: x5VReg, want: "e50790b8"},
2154 {k: fpuLoad32, amode: amodePostIndex1, rn: v5VReg, want: "c5a740bc"},
2155 {k: fpuLoad32, amode: amodePostIndex2, rn: v5VReg, want: "e50750bc"},
2156 {k: fpuLoad64, amode: amodePostIndex1, rn: v5VReg, want: "c5a740fc"},
2157 {k: fpuLoad64, amode: amodePostIndex2, rn: v5VReg, want: "e50750fc"},
2158 {k: fpuLoad128, amode: amodePostIndex1, rn: v5VReg, want: "c5a7c03c"},
2159 {k: fpuLoad128, amode: amodePostIndex2, rn: v5VReg, want: "e507d03c"},
2160 // addressModeKindPreIndex.
2161 {k: store8, amode: amodePreIndex1, rn: x5VReg, want: "c5af0038"},
2162 {k: store8, amode: amodePreIndex2, rn: x5VReg, want: "e50f1038"},
2163 {k: store16, amode: amodePreIndex1, rn: x5VReg, want: "c5af0078"},
2164 {k: store16, amode: amodePreIndex2, rn: x5VReg, want: "e50f1078"},
2165 {k: store32, amode: amodePreIndex1, rn: x5VReg, want: "c5af00b8"},
2166 {k: store32, amode: amodePreIndex2, rn: x5VReg, want: "e50f10b8"},
2167 {k: store64, amode: amodePreIndex1, rn: x5VReg, want: "c5af00f8"},
2168 {k: store64, amode: amodePreIndex2, rn: x5VReg, want: "e50f10f8"},
2169 {k: store64, amode: amodePreIndex2, rn: xzrVReg, want: "ff0f10f8"},
2170 {k: fpuStore32, amode: amodePreIndex1, rn: v5VReg, want: "c5af00bc"},
2171 {k: fpuStore32, amode: amodePreIndex2, rn: v5VReg, want: "e50f10bc"},
2172 {k: fpuStore64, amode: amodePreIndex1, rn: v5VReg, want: "c5af00fc"},
2173 {k: fpuStore64, amode: amodePreIndex2, rn: v5VReg, want: "e50f10fc"},
2174 {k: fpuStore128, amode: amodePreIndex1, rn: v5VReg, want: "c5af803c"},
2175 {k: fpuStore128, amode: amodePreIndex2, rn: v5VReg, want: "e50f903c"},
2176 {k: uLoad8, amode: amodePreIndex1, rn: x5VReg, want: "c5af4038"},
2177 {k: uLoad8, amode: amodePreIndex2, rn: x5VReg, want: "e50f5038"},
2178 {k: uLoad16, amode: amodePreIndex1, rn: x5VReg, want: "c5af4078"},
2179 {k: uLoad16, amode: amodePreIndex2, rn: x5VReg, want: "e50f5078"},
2180 {k: uLoad32, amode: amodePreIndex1, rn: x5VReg, want: "c5af40b8"},
2181 {k: uLoad32, amode: amodePreIndex2, rn: x5VReg, want: "e50f50b8"},
2182 {k: uLoad64, amode: amodePreIndex1, rn: x5VReg, want: "c5af40f8"},
2183 {k: uLoad64, amode: amodePreIndex2, rn: x5VReg, want: "e50f50f8"},
2184 {k: sLoad8, amode: amodePreIndex1, rn: x5VReg, want: "c5af8038"},
2185 {k: sLoad8, amode: amodePreIndex2, rn: x5VReg, want: "e50f9038"},
2186 {k: sLoad16, amode: amodePreIndex1, rn: x5VReg, want: "c5af8078"},
2187 {k: sLoad16, amode: amodePreIndex2, rn: x5VReg, want: "e50f9078"},
2188 {k: sLoad32, amode: amodePreIndex1, rn: x5VReg, want: "c5af80b8"},
2189 {k: sLoad32, amode: amodePreIndex2, rn: x5VReg, want: "e50f90b8"},
2190 {k: fpuLoad32, amode: amodePreIndex1, rn: v5VReg, want: "c5af40bc"},
2191 {k: fpuLoad32, amode: amodePreIndex2, rn: v5VReg, want: "e50f50bc"},
2192 {k: fpuLoad64, amode: amodePreIndex1, rn: v5VReg, want: "c5af40fc"},
2193 {k: fpuLoad64, amode: amodePreIndex2, rn: v5VReg, want: "e50f50fc"},
2194 {k: fpuLoad128, amode: amodePreIndex1, rn: v5VReg, want: "c5afc03c"},
2195 {k: fpuLoad128, amode: amodePreIndex2, rn: v5VReg, want: "e50fd03c"},
2196 // addressModeKindRegUnsignedImm12.
2197 {k: store8, amode: setImm(amodeUnsignedImm12_1, 10), rn: x5VReg, want: "c52b0039"},
2198 {k: store8, amode: setImm(amodeUnsignedImm12_2, 4095), rn: x5VReg, want: "e5ff3f39"},
2199 {k: store16, amode: setImm(amodeUnsignedImm12_1, 10), rn: x5VReg, want: "c5170079"},
2200 {k: store16, amode: setImm(amodeUnsignedImm12_2, 4095*2), rn: x5VReg, want: "e5ff3f79"},
2201 {k: store32, amode: setImm(amodeUnsignedImm12_1, 16), rn: x5VReg, want: "c51300b9"},
2202 {k: store32, amode: setImm(amodeUnsignedImm12_2, 4095*4), rn: x5VReg, want: "e5ff3fb9"},
2203 {k: store64, amode: setImm(amodeUnsignedImm12_1, 16), rn: x5VReg, want: "c50b00f9"},
2204 {k: store64, amode: setImm(amodeUnsignedImm12_2, 4095*8), rn: x5VReg, want: "e5ff3ff9"},
2205 {k: fpuStore32, amode: setImm(amodeUnsignedImm12_1, 256), rn: v5VReg, want: "c50301bd"},
2206 {k: fpuStore32, amode: setImm(amodeUnsignedImm12_2, 4095*4), rn: v5VReg, want: "e5ff3fbd"},
2207 {k: fpuStore64, amode: setImm(amodeUnsignedImm12_1, 512), rn: v5VReg, want: "c50301fd"},
2208 {k: fpuStore64, amode: setImm(amodeUnsignedImm12_2, 4095*8), rn: v5VReg, want: "e5ff3ffd"},
2209 {k: fpuStore128, amode: setImm(amodeUnsignedImm12_1, 16), rn: v5VReg, want: "c507803d"},
2210 {k: fpuStore128, amode: setImm(amodeUnsignedImm12_2, 4095*16), rn: v5VReg, want: "e5ffbf3d"},
2211 {k: uLoad8, amode: setImm(amodeUnsignedImm12_1, 10), rn: x5VReg, want: "c52b4039"},
2212 {k: uLoad8, amode: setImm(amodeUnsignedImm12_2, 4095), rn: x5VReg, want: "e5ff7f39"},
2213 {k: uLoad16, amode: setImm(amodeUnsignedImm12_1, 10), rn: x5VReg, want: "c5174079"},
2214 {k: uLoad16, amode: setImm(amodeUnsignedImm12_2, 4095*2), rn: x5VReg, want: "e5ff7f79"},
2215 {k: uLoad32, amode: setImm(amodeUnsignedImm12_1, 16), rn: x5VReg, want: "c51340b9"},
2216 {k: uLoad32, amode: setImm(amodeUnsignedImm12_2, 4095*4), rn: x5VReg, want: "e5ff7fb9"},
2217 {k: uLoad64, amode: setImm(amodeUnsignedImm12_1, 16), rn: x5VReg, want: "c50b40f9"},
2218 {k: uLoad64, amode: setImm(amodeUnsignedImm12_2, 4095*8), rn: x5VReg, want: "e5ff7ff9"},
2219 {k: sLoad8, amode: setImm(amodeUnsignedImm12_1, 10), rn: x5VReg, want: "c52b8039"},
2220 {k: sLoad8, amode: setImm(amodeUnsignedImm12_2, 4095), rn: x5VReg, want: "e5ffbf39"},
2221 {k: sLoad16, amode: setImm(amodeUnsignedImm12_1, 10), rn: x5VReg, want: "c5178079"},
2222 {k: sLoad16, amode: setImm(amodeUnsignedImm12_2, 4095*2), rn: x5VReg, want: "e5ffbf79"},
2223 {k: sLoad32, amode: setImm(amodeUnsignedImm12_1, 16), rn: x5VReg, want: "c51380b9"},
2224 {k: sLoad32, amode: setImm(amodeUnsignedImm12_2, 4095*4), rn: x5VReg, want: "e5ffbfb9"},
2225 {k: fpuLoad32, amode: setImm(amodeUnsignedImm12_1, 256), rn: v5VReg, want: "c50341bd"},
2226 {k: fpuLoad32, amode: setImm(amodeUnsignedImm12_2, 4095*4), rn: v5VReg, want: "e5ff7fbd"},
2227 {k: fpuLoad64, amode: setImm(amodeUnsignedImm12_1, 512), rn: v5VReg, want: "c50341fd"},
2228 {k: fpuLoad64, amode: setImm(amodeUnsignedImm12_2, 4095*8), rn: v5VReg, want: "e5ff7ffd"},
2229 {k: fpuLoad128, amode: setImm(amodeUnsignedImm12_1, 16), rn: v5VReg, want: "c507c03d"},
2230 {k: fpuLoad128, amode: setImm(amodeUnsignedImm12_2, 4095*16), rn: v5VReg, want: "e5ffff3d"},
2231 } {
2232 t.Run(tc.want, func(t *testing.T) {
2233 var i *instruction
2234 switch tc.k {
2235 case store8, store16, store32, store64, fpuStore32, fpuStore64, fpuStore128:
2236 i = &instruction{kind: tc.k, rn: operandNR(tc.rn)}
2237 case uLoad8, uLoad16, uLoad32, uLoad64, sLoad8, sLoad16, sLoad32, fpuLoad32, fpuLoad64, fpuLoad128:
2238 i = &instruction{kind: tc.k, rd: tc.rn}
2239 default:
2240 t.Fatalf("unknown kind: %v", tc.k)
2241 }
2242 i.setAmode(&tc.amode)
2243 _, _, m := newSetupWithMockContext()
2244 i.encode(m)
2245 // Note: for quick iteration we can use golang.org/x/arch package to verify the encoding.
2246 // but wazero doesn't add even a test dependency to it, so commented out.
2247 // inst, err := arm64asm.Decode(m.buf)
2248 // require.NoError(t, err)
2249 // fmt.Println(inst.String())
2250 require.Equal(t, tc.want, hex.EncodeToString(m.compiler.Buf()))
2251 })
2252 }
2253 }
2254
2255 func Test_encodeExitSequence(t *testing.T) {
2256 t.Run("no overlap", func(t *testing.T) {
2257 m := &mockCompiler{}
2258 encodeExitSequence(m, x22VReg)
2259 // ldr x29, [x22, #0x10]
2260 // ldr x30, [x22, #0x20]
2261 // ldr x27, [x22, #0x18]
2262 // mov sp, x27
2263 // ret
2264 // b #0x14 ;; dummy
2265 require.Equal(t, "dd0a40f9de1240f9db0e40f97f030091c0035fd600000014", hex.EncodeToString(m.buf))
2266 require.Equal(t, len(m.buf), exitSequenceSize)
2267 })
2268 t.Run("fp", func(t *testing.T) {
2269 m := &mockCompiler{}
2270 encodeExitSequence(m, fpVReg)
2271 // mov x27, x29
2272 // ldr x29, [x27, #0x10]
2273 // ldr x30, [x27, #0x20]
2274 // ldr x27, [x27, #0x18]
2275 // mov sp, x27
2276 // ret
2277 require.Equal(t, "fb031daa7d0b40f97e1340f97b0f40f97f030091c0035fd6", hex.EncodeToString(m.buf))
2278 require.Equal(t, len(m.buf), exitSequenceSize)
2279 })
2280 t.Run("lr", func(t *testing.T) {
2281 m := &mockCompiler{}
2282 encodeExitSequence(m, lrVReg)
2283 // mov x27, x30
2284 // ldr x29, [x27, #0x10]
2285 // ldr x30, [x27, #0x20]
2286 // ldr x27, [x27, #0x18]
2287 // mov sp, x27
2288 // ret
2289 require.Equal(t, "fb031eaa7d0b40f97e1340f97b0f40f97f030091c0035fd6", hex.EncodeToString(m.buf))
2290 require.Equal(t, len(m.buf), exitSequenceSize)
2291 })
2292 }
2293
2294 func Test_encodeBrTableSequence(t *testing.T) {
2295 _, _, m := newSetupWithMockContext()
2296 i := &instruction{}
2297 const tableIndex, tableSize = 5, 10
2298 i.asBrTableSequence(x22VReg, tableIndex, tableSize)
2299 m.jmpTableTargets = [][]uint32{{}, {}, {}, {}, {}, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}
2300 i.encode(m)
2301 encoded := m.compiler.Buf()
2302 require.Equal(t, i.size(), int64(len(encoded)))
2303 require.Equal(t, "9b000010765bb6b87b03168b60031fd6", hex.EncodeToString(encoded[:brTableSequenceOffsetTableBegin]))
2304 require.Equal(t, "0100000002000000030000000400000005000000060000000700000008000000090000000a000000", hex.EncodeToString(encoded[brTableSequenceOffsetTableBegin:]))
2305 }
2306
2307 func Test_encodeUnconditionalBranch(t *testing.T) {
2308 buf := make([]byte, 4)
2309
2310 actual := encodeUnconditionalBranch(true, 4)
2311 binary.LittleEndian.PutUint32(buf, actual)
2312 require.Equal(t, "0x01000094", fmt.Sprintf("%#x", buf))
2313
2314 actual = encodeUnconditionalBranch(false, 4*1024)
2315 binary.LittleEndian.PutUint32(buf, actual)
2316 require.Equal(t, "0x00040014", fmt.Sprintf("%#x", buf))
2317 }