return predicate;
}
-reg_spec_t sv_insn_t::predicated(reg_spec_t const& spec, int offs, uint64_t pred)
+reg_spec_t sv_insn_t::predicated(reg_spec_t const& spec, uint64_t pred)
{
reg_spec_t res = spec;
- if (pred & (1<<offs))
+ if (pred & (1<<(*spec.offset)))
{
return res;
}
- fprintf(stderr, "predication %ld %d %lx\n", spec.reg, offs, pred);
+ fprintf(stderr, "predication %ld %d %lx\n", spec.reg, (*spec.offset), pred);
res.reg = 0;
res.offset = 0;
return res;
{ return sv_reg_t(_rvc_spoffs_imm(4, insn_t::rvc_swsp_imm())); }
uint64_t rvc_sdsp_imm() { return _rvc_spoffs_imm(8, insn_t::rvc_sdsp_imm()); }
- reg_spec_t rd () { return predicated(_rd (), *offs_rd, prd); }
- reg_spec_t rs1() { return predicated(_rs1(), *offs_rs1, prs1); }
- reg_spec_t rs2() { return predicated(_rs2(), *offs_rs2, prs2); }
- reg_spec_t rs3() { return predicated(_rs3(), *offs_rs3, prs3); }
- reg_spec_t rvc_rs1 () { return predicated(_rvc_rs1 (), *offs_rs1, prs1); }
- reg_spec_t rvc_rs1s() { return predicated(_rvc_rs1s(), *offs_rs1, prs1); }
- reg_spec_t rvc_rs2 () { return predicated(_rvc_rs2 (), *offs_rs2, prs2); }
- reg_spec_t rvc_rs2s() { return predicated(_rvc_rs2s(), *offs_rs2, prs2); }
- reg_spec_t rvc_sp () { return predicated(_rvc_sp (), *offs_sp , psp ); }
+ reg_spec_t rd () { return predicated(_rd (), prd); }
+ reg_spec_t rs1() { return predicated(_rs1(), prs1); }
+ reg_spec_t rs2() { return predicated(_rs2(), prs2); }
+ reg_spec_t rs3() { return predicated(_rs3(), prs3); }
+ reg_spec_t rvc_rs1 () { return predicated(_rvc_rs1 (), prs1); }
+ reg_spec_t rvc_rs1s() { return predicated(_rvc_rs1s(), prs1); }
+ reg_spec_t rvc_rs2 () { return predicated(_rvc_rs2 (), prs2); }
+ reg_spec_t rvc_rs2s() { return predicated(_rvc_rs2s(), prs2); }
+ reg_spec_t rvc_sp () { return predicated(_rvc_sp (), psp ); }
reg_spec_t _rd () { return _remap(insn_t::rd (), fimap & REG_RD , offs_rd); }
reg_spec_t _rs1() { return _remap(insn_t::rs1(), fimap & REG_RS1, offs_rs1); }
// will need to take the current loop index/offset somehow
reg_spec_t remap(uint64_t reg, bool isint, int *offs);
- reg_spec_t predicated(reg_spec_t const& reg, int offs, uint64_t pred);
+ reg_spec_t predicated(reg_spec_t const& reg, uint64_t pred);
};
#endif