void ct_state_t::reset()
{
- vl = 0;
- maxvl = 32;
nxpr = 32;
nfpr = 32;
+ maxvl = 32;
+ vl = 0;
+ count = 0;
vf_pc = -1;
-
- cause = 0;
- aux = 0;
}
void ut_state_t::reset()
return false;
}
-void hwacha_t::take_exception(reg_t cause, reg_t aux)
+void hwacha_t::take_exception(reg_t c, reg_t a)
{
- get_ct_state()->cause = cause;
- get_ct_state()->aux = aux;
+ 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!");
uint32_t nfpr;
uint32_t maxvl;
uint32_t vl;
+ uint32_t count;
reg_t vf_pc;
-
- reg_t cause;
- reg_t aux;
};
struct ut_state_t
class hwacha_t : public extension_t
{
public:
- hwacha_t() : debug(false) {}
+ hwacha_t() : cause(0), aux(0), debug(false) {}
std::vector<insn_desc_t> get_instructions();
std::vector<disasm_insn_t*> get_disasms();
const char* name() { return "hwacha"; }
ct_state_t* get_ct_state() { return &ct_state; }
ut_state_t* get_ut_state(int idx) { return &ut_state[idx]; }
bool vf_active();
+ reg_t get_cause() { return cause; }
+ reg_t get_aux() { return aux; }
void take_exception(reg_t, reg_t);
void clear_exception() { clear_interrupt(); }
static const int max_uts = 2048;
ct_state_t ct_state;
ut_state_t ut_state[max_uts];
+ reg_t cause;
+ reg_t aux;
+
disassembler_t ut_disassembler;
bool debug;
};
int xprlen = 64;
reg_t npc = sext_xprlen(pc + insn_length(OPCODE));
hwacha_t* h = static_cast<hwacha_t*>(p->get_extension());
- for (uint32_t i=0; i<VL; i++) {
+ do {
#include "insns_ut/NAME.h"
- }
+ WRITE_UTIDX(UTIDX+1);
+ } while (UTIDX < VL);
+ WRITE_UTIDX(0);
return npc;
}