reg_t _target_reg = 0;
reg_t *target_reg = NULL;
#endif
- reg_spec_t sp = {0,0};
+ reg_spec_t sp = {0, insn.get_sp_offs()};
if (vlen > 0)
{
fprintf(stderr, "pre-ex reg %s %x %ld rd %ld rs1 %ld rs2 %ld vlen %d\n",
* of SV. it's "supposed" to "just" be a vectorisation API. it isn't:
* it's quite a bit more.
*/
-reg_spec_t sv_insn_t::remap(uint64_t reg, bool intreg, int voffs)
+reg_spec_t sv_insn_t::remap(uint64_t reg, bool intreg, int *voffs)
{
- reg_spec_t spec;
- spec.reg = reg;
- spec.offset = voffs;
+ reg_spec_t spec = {reg, voffs};
// okaay so first determine which map to use. intreg is passed
// in (ultimately) from id_regs.py's examination of the use of
// FRS1/RS1, WRITE_FRD/WRITE_RD, which in turn gets passed
// aaand now, as it's a "vector", FINALLY we can add on the loop-offset
// which was passed in to the sv_insn_t constructor (by reference)
// and, at last, we have "parallelism" a la contiguous registers.
- reg += voffs; // wheww :)
+ reg += *voffs; // wheww :)
spec.reg = reg;
return spec;
reg_spec_t sv_insn_t::predicated(reg_spec_t const& spec, int offs, uint64_t pred)
{
reg_spec_t res = spec;
- res.offset = offs;
if (pred & (1<<offs))
{
return res;
struct reg_spec_t
{
reg_t reg;
- int offset;
+ int *offset;
};
class sv_insn_t: public insn_t
{
vloop_continue = true;
}
- return remap(reg, isint, *offs);
+ return remap(reg, isint, offs);
}
uint64_t get_saved_branch_addr() { return save_branch_addr; }
uint64_t get_saved_branch_rd() { return save_branch_rd; }
uint64_t get_if_one_reg_vectorised() { return at_least_one_reg_vectorised; }
+ int *get_sp_offs() { return offs_sp; }
+
private:
bool vloop_continue;
bool at_least_one_reg_vectorised;
// remaps the register through the lookup table.
// will need to take the current loop index/offset somehow
- reg_spec_t remap(uint64_t reg, bool isint, int offs);
+ 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);
};
sv_reg_t sv_proc_t::get_rvc_sp()
{
- return get_intreg({X_SP, 0}); //_insn->rvc_sp()); // XXX TODO: work out redirection
+ return get_intreg({X_SP, _insn->get_sp_offs()});
}
freg_t sv_proc_t::get_frs1()