# help identify type of register
if insn in ['beq', 'bne', 'blt', 'bltu', 'bge', 'bgeu']:
txt += "#define INSN_TYPE_BRANCH\n"
- elif insn in ['c_ld', 'c_bnez']:
- txt += "\n#define INSN_TYPE_C_BRANCH\n"
+ if insn in ['lb', 'lbu', 'lw', 'lwu', 'ld', 'ldu']:
+ txt += "#define INSN_TYPE_LOAD\n"
elif insn in ['c_lwsp', 'c_ldsp', 'c_lqsp', 'c_flwsp', 'c_fldsp']:
txt += "\n#define INSN_TYPE_C_STACK_LD\n"
elif insn in ['c_swsp', 'c_sdsp', 'c_sqsp', 'c_fswsp', 'c_fsdsp']:
// REGS_PATTERN is generated by id_regs.py (per opcode)
unsigned int floatintmap = REGS_PATTERN;
reg_t dest_pred = ~0x0;
+ bool ldimm_sv = false;
+#ifdef INSN_TYPE_LOAD
+ bool ldimm_sv = true;
+#endif
sv_insn_t insn(p, bits, floatintmap,
- dest_pred, dest_pred, dest_pred, dest_pred);
+ dest_pred, dest_pred, dest_pred, dest_pred,
+ ldimm_sv);
bool zeroing;
#if defined(USING_REG_RD) || defined(USING_REG_FRD)
// use the ORIGINAL, i.e. NON-REDIRECTED, register here
#if defined(USING_REG_FRD)
fprintf(stderr, "reg %s %x vloop %d vlen %d stop %d pred %lx rd%lx\n",
xstr(INSN), INSNCODE, voffs, vlen, insn.stop_vloop(),
- dest_pred & (1<<voffs), READ_FREG(insn._rd()));
+ dest_pred & (1<<voffs),
+ (READ_FREG(insn._rd())));
#endif
}
insn.reset_caches(); // ready to increment offsets in next iteration
return 0;
}
+uint64_t sv_insn_t::i_imm()
+{
+ if (ldst_imm_mode == false)
+ {
+ return insn_t::i_imm();
+ }
+ return insn_t::i_imm(); // TODO
+}
{
public:
sv_insn_t(processor_t *pr, insn_bits_t bits, unsigned int f,
- uint64_t &p_rd, uint64_t &p_rs1, uint64_t &p_rs2, uint64_t &p_rs3) :
+ uint64_t &p_rd, uint64_t &p_rs1, uint64_t &p_rs2, uint64_t &p_rs3,
+ bool ldimm_mode) :
insn_t(bits), p(pr), vloop_continue(false), fimap(f),
cached_rd(0xff), cached_rs1(0xff),
cached_rs2(0xff), cached_rs3(0xff),
offs_rs2(0), offs_rs3(0),
new_offs_rd(0), new_offs_rs1(0),
new_offs_rs2(0), new_offs_rs3(0),
- prd(p_rd), prs1(p_rs1), prs2(p_rs2), prs3(p_rs3) {}
+ prd(p_rd), prs1(p_rs1), prs2(p_rs2), prs3(p_rs3),
+ ldst_imm_mode(ldimm_mode) {}
uint64_t rd () { return predicated(_rd (), offs_rd , prd); }
uint64_t rs1() { return predicated(_rs1(), offs_rs1, prs1); }
uint64_t rs2() { return predicated(_rs2(), offs_rs2, prs2); }
uint64_t rvc_rs1s() { return predicated(_rvc_rs1s(), offs_rs1, prs1); }
uint64_t rvc_rs2 () { return predicated(_rvc_rs2 (), offs_rs2, prs2); }
uint64_t rvc_rs2s() { return predicated(_rvc_rs2s(), offs_rs2, prs2); }
+ uint64_t i_imm();
uint64_t _rd () { return _remap(insn_t::rd (), fimap & REG_RD ,
offs_rd , cached_rd, new_offs_rd); }
uint64_t &prs1;
uint64_t &prs2;
uint64_t &prs3;
+ bool ldst_imm_mode;
// remaps the register through the lookup table.
// will need to take the current loop index/offset somehow