Compare commits

...

2 Commits

5 changed files with 2380 additions and 2338 deletions

View File

@ -15,59 +15,51 @@ RV32I:
- JAL:
encoding: 0b00000000000000000000000001101111
mask: 0b00000000000000000000000001111111
attributes: [[name:no_cont]]
size: 32
branch: true
delay: 1
- JALR:
encoding: 0b00000000000000000000000001100111
mask: 0b00000000000000000111000001111111
attributes: [[name:no_cont]]
size: 32
branch: true
delay: 1
- BEQ:
encoding: 0b00000000000000000000000001100011
mask: 0b00000000000000000111000001111111
attributes: [[name:no_cont], [name:cond]]
size: 32
branch: true
delay: [1,1]
delay: 1
- BNE:
encoding: 0b00000000000000000001000001100011
mask: 0b00000000000000000111000001111111
attributes: [[name:no_cont], [name:cond]]
size: 32
branch: true
delay: [1,1]
delay: 1
- BLT:
encoding: 0b00000000000000000100000001100011
mask: 0b00000000000000000111000001111111
attributes: [[name:no_cont], [name:cond]]
size: 32
branch: true
delay: [1,1]
delay: 1
- BGE:
encoding: 0b00000000000000000101000001100011
mask: 0b00000000000000000111000001111111
attributes: [[name:no_cont], [name:cond]]
size: 32
branch: true
delay: [1,1]
delay: 1
- BLTU:
encoding: 0b00000000000000000110000001100011
mask: 0b00000000000000000111000001111111
attributes: [[name:no_cont], [name:cond]]
size: 32
branch: true
delay: [1,1]
delay: 1
- BGEU:
encoding: 0b00000000000000000111000001100011
mask: 0b00000000000000000111000001111111
attributes: [[name:no_cont], [name:cond]]
size: 32
branch: true
delay: [1,1]
delay: 1
- LB:
encoding: 0b00000000000000000000000000000011
mask: 0b00000000000000000111000001111111
@ -239,14 +231,12 @@ RV32I:
- ECALL:
encoding: 0b00000000000000000000000001110011
mask: 0b11111111111111111111111111111111
attributes: [[name:no_cont]]
size: 32
branch: false
delay: 1
- EBREAK:
encoding: 0b00000000000100000000000001110011
mask: 0b11111111111111111111111111111111
attributes: [[name:no_cont]]
size: 32
branch: false
delay: 1
@ -391,7 +381,6 @@ RV32IC:
- CJAL:
encoding: 0b0010000000000001
mask: 0b1110000000000011
attributes: [[name:no_cont]]
size: 16
branch: true
delay: 1
@ -458,24 +447,21 @@ RV32IC:
- CJ:
encoding: 0b1010000000000001
mask: 0b1110000000000011
attributes: [[name:no_cont]]
size: 16
branch: true
delay: 1
- CBEQZ:
encoding: 0b1100000000000001
mask: 0b1110000000000011
attributes: [[name:no_cont], [name:cond]]
size: 16
branch: true
delay: [1,1]
delay: 1
- CBNEZ:
encoding: 0b1110000000000001
mask: 0b1110000000000011
attributes: [[name:no_cont], [name:cond]]
size: 16
branch: true
delay: [1,1]
delay: 1
- CSLLI:
encoding: 0b0000000000000010
mask: 0b1111000000000011
@ -497,7 +483,6 @@ RV32IC:
- CJR:
encoding: 0b1000000000000010
mask: 0b1111000001111111
attributes: [[name:no_cont]]
size: 16
branch: true
delay: 1
@ -510,14 +495,12 @@ RV32IC:
- CJALR:
encoding: 0b1001000000000010
mask: 0b1111000001111111
attributes: [[name:no_cont]]
size: 16
branch: true
delay: 1
- CEBREAK:
encoding: 0b1001000000000010
mask: 0b1111111111111111
attributes: [[name:no_cont]]
size: 16
branch: false
delay: 1
@ -530,7 +513,6 @@ RV32IC:
- DII:
encoding: 0b0000000000000000
mask: 0b1111111111111111
attributes: [[name:no_cont]]
size: 16
branch: false
delay: 1

View File

