2ec169af751172bdcecef1036a52123fe152cf88
[riscv-isa-sim.git] / riscv / dispatch_1.cc
1 #include "insn_includes.h"
2
3 reg_t processor_t::opcode_func_001(insn_t insn, reg_t pc)
4 {
5 reg_t npc = pc + insn_length(0x00000001);
6 #include "insns/c_addi.h"
7 return npc;
8 }
9
10 reg_t processor_t::opcode_func_00b(insn_t insn, reg_t pc)
11 {
12 if((insn.bits & 0x3fffff) == 0xb)
13 {
14 reg_t npc = pc + insn_length(0x0000000b);
15 #include "insns/vlb.h"
16 return npc;
17 }
18 if((insn.bits & 0x1ffff) == 0x100b)
19 {
20 reg_t npc = pc + insn_length(0x0000100b);
21 #include "insns/vlstb.h"
22 return npc;
23 }
24 if((insn.bits & 0xfff) == 0x80b)
25 {
26 reg_t npc = pc + insn_length(0x0000080b);
27 #include "insns/vlsegstb.h"
28 return npc;
29 }
30 if((insn.bits & 0x1ffff) == 0x200b)
31 {
32 reg_t npc = pc + insn_length(0x0000200b);
33 #include "insns/vlsegb.h"
34 return npc;
35 }
36 throw trap_illegal_instruction;
37 }
38
39 reg_t processor_t::opcode_func_015(insn_t insn, reg_t pc)
40 {
41 reg_t npc = pc + insn_length(0x00000015);
42 #include "insns/c_fld.h"
43 return npc;
44 }
45
46 reg_t processor_t::opcode_func_01f(insn_t insn, reg_t pc)
47 {
48 throw trap_illegal_instruction;
49 }
50
51 reg_t processor_t::opcode_func_029(insn_t insn, reg_t pc)
52 {
53 reg_t npc = pc + insn_length(0x00000009);
54 #include "insns/c_ld.h"
55 return npc;
56 }
57
58 reg_t processor_t::opcode_func_033(insn_t insn, reg_t pc)
59 {
60 if((insn.bits & 0x1ffff) == 0x33)
61 {
62 reg_t npc = pc + insn_length(0x00000033);
63 #include "insns/add.h"
64 return npc;
65 }
66 if((insn.bits & 0x1ffff) == 0x433)
67 {
68 reg_t npc = pc + insn_length(0x00000433);
69 #include "insns/mul.h"
70 return npc;
71 }
72 if((insn.bits & 0x1ffff) == 0x10033)
73 {
74 reg_t npc = pc + insn_length(0x00010033);
75 #include "insns/sub.h"
76 return npc;
77 }
78 throw trap_illegal_instruction;
79 }
80
81 reg_t processor_t::opcode_func_03d(insn_t insn, reg_t pc)
82 {
83 reg_t npc = pc + insn_length(0x0000001d);
84 #include "insns/c_addiw.h"
85 return npc;
86 }
87
88 reg_t processor_t::opcode_func_047(insn_t insn, reg_t pc)
89 {
90 reg_t npc = pc + insn_length(0x00000047);
91 #include "insns/fmsub_s.h"
92 return npc;
93 }
94
95 reg_t processor_t::opcode_func_051(insn_t insn, reg_t pc)
96 {
97 reg_t npc = pc + insn_length(0x00000011);
98 #include "insns/c_bne.h"
99 return npc;
100 }
101
102 reg_t processor_t::opcode_func_05b(insn_t insn, reg_t pc)
103 {
104 throw trap_illegal_instruction;
105 }
106
107 reg_t processor_t::opcode_func_065(insn_t insn, reg_t pc)
108 {
109 reg_t npc = pc + insn_length(0x00000005);
110 #include "insns/c_lwsp.h"
111 return npc;
112 }
113
114 reg_t processor_t::opcode_func_06f(insn_t insn, reg_t pc)
115 {
116 reg_t npc = pc + insn_length(0x0000006f);
117 #include "insns/jal.h"
118 return npc;
119 }
120
121 reg_t processor_t::opcode_func_079(insn_t insn, reg_t pc)
122 {
123 if((insn.bits & 0x1c1f) == 0x19)
124 {
125 reg_t npc = pc + insn_length(0x00000019);
126 #include "insns/c_slli.h"
127 return npc;
128 }
129 if((insn.bits & 0x1c1f) == 0x819)
130 {
131 reg_t npc = pc + insn_length(0x00000819);
132 #include "insns/c_srli.h"
133 return npc;
134 }
135 if((insn.bits & 0x1c1f) == 0x1419)
136 {
137 reg_t npc = pc + insn_length(0x00001419);
138 #include "insns/c_srai32.h"
139 return npc;
140 }
141 if((insn.bits & 0x1c1f) == 0x1819)
142 {
143 reg_t npc = pc + insn_length(0x00001819);
144 #include "insns/c_slliw.h"
145 return npc;
146 }
147 if((insn.bits & 0x1c1f) == 0xc19)
148 {
149 reg_t npc = pc + insn_length(0x00000c19);
150 #include "insns/c_srli32.h"
151 return npc;
152 }
153 if((insn.bits & 0x1c1f) == 0x1019)
154 {
155 reg_t npc = pc + insn_length(0x00001019);
156 #include "insns/c_srai.h"
157 return npc;
158 }
159 if((insn.bits & 0x1c1f) == 0x419)
160 {
161 reg_t npc = pc + insn_length(0x00000419);
162 #include "insns/c_slli32.h"
163 return npc;
164 }
165 throw trap_illegal_instruction;
166 }
167
168 reg_t processor_t::opcode_func_083(insn_t insn, reg_t pc)
169 {
170 reg_t npc = pc + insn_length(0x00000083);
171 #include "insns/lh.h"
172 return npc;
173 }
174
175 reg_t processor_t::opcode_func_08d(insn_t insn, reg_t pc)
176 {
177 reg_t npc = pc + insn_length(0x0000000d);
178 #include "insns/c_sw.h"
179 return npc;
180 }
181
182 reg_t processor_t::opcode_func_097(insn_t insn, reg_t pc)
183 {
184 throw trap_illegal_instruction;
185 }
186
187 reg_t processor_t::opcode_func_0a1(insn_t insn, reg_t pc)
188 {
189 reg_t npc = pc + insn_length(0x00000001);
190 #include "insns/c_addi.h"
191 return npc;
192 }
193
194 reg_t processor_t::opcode_func_0ab(insn_t insn, reg_t pc)
195 {
196 throw trap_illegal_instruction;
197 }
198
199 reg_t processor_t::opcode_func_0b5(insn_t insn, reg_t pc)
200 {
201 reg_t npc = pc + insn_length(0x00000015);
202 #include "insns/c_fld.h"
203 return npc;
204 }
205
206 reg_t processor_t::opcode_func_0bf(insn_t insn, reg_t pc)
207 {
208 throw trap_illegal_instruction;
209 }
210
211 reg_t processor_t::opcode_func_0c9(insn_t insn, reg_t pc)
212 {
213 reg_t npc = pc + insn_length(0x00000009);
214 #include "insns/c_ld.h"
215 return npc;
216 }
217
218 reg_t processor_t::opcode_func_0d3(insn_t insn, reg_t pc)
219 {
220 if((insn.bits & 0x1ffff) == 0x180d3)
221 {
222 reg_t npc = pc + insn_length(0x000180d3);
223 #include "insns/fmin_d.h"
224 return npc;
225 }
226 if((insn.bits & 0x3ff1ff) == 0xc0d3)
227 {
228 reg_t npc = pc + insn_length(0x0000c0d3);
229 #include "insns/fcvt_d_l.h"
230 return npc;
231 }
232 if((insn.bits & 0x3ff1ff) == 0xe0d3)
233 {
234 reg_t npc = pc + insn_length(0x0000e0d3);
235 #include "insns/fcvt_d_w.h"
236 return npc;
237 }
238 if((insn.bits & 0x3ff1ff) == 0x100d3)
239 {
240 reg_t npc = pc + insn_length(0x000100d3);
241 #include "insns/fcvt_d_s.h"
242 return npc;
243 }
244 if((insn.bits & 0x1ffff) == 0x190d3)
245 {
246 reg_t npc = pc + insn_length(0x000190d3);
247 #include "insns/fmax_d.h"
248 return npc;
249 }
250 if((insn.bits & 0x7c1ffff) == 0x1c0d3)
251 {
252 reg_t npc = pc + insn_length(0x0001c0d3);
253 #include "insns/mftx_d.h"
254 return npc;
255 }
256 if((insn.bits & 0x1ffff) == 0x170d3)
257 {
258 reg_t npc = pc + insn_length(0x000170d3);
259 #include "insns/fle_d.h"
260 return npc;
261 }
262 if((insn.bits & 0x1ffff) == 0x160d3)
263 {
264 reg_t npc = pc + insn_length(0x000160d3);
265 #include "insns/flt_d.h"
266 return npc;
267 }
268 if((insn.bits & 0x1f1ff) == 0x20d3)
269 {
270 reg_t npc = pc + insn_length(0x000020d3);
271 #include "insns/fmul_d.h"
272 return npc;
273 }
274 if((insn.bits & 0x1ffff) == 0x70d3)
275 {
276 reg_t npc = pc + insn_length(0x000070d3);
277 #include "insns/fsgnjx_d.h"
278 return npc;
279 }
280 if((insn.bits & 0x1ffff) == 0x150d3)
281 {
282 reg_t npc = pc + insn_length(0x000150d3);
283 #include "insns/feq_d.h"
284 return npc;
285 }
286 if((insn.bits & 0x3ff1ff) == 0xf0d3)
287 {
288 reg_t npc = pc + insn_length(0x0000f0d3);
289 #include "insns/fcvt_d_wu.h"
290 return npc;
291 }
292 if((insn.bits & 0x3ff1ff) == 0xb0d3)
293 {
294 reg_t npc = pc + insn_length(0x0000b0d3);
295 #include "insns/fcvt_wu_d.h"
296 return npc;
297 }
298 if((insn.bits & 0x1ffff) == 0x60d3)
299 {
300 reg_t npc = pc + insn_length(0x000060d3);
301 #include "insns/fsgnjn_d.h"
302 return npc;
303 }
304 if((insn.bits & 0x3ff1ff) == 0xd0d3)
305 {
306 reg_t npc = pc + insn_length(0x0000d0d3);
307 #include "insns/fcvt_d_lu.h"
308 return npc;
309 }
310 if((insn.bits & 0x3ff1ff) == 0xa0d3)
311 {
312 reg_t npc = pc + insn_length(0x0000a0d3);
313 #include "insns/fcvt_w_d.h"
314 return npc;
315 }
316 if((insn.bits & 0x3fffff) == 0x1e0d3)
317 {
318 reg_t npc = pc + insn_length(0x0001e0d3);
319 #include "insns/mxtf_d.h"
320 return npc;
321 }
322 if((insn.bits & 0x1ffff) == 0x50d3)
323 {
324 reg_t npc = pc + insn_length(0x000050d3);
325 #include "insns/fsgnj_d.h"
326 return npc;
327 }
328 if((insn.bits & 0x3ff1ff) == 0x80d3)
329 {
330 reg_t npc = pc + insn_length(0x000080d3);
331 #include "insns/fcvt_l_d.h"
332 return npc;
333 }
334 if((insn.bits & 0x1f1ff) == 0xd3)
335 {
336 reg_t npc = pc + insn_length(0x000000d3);
337 #include "insns/fadd_d.h"
338 return npc;
339 }
340 if((insn.bits & 0x3ff1ff) == 0x90d3)
341 {
342 reg_t npc = pc + insn_length(0x000090d3);
343 #include "insns/fcvt_lu_d.h"
344 return npc;
345 }
346 if((insn.bits & 0x1f1ff) == 0x10d3)
347 {
348 reg_t npc = pc + insn_length(0x000010d3);
349 #include "insns/fsub_d.h"
350 return npc;
351 }
352 if((insn.bits & 0x3ff1ff) == 0x40d3)
353 {
354 reg_t npc = pc + insn_length(0x000040d3);
355 #include "insns/fsqrt_d.h"
356 return npc;
357 }
358 if((insn.bits & 0x1f1ff) == 0x30d3)
359 {
360 reg_t npc = pc + insn_length(0x000030d3);
361 #include "insns/fdiv_d.h"
362 return npc;
363 }
364 throw trap_illegal_instruction;
365 }
366
367 reg_t processor_t::opcode_func_0dd(insn_t insn, reg_t pc)
368 {
369 reg_t npc = pc + insn_length(0x0000001d);
370 #include "insns/c_addiw.h"
371 return npc;
372 }
373
374 reg_t processor_t::opcode_func_0e7(insn_t insn, reg_t pc)
375 {
376 reg_t npc = pc + insn_length(0x00000067);
377 #include "insns/j.h"
378 return npc;
379 }
380
381 reg_t processor_t::opcode_func_0f1(insn_t insn, reg_t pc)
382 {
383 reg_t npc = pc + insn_length(0x00000011);
384 #include "insns/c_bne.h"
385 return npc;
386 }
387
388 reg_t processor_t::opcode_func_0fb(insn_t insn, reg_t pc)
389 {
390 if((insn.bits & 0x7ffffff) == 0xfb)
391 {
392 reg_t npc = pc + insn_length(0x000000fb);
393 #include "insns/di.h"
394 return npc;
395 }
396 throw trap_illegal_instruction;
397 }
398
399 reg_t processor_t::opcode_func_105(insn_t insn, reg_t pc)
400 {
401 reg_t npc = pc + insn_length(0x00000005);
402 #include "insns/c_lwsp.h"
403 return npc;
404 }
405
406 reg_t processor_t::opcode_func_10f(insn_t insn, reg_t pc)
407 {
408 if((insn.bits & 0x1ffff) == 0x150f)
409 {
410 reg_t npc = pc + insn_length(0x0000150f);
411 #include "insns/vfsstw.h"
412 return npc;
413 }
414 if((insn.bits & 0xfff) == 0x90f)
415 {
416 reg_t npc = pc + insn_length(0x0000090f);
417 #include "insns/vssegstw.h"
418 return npc;
419 }
420 if((insn.bits & 0x3fffff) == 0x10f)
421 {
422 reg_t npc = pc + insn_length(0x0000010f);
423 #include "insns/vsw.h"
424 return npc;
425 }
426 if((insn.bits & 0x1ffff) == 0x110f)
427 {
428 reg_t npc = pc + insn_length(0x0000110f);
429 #include "insns/vsstw.h"
430 return npc;
431 }
432 if((insn.bits & 0xfff) == 0xd0f)
433 {
434 reg_t npc = pc + insn_length(0x00000d0f);
435 #include "insns/vfssegstw.h"
436 return npc;
437 }
438 if((insn.bits & 0x1ffff) == 0x210f)
439 {
440 reg_t npc = pc + insn_length(0x0000210f);
441 #include "insns/vssegw.h"
442 return npc;
443 }
444 if((insn.bits & 0x3fffff) == 0x50f)
445 {
446 reg_t npc = pc + insn_length(0x0000050f);
447 #include "insns/vfsw.h"
448 return npc;
449 }
450 if((insn.bits & 0x1ffff) == 0x250f)
451 {
452 reg_t npc = pc + insn_length(0x0000250f);
453 #include "insns/vfssegw.h"
454 return npc;
455 }
456 throw trap_illegal_instruction;
457 }
458
459 reg_t processor_t::opcode_func_119(insn_t insn, reg_t pc)
460 {
461 if((insn.bits & 0x1c1f) == 0x19)
462 {
463 reg_t npc = pc + insn_length(0x00000019);
464 #include "insns/c_slli.h"
465 return npc;
466 }
467 if((insn.bits & 0x1c1f) == 0x819)
468 {
469 reg_t npc = pc + insn_length(0x00000819);
470 #include "insns/c_srli.h"
471 return npc;
472 }
473 if((insn.bits & 0x1c1f) == 0x1419)
474 {
475 reg_t npc = pc + insn_length(0x00001419);
476 #include "insns/c_srai32.h"
477 return npc;
478 }
479 if((insn.bits & 0x1c1f) == 0x1819)
480 {
481 reg_t npc = pc + insn_length(0x00001819);
482 #include "insns/c_slliw.h"
483 return npc;
484 }
485 if((insn.bits & 0x1c1f) == 0xc19)
486 {
487 reg_t npc = pc + insn_length(0x00000c19);
488 #include "insns/c_srli32.h"
489 return npc;
490 }
491 if((insn.bits & 0x1c1f) == 0x1019)
492 {
493 reg_t npc = pc + insn_length(0x00001019);
494 #include "insns/c_srai.h"
495 return npc;
496 }
497 if((insn.bits & 0x1c1f) == 0x419)
498 {
499 reg_t npc = pc + insn_length(0x00000419);
500 #include "insns/c_slli32.h"
501 return npc;
502 }
503 throw trap_illegal_instruction;
504 }
505
506 reg_t processor_t::opcode_func_123(insn_t insn, reg_t pc)
507 {
508 reg_t npc = pc + insn_length(0x00000123);
509 #include "insns/sw.h"
510 return npc;
511 }
512
513 reg_t processor_t::opcode_func_12d(insn_t insn, reg_t pc)
514 {
515 reg_t npc = pc + insn_length(0x0000000d);
516 #include "insns/c_sw.h"
517 return npc;
518 }
519
520 reg_t processor_t::opcode_func_137(insn_t insn, reg_t pc)
521 {
522 reg_t npc = pc + insn_length(0x00000037);
523 #include "insns/lui.h"
524 return npc;
525 }
526
527 reg_t processor_t::opcode_func_141(insn_t insn, reg_t pc)
528 {
529 reg_t npc = pc + insn_length(0x00000001);
530 #include "insns/c_addi.h"
531 return npc;
532 }
533
534 reg_t processor_t::opcode_func_14b(insn_t insn, reg_t pc)
535 {
536 throw trap_illegal_instruction;
537 }
538
539 reg_t processor_t::opcode_func_155(insn_t insn, reg_t pc)
540 {
541 reg_t npc = pc + insn_length(0x00000015);
542 #include "insns/c_fld.h"
543 return npc;
544 }
545
546 reg_t processor_t::opcode_func_15f(insn_t insn, reg_t pc)
547 {
548 throw trap_illegal_instruction;
549 }
550
551 reg_t processor_t::opcode_func_169(insn_t insn, reg_t pc)
552 {
553 reg_t npc = pc + insn_length(0x00000009);
554 #include "insns/c_ld.h"
555 return npc;
556 }
557
558 reg_t processor_t::opcode_func_173(insn_t insn, reg_t pc)
559 {
560 if((insn.bits & 0x1ffff) == 0x1173)
561 {
562 reg_t npc = pc + insn_length(0x00001173);
563 #include "insns/vfmst.h"
564 return npc;
565 }
566 if((insn.bits & 0x1ffff) == 0x1973)
567 {
568 reg_t npc = pc + insn_length(0x00001973);
569 #include "insns/vfmts.h"
570 return npc;
571 }
572 if((insn.bits & 0x3fffff) == 0x973)
573 {
574 reg_t npc = pc + insn_length(0x00000973);
575 #include "insns/vfmsv.h"
576 return npc;
577 }
578 if((insn.bits & 0x3fffff) == 0x173)
579 {
580 reg_t npc = pc + insn_length(0x00000173);
581 #include "insns/vfmvv.h"
582 return npc;
583 }
584 throw trap_illegal_instruction;
585 }
586
587 reg_t processor_t::opcode_func_17d(insn_t insn, reg_t pc)
588 {
589 reg_t npc = pc + insn_length(0x0000001d);
590 #include "insns/c_addiw.h"
591 return npc;
592 }
593
594 reg_t processor_t::opcode_func_187(insn_t insn, reg_t pc)
595 {
596 reg_t npc = pc + insn_length(0x00000187);
597 #include "insns/fld.h"
598 return npc;
599 }
600
601 reg_t processor_t::opcode_func_191(insn_t insn, reg_t pc)
602 {
603 reg_t npc = pc + insn_length(0x00000011);
604 #include "insns/c_bne.h"
605 return npc;
606 }
607
608 reg_t processor_t::opcode_func_19b(insn_t insn, reg_t pc)
609 {
610 throw trap_illegal_instruction;
611 }
612
613 reg_t processor_t::opcode_func_1a5(insn_t insn, reg_t pc)
614 {
615 reg_t npc = pc + insn_length(0x00000005);
616 #include "insns/c_lwsp.h"
617 return npc;
618 }
619
620 reg_t processor_t::opcode_func_1af(insn_t insn, reg_t pc)
621 {
622 throw trap_illegal_instruction;
623 }
624
625 reg_t processor_t::opcode_func_1b9(insn_t insn, reg_t pc)
626 {
627 if((insn.bits & 0x1c1f) == 0x19)
628 {
629 reg_t npc = pc + insn_length(0x00000019);
630 #include "insns/c_slli.h"
631 return npc;
632 }
633 if((insn.bits & 0x1c1f) == 0x819)
634 {
635 reg_t npc = pc + insn_length(0x00000819);
636 #include "insns/c_srli.h"
637 return npc;
638 }
639 if((insn.bits & 0x1c1f) == 0x1419)
640 {
641 reg_t npc = pc + insn_length(0x00001419);
642 #include "insns/c_srai32.h"
643 return npc;
644 }
645 if((insn.bits & 0x1c1f) == 0x1819)
646 {
647 reg_t npc = pc + insn_length(0x00001819);
648 #include "insns/c_slliw.h"
649 return npc;
650 }
651 if((insn.bits & 0x1c1f) == 0xc19)
652 {
653 reg_t npc = pc + insn_length(0x00000c19);
654 #include "insns/c_srli32.h"
655 return npc;
656 }
657 if((insn.bits & 0x1c1f) == 0x1019)
658 {
659 reg_t npc = pc + insn_length(0x00001019);
660 #include "insns/c_srai.h"
661 return npc;
662 }
663 if((insn.bits & 0x1c1f) == 0x419)
664 {
665 reg_t npc = pc + insn_length(0x00000419);
666 #include "insns/c_slli32.h"
667 return npc;
668 }
669 throw trap_illegal_instruction;
670 }
671
672 reg_t processor_t::opcode_func_1c3(insn_t insn, reg_t pc)
673 {
674 throw trap_illegal_instruction;
675 }
676
677 reg_t processor_t::opcode_func_1cd(insn_t insn, reg_t pc)
678 {
679 reg_t npc = pc + insn_length(0x0000000d);
680 #include "insns/c_sw.h"
681 return npc;
682 }
683
684 reg_t processor_t::opcode_func_1d7(insn_t insn, reg_t pc)
685 {
686 throw trap_illegal_instruction;
687 }
688
689 reg_t processor_t::opcode_func_1e1(insn_t insn, reg_t pc)
690 {
691 reg_t npc = pc + insn_length(0x00000001);
692 #include "insns/c_addi.h"
693 return npc;
694 }
695
696 reg_t processor_t::opcode_func_1eb(insn_t insn, reg_t pc)
697 {
698 throw trap_illegal_instruction;
699 }
700
701 reg_t processor_t::opcode_func_1f5(insn_t insn, reg_t pc)
702 {
703 reg_t npc = pc + insn_length(0x00000015);
704 #include "insns/c_fld.h"
705 return npc;
706 }
707
708 reg_t processor_t::opcode_func_1ff(insn_t insn, reg_t pc)
709 {
710 throw trap_illegal_instruction;
711 }
712
713 reg_t processor_t::opcode_func_209(insn_t insn, reg_t pc)
714 {
715 reg_t npc = pc + insn_length(0x00000009);
716 #include "insns/c_ld.h"
717 return npc;
718 }
719
720 reg_t processor_t::opcode_func_213(insn_t insn, reg_t pc)
721 {
722 reg_t npc = pc + insn_length(0x00000213);
723 #include "insns/xori.h"
724 return npc;
725 }
726
727 reg_t processor_t::opcode_func_21d(insn_t insn, reg_t pc)
728 {
729 reg_t npc = pc + insn_length(0x0000001d);
730 #include "insns/c_addiw.h"
731 return npc;
732 }
733
734 reg_t processor_t::opcode_func_227(insn_t insn, reg_t pc)
735 {
736 throw trap_illegal_instruction;
737 }
738
739 reg_t processor_t::opcode_func_231(insn_t insn, reg_t pc)
740 {
741 reg_t npc = pc + insn_length(0x00000011);
742 #include "insns/c_bne.h"
743 return npc;
744 }
745
746 reg_t processor_t::opcode_func_23b(insn_t insn, reg_t pc)
747 {
748 if((insn.bits & 0x1ffff) == 0x63b)
749 {
750 reg_t npc = pc + insn_length(0x0000063b);
751 #include "insns/divw.h"
752 return npc;
753 }
754 throw trap_illegal_instruction;
755 }
756
757 reg_t processor_t::opcode_func_245(insn_t insn, reg_t pc)
758 {
759 reg_t npc = pc + insn_length(0x00000005);
760 #include "insns/c_lwsp.h"
761 return npc;
762 }
763
764 reg_t processor_t::opcode_func_24f(insn_t insn, reg_t pc)
765 {
766 reg_t npc = pc + insn_length(0x0000004f);
767 #include "insns/fnmadd_s.h"
768 return npc;
769 }
770
771 reg_t processor_t::opcode_func_259(insn_t insn, reg_t pc)
772 {
773 if((insn.bits & 0x1c1f) == 0x19)
774 {
775 reg_t npc = pc + insn_length(0x00000019);
776 #include "insns/c_slli.h"
777 return npc;
778 }
779 if((insn.bits & 0x1c1f) == 0x819)
780 {
781 reg_t npc = pc + insn_length(0x00000819);
782 #include "insns/c_srli.h"
783 return npc;
784 }
785 if((insn.bits & 0x1c1f) == 0x1419)
786 {
787 reg_t npc = pc + insn_length(0x00001419);
788 #include "insns/c_srai32.h"
789 return npc;
790 }
791 if((insn.bits & 0x1c1f) == 0x1819)
792 {
793 reg_t npc = pc + insn_length(0x00001819);
794 #include "insns/c_slliw.h"
795 return npc;
796 }
797 if((insn.bits & 0x1c1f) == 0xc19)
798 {
799 reg_t npc = pc + insn_length(0x00000c19);
800 #include "insns/c_srli32.h"
801 return npc;
802 }
803 if((insn.bits & 0x1c1f) == 0x1019)
804 {
805 reg_t npc = pc + insn_length(0x00001019);
806 #include "insns/c_srai.h"
807 return npc;
808 }
809 if((insn.bits & 0x1c1f) == 0x419)
810 {
811 reg_t npc = pc + insn_length(0x00000419);
812 #include "insns/c_slli32.h"
813 return npc;
814 }
815 throw trap_illegal_instruction;
816 }
817
818 reg_t processor_t::opcode_func_263(insn_t insn, reg_t pc)
819 {
820 reg_t npc = pc + insn_length(0x00000263);
821 #include "insns/blt.h"
822 return npc;
823 }
824
825 reg_t processor_t::opcode_func_26d(insn_t insn, reg_t pc)
826 {
827 reg_t npc = pc + insn_length(0x0000000d);
828 #include "insns/c_sw.h"
829 return npc;
830 }
831
832 reg_t processor_t::opcode_func_277(insn_t insn, reg_t pc)
833 {
834 if((insn.bits & 0x7ffffff) == 0x277)
835 {
836 reg_t npc = pc + insn_length(0x00000277);
837 #include "insns/rdcycle.h"
838 return npc;
839 }
840 if((insn.bits & 0x7ffffff) == 0xa77)
841 {
842 reg_t npc = pc + insn_length(0x00000a77);
843 #include "insns/rdinstret.h"
844 return npc;
845 }
846 if((insn.bits & 0x7ffffff) == 0x677)
847 {
848 reg_t npc = pc + insn_length(0x00000677);
849 #include "insns/rdtime.h"
850 return npc;
851 }
852 throw trap_illegal_instruction;
853 }
854
855 reg_t processor_t::opcode_func_281(insn_t insn, reg_t pc)
856 {
857 reg_t npc = pc + insn_length(0x00000001);
858 #include "insns/c_addi.h"
859 return npc;
860 }
861
862 reg_t processor_t::opcode_func_28b(insn_t insn, reg_t pc)
863 {
864 if((insn.bits & 0x1ffff) == 0x128b)
865 {
866 reg_t npc = pc + insn_length(0x0000128b);
867 #include "insns/vlsthu.h"
868 return npc;
869 }
870 if((insn.bits & 0xfff) == 0xa8b)
871 {
872 reg_t npc = pc + insn_length(0x00000a8b);
873 #include "insns/vlsegsthu.h"
874 return npc;
875 }
876 if((insn.bits & 0x3fffff) == 0x28b)
877 {
878 reg_t npc = pc + insn_length(0x0000028b);
879 #include "insns/vlhu.h"
880 return npc;
881 }
882 if((insn.bits & 0x1ffff) == 0x228b)
883 {
884 reg_t npc = pc + insn_length(0x0000228b);
885 #include "insns/vlseghu.h"
886 return npc;
887 }
888 throw trap_illegal_instruction;
889 }
890
891 reg_t processor_t::opcode_func_295(insn_t insn, reg_t pc)
892 {
893 reg_t npc = pc + insn_length(0x00000015);
894 #include "insns/c_fld.h"
895 return npc;
896 }
897
898 reg_t processor_t::opcode_func_29f(insn_t insn, reg_t pc)
899 {
900 throw trap_illegal_instruction;
901 }
902
903 reg_t processor_t::opcode_func_2a9(insn_t insn, reg_t pc)
904 {
905 reg_t npc = pc + insn_length(0x00000009);
906 #include "insns/c_ld.h"
907 return npc;
908 }
909
910 reg_t processor_t::opcode_func_2b3(insn_t insn, reg_t pc)
911 {
912 if((insn.bits & 0x1ffff) == 0x102b3)
913 {
914 reg_t npc = pc + insn_length(0x000102b3);
915 #include "insns/sra.h"
916 return npc;
917 }
918 if((insn.bits & 0x1ffff) == 0x2b3)
919 {
920 reg_t npc = pc + insn_length(0x000002b3);
921 #include "insns/srl.h"
922 return npc;
923 }
924 if((insn.bits & 0x1ffff) == 0x6b3)
925 {
926 reg_t npc = pc + insn_length(0x000006b3);
927 #include "insns/divu.h"
928 return npc;
929 }
930 throw trap_illegal_instruction;
931 }
932
933 reg_t processor_t::opcode_func_2bd(insn_t insn, reg_t pc)
934 {
935 reg_t npc = pc + insn_length(0x0000001d);
936 #include "insns/c_addiw.h"
937 return npc;
938 }
939
940 reg_t processor_t::opcode_func_2c7(insn_t insn, reg_t pc)
941 {
942 reg_t npc = pc + insn_length(0x000000c7);
943 #include "insns/fmsub_d.h"
944 return npc;
945 }
946
947 reg_t processor_t::opcode_func_2d1(insn_t insn, reg_t pc)
948 {
949 reg_t npc = pc + insn_length(0x00000011);
950 #include "insns/c_bne.h"
951 return npc;
952 }
953
954 reg_t processor_t::opcode_func_2db(insn_t insn, reg_t pc)
955 {
956 throw trap_illegal_instruction;
957 }
958
959 reg_t processor_t::opcode_func_2e5(insn_t insn, reg_t pc)
960 {
961 reg_t npc = pc + insn_length(0x00000005);
962 #include "insns/c_lwsp.h"
963 return npc;
964 }
965
966 reg_t processor_t::opcode_func_2ef(insn_t insn, reg_t pc)
967 {
968 reg_t npc = pc + insn_length(0x0000006f);
969 #include "insns/jal.h"
970 return npc;
971 }
972
973 reg_t processor_t::opcode_func_2f9(insn_t insn, reg_t pc)
974 {
975 if((insn.bits & 0x1c1f) == 0x19)
976 {
977 reg_t npc = pc + insn_length(0x00000019);
978 #include "insns/c_slli.h"
979 return npc;
980 }
981 if((insn.bits & 0x1c1f) == 0x819)
982 {
983 reg_t npc = pc + insn_length(0x00000819);
984 #include "insns/c_srli.h"
985 return npc;
986 }
987 if((insn.bits & 0x1c1f) == 0x1419)
988 {
989 reg_t npc = pc + insn_length(0x00001419);
990 #include "insns/c_srai32.h"
991 return npc;
992 }
993 if((insn.bits & 0x1c1f) == 0x1819)
994 {
995 reg_t npc = pc + insn_length(0x00001819);
996 #include "insns/c_slliw.h"
997 return npc;
998 }
999 if((insn.bits & 0x1c1f) == 0xc19)
1000 {
1001 reg_t npc = pc + insn_length(0x00000c19);
1002 #include "insns/c_srli32.h"
1003 return npc;
1004 }
1005 if((insn.bits & 0x1c1f) == 0x1019)
1006 {
1007 reg_t npc = pc + insn_length(0x00001019);
1008 #include "insns/c_srai.h"
1009 return npc;
1010 }
1011 if((insn.bits & 0x1c1f) == 0x419)
1012 {
1013 reg_t npc = pc + insn_length(0x00000419);
1014 #include "insns/c_slli32.h"
1015 return npc;
1016 }
1017 throw trap_illegal_instruction;
1018 }
1019
1020 reg_t processor_t::opcode_func_303(insn_t insn, reg_t pc)
1021 {
1022 reg_t npc = pc + insn_length(0x00000303);
1023 #include "insns/lwu.h"
1024 return npc;
1025 }
1026
1027 reg_t processor_t::opcode_func_30d(insn_t insn, reg_t pc)
1028 {
1029 reg_t npc = pc + insn_length(0x0000000d);
1030 #include "insns/c_sw.h"
1031 return npc;
1032 }
1033
1034 reg_t processor_t::opcode_func_317(insn_t insn, reg_t pc)
1035 {
1036 throw trap_illegal_instruction;
1037 }
1038
1039 reg_t processor_t::opcode_func_321(insn_t insn, reg_t pc)
1040 {
1041 reg_t npc = pc + insn_length(0x00000001);
1042 #include "insns/c_addi.h"
1043 return npc;
1044 }
1045
1046 reg_t processor_t::opcode_func_32b(insn_t insn, reg_t pc)
1047 {
1048 throw trap_illegal_instruction;
1049 }
1050
1051 reg_t processor_t::opcode_func_335(insn_t insn, reg_t pc)
1052 {
1053 reg_t npc = pc + insn_length(0x00000015);
1054 #include "insns/c_fld.h"
1055 return npc;
1056 }
1057
1058 reg_t processor_t::opcode_func_33f(insn_t insn, reg_t pc)
1059 {
1060 throw trap_illegal_instruction;
1061 }
1062
1063 reg_t processor_t::opcode_func_349(insn_t insn, reg_t pc)
1064 {
1065 reg_t npc = pc + insn_length(0x00000009);
1066 #include "insns/c_ld.h"
1067 return npc;
1068 }
1069
1070 reg_t processor_t::opcode_func_353(insn_t insn, reg_t pc)
1071 {
1072 throw trap_illegal_instruction;
1073 }
1074
1075 reg_t processor_t::opcode_func_35d(insn_t insn, reg_t pc)
1076 {
1077 reg_t npc = pc + insn_length(0x0000001d);
1078 #include "insns/c_addiw.h"
1079 return npc;
1080 }
1081
1082 reg_t processor_t::opcode_func_367(insn_t insn, reg_t pc)
1083 {
1084 reg_t npc = pc + insn_length(0x00000067);
1085 #include "insns/j.h"
1086 return npc;
1087 }
1088
1089 reg_t processor_t::opcode_func_371(insn_t insn, reg_t pc)
1090 {
1091 reg_t npc = pc + insn_length(0x00000011);
1092 #include "insns/c_bne.h"
1093 return npc;
1094 }
1095
1096 reg_t processor_t::opcode_func_37b(insn_t insn, reg_t pc)
1097 {
1098 throw trap_illegal_instruction;
1099 }
1100
1101 reg_t processor_t::opcode_func_385(insn_t insn, reg_t pc)
1102 {
1103 reg_t npc = pc + insn_length(0x00000005);
1104 #include "insns/c_lwsp.h"
1105 return npc;
1106 }
1107
1108 reg_t processor_t::opcode_func_38f(insn_t insn, reg_t pc)
1109 {
1110 throw trap_illegal_instruction;
1111 }
1112
1113 reg_t processor_t::opcode_func_399(insn_t insn, reg_t pc)
1114 {
1115 if((insn.bits & 0x1c1f) == 0x19)
1116 {
1117 reg_t npc = pc + insn_length(0x00000019);
1118 #include "insns/c_slli.h"
1119 return npc;
1120 }
1121 if((insn.bits & 0x1c1f) == 0x819)
1122 {
1123 reg_t npc = pc + insn_length(0x00000819);
1124 #include "insns/c_srli.h"
1125 return npc;
1126 }
1127 if((insn.bits & 0x1c1f) == 0x1419)
1128 {
1129 reg_t npc = pc + insn_length(0x00001419);
1130 #include "insns/c_srai32.h"
1131 return npc;
1132 }
1133 if((insn.bits & 0x1c1f) == 0x1819)
1134 {
1135 reg_t npc = pc + insn_length(0x00001819);
1136 #include "insns/c_slliw.h"
1137 return npc;
1138 }
1139 if((insn.bits & 0x1c1f) == 0xc19)
1140 {
1141 reg_t npc = pc + insn_length(0x00000c19);
1142 #include "insns/c_srli32.h"
1143 return npc;
1144 }
1145 if((insn.bits & 0x1c1f) == 0x1019)
1146 {
1147 reg_t npc = pc + insn_length(0x00001019);
1148 #include "insns/c_srai.h"
1149 return npc;
1150 }
1151 if((insn.bits & 0x1c1f) == 0x419)
1152 {
1153 reg_t npc = pc + insn_length(0x00000419);
1154 #include "insns/c_slli32.h"
1155 return npc;
1156 }
1157 throw trap_illegal_instruction;
1158 }
1159
1160 reg_t processor_t::opcode_func_3a3(insn_t insn, reg_t pc)
1161 {
1162 throw trap_illegal_instruction;
1163 }
1164
1165 reg_t processor_t::opcode_func_3ad(insn_t insn, reg_t pc)
1166 {
1167 reg_t npc = pc + insn_length(0x0000000d);
1168 #include "insns/c_sw.h"
1169 return npc;
1170 }
1171
1172 reg_t processor_t::opcode_func_3b7(insn_t insn, reg_t pc)
1173 {
1174 reg_t npc = pc + insn_length(0x00000037);
1175 #include "insns/lui.h"
1176 return npc;
1177 }
1178
1179 reg_t processor_t::opcode_func_3c1(insn_t insn, reg_t pc)
1180 {
1181 reg_t npc = pc + insn_length(0x00000001);
1182 #include "insns/c_addi.h"
1183 return npc;
1184 }
1185
1186 reg_t processor_t::opcode_func_3cb(insn_t insn, reg_t pc)
1187 {
1188 throw trap_illegal_instruction;
1189 }
1190
1191 reg_t processor_t::opcode_func_3d5(insn_t insn, reg_t pc)
1192 {
1193 reg_t npc = pc + insn_length(0x00000015);
1194 #include "insns/c_fld.h"
1195 return npc;
1196 }
1197
1198 reg_t processor_t::opcode_func_3df(insn_t insn, reg_t pc)
1199 {
1200 throw trap_illegal_instruction;
1201 }
1202
1203 reg_t processor_t::opcode_func_3e9(insn_t insn, reg_t pc)
1204 {
1205 reg_t npc = pc + insn_length(0x00000009);
1206 #include "insns/c_ld.h"
1207 return npc;
1208 }
1209
1210 reg_t processor_t::opcode_func_3f3(insn_t insn, reg_t pc)
1211 {
1212 if((insn.bits & 0xf80003ff) == 0x3f3)
1213 {
1214 reg_t npc = pc + insn_length(0x000003f3);
1215 #include "insns/vf.h"
1216 return npc;
1217 }
1218 throw trap_illegal_instruction;
1219 }
1220
1221 reg_t processor_t::opcode_func_3fd(insn_t insn, reg_t pc)
1222 {
1223 reg_t npc = pc + insn_length(0x0000001d);
1224 #include "insns/c_addiw.h"
1225 return npc;
1226 }
1227