// in a stack of other things that are needed.
insn_bits_t bits = s_insn.bits();
int vlen = 0;
- int subvl = 0;
+ int subvl = 1;
if (p->get_state()->prv == 0) { // XXX HACK - disable in supervisor mode
vlen = p->get_state()->sv().vl;
subvl = p->get_state()->sv().subvl;
reg_spec_t sp = {0, NULL};
if (vlen > 0)
{
- fprintf(stderr, "pre-ex reg %s %x %ld rd %ld rs1 %ld rs2 %ld vlen %d\n",
+ fprintf(stderr,
+ "pre-ex reg %s %x %ld rd %ld rs1 %ld rs2 %ld vlen %d subvl %d\n",
xstr(INSN), INSNCODE, p->get_state()->prv,
s_insn.rd(), s_insn.rs1(), s_insn.rs2(),
- vlen);
+ vlen, subvl);
#ifdef INSN_TYPE_C_STACK_LD
sp = insn._remap(X_SP, true, src_offs, src_subo);
#endif
{
vlen = 1; // minimum of one loop
}
- for (int voffs=0; voffs < vlen; voffs++)
+ for (int voffs=0; voffs < vlen*subvl; voffs++)
{
insn.reset_vloop_check();
#ifdef INSN_C_MV
"vlen %d stop %d pred %lx rdv %lx v %ld rvc2 %ld sp %lx\n",
xstr(INSN), INSNCODE, voffs, *src_offs, *dest_offs,
vlen, insn.stop_vloop(),
- dest_pred & (1<<voffs), READ_REG(insn._rvc_rs2()),
+ dest_pred & (1<<(voffs/subvl)), READ_REG(insn._rvc_rs2()),
insn._rvc_rs2().reg, insn.rvc_lwsp_imm(), READ_REG(sp));
#endif
#ifdef INSN_C_LWSP
"vlen %d stop %d pred %lx rdv %lx rd %ld rvc2 %ld sp %lx\n",
xstr(INSN), INSNCODE, voffs, *src_offs, *dest_offs,
vlen, insn.stop_vloop(),
- dest_pred & (1<<voffs), READ_REG(insn._rd()),
+ dest_pred & (1<<(voffs/subvl)), READ_REG(insn._rd()),
insn._rd().reg, insn.rvc_lwsp_imm(), READ_REG(sp));
#endif
#ifdef INSN_C_BEQZ
"vlen %d stop %d pred %lx rdv %lx rvc_rs1 %ld\n",
xstr(INSN), INSNCODE, voffs, _target_reg, *dest_offs,
vlen, insn.stop_vloop(),
- dest_pred & (1<<voffs), READ_REG(insn._rvc_rs1s()),
+ dest_pred & (1<<(voffs/subvl)), READ_REG(insn._rvc_rs1s()),
insn._rvc_rs1s().reg);
#endif
#ifdef INSN_LD
"vlen %d stop %d pred %lx rdv %lx rvc_rs1 %ld\n",
xstr(INSN), INSNCODE, voffs, *src_offs, *dest_offs,
vlen, insn.stop_vloop(),
- dest_pred & (1<<voffs), READ_REG(insn._rs1()),
+ dest_pred & (1<<(voffs/subvl)), READ_REG(insn._rs1()),
insn._rs1().reg);
#endif
#include INCLUDEFILE
if (vlen > 1)
{
#if defined(USING_REG_RD)
- fprintf(stderr, "reg %s %x vloop %d vlen %d stop %d pred %lx rd%lx\n",
+ 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_REG(insn._rd()));
+ dest_pred & (1<<(voffs/subvl)), READ_REG(insn._rd()));
#endif
#if defined(USING_REG_FRD)
- fprintf(stderr, "reg %s %x vloop %d vlen %d stop %d pred %lx rd%g\n",
+ fprintf(stderr,
+ "reg %s %x vloop %d vlen %d stop %d pred %lx rd%g\n",
xstr(INSN), INSNCODE, voffs, vlen, insn.stop_vloop(),
- dest_pred & (1<<voffs),
+ dest_pred & (1<<(voffs/subvl)),
(double)(READ_FREG(insn._rd())).v[0]);
#endif
}
inc_offs(vlen, subvl, *src_offs, *src_subo);
#endif
inc_offs(vlen, subvl, *dest_offs, *dest_subo);
- }
+ } // end voffs loop
#ifdef INSN_TYPE_BRANCH
// ok, at the end of the loop, if the predicates are equal,
// we're good to branch. use the saved address (to avoid