@ -43,6 +43,7 @@ def nativeTypeSize(int size){
#include <sstream>
#include <boost/coroutine2/all.hpp>
#include <functional>
#include <exception>
#ifndef FMT_HEADER_ONLY
#define FMT_HEADER_ONLY
@ -59,6 +60,10 @@ using namespace iss::arch;
using namespace iss::debugger;
using namespace std::placeholders;
struct memory_access_exception : public std::exception{
memory_access_exception(){}
};
template <typename ARCH> class vm_impl : public iss::interp::vm_base<ARCH> {
public:
using traits = arch::traits<ARCH>;
@ -91,30 +96,9 @@ protected:
inline const char *name(size_t index){return index<traits::reg_aliases.size()?traits::reg_aliases[index]:"illegal";}
typename arch::traits<ARCH>::opcode_e decode_inst_id(code_word_t instr);
virt_addr_t execute_inst(finish_cond_e cond, virt_addr_t start, uint64_t icount_limit) override;
// some compile time constants
// enum { MASK16 = 0b1111110001100011, MASK32 = 0b11111111111100000111000001111111 };
enum { MASK16 = 0b1111111111111111, MASK32 = 0b11111111111100000111000001111111 };
enum { EXTR_MASK16 = MASK16 >> 2, EXTR_MASK32 = MASK32 >> 2 };
enum {
LUT_SIZE = 1 << util::bit_count(static_cast<uint32_t>(EXTR_MASK32)),
LUT_SIZE_C = 1 << util::bit_count(static_cast<uint32_t>(EXTR_MASK16))
};
std::array<compile_func, LUT_SIZE> lut;
std::array<compile_func, LUT_SIZE_C> lut_00, lut_01, lut_10;
std::array<compile_func, LUT_SIZE> lut_11;
struct instruction_pattern {
uint32_t value;
uint32_t mask;
typename arch::traits<ARCH>::opcode_e id;
};
std::array<std::vector<instruction_pattern>, 4> qlut;
inline void raise(uint16_t trap_id, uint16_t cause){
auto trap_val = 0x80ULL << 24 | (cause << 16) | trap_id;
@ -314,28 +298,30 @@ typename vm_base<ARCH>::virt_addr_t vm_impl<ARCH>::execute_inst(finish_cond_e co
// pre execution stuff
this->core.reg.last_branch = 0;
if(this->sync_exec && PRE_SYNC) this->do_sync(PRE_SYNC, static_cast<unsigned>(inst_id));
switch(inst_id){<%instructions.eachWithIndex{instr, idx -> %>
case arch::traits<ARCH>::opcode_e::${instr.name}: {
<%instr.fields.eachLine{%>${it}
<%}%>if(this->disass_enabled){
/* generate console output when executing the command */<%instr.disass.eachLine{%>
try{
switch(inst_id){<%instructions.eachWithIndex{instr, idx -> %>
case arch::traits<ARCH>::opcode_e::${instr.name}: {
<%instr.fields.eachLine{%>${it}
<%}%>if(this->disass_enabled){
/* generate console output when executing the command */<%instr.disass.eachLine{%>
${it}<%}%>
}
// used registers<%instr.usedVariables.each{ k,v->
if(v.isArray) {%>
auto* ${k} = reinterpret_cast<uint${nativeTypeSize(v.type.size)}_t*>(this->regs_base_ptr+arch::traits<ARCH>::reg_byte_offsets[arch::traits<ARCH>::${k}0]);<% }else{ %>
auto* ${k} = reinterpret_cast<uint${nativeTypeSize(v.type.size)}_t*>(this->regs_base_ptr+arch::traits<ARCH>::reg_byte_offsets[arch::traits<ARCH>::${k}]);
<%}}%>// calculate next pc value
*NEXT_PC = *PC + ${instr.length/8};
// execute instruction<%instr.behavior.eachLine{%>
${it}<%}%>
break;
}// @suppress("No break at end of case")<%}%>
default: {
*NEXT_PC = *PC + ((instr & 3) == 3 ? 4 : 2);
raise(0, 2);
}
// used registers<%instr.usedVariables.each{ k,v->
if(v.isArray) {%>
auto* ${k} = reinterpret_cast<uint${nativeTypeSize(v.type.size)}_t*>(this->regs_base_ptr+arch::traits<ARCH>::reg_byte_offsets[arch::traits<ARCH>::${k}0]);<% }else{ %>
auto* ${k} = reinterpret_cast<uint${nativeTypeSize(v.type.size)}_t*>(this->regs_base_ptr+arch::traits<ARCH>::reg_byte_offsets[arch::traits<ARCH>::${k}]);
<%}}%>// calculate next pc value
*NEXT_PC = *PC + ${instr.length/8};
// execute instruction<%instr.behavior.eachLine{%>
${it}<%}%>
TRAP_${instr.name}:break;
}// @suppress("No break at end of case")<%}%>
default: {
*NEXT_PC = *PC + ((instr & 3) == 3 ? 4 : 2);
raise(0, 2);
}
}
}
}catch(memory_access_exception& e){}
// post execution stuff
process_spawn_blocks();
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, static_cast<unsigned>(inst_id));

View File

@ -167,8 +167,9 @@ private:
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
pc=pc+ ${instr.length/8};
gen_set_pc(tu, pc, traits::NEXT_PC);
tu.open_scope();<%instr.behavior.eachLine{%>
${it}<%}%>
tu.open_scope();
<%instr.behavior.eachLine{%>${it}
<%}%>
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,${idx});
gen_trap_check(tu);

File diff suppressed because it is too large Load Diff

View File

@ -353,6 +353,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,0);
gen_trap_check(tu);
@ -385,6 +386,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,1);
gen_trap_check(tu);
@ -424,6 +426,7 @@ private:
}
}
auto returnValue = std::make_tuple(BRANCH);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,2);
gen_trap_check(tu);
@ -465,6 +468,7 @@ private:
tu.close_scope();
}
auto returnValue = std::make_tuple(BRANCH);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,3);
gen_trap_check(tu);
@ -504,6 +508,7 @@ private:
tu.close_scope();
}
auto returnValue = std::make_tuple(BRANCH);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,4);
gen_trap_check(tu);
@ -543,6 +548,7 @@ private:
tu.close_scope();
}
auto returnValue = std::make_tuple(BRANCH);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,5);
gen_trap_check(tu);
@ -582,6 +588,7 @@ private:
tu.close_scope();
}
auto returnValue = std::make_tuple(BRANCH);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,6);
gen_trap_check(tu);
@ -621,6 +628,7 @@ private:
tu.close_scope();
}
auto returnValue = std::make_tuple(BRANCH);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,7);
gen_trap_check(tu);
@ -660,6 +668,7 @@ private:
tu.close_scope();
}
auto returnValue = std::make_tuple(BRANCH);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,8);
gen_trap_check(tu);
@ -699,6 +708,7 @@ private:
tu.close_scope();
}
auto returnValue = std::make_tuple(BRANCH);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,9);
gen_trap_check(tu);
@ -734,6 +744,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,10);
gen_trap_check(tu);
@ -769,6 +780,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,11);
gen_trap_check(tu);
@ -804,6 +816,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,12);
gen_trap_check(tu);
@ -839,6 +852,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,13);
gen_trap_check(tu);
@ -874,6 +888,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,14);
gen_trap_check(tu);
@ -906,6 +921,7 @@ private:
tu.write_mem(traits::MEM, store_address, tu.ext(tu.load(rs2+ traits::X0, 0),8,true));
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,15);
gen_trap_check(tu);
@ -938,6 +954,7 @@ private:
tu.write_mem(traits::MEM, store_address, tu.ext(tu.load(rs2+ traits::X0, 0),16,true));
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,16);
gen_trap_check(tu);
@ -970,6 +987,7 @@ private:
tu.write_mem(traits::MEM, store_address, tu.ext(tu.load(rs2+ traits::X0, 0),32,true));
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,17);
gen_trap_check(tu);
@ -1003,6 +1021,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,18);
gen_trap_check(tu);
@ -1036,6 +1055,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,19);
gen_trap_check(tu);
@ -1069,6 +1089,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,20);
gen_trap_check(tu);
@ -1102,6 +1123,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,21);
gen_trap_check(tu);
@ -1135,6 +1157,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,22);
gen_trap_check(tu);
@ -1168,6 +1191,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,23);
gen_trap_check(tu);
@ -1201,6 +1225,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,24);
gen_trap_check(tu);
@ -1234,6 +1259,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,25);
gen_trap_check(tu);
@ -1267,6 +1293,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,26);
gen_trap_check(tu);
@ -1300,6 +1327,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,27);
gen_trap_check(tu);
@ -1333,6 +1361,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,28);
gen_trap_check(tu);
@ -1366,6 +1395,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,29);
gen_trap_check(tu);
@ -1399,6 +1429,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,30);
gen_trap_check(tu);
@ -1432,6 +1463,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,31);
gen_trap_check(tu);
@ -1465,6 +1497,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,32);
gen_trap_check(tu);
@ -1498,6 +1531,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,33);
gen_trap_check(tu);
@ -1531,6 +1565,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,34);
gen_trap_check(tu);
@ -1564,6 +1599,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,35);
gen_trap_check(tu);
@ -1597,6 +1633,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,36);
gen_trap_check(tu);
@ -1625,6 +1662,7 @@ private:
tu.open_scope();
tu.write_mem(traits::FENCE, static_cast<uint32_t>(traits:: fence), tu.constant((uint8_t)pred<< 4|succ,8));
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,37);
gen_trap_check(tu);
@ -1645,6 +1683,7 @@ private:
tu.open_scope();
this->gen_raise_trap(tu, 0, 11);
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,38);
gen_trap_check(tu);
@ -1665,6 +1704,7 @@ private:
tu.open_scope();
this->gen_raise_trap(tu, 0, 3);
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,39);
gen_trap_check(tu);
@ -1685,6 +1725,7 @@ private:
tu.open_scope();
this->gen_leave_trap(tu, 3);
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,40);
gen_trap_check(tu);
@ -1705,6 +1746,7 @@ private:
tu.open_scope();
this->gen_wait(tu, 1);
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,41);
gen_trap_check(tu);
@ -1743,6 +1785,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,42);
gen_trap_check(tu);
@ -1781,6 +1824,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,43);
gen_trap_check(tu);
@ -1819,6 +1863,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,44);
gen_trap_check(tu);
@ -1854,6 +1899,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,45);
gen_trap_check(tu);
@ -1891,6 +1937,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,46);
gen_trap_check(tu);
@ -1928,6 +1975,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,47);
gen_trap_check(tu);
@ -1954,6 +2002,7 @@ private:
tu.open_scope();
tu.write_mem(traits::FENCE, static_cast<uint32_t>(traits:: fencei), tu.constant(imm,16));
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,48);
gen_trap_check(tu);
@ -1988,6 +2037,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,49);
gen_trap_check(tu);
@ -2022,6 +2072,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,50);
gen_trap_check(tu);
@ -2056,6 +2107,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,51);
gen_trap_check(tu);
@ -2090,6 +2142,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,52);
gen_trap_check(tu);
@ -2133,6 +2186,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,53);
gen_trap_check(tu);
@ -2172,6 +2226,7 @@ private:
tu.close_scope();
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,54);
gen_trap_check(tu);
@ -2218,6 +2273,7 @@ private:
tu.close_scope();
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,55);
gen_trap_check(tu);
@ -2257,6 +2313,7 @@ private:
tu.close_scope();
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,56);
gen_trap_check(tu);
@ -2287,6 +2344,7 @@ private:
this->gen_raise_trap(tu, 0, 2);
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,57);
gen_trap_check(tu);
@ -2314,6 +2372,7 @@ private:
auto offs = tu.assignment(tu.ext((tu.add(tu.load(rs1+ 8+ traits::X0, 0),tu.constant(uimm,8))),32,true),32);
tu.store(rd+ 8 + traits::X0,tu.ext(tu.ext(tu.read_mem(traits::MEM, offs, 32),32,false),32,true));
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,58);
gen_trap_check(tu);
@ -2341,6 +2400,7 @@ private:
auto offs = tu.assignment(tu.ext((tu.add(tu.load(rs1+ 8+ traits::X0, 0),tu.constant(uimm,8))),32,true),32);
tu.write_mem(traits::MEM, offs, tu.ext(tu.load(rs2+ 8+ traits::X0, 0),32,true));
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,59);
gen_trap_check(tu);
@ -2373,6 +2433,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,60);
gen_trap_check(tu);
@ -2393,6 +2454,7 @@ private:
gen_set_pc(tu, pc, traits::NEXT_PC);
tu.open_scope();
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,61);
gen_trap_check(tu);
@ -2420,6 +2482,7 @@ private:
tu.store(traits::NEXT_PC, PC_val_v);
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
auto returnValue = std::make_tuple(BRANCH);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,62);
gen_trap_check(tu);
@ -2452,6 +2515,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,63);
gen_trap_check(tu);
@ -2482,6 +2546,7 @@ private:
tu.store(rd + traits::X0,tu.constant((uint32_t)((int32_t)sext<18>(imm)),32));
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,64);
gen_trap_check(tu);
@ -2511,6 +2576,7 @@ private:
this->gen_raise_trap(tu, 0, 2);
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,65);
gen_trap_check(tu);
@ -2532,6 +2598,7 @@ private:
tu.open_scope();
this->gen_raise_trap(tu, 0, 2);
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,66);
gen_trap_check(tu);
@ -2557,6 +2624,7 @@ private:
tu.open_scope();
tu.store(rs1+ 8 + traits::X0,tu.lshr(tu.load(rs1+ 8+ traits::X0, 0),tu.constant(shamt,8)));
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,67);
gen_trap_check(tu);
@ -2587,6 +2655,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,68);
gen_trap_check(tu);
@ -2612,6 +2681,7 @@ private:
tu.open_scope();
tu.store(rs1+ 8 + traits::X0,tu.ext((tu.bitwise_and(tu.load(rs1+ 8+ traits::X0, 0),tu.constant((int8_t)sext<6>(imm),8))),32,true));
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,69);
gen_trap_check(tu);
@ -2637,6 +2707,7 @@ private:
tu.open_scope();
tu.store(rd+ 8 + traits::X0,tu.ext((tu.sub(tu.load(rd+ 8+ traits::X0, 0),tu.load(rs2+ 8+ traits::X0, 0))),32,true));
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,70);
gen_trap_check(tu);
@ -2662,6 +2733,7 @@ private:
tu.open_scope();
tu.store(rd+ 8 + traits::X0,tu.bitwise_xor(tu.load(rd+ 8+ traits::X0, 0),tu.load(rs2+ 8+ traits::X0, 0)));
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,71);
gen_trap_check(tu);
@ -2687,6 +2759,7 @@ private:
tu.open_scope();
tu.store(rd+ 8 + traits::X0,tu.bitwise_or(tu.load(rd+ 8+ traits::X0, 0),tu.load(rs2+ 8+ traits::X0, 0)));
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,72);
gen_trap_check(tu);
@ -2712,6 +2785,7 @@ private:
tu.open_scope();
tu.store(rd+ 8 + traits::X0,tu.bitwise_and(tu.load(rd+ 8+ traits::X0, 0),tu.load(rs2+ 8+ traits::X0, 0)));
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,73);
gen_trap_check(tu);
@ -2738,6 +2812,7 @@ private:
tu.store(traits::NEXT_PC, PC_val_v);
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
auto returnValue = std::make_tuple(BRANCH);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,74);
gen_trap_check(tu);
@ -2767,6 +2842,7 @@ private:
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
tu.close_scope();
auto returnValue = std::make_tuple(BRANCH);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,75);
gen_trap_check(tu);
@ -2796,6 +2872,7 @@ private:
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
tu.close_scope();
auto returnValue = std::make_tuple(BRANCH);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,76);
gen_trap_check(tu);
@ -2828,6 +2905,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,77);
gen_trap_check(tu);
@ -2859,6 +2937,7 @@ private:
tu.store(rd + traits::X0,tu.ext(tu.ext(tu.read_mem(traits::MEM, offs, 32),32,false),32,true));
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,78);
gen_trap_check(tu);
@ -2891,6 +2970,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,79);
gen_trap_check(tu);
@ -2922,6 +3002,7 @@ private:
this->gen_raise_trap(tu, 0, 2);
}
auto returnValue = std::make_tuple(BRANCH);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,80);
gen_trap_check(tu);
@ -2942,6 +3023,7 @@ private:
tu.open_scope();
this->gen_raise_trap(tu, 0, 2);
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,81);
gen_trap_check(tu);
@ -2974,6 +3056,7 @@ private:
}
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,82);
gen_trap_check(tu);
@ -3007,6 +3090,7 @@ private:
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
}
auto returnValue = std::make_tuple(BRANCH);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,83);
gen_trap_check(tu);
@ -3027,6 +3111,7 @@ private:
tu.open_scope();
this->gen_raise_trap(tu, 0, 3);
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,84);
gen_trap_check(tu);
@ -3058,6 +3143,7 @@ private:
tu.write_mem(traits::MEM, offs, tu.ext(tu.load(rs2+ traits::X0, 0),32,true));
}
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,85);
gen_trap_check(tu);
@ -3078,6 +3164,7 @@ private:
tu.open_scope();
this->gen_raise_trap(tu, 0, 2);
auto returnValue = std::make_tuple(CONT);
tu.close_scope();
vm_base<ARCH>::gen_sync(tu, POST_SYNC,86);
gen_trap_check(tu);