podman
459 строк · 12.1 Кб
1// Code generated by parse_opcodes -go; DO NOT EDIT.
2
3package riscv
4
5import "github.com/twitchyliquid64/golang-asm/obj"
6
7type inst struct {
8opcode uint32
9funct3 uint32
10rs2 uint32
11csr int64
12funct7 uint32
13}
14
15func encode(a obj.As) *inst {
16switch a {
17case ABEQ:
18return &inst{0x63, 0x0, 0x0, 0, 0x0}
19case ABNE:
20return &inst{0x63, 0x1, 0x0, 0, 0x0}
21case ABLT:
22return &inst{0x63, 0x4, 0x0, 0, 0x0}
23case ABGE:
24return &inst{0x63, 0x5, 0x0, 0, 0x0}
25case ABLTU:
26return &inst{0x63, 0x6, 0x0, 0, 0x0}
27case ABGEU:
28return &inst{0x63, 0x7, 0x0, 0, 0x0}
29case AJALR:
30return &inst{0x67, 0x0, 0x0, 0, 0x0}
31case AJAL:
32return &inst{0x6f, 0x0, 0x0, 0, 0x0}
33case ALUI:
34return &inst{0x37, 0x0, 0x0, 0, 0x0}
35case AAUIPC:
36return &inst{0x17, 0x0, 0x0, 0, 0x0}
37case AADDI:
38return &inst{0x13, 0x0, 0x0, 0, 0x0}
39case ASLLI:
40return &inst{0x13, 0x1, 0x0, 0, 0x0}
41case ASLTI:
42return &inst{0x13, 0x2, 0x0, 0, 0x0}
43case ASLTIU:
44return &inst{0x13, 0x3, 0x0, 0, 0x0}
45case AXORI:
46return &inst{0x13, 0x4, 0x0, 0, 0x0}
47case ASRLI:
48return &inst{0x13, 0x5, 0x0, 0, 0x0}
49case ASRAI:
50return &inst{0x13, 0x5, 0x0, 1024, 0x20}
51case AORI:
52return &inst{0x13, 0x6, 0x0, 0, 0x0}
53case AANDI:
54return &inst{0x13, 0x7, 0x0, 0, 0x0}
55case AADD:
56return &inst{0x33, 0x0, 0x0, 0, 0x0}
57case ASUB:
58return &inst{0x33, 0x0, 0x0, 1024, 0x20}
59case ASLL:
60return &inst{0x33, 0x1, 0x0, 0, 0x0}
61case ASLT:
62return &inst{0x33, 0x2, 0x0, 0, 0x0}
63case ASLTU:
64return &inst{0x33, 0x3, 0x0, 0, 0x0}
65case AXOR:
66return &inst{0x33, 0x4, 0x0, 0, 0x0}
67case ASRL:
68return &inst{0x33, 0x5, 0x0, 0, 0x0}
69case ASRA:
70return &inst{0x33, 0x5, 0x0, 1024, 0x20}
71case AOR:
72return &inst{0x33, 0x6, 0x0, 0, 0x0}
73case AAND:
74return &inst{0x33, 0x7, 0x0, 0, 0x0}
75case AADDIW:
76return &inst{0x1b, 0x0, 0x0, 0, 0x0}
77case ASLLIW:
78return &inst{0x1b, 0x1, 0x0, 0, 0x0}
79case ASRLIW:
80return &inst{0x1b, 0x5, 0x0, 0, 0x0}
81case ASRAIW:
82return &inst{0x1b, 0x5, 0x0, 1024, 0x20}
83case AADDW:
84return &inst{0x3b, 0x0, 0x0, 0, 0x0}
85case ASUBW:
86return &inst{0x3b, 0x0, 0x0, 1024, 0x20}
87case ASLLW:
88return &inst{0x3b, 0x1, 0x0, 0, 0x0}
89case ASRLW:
90return &inst{0x3b, 0x5, 0x0, 0, 0x0}
91case ASRAW:
92return &inst{0x3b, 0x5, 0x0, 1024, 0x20}
93case ALB:
94return &inst{0x3, 0x0, 0x0, 0, 0x0}
95case ALH:
96return &inst{0x3, 0x1, 0x0, 0, 0x0}
97case ALW:
98return &inst{0x3, 0x2, 0x0, 0, 0x0}
99case ALD:
100return &inst{0x3, 0x3, 0x0, 0, 0x0}
101case ALBU:
102return &inst{0x3, 0x4, 0x0, 0, 0x0}
103case ALHU:
104return &inst{0x3, 0x5, 0x0, 0, 0x0}
105case ALWU:
106return &inst{0x3, 0x6, 0x0, 0, 0x0}
107case ASB:
108return &inst{0x23, 0x0, 0x0, 0, 0x0}
109case ASH:
110return &inst{0x23, 0x1, 0x0, 0, 0x0}
111case ASW:
112return &inst{0x23, 0x2, 0x0, 0, 0x0}
113case ASD:
114return &inst{0x23, 0x3, 0x0, 0, 0x0}
115case AFENCE:
116return &inst{0xf, 0x0, 0x0, 0, 0x0}
117case AFENCEI:
118return &inst{0xf, 0x1, 0x0, 0, 0x0}
119case AMUL:
120return &inst{0x33, 0x0, 0x0, 32, 0x1}
121case AMULH:
122return &inst{0x33, 0x1, 0x0, 32, 0x1}
123case AMULHSU:
124return &inst{0x33, 0x2, 0x0, 32, 0x1}
125case AMULHU:
126return &inst{0x33, 0x3, 0x0, 32, 0x1}
127case ADIV:
128return &inst{0x33, 0x4, 0x0, 32, 0x1}
129case ADIVU:
130return &inst{0x33, 0x5, 0x0, 32, 0x1}
131case AREM:
132return &inst{0x33, 0x6, 0x0, 32, 0x1}
133case AREMU:
134return &inst{0x33, 0x7, 0x0, 32, 0x1}
135case AMULW:
136return &inst{0x3b, 0x0, 0x0, 32, 0x1}
137case ADIVW:
138return &inst{0x3b, 0x4, 0x0, 32, 0x1}
139case ADIVUW:
140return &inst{0x3b, 0x5, 0x0, 32, 0x1}
141case AREMW:
142return &inst{0x3b, 0x6, 0x0, 32, 0x1}
143case AREMUW:
144return &inst{0x3b, 0x7, 0x0, 32, 0x1}
145case AAMOADDW:
146return &inst{0x2f, 0x2, 0x0, 0, 0x0}
147case AAMOXORW:
148return &inst{0x2f, 0x2, 0x0, 512, 0x10}
149case AAMOORW:
150return &inst{0x2f, 0x2, 0x0, 1024, 0x20}
151case AAMOANDW:
152return &inst{0x2f, 0x2, 0x0, 1536, 0x30}
153case AAMOMINW:
154return &inst{0x2f, 0x2, 0x0, -2048, 0x40}
155case AAMOMAXW:
156return &inst{0x2f, 0x2, 0x0, -1536, 0x50}
157case AAMOMINUW:
158return &inst{0x2f, 0x2, 0x0, -1024, 0x60}
159case AAMOMAXUW:
160return &inst{0x2f, 0x2, 0x0, -512, 0x70}
161case AAMOSWAPW:
162return &inst{0x2f, 0x2, 0x0, 128, 0x4}
163case ALRW:
164return &inst{0x2f, 0x2, 0x0, 256, 0x8}
165case ASCW:
166return &inst{0x2f, 0x2, 0x0, 384, 0xc}
167case AAMOADDD:
168return &inst{0x2f, 0x3, 0x0, 0, 0x0}
169case AAMOXORD:
170return &inst{0x2f, 0x3, 0x0, 512, 0x10}
171case AAMOORD:
172return &inst{0x2f, 0x3, 0x0, 1024, 0x20}
173case AAMOANDD:
174return &inst{0x2f, 0x3, 0x0, 1536, 0x30}
175case AAMOMIND:
176return &inst{0x2f, 0x3, 0x0, -2048, 0x40}
177case AAMOMAXD:
178return &inst{0x2f, 0x3, 0x0, -1536, 0x50}
179case AAMOMINUD:
180return &inst{0x2f, 0x3, 0x0, -1024, 0x60}
181case AAMOMAXUD:
182return &inst{0x2f, 0x3, 0x0, -512, 0x70}
183case AAMOSWAPD:
184return &inst{0x2f, 0x3, 0x0, 128, 0x4}
185case ALRD:
186return &inst{0x2f, 0x3, 0x0, 256, 0x8}
187case ASCD:
188return &inst{0x2f, 0x3, 0x0, 384, 0xc}
189case AECALL:
190return &inst{0x73, 0x0, 0x0, 0, 0x0}
191case AEBREAK:
192return &inst{0x73, 0x0, 0x1, 1, 0x0}
193case AURET:
194return &inst{0x73, 0x0, 0x2, 2, 0x0}
195case ASRET:
196return &inst{0x73, 0x0, 0x2, 258, 0x8}
197case AMRET:
198return &inst{0x73, 0x0, 0x2, 770, 0x18}
199case ADRET:
200return &inst{0x73, 0x0, 0x12, 1970, 0x3d}
201case ASFENCEVMA:
202return &inst{0x73, 0x0, 0x0, 288, 0x9}
203case AWFI:
204return &inst{0x73, 0x0, 0x5, 261, 0x8}
205case ACSRRW:
206return &inst{0x73, 0x1, 0x0, 0, 0x0}
207case ACSRRS:
208return &inst{0x73, 0x2, 0x0, 0, 0x0}
209case ACSRRC:
210return &inst{0x73, 0x3, 0x0, 0, 0x0}
211case ACSRRWI:
212return &inst{0x73, 0x5, 0x0, 0, 0x0}
213case ACSRRSI:
214return &inst{0x73, 0x6, 0x0, 0, 0x0}
215case ACSRRCI:
216return &inst{0x73, 0x7, 0x0, 0, 0x0}
217case AHFENCEVVMA:
218return &inst{0x73, 0x0, 0x0, 544, 0x11}
219case AHFENCEGVMA:
220return &inst{0x73, 0x0, 0x0, 1568, 0x31}
221case AFADDS:
222return &inst{0x53, 0x0, 0x0, 0, 0x0}
223case AFSUBS:
224return &inst{0x53, 0x0, 0x0, 128, 0x4}
225case AFMULS:
226return &inst{0x53, 0x0, 0x0, 256, 0x8}
227case AFDIVS:
228return &inst{0x53, 0x0, 0x0, 384, 0xc}
229case AFSGNJS:
230return &inst{0x53, 0x0, 0x0, 512, 0x10}
231case AFSGNJNS:
232return &inst{0x53, 0x1, 0x0, 512, 0x10}
233case AFSGNJXS:
234return &inst{0x53, 0x2, 0x0, 512, 0x10}
235case AFMINS:
236return &inst{0x53, 0x0, 0x0, 640, 0x14}
237case AFMAXS:
238return &inst{0x53, 0x1, 0x0, 640, 0x14}
239case AFSQRTS:
240return &inst{0x53, 0x0, 0x0, 1408, 0x2c}
241case AFADDD:
242return &inst{0x53, 0x0, 0x0, 32, 0x1}
243case AFSUBD:
244return &inst{0x53, 0x0, 0x0, 160, 0x5}
245case AFMULD:
246return &inst{0x53, 0x0, 0x0, 288, 0x9}
247case AFDIVD:
248return &inst{0x53, 0x0, 0x0, 416, 0xd}
249case AFSGNJD:
250return &inst{0x53, 0x0, 0x0, 544, 0x11}
251case AFSGNJND:
252return &inst{0x53, 0x1, 0x0, 544, 0x11}
253case AFSGNJXD:
254return &inst{0x53, 0x2, 0x0, 544, 0x11}
255case AFMIND:
256return &inst{0x53, 0x0, 0x0, 672, 0x15}
257case AFMAXD:
258return &inst{0x53, 0x1, 0x0, 672, 0x15}
259case AFCVTSD:
260return &inst{0x53, 0x0, 0x1, 1025, 0x20}
261case AFCVTDS:
262return &inst{0x53, 0x0, 0x0, 1056, 0x21}
263case AFSQRTD:
264return &inst{0x53, 0x0, 0x0, 1440, 0x2d}
265case AFADDQ:
266return &inst{0x53, 0x0, 0x0, 96, 0x3}
267case AFSUBQ:
268return &inst{0x53, 0x0, 0x0, 224, 0x7}
269case AFMULQ:
270return &inst{0x53, 0x0, 0x0, 352, 0xb}
271case AFDIVQ:
272return &inst{0x53, 0x0, 0x0, 480, 0xf}
273case AFSGNJQ:
274return &inst{0x53, 0x0, 0x0, 608, 0x13}
275case AFSGNJNQ:
276return &inst{0x53, 0x1, 0x0, 608, 0x13}
277case AFSGNJXQ:
278return &inst{0x53, 0x2, 0x0, 608, 0x13}
279case AFMINQ:
280return &inst{0x53, 0x0, 0x0, 736, 0x17}
281case AFMAXQ:
282return &inst{0x53, 0x1, 0x0, 736, 0x17}
283case AFCVTSQ:
284return &inst{0x53, 0x0, 0x3, 1027, 0x20}
285case AFCVTQS:
286return &inst{0x53, 0x0, 0x0, 1120, 0x23}
287case AFCVTDQ:
288return &inst{0x53, 0x0, 0x3, 1059, 0x21}
289case AFCVTQD:
290return &inst{0x53, 0x0, 0x1, 1121, 0x23}
291case AFSQRTQ:
292return &inst{0x53, 0x0, 0x0, 1504, 0x2f}
293case AFLES:
294return &inst{0x53, 0x0, 0x0, -1536, 0x50}
295case AFLTS:
296return &inst{0x53, 0x1, 0x0, -1536, 0x50}
297case AFEQS:
298return &inst{0x53, 0x2, 0x0, -1536, 0x50}
299case AFLED:
300return &inst{0x53, 0x0, 0x0, -1504, 0x51}
301case AFLTD:
302return &inst{0x53, 0x1, 0x0, -1504, 0x51}
303case AFEQD:
304return &inst{0x53, 0x2, 0x0, -1504, 0x51}
305case AFLEQ:
306return &inst{0x53, 0x0, 0x0, -1440, 0x53}
307case AFLTQ:
308return &inst{0x53, 0x1, 0x0, -1440, 0x53}
309case AFEQQ:
310return &inst{0x53, 0x2, 0x0, -1440, 0x53}
311case AFCVTWS:
312return &inst{0x53, 0x0, 0x0, -1024, 0x60}
313case AFCVTWUS:
314return &inst{0x53, 0x0, 0x1, -1023, 0x60}
315case AFCVTLS:
316return &inst{0x53, 0x0, 0x2, -1022, 0x60}
317case AFCVTLUS:
318return &inst{0x53, 0x0, 0x3, -1021, 0x60}
319case AFMVXW:
320return &inst{0x53, 0x0, 0x0, -512, 0x70}
321case AFCLASSS:
322return &inst{0x53, 0x1, 0x0, -512, 0x70}
323case AFCVTWD:
324return &inst{0x53, 0x0, 0x0, -992, 0x61}
325case AFCVTWUD:
326return &inst{0x53, 0x0, 0x1, -991, 0x61}
327case AFCVTLD:
328return &inst{0x53, 0x0, 0x2, -990, 0x61}
329case AFCVTLUD:
330return &inst{0x53, 0x0, 0x3, -989, 0x61}
331case AFMVXD:
332return &inst{0x53, 0x0, 0x0, -480, 0x71}
333case AFCLASSD:
334return &inst{0x53, 0x1, 0x0, -480, 0x71}
335case AFCVTWQ:
336return &inst{0x53, 0x0, 0x0, -928, 0x63}
337case AFCVTWUQ:
338return &inst{0x53, 0x0, 0x1, -927, 0x63}
339case AFCVTLQ:
340return &inst{0x53, 0x0, 0x2, -926, 0x63}
341case AFCVTLUQ:
342return &inst{0x53, 0x0, 0x3, -925, 0x63}
343case AFMVXQ:
344return &inst{0x53, 0x0, 0x0, -416, 0x73}
345case AFCLASSQ:
346return &inst{0x53, 0x1, 0x0, -416, 0x73}
347case AFCVTSW:
348return &inst{0x53, 0x0, 0x0, -768, 0x68}
349case AFCVTSWU:
350return &inst{0x53, 0x0, 0x1, -767, 0x68}
351case AFCVTSL:
352return &inst{0x53, 0x0, 0x2, -766, 0x68}
353case AFCVTSLU:
354return &inst{0x53, 0x0, 0x3, -765, 0x68}
355case AFMVWX:
356return &inst{0x53, 0x0, 0x0, -256, 0x78}
357case AFCVTDW:
358return &inst{0x53, 0x0, 0x0, -736, 0x69}
359case AFCVTDWU:
360return &inst{0x53, 0x0, 0x1, -735, 0x69}
361case AFCVTDL:
362return &inst{0x53, 0x0, 0x2, -734, 0x69}
363case AFCVTDLU:
364return &inst{0x53, 0x0, 0x3, -733, 0x69}
365case AFMVDX:
366return &inst{0x53, 0x0, 0x0, -224, 0x79}
367case AFCVTQW:
368return &inst{0x53, 0x0, 0x0, -672, 0x6b}
369case AFCVTQWU:
370return &inst{0x53, 0x0, 0x1, -671, 0x6b}
371case AFCVTQL:
372return &inst{0x53, 0x0, 0x2, -670, 0x6b}
373case AFCVTQLU:
374return &inst{0x53, 0x0, 0x3, -669, 0x6b}
375case AFMVQX:
376return &inst{0x53, 0x0, 0x0, -160, 0x7b}
377case AFLW:
378return &inst{0x7, 0x2, 0x0, 0, 0x0}
379case AFLD:
380return &inst{0x7, 0x3, 0x0, 0, 0x0}
381case AFLQ:
382return &inst{0x7, 0x4, 0x0, 0, 0x0}
383case AFSW:
384return &inst{0x27, 0x2, 0x0, 0, 0x0}
385case AFSD:
386return &inst{0x27, 0x3, 0x0, 0, 0x0}
387case AFSQ:
388return &inst{0x27, 0x4, 0x0, 0, 0x0}
389case AFMADDS:
390return &inst{0x43, 0x0, 0x0, 0, 0x0}
391case AFMSUBS:
392return &inst{0x47, 0x0, 0x0, 0, 0x0}
393case AFNMSUBS:
394return &inst{0x4b, 0x0, 0x0, 0, 0x0}
395case AFNMADDS:
396return &inst{0x4f, 0x0, 0x0, 0, 0x0}
397case AFMADDD:
398return &inst{0x43, 0x0, 0x0, 32, 0x1}
399case AFMSUBD:
400return &inst{0x47, 0x0, 0x0, 32, 0x1}
401case AFNMSUBD:
402return &inst{0x4b, 0x0, 0x0, 32, 0x1}
403case AFNMADDD:
404return &inst{0x4f, 0x0, 0x0, 32, 0x1}
405case AFMADDQ:
406return &inst{0x43, 0x0, 0x0, 96, 0x3}
407case AFMSUBQ:
408return &inst{0x47, 0x0, 0x0, 96, 0x3}
409case AFNMSUBQ:
410return &inst{0x4b, 0x0, 0x0, 96, 0x3}
411case AFNMADDQ:
412return &inst{0x4f, 0x0, 0x0, 96, 0x3}
413case ASLLIRV32:
414return &inst{0x13, 0x1, 0x0, 0, 0x0}
415case ASRLIRV32:
416return &inst{0x13, 0x5, 0x0, 0, 0x0}
417case ASRAIRV32:
418return &inst{0x13, 0x5, 0x0, 1024, 0x20}
419case AFRFLAGS:
420return &inst{0x73, 0x2, 0x1, 1, 0x0}
421case AFSFLAGS:
422return &inst{0x73, 0x1, 0x1, 1, 0x0}
423case AFSFLAGSI:
424return &inst{0x73, 0x5, 0x1, 1, 0x0}
425case AFRRM:
426return &inst{0x73, 0x2, 0x2, 2, 0x0}
427case AFSRM:
428return &inst{0x73, 0x1, 0x2, 2, 0x0}
429case AFSRMI:
430return &inst{0x73, 0x5, 0x2, 2, 0x0}
431case AFSCSR:
432return &inst{0x73, 0x1, 0x3, 3, 0x0}
433case AFRCSR:
434return &inst{0x73, 0x2, 0x3, 3, 0x0}
435case ARDCYCLE:
436return &inst{0x73, 0x2, 0x0, -1024, 0x60}
437case ARDTIME:
438return &inst{0x73, 0x2, 0x1, -1023, 0x60}
439case ARDINSTRET:
440return &inst{0x73, 0x2, 0x2, -1022, 0x60}
441case ARDCYCLEH:
442return &inst{0x73, 0x2, 0x0, -896, 0x64}
443case ARDTIMEH:
444return &inst{0x73, 0x2, 0x1, -895, 0x64}
445case ARDINSTRETH:
446return &inst{0x73, 0x2, 0x2, -894, 0x64}
447case ASCALL:
448return &inst{0x73, 0x0, 0x0, 0, 0x0}
449case ASBREAK:
450return &inst{0x73, 0x0, 0x1, 1, 0x0}
451case AFMVXS:
452return &inst{0x53, 0x0, 0x0, -512, 0x70}
453case AFMVSX:
454return &inst{0x53, 0x0, 0x0, -256, 0x78}
455case AFENCETSO:
456return &inst{0xf, 0x0, 0x13, -1997, 0x41}
457}
458return nil
459}
460