int vlen = 1;
sv_insn_t insn(bits, voffs);
bool vectorop = false;
+ reg_t predicate = 0;
+ // identify which regs have had their CSR entries set as vectorised.
+ // really could do with a macro for-loop here... oh well...
+ // integer ops, RD, RS1, RS2, RS3 (use sv_int_tb)
+#ifdef USING_RD
+ vectorop &= check_reg(true, s_insn.rd());
+#endif
+#ifdef USING_RS1
+ vectorop &= check_reg(true, s_insn.rs1());
+#endif
+#ifdef USING_RS2
+ vectorop &= check_reg(true, s_insn.rs2());
+#endif
+#ifdef USING_RS2
+ vectorop &= check_reg(true, s_insn.rs3());
+#endif
+ // fp ops, RD, RS1, RS2, RS3 (use sv_fp_tb)
+#ifdef USING_FRD
+ vectorop &= check_reg(false, s_insn.frd());
+#endif
+#ifdef USING_FRS1
+ vectorop &= check_reg(false, s_insn.frs1());
+#endif
+#ifdef USING_FRS2
+ vectorop &= check_reg(false, s_insn.rs2());
+#endif
+#ifdef USING_FRS2
+ vectorop &= check_reg(false, s_insn.rs3());
+#endif
+
+ // if vectorop is set, one of the regs is not a scalar,
+ // so we must read the VL CSR and do a loop
+ if (vectorop)
+ {
+ // TODO: vlen = p->CSR(SIMPLEV_VL); // something like that...
+ }
for (; voffs < vlen; voffs++)
{
#include INCLUDEFILE
sv_pred_csr_entry sv_pred_csrs[SV_CSR_SZ];
sv_pred_entry sv_pred_tb[NXPR];
+bool sv_check_reg(bool intreg, uint64_t reg)
+{
+ sv_reg_entry *r;
+ if (intreg)
+ {
+ r = &sv_int_tb[reg];
+ }
+ else
+ {
+ r = &sv_fp_tb[reg];
+ }
+ if (r->elwidth != 0)
+ {
+ // XXX raise exception
+ }
+ if (r->active && r->isvec)
+ {
+ return true;
+ }
+ return false;
+}
// 32 entries, only integer regs are predicates.
extern sv_pred_entry sv_pred_tb[NXPR];
+bool sv_check_reg(bool intreg, uint64_t reg);
+
#endif