66#include " trap.h"
77#include < cstdlib>
88
9- #define customX (n ) \
10- static reg_t c##n(processor_t * p, insn_t insn, reg_t pc) \
11- { \
12- rocc_t * rocc = static_cast <rocc_t *>(p->get_extension ()); \
13- rocc_insn_union_t u; \
14- u.i = insn; \
15- reg_t xs1 = u.r .xs1 ? RS1 : -1 ; \
16- reg_t xs2 = u.r .xs2 ? RS2 : -1 ; \
17- reg_t xd = rocc->custom ##n (u.r , xs1, xs2); \
18- if (u.r .xd ) \
19- WRITE_RD (xd); \
20- return pc+4 ; \
21- } \
22- \
23- reg_t rocc_t ::custom##n(rocc_insn_t UNUSED insn, reg_t UNUSED xs1, reg_t UNUSED xs2) \
24- { \
25- illegal_instruction (); \
26- return 0 ; \
9+ #define customX (n ) \
10+ static reg_t c##n(processor_t *p, insn_t insn, reg_t pc) \
11+ { \
12+ rocc_t *rocc = static_cast <rocc_t *>(p->get_extension ()); \
13+ rocc_insn_union_t u; \
14+ u.i = insn; \
15+ reg_t xs1 = u.r .xs1 ? RS1 : -1 ; \
16+ reg_t xs2 = u.r .xs2 ? RS2 : -1 ; \
17+ reg_t xd = rocc->custom ##n (p, u.r , xs1, xs2); \
18+ if (u.r .xd ) \
19+ WRITE_RD (xd); \
20+ return pc + 4 ; \
21+ } \
22+ \
23+ reg_t rocc_t ::custom##n(processor_t *p, rocc_insn_t UNUSED insn, \
24+ reg_t UNUSED xs1, reg_t UNUSED xs2) \
25+ { \
26+ illegal_instruction (*p); \
27+ return 0 ; \
2728 }
2829
30+ // clang-format off
2931customX (0 )
3032customX(1 )
3133customX(2 )
3234customX(3 )
35+ // clang-format on
3336
34- std::vector<insn_desc_t> rocc_t::get_instructions()
35- {
37+ std::vector<insn_desc_t> rocc_t::get_instructions(processor_t &) {
3638 std::vector<insn_desc_t > insns;
3739 insns.push_back ((insn_desc_t ){0x0b , 0x7f ,
3840 &::illegal_instruction, c0, &::illegal_instruction, c0,
@@ -49,8 +51,7 @@ std::vector<insn_desc_t> rocc_t::get_instructions()
4951 return insns;
5052}
5153
52- std::vector<disasm_insn_t *> rocc_t::get_disasms ()
53- {
54+ std::vector<disasm_insn_t *> rocc_t::get_disasms (processor_t *) {
5455 std::vector<disasm_insn_t *> insns;
5556 return insns;
5657}
0 commit comments