#include "trap.h"
#include <stdexcept>
+REGISTER_EXTENSION(hwacha, []() { return new hwacha_t; })
+
void ct_state_t::reset()
{
nxpr = 32;
maxvl = 32;
vl = 0;
count = 0;
+ prec = 64;
vf_pc = -1;
}
void ut_state_t::reset()
{
- run = false;
- XPR.reset();
- FPR.reset();
+ memset(this, 0, sizeof(*this));
}
void hwacha_t::reset()
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;
}
if (!matched)
- h->take_exception(HWACHA_CAUSE_ILLEGAL_INSTRUCTION, insn.bits());
+ h->take_exception(HWACHA_CAUSE_ILLEGAL_INSTRUCTION, uint32_t(insn.bits()));
return npc;
}
cause = c;
aux = a;
raise_interrupt();
- if (!(p->get_state()->sr & SR_EI))
- throw std::logic_error("hwacha exception posted, but SR_EI bit not set!");
- throw std::logic_error("hwacha exception posted, but IM[COP] bit not set!");
+ throw std::logic_error("unreachable!");
}