d225949c993cf9377552bb0f4e2730ecccddf123
[riscv-isa-sim.git] / hwacha / insn_template_hwacha.cc
1 // See LICENSE for license details.
2 #include "insn_template_hwacha.h"
3
4 reg_t hwacha_NAME(processor_t* p, insn_t insn, reg_t pc)
5 {
6 int xlen = 64;
7 reg_t npc = sext_xlen(pc + insn_length(OPCODE));
8 hwacha_t* h = static_cast<hwacha_t*>(p->get_extension());
9 rocc_insn_union_t u;
10 u.i = insn;
11 reg_t xs1 = u.r.xs1 ? RS1 : -1;
12 reg_t xs2 = u.r.xs2 ? RS2 : -1;
13 reg_t xd = -1;
14 #include "insns/NAME.h"
15 if (u.r.xd) WRITE_RD(xd);
16 return npc;
17 }