From 7c73f14383959e04f86411ea449ca118a05d33bf Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 27 Jun 2019 09:31:07 +0100 Subject: [PATCH] add in use of inc_offs and sub-src/dest offsets --- riscv/insn_template_sv.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/riscv/insn_template_sv.cc b/riscv/insn_template_sv.cc index c73e3fd..4766a82 100644 --- a/riscv/insn_template_sv.cc +++ b/riscv/insn_template_sv.cc @@ -45,8 +45,10 @@ reg_t sv_proc_t::FN(processor_t* p, insn_t s_insn, reg_t pc) // in a stack of other things that are needed. insn_bits_t bits = s_insn.bits(); int vlen = 0; + int subvl = 0; if (p->get_state()->prv == 0) { // XXX HACK - disable in supervisor mode vlen = p->get_state()->sv().vl; + subvl = p->get_state()->sv().subvl; } // need to know if register is used as float or int. // REGS_PATTERN is generated by id_regs.py (per opcode) @@ -55,12 +57,14 @@ reg_t sv_proc_t::FN(processor_t* p, insn_t s_insn, reg_t pc) reg_t dest_pred = ~0x0; bool dest_pset = false; int *dest_offs = &(p->get_state()->sv().destoffs); + int *sub_doffs = &(p->get_state()->sv().dsvoffs); bool zeroing = false; #ifdef INSN_CATEGORY_TWINPREDICATION reg_t src_preg = 0; reg_t src_pred = ~0x0; bool src_pset = false; int *src_offs = &(p->get_state()->sv().srcoffs); + int *ssv_offs = &(p->get_state()->sv().ssvoffs); bool zeroingsrc = false; #endif #ifdef INSN_TYPE_BRANCH @@ -176,7 +180,7 @@ reg_t sv_proc_t::FN(processor_t* p, insn_t s_insn, reg_t pc) { while ((src_pset = (src_pred & (1<= vlen) { break; } @@ -186,7 +190,7 @@ reg_t sv_proc_t::FN(processor_t* p, insn_t s_insn, reg_t pc) { while ((dest_pset = (dest_pred & (1<= vlen) { break; } @@ -278,9 +282,9 @@ reg_t sv_proc_t::FN(processor_t* p, insn_t s_insn, reg_t pc) break; } #ifdef INSN_CATEGORY_TWINPREDICATION - *src_offs += 1; + inc_offs(vlen, subvl, *src_offs, *ssv_offs); #endif - *dest_offs += 1; + inc_offs(vlen, subvl, *dest_offs, *sub_doffs); } #ifdef INSN_TYPE_BRANCH // ok, at the end of the loop, if the predicates are equal, -- 2.30.2