[sim] fix writeback after ipi clearing
[riscv-isa-sim.git] / riscv / dispatch_7.cc
1 #include "insn_includes.h"
2
3 reg_t processor_t::opcode_func_007(insn_t insn, reg_t pc)
4 {
5 throw trap_illegal_instruction;
6 }
7
8 reg_t processor_t::opcode_func_011(insn_t insn, reg_t pc)
9 {
10 reg_t npc = pc + insn_length(0x00000011);
11 #include "insns/c_bne.h"
12 return npc;
13 }
14
15 reg_t processor_t::opcode_func_01b(insn_t insn, reg_t pc)
16 {
17 reg_t npc = pc + insn_length(0x0000001b);
18 #include "insns/addiw.h"
19 return npc;
20 }
21
22 reg_t processor_t::opcode_func_025(insn_t insn, reg_t pc)
23 {
24 reg_t npc = pc + insn_length(0x00000005);
25 #include "insns/c_lwsp.h"
26 return npc;
27 }
28
29 reg_t processor_t::opcode_func_02f(insn_t insn, reg_t pc)
30 {
31 throw trap_illegal_instruction;
32 }
33
34 reg_t processor_t::opcode_func_039(insn_t insn, reg_t pc)
35 {
36 if((insn.bits & 0x1c1f) == 0x19)
37 {
38 reg_t npc = pc + insn_length(0x00000019);
39 #include "insns/c_slli.h"
40 return npc;
41 }
42 if((insn.bits & 0x1c1f) == 0x819)
43 {
44 reg_t npc = pc + insn_length(0x00000819);
45 #include "insns/c_srli.h"
46 return npc;
47 }
48 if((insn.bits & 0x1c1f) == 0x1419)
49 {
50 reg_t npc = pc + insn_length(0x00001419);
51 #include "insns/c_srai32.h"
52 return npc;
53 }
54 if((insn.bits & 0x1c1f) == 0x1819)
55 {
56 reg_t npc = pc + insn_length(0x00001819);
57 #include "insns/c_slliw.h"
58 return npc;
59 }
60 if((insn.bits & 0x1c1f) == 0xc19)
61 {
62 reg_t npc = pc + insn_length(0x00000c19);
63 #include "insns/c_srli32.h"
64 return npc;
65 }
66 if((insn.bits & 0x1c1f) == 0x1019)
67 {
68 reg_t npc = pc + insn_length(0x00001019);
69 #include "insns/c_srai.h"
70 return npc;
71 }
72 if((insn.bits & 0x1c1f) == 0x419)
73 {
74 reg_t npc = pc + insn_length(0x00000419);
75 #include "insns/c_slli32.h"
76 return npc;
77 }
78 throw trap_illegal_instruction;
79 }
80
81 reg_t processor_t::opcode_func_043(insn_t insn, reg_t pc)
82 {
83 reg_t npc = pc + insn_length(0x00000043);
84 #include "insns/fmadd_s.h"
85 return npc;
86 }
87
88 reg_t processor_t::opcode_func_04d(insn_t insn, reg_t pc)
89 {
90 reg_t npc = pc + insn_length(0x0000000d);
91 #include "insns/c_sw.h"
92 return npc;
93 }
94
95 reg_t processor_t::opcode_func_057(insn_t insn, reg_t pc)
96 {
97 throw trap_illegal_instruction;
98 }
99
100 reg_t processor_t::opcode_func_061(insn_t insn, reg_t pc)
101 {
102 reg_t npc = pc + insn_length(0x00000001);
103 #include "insns/c_addi.h"
104 return npc;
105 }
106
107 reg_t processor_t::opcode_func_06b(insn_t insn, reg_t pc)
108 {
109 reg_t npc = pc + insn_length(0x0000006b);
110 #include "insns/jalr_c.h"
111 return npc;
112 }
113
114 reg_t processor_t::opcode_func_075(insn_t insn, reg_t pc)
115 {
116 reg_t npc = pc + insn_length(0x00000015);
117 #include "insns/c_fld.h"
118 return npc;
119 }
120
121 reg_t processor_t::opcode_func_07f(insn_t insn, reg_t pc)
122 {
123 throw trap_illegal_instruction;
124 }
125
126 reg_t processor_t::opcode_func_089(insn_t insn, reg_t pc)
127 {
128 reg_t npc = pc + insn_length(0x00000009);
129 #include "insns/c_ld.h"
130 return npc;
131 }
132
133 reg_t processor_t::opcode_func_093(insn_t insn, reg_t pc)
134 {
135 if((insn.bits & 0x3f03ff) == 0x93)
136 {
137 reg_t npc = pc + insn_length(0x00000093);
138 #include "insns/slli.h"
139 return npc;
140 }
141 throw trap_illegal_instruction;
142 }
143
144 reg_t processor_t::opcode_func_09d(insn_t insn, reg_t pc)
145 {
146 reg_t npc = pc + insn_length(0x0000001d);
147 #include "insns/c_addiw.h"
148 return npc;
149 }
150
151 reg_t processor_t::opcode_func_0a7(insn_t insn, reg_t pc)
152 {
153 throw trap_illegal_instruction;
154 }
155
156 reg_t processor_t::opcode_func_0b1(insn_t insn, reg_t pc)
157 {
158 reg_t npc = pc + insn_length(0x00000011);
159 #include "insns/c_bne.h"
160 return npc;
161 }
162
163 reg_t processor_t::opcode_func_0bb(insn_t insn, reg_t pc)
164 {
165 if((insn.bits & 0x1ffff) == 0xbb)
166 {
167 reg_t npc = pc + insn_length(0x000000bb);
168 #include "insns/sllw.h"
169 return npc;
170 }
171 throw trap_illegal_instruction;
172 }
173
174 reg_t processor_t::opcode_func_0c5(insn_t insn, reg_t pc)
175 {
176 reg_t npc = pc + insn_length(0x00000005);
177 #include "insns/c_lwsp.h"
178 return npc;
179 }
180
181 reg_t processor_t::opcode_func_0cf(insn_t insn, reg_t pc)
182 {
183 reg_t npc = pc + insn_length(0x000000cf);
184 #include "insns/fnmadd_d.h"
185 return npc;
186 }
187
188 reg_t processor_t::opcode_func_0d9(insn_t insn, reg_t pc)
189 {
190 if((insn.bits & 0x1c1f) == 0x19)
191 {
192 reg_t npc = pc + insn_length(0x00000019);
193 #include "insns/c_slli.h"
194 return npc;
195 }
196 if((insn.bits & 0x1c1f) == 0x819)
197 {
198 reg_t npc = pc + insn_length(0x00000819);
199 #include "insns/c_srli.h"
200 return npc;
201 }
202 if((insn.bits & 0x1c1f) == 0x1419)
203 {
204 reg_t npc = pc + insn_length(0x00001419);
205 #include "insns/c_srai32.h"
206 return npc;
207 }
208 if((insn.bits & 0x1c1f) == 0x1819)
209 {
210 reg_t npc = pc + insn_length(0x00001819);
211 #include "insns/c_slliw.h"
212 return npc;
213 }
214 if((insn.bits & 0x1c1f) == 0xc19)
215 {
216 reg_t npc = pc + insn_length(0x00000c19);
217 #include "insns/c_srli32.h"
218 return npc;
219 }
220 if((insn.bits & 0x1c1f) == 0x1019)
221 {
222 reg_t npc = pc + insn_length(0x00001019);
223 #include "insns/c_srai.h"
224 return npc;
225 }
226 if((insn.bits & 0x1c1f) == 0x419)
227 {
228 reg_t npc = pc + insn_length(0x00000419);
229 #include "insns/c_slli32.h"
230 return npc;
231 }
232 throw trap_illegal_instruction;
233 }
234
235 reg_t processor_t::opcode_func_0e3(insn_t insn, reg_t pc)
236 {
237 reg_t npc = pc + insn_length(0x000000e3);
238 #include "insns/bne.h"
239 return npc;
240 }
241
242 reg_t processor_t::opcode_func_0ed(insn_t insn, reg_t pc)
243 {
244 reg_t npc = pc + insn_length(0x0000000d);
245 #include "insns/c_sw.h"
246 return npc;
247 }
248
249 reg_t processor_t::opcode_func_0f7(insn_t insn, reg_t pc)
250 {
251 if((insn.bits & 0xffffffff) == 0xf7)
252 {
253 reg_t npc = pc + insn_length(0x000000f7);
254 #include "insns/break.h"
255 return npc;
256 }
257 throw trap_illegal_instruction;
258 }
259
260 reg_t processor_t::opcode_func_101(insn_t insn, reg_t pc)
261 {
262 reg_t npc = pc + insn_length(0x00000001);
263 #include "insns/c_addi.h"
264 return npc;
265 }
266
267 reg_t processor_t::opcode_func_10b(insn_t insn, reg_t pc)
268 {
269 if((insn.bits & 0x1ffff) == 0x150b)
270 {
271 reg_t npc = pc + insn_length(0x0000150b);
272 #include "insns/vflstw.h"
273 return npc;
274 }
275 if((insn.bits & 0x3fffff) == 0x10b)
276 {
277 reg_t npc = pc + insn_length(0x0000010b);
278 #include "insns/vlw.h"
279 return npc;
280 }
281 if((insn.bits & 0x1ffff) == 0x110b)
282 {
283 reg_t npc = pc + insn_length(0x0000110b);
284 #include "insns/vlstw.h"
285 return npc;
286 }
287 if((insn.bits & 0xfff) == 0x90b)
288 {
289 reg_t npc = pc + insn_length(0x0000090b);
290 #include "insns/vlsegstw.h"
291 return npc;
292 }
293 if((insn.bits & 0x1ffff) == 0x250b)
294 {
295 reg_t npc = pc + insn_length(0x0000250b);
296 #include "insns/vflsegw.h"
297 return npc;
298 }
299 if((insn.bits & 0xfff) == 0xd0b)
300 {
301 reg_t npc = pc + insn_length(0x00000d0b);
302 #include "insns/vflsegstw.h"
303 return npc;
304 }
305 if((insn.bits & 0x3fffff) == 0x50b)
306 {
307 reg_t npc = pc + insn_length(0x0000050b);
308 #include "insns/vflw.h"
309 return npc;
310 }
311 if((insn.bits & 0x1ffff) == 0x210b)
312 {
313 reg_t npc = pc + insn_length(0x0000210b);
314 #include "insns/vlsegw.h"
315 return npc;
316 }
317 throw trap_illegal_instruction;
318 }
319
320 reg_t processor_t::opcode_func_115(insn_t insn, reg_t pc)
321 {
322 reg_t npc = pc + insn_length(0x00000015);
323 #include "insns/c_fld.h"
324 return npc;
325 }
326
327 reg_t processor_t::opcode_func_11f(insn_t insn, reg_t pc)
328 {
329 throw trap_illegal_instruction;
330 }
331
332 reg_t processor_t::opcode_func_129(insn_t insn, reg_t pc)
333 {
334 reg_t npc = pc + insn_length(0x00000009);
335 #include "insns/c_ld.h"
336 return npc;
337 }
338
339 reg_t processor_t::opcode_func_133(insn_t insn, reg_t pc)
340 {
341 if((insn.bits & 0x1ffff) == 0x533)
342 {
343 reg_t npc = pc + insn_length(0x00000533);
344 #include "insns/mulhsu.h"
345 return npc;
346 }
347 if((insn.bits & 0x1ffff) == 0x133)
348 {
349 reg_t npc = pc + insn_length(0x00000133);
350 #include "insns/slt.h"
351 return npc;
352 }
353 throw trap_illegal_instruction;
354 }
355
356 reg_t processor_t::opcode_func_13d(insn_t insn, reg_t pc)
357 {
358 reg_t npc = pc + insn_length(0x0000001d);
359 #include "insns/c_addiw.h"
360 return npc;
361 }
362
363 reg_t processor_t::opcode_func_147(insn_t insn, reg_t pc)
364 {
365 throw trap_illegal_instruction;
366 }
367
368 reg_t processor_t::opcode_func_151(insn_t insn, reg_t pc)
369 {
370 reg_t npc = pc + insn_length(0x00000011);
371 #include "insns/c_bne.h"
372 return npc;
373 }
374
375 reg_t processor_t::opcode_func_15b(insn_t insn, reg_t pc)
376 {
377 throw trap_illegal_instruction;
378 }
379
380 reg_t processor_t::opcode_func_165(insn_t insn, reg_t pc)
381 {
382 reg_t npc = pc + insn_length(0x00000005);
383 #include "insns/c_lwsp.h"
384 return npc;
385 }
386
387 reg_t processor_t::opcode_func_16f(insn_t insn, reg_t pc)
388 {
389 reg_t npc = pc + insn_length(0x0000006f);
390 #include "insns/jal.h"
391 return npc;
392 }
393
394 reg_t processor_t::opcode_func_179(insn_t insn, reg_t pc)
395 {
396 if((insn.bits & 0x1c1f) == 0x19)
397 {
398 reg_t npc = pc + insn_length(0x00000019);
399 #include "insns/c_slli.h"
400 return npc;
401 }
402 if((insn.bits & 0x1c1f) == 0x819)
403 {
404 reg_t npc = pc + insn_length(0x00000819);
405 #include "insns/c_srli.h"
406 return npc;
407 }
408 if((insn.bits & 0x1c1f) == 0x1419)
409 {
410 reg_t npc = pc + insn_length(0x00001419);
411 #include "insns/c_srai32.h"
412 return npc;
413 }
414 if((insn.bits & 0x1c1f) == 0x1819)
415 {
416 reg_t npc = pc + insn_length(0x00001819);
417 #include "insns/c_slliw.h"
418 return npc;
419 }
420 if((insn.bits & 0x1c1f) == 0xc19)
421 {
422 reg_t npc = pc + insn_length(0x00000c19);
423 #include "insns/c_srli32.h"
424 return npc;
425 }
426 if((insn.bits & 0x1c1f) == 0x1019)
427 {
428 reg_t npc = pc + insn_length(0x00001019);
429 #include "insns/c_srai.h"
430 return npc;
431 }
432 if((insn.bits & 0x1c1f) == 0x419)
433 {
434 reg_t npc = pc + insn_length(0x00000419);
435 #include "insns/c_slli32.h"
436 return npc;
437 }
438 throw trap_illegal_instruction;
439 }
440
441 reg_t processor_t::opcode_func_183(insn_t insn, reg_t pc)
442 {
443 reg_t npc = pc + insn_length(0x00000183);
444 #include "insns/ld.h"
445 return npc;
446 }
447
448 reg_t processor_t::opcode_func_18d(insn_t insn, reg_t pc)
449 {
450 reg_t npc = pc + insn_length(0x0000000d);
451 #include "insns/c_sw.h"
452 return npc;
453 }
454
455 reg_t processor_t::opcode_func_197(insn_t insn, reg_t pc)
456 {
457 throw trap_illegal_instruction;
458 }
459
460 reg_t processor_t::opcode_func_1a1(insn_t insn, reg_t pc)
461 {
462 reg_t npc = pc + insn_length(0x00000001);
463 #include "insns/c_addi.h"
464 return npc;
465 }
466
467 reg_t processor_t::opcode_func_1ab(insn_t insn, reg_t pc)
468 {
469 if((insn.bits & 0x1ffff) == 0x19ab)
470 {
471 reg_t npc = pc + insn_length(0x000019ab);
472 #include "insns/amominu_d.h"
473 return npc;
474 }
475 if((insn.bits & 0x1ffff) == 0x9ab)
476 {
477 reg_t npc = pc + insn_length(0x000009ab);
478 #include "insns/amoand_d.h"
479 return npc;
480 }
481 if((insn.bits & 0x1ffff) == 0x1dab)
482 {
483 reg_t npc = pc + insn_length(0x00001dab);
484 #include "insns/amomaxu_d.h"
485 return npc;
486 }
487 if((insn.bits & 0x1ffff) == 0x1ab)
488 {
489 reg_t npc = pc + insn_length(0x000001ab);
490 #include "insns/amoadd_d.h"
491 return npc;
492 }
493 if((insn.bits & 0x1ffff) == 0x15ab)
494 {
495 reg_t npc = pc + insn_length(0x000015ab);
496 #include "insns/amomax_d.h"
497 return npc;
498 }
499 if((insn.bits & 0x1ffff) == 0xdab)
500 {
501 reg_t npc = pc + insn_length(0x00000dab);
502 #include "insns/amoor_d.h"
503 return npc;
504 }
505 if((insn.bits & 0x1ffff) == 0x5ab)
506 {
507 reg_t npc = pc + insn_length(0x000005ab);
508 #include "insns/amoswap_d.h"
509 return npc;
510 }
511 if((insn.bits & 0x1ffff) == 0x11ab)
512 {
513 reg_t npc = pc + insn_length(0x000011ab);
514 #include "insns/amomin_d.h"
515 return npc;
516 }
517 throw trap_illegal_instruction;
518 }
519
520 reg_t processor_t::opcode_func_1b5(insn_t insn, reg_t pc)
521 {
522 reg_t npc = pc + insn_length(0x00000015);
523 #include "insns/c_fld.h"
524 return npc;
525 }
526
527 reg_t processor_t::opcode_func_1bf(insn_t insn, reg_t pc)
528 {
529 throw trap_illegal_instruction;
530 }
531
532 reg_t processor_t::opcode_func_1c9(insn_t insn, reg_t pc)
533 {
534 reg_t npc = pc + insn_length(0x00000009);
535 #include "insns/c_ld.h"
536 return npc;
537 }
538
539 reg_t processor_t::opcode_func_1d3(insn_t insn, reg_t pc)
540 {
541 throw trap_illegal_instruction;
542 }
543
544 reg_t processor_t::opcode_func_1dd(insn_t insn, reg_t pc)
545 {
546 reg_t npc = pc + insn_length(0x0000001d);
547 #include "insns/c_addiw.h"
548 return npc;
549 }
550
551 reg_t processor_t::opcode_func_1e7(insn_t insn, reg_t pc)
552 {
553 reg_t npc = pc + insn_length(0x00000067);
554 #include "insns/j.h"
555 return npc;
556 }
557
558 reg_t processor_t::opcode_func_1f1(insn_t insn, reg_t pc)
559 {
560 reg_t npc = pc + insn_length(0x00000011);
561 #include "insns/c_bne.h"
562 return npc;
563 }
564
565 reg_t processor_t::opcode_func_1fb(insn_t insn, reg_t pc)
566 {
567 if((insn.bits & 0xf801ffff) == 0x1fb)
568 {
569 reg_t npc = pc + insn_length(0x000001fb);
570 #include "insns/mtpcr.h"
571 return npc;
572 }
573 throw trap_illegal_instruction;
574 }
575
576 reg_t processor_t::opcode_func_205(insn_t insn, reg_t pc)
577 {
578 reg_t npc = pc + insn_length(0x00000005);
579 #include "insns/c_lwsp.h"
580 return npc;
581 }
582
583 reg_t processor_t::opcode_func_20f(insn_t insn, reg_t pc)
584 {
585 throw trap_illegal_instruction;
586 }
587
588 reg_t processor_t::opcode_func_219(insn_t insn, reg_t pc)
589 {
590 if((insn.bits & 0x1c1f) == 0x19)
591 {
592 reg_t npc = pc + insn_length(0x00000019);
593 #include "insns/c_slli.h"
594 return npc;
595 }
596 if((insn.bits & 0x1c1f) == 0x819)
597 {
598 reg_t npc = pc + insn_length(0x00000819);
599 #include "insns/c_srli.h"
600 return npc;
601 }
602 if((insn.bits & 0x1c1f) == 0x1419)
603 {
604 reg_t npc = pc + insn_length(0x00001419);
605 #include "insns/c_srai32.h"
606 return npc;
607 }
608 if((insn.bits & 0x1c1f) == 0x1819)
609 {
610 reg_t npc = pc + insn_length(0x00001819);
611 #include "insns/c_slliw.h"
612 return npc;
613 }
614 if((insn.bits & 0x1c1f) == 0xc19)
615 {
616 reg_t npc = pc + insn_length(0x00000c19);
617 #include "insns/c_srli32.h"
618 return npc;
619 }
620 if((insn.bits & 0x1c1f) == 0x1019)
621 {
622 reg_t npc = pc + insn_length(0x00001019);
623 #include "insns/c_srai.h"
624 return npc;
625 }
626 if((insn.bits & 0x1c1f) == 0x419)
627 {
628 reg_t npc = pc + insn_length(0x00000419);
629 #include "insns/c_slli32.h"
630 return npc;
631 }
632 throw trap_illegal_instruction;
633 }
634
635 reg_t processor_t::opcode_func_223(insn_t insn, reg_t pc)
636 {
637 throw trap_illegal_instruction;
638 }
639
640 reg_t processor_t::opcode_func_22d(insn_t insn, reg_t pc)
641 {
642 reg_t npc = pc + insn_length(0x0000000d);
643 #include "insns/c_sw.h"
644 return npc;
645 }
646
647 reg_t processor_t::opcode_func_237(insn_t insn, reg_t pc)
648 {
649 reg_t npc = pc + insn_length(0x00000037);
650 #include "insns/lui.h"
651 return npc;
652 }
653
654 reg_t processor_t::opcode_func_241(insn_t insn, reg_t pc)
655 {
656 reg_t npc = pc + insn_length(0x00000001);
657 #include "insns/c_addi.h"
658 return npc;
659 }
660
661 reg_t processor_t::opcode_func_24b(insn_t insn, reg_t pc)
662 {
663 reg_t npc = pc + insn_length(0x0000004b);
664 #include "insns/fnmsub_s.h"
665 return npc;
666 }
667
668 reg_t processor_t::opcode_func_255(insn_t insn, reg_t pc)
669 {
670 reg_t npc = pc + insn_length(0x00000015);
671 #include "insns/c_fld.h"
672 return npc;
673 }
674
675 reg_t processor_t::opcode_func_25f(insn_t insn, reg_t pc)
676 {
677 throw trap_illegal_instruction;
678 }
679
680 reg_t processor_t::opcode_func_269(insn_t insn, reg_t pc)
681 {
682 reg_t npc = pc + insn_length(0x00000009);
683 #include "insns/c_ld.h"
684 return npc;
685 }
686
687 reg_t processor_t::opcode_func_273(insn_t insn, reg_t pc)
688 {
689 throw trap_illegal_instruction;
690 }
691
692 reg_t processor_t::opcode_func_27d(insn_t insn, reg_t pc)
693 {
694 reg_t npc = pc + insn_length(0x0000001d);
695 #include "insns/c_addiw.h"
696 return npc;
697 }
698
699 reg_t processor_t::opcode_func_287(insn_t insn, reg_t pc)
700 {
701 throw trap_illegal_instruction;
702 }
703
704 reg_t processor_t::opcode_func_291(insn_t insn, reg_t pc)
705 {
706 reg_t npc = pc + insn_length(0x00000011);
707 #include "insns/c_bne.h"
708 return npc;
709 }
710
711 reg_t processor_t::opcode_func_29b(insn_t insn, reg_t pc)
712 {
713 if((insn.bits & 0x3f83ff) == 0x29b)
714 {
715 reg_t npc = pc + insn_length(0x0000029b);
716 #include "insns/srliw.h"
717 return npc;
718 }
719 if((insn.bits & 0x3f83ff) == 0x1029b)
720 {
721 reg_t npc = pc + insn_length(0x0001029b);
722 #include "insns/sraiw.h"
723 return npc;
724 }
725 throw trap_illegal_instruction;
726 }
727
728 reg_t processor_t::opcode_func_2a5(insn_t insn, reg_t pc)
729 {
730 reg_t npc = pc + insn_length(0x00000005);
731 #include "insns/c_lwsp.h"
732 return npc;
733 }
734
735 reg_t processor_t::opcode_func_2af(insn_t insn, reg_t pc)
736 {
737 reg_t npc = pc + insn_length(0x000002af);
738 #include "insns/fence_g_v.h"
739 return npc;
740 }
741
742 reg_t processor_t::opcode_func_2b9(insn_t insn, reg_t pc)
743 {
744 if((insn.bits & 0x1c1f) == 0x19)
745 {
746 reg_t npc = pc + insn_length(0x00000019);
747 #include "insns/c_slli.h"
748 return npc;
749 }
750 if((insn.bits & 0x1c1f) == 0x819)
751 {
752 reg_t npc = pc + insn_length(0x00000819);
753 #include "insns/c_srli.h"
754 return npc;
755 }
756 if((insn.bits & 0x1c1f) == 0x1419)
757 {
758 reg_t npc = pc + insn_length(0x00001419);
759 #include "insns/c_srai32.h"
760 return npc;
761 }
762 if((insn.bits & 0x1c1f) == 0x1819)
763 {
764 reg_t npc = pc + insn_length(0x00001819);
765 #include "insns/c_slliw.h"
766 return npc;
767 }
768 if((insn.bits & 0x1c1f) == 0xc19)
769 {
770 reg_t npc = pc + insn_length(0x00000c19);
771 #include "insns/c_srli32.h"
772 return npc;
773 }
774 if((insn.bits & 0x1c1f) == 0x1019)
775 {
776 reg_t npc = pc + insn_length(0x00001019);
777 #include "insns/c_srai.h"
778 return npc;
779 }
780 if((insn.bits & 0x1c1f) == 0x419)
781 {
782 reg_t npc = pc + insn_length(0x00000419);
783 #include "insns/c_slli32.h"
784 return npc;
785 }
786 throw trap_illegal_instruction;
787 }
788
789 reg_t processor_t::opcode_func_2c3(insn_t insn, reg_t pc)
790 {
791 reg_t npc = pc + insn_length(0x000000c3);
792 #include "insns/fmadd_d.h"
793 return npc;
794 }
795
796 reg_t processor_t::opcode_func_2cd(insn_t insn, reg_t pc)
797 {
798 reg_t npc = pc + insn_length(0x0000000d);
799 #include "insns/c_sw.h"
800 return npc;
801 }
802
803 reg_t processor_t::opcode_func_2d7(insn_t insn, reg_t pc)
804 {
805 throw trap_illegal_instruction;
806 }
807
808 reg_t processor_t::opcode_func_2e1(insn_t insn, reg_t pc)
809 {
810 reg_t npc = pc + insn_length(0x00000001);
811 #include "insns/c_addi.h"
812 return npc;
813 }
814
815 reg_t processor_t::opcode_func_2eb(insn_t insn, reg_t pc)
816 {
817 throw trap_illegal_instruction;
818 }
819
820 reg_t processor_t::opcode_func_2f5(insn_t insn, reg_t pc)
821 {
822 reg_t npc = pc + insn_length(0x00000015);
823 #include "insns/c_fld.h"
824 return npc;
825 }
826
827 reg_t processor_t::opcode_func_2ff(insn_t insn, reg_t pc)
828 {
829 throw trap_illegal_instruction;
830 }
831
832 reg_t processor_t::opcode_func_309(insn_t insn, reg_t pc)
833 {
834 reg_t npc = pc + insn_length(0x00000009);
835 #include "insns/c_ld.h"
836 return npc;
837 }
838
839 reg_t processor_t::opcode_func_313(insn_t insn, reg_t pc)
840 {
841 reg_t npc = pc + insn_length(0x00000313);
842 #include "insns/ori.h"
843 return npc;
844 }
845
846 reg_t processor_t::opcode_func_31d(insn_t insn, reg_t pc)
847 {
848 reg_t npc = pc + insn_length(0x0000001d);
849 #include "insns/c_addiw.h"
850 return npc;
851 }
852
853 reg_t processor_t::opcode_func_327(insn_t insn, reg_t pc)
854 {
855 throw trap_illegal_instruction;
856 }
857
858 reg_t processor_t::opcode_func_331(insn_t insn, reg_t pc)
859 {
860 reg_t npc = pc + insn_length(0x00000011);
861 #include "insns/c_bne.h"
862 return npc;
863 }
864
865 reg_t processor_t::opcode_func_33b(insn_t insn, reg_t pc)
866 {
867 if((insn.bits & 0x1ffff) == 0x73b)
868 {
869 reg_t npc = pc + insn_length(0x0000073b);
870 #include "insns/remw.h"
871 return npc;
872 }
873 throw trap_illegal_instruction;
874 }
875
876 reg_t processor_t::opcode_func_345(insn_t insn, reg_t pc)
877 {
878 reg_t npc = pc + insn_length(0x00000005);
879 #include "insns/c_lwsp.h"
880 return npc;
881 }
882
883 reg_t processor_t::opcode_func_34f(insn_t insn, reg_t pc)
884 {
885 throw trap_illegal_instruction;
886 }
887
888 reg_t processor_t::opcode_func_359(insn_t insn, reg_t pc)
889 {
890 if((insn.bits & 0x1c1f) == 0x19)
891 {
892 reg_t npc = pc + insn_length(0x00000019);
893 #include "insns/c_slli.h"
894 return npc;
895 }
896 if((insn.bits & 0x1c1f) == 0x819)
897 {
898 reg_t npc = pc + insn_length(0x00000819);
899 #include "insns/c_srli.h"
900 return npc;
901 }
902 if((insn.bits & 0x1c1f) == 0x1419)
903 {
904 reg_t npc = pc + insn_length(0x00001419);
905 #include "insns/c_srai32.h"
906 return npc;
907 }
908 if((insn.bits & 0x1c1f) == 0x1819)
909 {
910 reg_t npc = pc + insn_length(0x00001819);
911 #include "insns/c_slliw.h"
912 return npc;
913 }
914 if((insn.bits & 0x1c1f) == 0xc19)
915 {
916 reg_t npc = pc + insn_length(0x00000c19);
917 #include "insns/c_srli32.h"
918 return npc;
919 }
920 if((insn.bits & 0x1c1f) == 0x1019)
921 {
922 reg_t npc = pc + insn_length(0x00001019);
923 #include "insns/c_srai.h"
924 return npc;
925 }
926 if((insn.bits & 0x1c1f) == 0x419)
927 {
928 reg_t npc = pc + insn_length(0x00000419);
929 #include "insns/c_slli32.h"
930 return npc;
931 }
932 throw trap_illegal_instruction;
933 }
934
935 reg_t processor_t::opcode_func_363(insn_t insn, reg_t pc)
936 {
937 reg_t npc = pc + insn_length(0x00000363);
938 #include "insns/bltu.h"
939 return npc;
940 }
941
942 reg_t processor_t::opcode_func_36d(insn_t insn, reg_t pc)
943 {
944 reg_t npc = pc + insn_length(0x0000000d);
945 #include "insns/c_sw.h"
946 return npc;
947 }
948
949 reg_t processor_t::opcode_func_377(insn_t insn, reg_t pc)
950 {
951 throw trap_illegal_instruction;
952 }
953
954 reg_t processor_t::opcode_func_381(insn_t insn, reg_t pc)
955 {
956 reg_t npc = pc + insn_length(0x00000001);
957 #include "insns/c_addi.h"
958 return npc;
959 }
960
961 reg_t processor_t::opcode_func_38b(insn_t insn, reg_t pc)
962 {
963 throw trap_illegal_instruction;
964 }
965
966 reg_t processor_t::opcode_func_395(insn_t insn, reg_t pc)
967 {
968 reg_t npc = pc + insn_length(0x00000015);
969 #include "insns/c_fld.h"
970 return npc;
971 }
972
973 reg_t processor_t::opcode_func_39f(insn_t insn, reg_t pc)
974 {
975 throw trap_illegal_instruction;
976 }
977
978 reg_t processor_t::opcode_func_3a9(insn_t insn, reg_t pc)
979 {
980 reg_t npc = pc + insn_length(0x00000009);
981 #include "insns/c_ld.h"
982 return npc;
983 }
984
985 reg_t processor_t::opcode_func_3b3(insn_t insn, reg_t pc)
986 {
987 if((insn.bits & 0x1ffff) == 0x7b3)
988 {
989 reg_t npc = pc + insn_length(0x000007b3);
990 #include "insns/remu.h"
991 return npc;
992 }
993 if((insn.bits & 0x1ffff) == 0x3b3)
994 {
995 reg_t npc = pc + insn_length(0x000003b3);
996 #include "insns/and.h"
997 return npc;
998 }
999 throw trap_illegal_instruction;
1000 }
1001
1002 reg_t processor_t::opcode_func_3bd(insn_t insn, reg_t pc)
1003 {
1004 reg_t npc = pc + insn_length(0x0000001d);
1005 #include "insns/c_addiw.h"
1006 return npc;
1007 }
1008
1009 reg_t processor_t::opcode_func_3c7(insn_t insn, reg_t pc)
1010 {
1011 throw trap_illegal_instruction;
1012 }
1013
1014 reg_t processor_t::opcode_func_3d1(insn_t insn, reg_t pc)
1015 {
1016 reg_t npc = pc + insn_length(0x00000011);
1017 #include "insns/c_bne.h"
1018 return npc;
1019 }
1020
1021 reg_t processor_t::opcode_func_3db(insn_t insn, reg_t pc)
1022 {
1023 throw trap_illegal_instruction;
1024 }
1025
1026 reg_t processor_t::opcode_func_3e5(insn_t insn, reg_t pc)
1027 {
1028 reg_t npc = pc + insn_length(0x00000005);
1029 #include "insns/c_lwsp.h"
1030 return npc;
1031 }
1032
1033 reg_t processor_t::opcode_func_3ef(insn_t insn, reg_t pc)
1034 {
1035 reg_t npc = pc + insn_length(0x0000006f);
1036 #include "insns/jal.h"
1037 return npc;
1038 }
1039
1040 reg_t processor_t::opcode_func_3f9(insn_t insn, reg_t pc)
1041 {
1042 if((insn.bits & 0x1c1f) == 0x19)
1043 {
1044 reg_t npc = pc + insn_length(0x00000019);
1045 #include "insns/c_slli.h"
1046 return npc;
1047 }
1048 if((insn.bits & 0x1c1f) == 0x819)
1049 {
1050 reg_t npc = pc + insn_length(0x00000819);
1051 #include "insns/c_srli.h"
1052 return npc;
1053 }
1054 if((insn.bits & 0x1c1f) == 0x1419)
1055 {
1056 reg_t npc = pc + insn_length(0x00001419);
1057 #include "insns/c_srai32.h"
1058 return npc;
1059 }
1060 if((insn.bits & 0x1c1f) == 0x1819)
1061 {
1062 reg_t npc = pc + insn_length(0x00001819);
1063 #include "insns/c_slliw.h"
1064 return npc;
1065 }
1066 if((insn.bits & 0x1c1f) == 0xc19)
1067 {
1068 reg_t npc = pc + insn_length(0x00000c19);
1069 #include "insns/c_srli32.h"
1070 return npc;
1071 }
1072 if((insn.bits & 0x1c1f) == 0x1019)
1073 {
1074 reg_t npc = pc + insn_length(0x00001019);
1075 #include "insns/c_srai.h"
1076 return npc;
1077 }
1078 if((insn.bits & 0x1c1f) == 0x419)
1079 {
1080 reg_t npc = pc + insn_length(0x00000419);
1081 #include "insns/c_slli32.h"
1082 return npc;
1083 }
1084 throw trap_illegal_instruction;
1085 }
1086