static reg_t custom(processor_t* p, insn_t insn, reg_t pc)
{
+ require_accelerator;
hwacha_t* h = static_cast<hwacha_t*>(p->get_extension());
bool matched = false;
reg_t npc = -1;
#else
# define require_fp if(unlikely(!(p->get_state()->sr & SR_EF))) throw trap_fp_disabled()
#endif
+#define require_accelerator if(unlikely(!(p->get_state()->sr & SR_EA))) throw trap_accelerator_disabled()
#define cmp_trunc(reg) (reg_t(reg) << (64-xprlen))
#define set_fp_exceptions ({ p->set_fsr(p->get_state()->fsr | \
#define customX(n) \
static reg_t c##n(processor_t* p, insn_t insn, reg_t pc) \
{ \
+ require_accelerator; \
rocc_t* rocc = static_cast<rocc_t*>(p->get_extension()); \
rocc_insn_union_t u; \
u.i = insn; \
DECLARE_MEM_TRAP(9, store_address_misaligned)
DECLARE_MEM_TRAP(10, load_access_fault)
DECLARE_MEM_TRAP(11, store_access_fault)
+DECLARE_TRAP(12, accelerator_disabled)
#endif