add support for non-compressed ISA

This commit is contained in:
Eyck Jentzsch 2021-09-23 21:09:36 +02:00
parent ba9339a50d
commit 174259155d
3 changed files with 107 additions and 3 deletions

View File

@ -65,6 +65,8 @@ public:
using reg_t = typename traits::reg_t; using reg_t = typename traits::reg_t;
using mem_type_e = typename traits::mem_type_e; using mem_type_e = typename traits::mem_type_e;
const bool has_compressed = traits::MISA_VAL & 0b100;
vm_impl(); vm_impl();
vm_impl(ARCH &core, unsigned core_id = 0, unsigned cluster_id = 0); vm_impl(ARCH &core, unsigned core_id = 0, unsigned cluster_id = 0);
@ -210,6 +212,7 @@ private:
<%instr.behavior.eachLine{%>${it} <%instr.behavior.eachLine{%>${it}
<%}%>} catch(...){} <%}%>} catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, ${idx}); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, ${idx});
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -324,6 +327,7 @@ typename vm_base<ARCH>::virt_addr_t vm_impl<ARCH>::execute_inst(finish_cond_e co
if (is_jump_to_self_enabled(cond) && if (is_jump_to_self_enabled(cond) &&
(insn == 0x0000006f || (insn&0xffff)==0xa001)) throw simulation_stopped(0); // 'J 0' or 'C.J 0' (insn == 0x0000006f || (insn&0xffff)==0xa001)) throw simulation_stopped(0); // 'J 0' or 'C.J 0'
auto f = decode_inst(insn); auto f = decode_inst(insn);
auto old_pc = pc.val;
pc = (this->*f)(pc, insn); pc = (this->*f)(pc, insn);
} }
} }

View File

