# RS1 also matches against RVC_FRS1 (etc.)
# check letter before match: if "_", skip it.
continue
- if 'RVC_' in pattern and f[x+len(pattern)-1] == 'S':
+ if 'RVC_' in pattern and f[x+len(pattern)] == 'S':
# RVC_RS2S also matches against RVC_RS2 (etc.)
# check letter at end of match: if "S", skip it.
continue
twin_predication = True
elif insn in ['c_beqz', 'c_bnez']:
txt += "\n#define INSN_TYPE_C_BRANCH\n"
+ txt += "\n#define INSN_TYPE_BRANCH\n"
+ is_branch = 'STD' # standard branch
elif insn in ['c_mv']:
twin_predication = True
elif insn.startswith("c_"):
#include INCLUDEFILE
#else
#ifdef INSN_TYPE_BRANCH
+#ifdef INSN_TYPE_C_BRANCH
+ sv_pred_entry *r = insn.get_predentry(0, true); // yes, really taken from x0
+#else
sv_pred_entry *r = insn.get_predentry(s_insn.rs2(), true);
+#endif
reg_t _target_reg = 0;
reg_t *target_reg = NULL;
#endif
{
_target_reg = r->regidx;
target_reg = &_target_reg;
+#ifdef INSN_TYPE_C_BRANCH
+ insn.predicate(0, true, zeroingtarg);
+#else
insn.predicate(s_insn.rs2(), true, zeroingtarg);
+#endif
fprintf(stderr, "branch pred reg %ld pred %lx\n",
_target_reg, target_pred);
}
for (int voffs=0; voffs < vlen; voffs++)
{
insn.reset_vloop_check();
+#ifdef INSN_C_BEQZ
+ fprintf(stderr, "pre twin reg %s src %d dest %d pred %lx %lx\n",
+ xstr(INSN), *target_reg, *dest_offs, target_pred, dest_pred);
+#endif
#ifdef INSN_CATEGORY_TWINPREDICATION
if (*src_offs >= vlen) {
break;
vlen, insn.stop_vloop(),
dest_pred & (1<<voffs), READ_REG(insn._rd()),
insn._rd(), insn.rvc_lwsp_imm(), READ_REG(sp));
+#endif
+#ifdef INSN_C_BEQZ
+ fprintf(stderr, "pre %s %x vloop %d %d %d" \
+ "vlen %d stop %d pred %lx rdv %lx rvc_rs1 %d\n",
+ xstr(INSN), INSNCODE, voffs, *target_reg, *dest_offs,
+ vlen, insn.stop_vloop(),
+ dest_pred & (1<<voffs), READ_REG(insn._rvc_rs1s()),
+ insn._rvc_rs1s());
#endif
#include INCLUDEFILE
#ifdef DEST_PREDINT
reg_t sv_proc_t::get_rvc_rs1s()
{
+ fprintf(stderr, "get_rvc_rs1s %d\n", _insn->rvc_rs1s());
+ sv_reg_entry *r = _insn->get_regentry(_insn->_rvc_rs1s(), true);
+ fprintf(stderr, "active %d vec %d map %d\n",
+ r->active, r->isvec, r->regidx);
+
return (_insn->p->get_state()->XPR[_insn->rvc_rs1s()]);
}