revamp hwacha; now runs in physical mode
[riscv-isa-sim.git] / hwacha / insns / vf.h
1 if (VL) {
2 if (!h->vf_active()) {
3 h->get_ct_state()->vf_pc = XS1 + insn.s_imm();
4 for (uint32_t i=0; i<VL; i++)
5 h->get_ut_state(i)->run = true;
6 }
7
8 mmu_t::insn_fetch_t ut_fetch = p->get_mmu()->load_insn(h->get_ct_state()->vf_pc);
9 insn_t ut_insn = ut_fetch.insn.insn;
10
11 bool matched = false;
12
13 #define DECLARE_INSN(name, match, mask) \
14 extern reg_t hwacha_##name(processor_t*, insn_t, reg_t); \
15 if ((ut_insn.bits() & mask) == match) { \
16 h->get_ct_state()->vf_pc = hwacha_##name(p, ut_insn, h->get_ct_state()->vf_pc); \
17 matched = true; \
18 }
19 #include "opcodes_hwacha_ut.h"
20 #undef DECLARE_INSN
21
22 // YUNSUP FIXME
23 assert(matched);
24
25 // if vf is still running, rewind pc so that it will execute again
26 if (h->vf_active())
27 npc = pc;
28 }