@ -920,7 +920,16 @@ template <typename BASE> uint64_t riscv_hart_m_p<BASE>::enter_trap(uint64_t flag
if (trap_id == 0) { // exception if (trap_id == 0) { // exception
// store ret addr in xepc register // store ret addr in xepc register
csr[mepc] = static_cast<reg_t>(addr) & get_pc_mask(); // store actual address instruction of exception csr[mepc] = static_cast<reg_t>(addr) & get_pc_mask(); // store actual address instruction of exception
csr[mtval] = cause==2?((instr & 0x3)==3?instr:instr&0xffff):fault_data; switch(cause){
case 0:
csr[mtval] = instr;
break;
case 2:
csr[mtval] = (instr & 0x3)==3?instr:instr&0xffff;
break;
default:
csr[mtval] = fault_data;
}
fault_data = 0; fault_data = 0;
} else { } else {
csr[mepc] = this->reg.NEXT_PC & get_pc_mask(); // store next address if interrupt csr[mepc] = this->reg.NEXT_PC & get_pc_mask(); // store next address if interrupt

View File

@ -65,6 +65,8 @@ public:
using reg_t = typename traits::reg_t; using reg_t = typename traits::reg_t;
using mem_type_e = typename traits::mem_type_e; using mem_type_e = typename traits::mem_type_e;
const bool has_compressed = traits::MISA_VAL & 0b100;
vm_impl(); vm_impl();
vm_impl(ARCH &core, unsigned core_id = 0, unsigned cluster_id = 0); vm_impl(ARCH &core, unsigned core_id = 0, unsigned cluster_id = 0);
@ -385,6 +387,7 @@ private:
if(rd != 0) *(X+rd) = (int32_t)imm; if(rd != 0) *(X+rd) = (int32_t)imm;
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 0); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 0);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -425,6 +428,7 @@ private:
if(rd != 0) *(X+rd) = *PC + (int32_t)imm; if(rd != 0) *(X+rd) = *PC + (int32_t)imm;
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 1); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 1);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -468,6 +472,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 2); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 2);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -513,6 +518,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 3); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 3);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -554,6 +560,7 @@ private:
if(*(X+rs1) == *(X+rs2)) pc_assign(*NEXT_PC) = *PC + (int16_t)sext<13>(imm); if(*(X+rs1) == *(X+rs2)) pc_assign(*NEXT_PC) = *PC + (int16_t)sext<13>(imm);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 4); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 4);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -595,6 +602,7 @@ private:
if(*(X+rs1) != *(X+rs2)) pc_assign(*NEXT_PC) = *PC + (int16_t)sext<13>(imm); if(*(X+rs1) != *(X+rs2)) pc_assign(*NEXT_PC) = *PC + (int16_t)sext<13>(imm);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 5); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 5);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -636,6 +644,7 @@ private:
if((int32_t)*(X+rs1) < (int32_t)*(X+rs2)) pc_assign(*NEXT_PC) = *PC + (int16_t)sext<13>(imm); if((int32_t)*(X+rs1) < (int32_t)*(X+rs2)) pc_assign(*NEXT_PC) = *PC + (int16_t)sext<13>(imm);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 6); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 6);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -677,6 +686,7 @@ private:
if((int32_t)*(X+rs1) >= (int32_t)*(X+rs2)) pc_assign(*NEXT_PC) = *PC + (int16_t)sext<13>(imm); if((int32_t)*(X+rs1) >= (int32_t)*(X+rs2)) pc_assign(*NEXT_PC) = *PC + (int16_t)sext<13>(imm);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 7); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 7);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -718,6 +728,7 @@ private:
if(*(X+rs1) < *(X+rs2)) pc_assign(*NEXT_PC) = *PC + (int16_t)sext<13>(imm); if(*(X+rs1) < *(X+rs2)) pc_assign(*NEXT_PC) = *PC + (int16_t)sext<13>(imm);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 8); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 8);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -759,6 +770,7 @@ private:
if(*(X+rs1) >= *(X+rs2)) pc_assign(*NEXT_PC) = *PC + (int16_t)sext<13>(imm); if(*(X+rs1) >= *(X+rs2)) pc_assign(*NEXT_PC) = *PC + (int16_t)sext<13>(imm);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 9); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 9);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -803,6 +815,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 10); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 10);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -848,6 +861,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 11); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 11);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -893,6 +907,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 12); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 12);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -937,6 +952,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 13); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 13);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -982,6 +998,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 14); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 14);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1023,6 +1040,7 @@ private:
writeSpace1(traits::MEM, *(X+rs1) + (int16_t)sext<12>(imm), (int8_t)*(X+rs2)); writeSpace1(traits::MEM, *(X+rs1) + (int16_t)sext<12>(imm), (int8_t)*(X+rs2));
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 15); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 15);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1067,6 +1085,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 16); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 16);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1111,6 +1130,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 17); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 17);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1152,6 +1172,7 @@ private:
if(rd != 0) *(X+rd) = *(X+rs1) + (int16_t)sext<12>(imm); if(rd != 0) *(X+rd) = *(X+rs1) + (int16_t)sext<12>(imm);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 18); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 18);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1193,6 +1214,7 @@ private:
if(rd != 0) *(X+rd) = (int32_t)*(X+rs1) < (int16_t)sext<12>(imm)? 1 : 0; if(rd != 0) *(X+rd) = (int32_t)*(X+rs1) < (int16_t)sext<12>(imm)? 1 : 0;
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 19); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 19);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1234,6 +1256,7 @@ private:
if(rd != 0) *(X+rd) = (*(X+rs1) < (uint32_t)((int16_t)sext<12>(imm)))? 1 : 0; if(rd != 0) *(X+rd) = (*(X+rs1) < (uint32_t)((int16_t)sext<12>(imm)))? 1 : 0;
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 20); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 20);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1275,6 +1298,7 @@ private:
if(rd != 0) *(X+rd) = *(X+rs1) ^ (int16_t)sext<12>(imm); if(rd != 0) *(X+rd) = *(X+rs1) ^ (int16_t)sext<12>(imm);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 21); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 21);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1316,6 +1340,7 @@ private:
if(rd != 0) *(X+rd) = *(X+rs1) | (int16_t)sext<12>(imm); if(rd != 0) *(X+rd) = *(X+rs1) | (int16_t)sext<12>(imm);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 22); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 22);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1357,6 +1382,7 @@ private:
if(rd != 0) *(X+rd) = *(X+rs1) & (int16_t)sext<12>(imm); if(rd != 0) *(X+rd) = *(X+rs1) & (int16_t)sext<12>(imm);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 23); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 23);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1403,6 +1429,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 24); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 24);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1449,6 +1476,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 25); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 25);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1495,6 +1523,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 26); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 26);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1536,6 +1565,7 @@ private:
if(rd != 0) *(X+rd) = *(X+rs1) + *(X+rs2); if(rd != 0) *(X+rd) = *(X+rs1) + *(X+rs2);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 27); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 27);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1577,6 +1607,7 @@ private:
if(rd != 0) *(X+rd) = *(X+rs1) - *(X+rs2); if(rd != 0) *(X+rd) = *(X+rs1) - *(X+rs2);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 28); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 28);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1618,6 +1649,7 @@ private:
if(rd != 0) *(X+rd) = *(X+rs1) << (*(X+rs2) & (traits::XLEN - 1)); if(rd != 0) *(X+rd) = *(X+rs1) << (*(X+rs2) & (traits::XLEN - 1));
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 29); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 29);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1659,6 +1691,7 @@ private:
if(rd != 0) *(X+rd) = (int32_t)*(X+rs1) < (int32_t)*(X+rs2)? 1 : 0; if(rd != 0) *(X+rd) = (int32_t)*(X+rs1) < (int32_t)*(X+rs2)? 1 : 0;
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 30); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 30);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1700,6 +1733,7 @@ private:
if(rd != 0) *(X+rd) = (uint32_t)*(X+rs1) < (uint32_t)*(X+rs2)? 1 : 0; if(rd != 0) *(X+rd) = (uint32_t)*(X+rs1) < (uint32_t)*(X+rs2)? 1 : 0;
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 31); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 31);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1741,6 +1775,7 @@ private:
if(rd != 0) *(X+rd) = *(X+rs1) ^ *(X+rs2); if(rd != 0) *(X+rd) = *(X+rs1) ^ *(X+rs2);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 32); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 32);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1782,6 +1817,7 @@ private:
if(rd != 0) *(X+rd) = *(X+rs1) >> (*(X+rs2) & (traits::XLEN - 1)); if(rd != 0) *(X+rd) = *(X+rs1) >> (*(X+rs2) & (traits::XLEN - 1));
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 33); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 33);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1823,6 +1859,7 @@ private:
if(rd != 0) *(X+rd) = (int32_t)*(X+rs1) >> (*(X+rs2) & (traits::XLEN - 1)); if(rd != 0) *(X+rd) = (int32_t)*(X+rs1) >> (*(X+rs2) & (traits::XLEN - 1));
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 34); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 34);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1864,6 +1901,7 @@ private:
if(rd != 0) *(X+rd) = *(X+rs1) | *(X+rs2); if(rd != 0) *(X+rd) = *(X+rs1) | *(X+rs2);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 35); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 35);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1905,6 +1943,7 @@ private:
if(rd != 0) *(X+rd) = *(X+rs1) & *(X+rs2); if(rd != 0) *(X+rd) = *(X+rs1) & *(X+rs2);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 36); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 36);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1947,6 +1986,7 @@ private:
writeSpace1(traits::FENCE, traits::fence, pred << 4 | succ); writeSpace1(traits::FENCE, traits::fence, pred << 4 | succ);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 37); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 37);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -1981,6 +2021,7 @@ private:
raise(0, 11); raise(0, 11);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 38); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 38);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2015,6 +2056,7 @@ private:
raise(0, 3); raise(0, 3);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 39); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 39);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2049,6 +2091,7 @@ private:
leave(0); leave(0);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 40); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 40);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2083,6 +2126,7 @@ private:
leave(1); leave(1);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 41); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 41);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2117,6 +2161,7 @@ private:
leave(3); leave(3);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 42); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 42);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2151,6 +2196,7 @@ private:
wait(1); wait(1);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 43); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 43);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2202,6 +2248,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 44); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 44);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2248,6 +2295,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 45); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 45);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2294,6 +2342,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 46); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 46);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2339,6 +2388,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 47); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 47);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2384,6 +2434,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 48); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 48);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2429,6 +2480,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 49); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 49);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2475,6 +2527,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 50); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 50);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2521,6 +2574,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 51); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 51);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2567,6 +2621,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 52); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 52);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2613,6 +2668,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 53); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 53);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2663,6 +2719,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 54); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 54);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2709,6 +2766,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 55); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 55);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2759,6 +2817,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 56); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 56);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2805,6 +2864,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 57); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 57);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2846,6 +2906,7 @@ private:
else raise(0, 2); else raise(0, 2);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 58); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 58);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2890,6 +2951,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 59); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 59);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2934,6 +2996,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 60); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 60);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -2974,6 +3037,7 @@ private:
*(X+rs1) = *(X+rs1) + (int8_t)sext<6>(imm); *(X+rs1) = *(X+rs1) + (int8_t)sext<6>(imm);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 61); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 61);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3010,6 +3074,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 62); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 62);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3052,6 +3117,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 63); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 63);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3094,6 +3160,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 64); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 64);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3137,6 +3204,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 65); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 65);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3177,6 +3245,7 @@ private:
else raise(0, 2); else raise(0, 2);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 66); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 66);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3212,6 +3281,7 @@ private:
raise(0, 2); raise(0, 2);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 67); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 67);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3255,6 +3325,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 68); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 68);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3302,6 +3373,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 69); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 69);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3345,6 +3417,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 70); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 70);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3388,6 +3461,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 71); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 71);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3431,6 +3505,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 72); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 72);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3474,6 +3549,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 73); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 73);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3517,6 +3593,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 74); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 74);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3555,6 +3632,7 @@ private:
pc_assign(*NEXT_PC) = *PC + (int16_t)sext<12>(imm); pc_assign(*NEXT_PC) = *PC + (int16_t)sext<12>(imm);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 75); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 75);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3595,6 +3673,7 @@ private:
if(*(X+(rs1 + 8)) == 0) pc_assign(*NEXT_PC) = *PC + (int16_t)sext<9>(imm); if(*(X+(rs1 + 8)) == 0) pc_assign(*NEXT_PC) = *PC + (int16_t)sext<9>(imm);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 76); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 76);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3635,6 +3714,7 @@ private:
if(*(X+(rs1 + 8)) != 0) pc_assign(*NEXT_PC) = *PC + (int16_t)sext<9>(imm); if(*(X+(rs1 + 8)) != 0) pc_assign(*NEXT_PC) = *PC + (int16_t)sext<9>(imm);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 77); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 77);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3675,6 +3755,7 @@ private:
if(nzuimm) *(X+rs1) = *(X+rs1) << nzuimm; if(nzuimm) *(X+rs1) = *(X+rs1) << nzuimm;
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 78); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 78);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3719,6 +3800,7 @@ private:
else raise(0, 2); else raise(0, 2);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 79); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 79);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3759,6 +3841,7 @@ private:
if(rd != 0) *(X+rd) = *(X+rs2); if(rd != 0) *(X+rd) = *(X+rs2);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 80); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 80);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3799,6 +3882,7 @@ private:
else raise(0, 2); else raise(0, 2);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 81); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 81);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3833,6 +3917,7 @@ private:
raise(0, 2); raise(0, 2);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 82); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 82);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3873,6 +3958,7 @@ private:
if(rd != 0) *(X+rd) = *(X+rd) + *(X+rs2); if(rd != 0) *(X+rd) = *(X+rd) + *(X+rs2);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 83); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 83);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3916,6 +4002,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 84); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 84);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3950,6 +4037,7 @@ private:
raise(0, 3); raise(0, 3);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 85); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 85);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -3993,6 +4081,7 @@ private:
} }
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 86); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 86);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -4027,6 +4116,7 @@ private:
raise(0, 2); raise(0, 2);
} catch(...){} } catch(...){}
// post execution stuff // post execution stuff
if(!has_compressed && (*NEXT_PC&0x3)!=0) raise(0, 0);
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 87); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, 87);
// trap check // trap check
if(*trap_state!=0){ if(*trap_state!=0){
@ -4141,6 +4231,7 @@ typename vm_base<ARCH>::virt_addr_t vm_impl<ARCH>::execute_inst(finish_cond_e co
if (is_jump_to_self_enabled(cond) && if (is_jump_to_self_enabled(cond) &&
(insn == 0x0000006f || (insn&0xffff)==0xa001)) throw simulation_stopped(0); // 'J 0' or 'C.J 0' (insn == 0x0000006f || (insn&0xffff)==0xa001)) throw simulation_stopped(0); // 'J 0' or 'C.J 0'
auto f = decode_inst(insn); auto f = decode_inst(insn);
auto old_pc = pc.val;
pc = (this->*f)(pc, insn); pc = (this->*f)(pc, insn);
} }
} }