|
|
|
@ -350,8 +350,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.constant((uint32_t)((int32_t)imm),32));
|
|
|
|
|
tu.store(rd + traits::X0,tu.constant((uint32_t)((int32_t)imm),32));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -385,8 +384,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.constant((uint32_t)(PC+(int32_t)imm),32));
|
|
|
|
|
tu.store(rd + traits::X0,tu.constant((uint32_t)(PC+(int32_t)imm),32));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -423,8 +421,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.constant((uint32_t)(PC+ 4),32));
|
|
|
|
|
tu.store(rd + traits::X0,tu.constant((uint32_t)(PC+ 4),32));
|
|
|
|
|
}
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", (uint32_t)(PC+(int32_t)sext<21>(imm)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
@ -463,19 +460,12 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto addr_mask = tu.assignment(tu.constant((uint32_t)- 2,32),32);
|
|
|
|
|
auto new_pc = tu.assignment(tu.ext((tu.bitwise_and(
|
|
|
|
|
(tu.add(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant((int16_t)sext<12>(imm),16))),
|
|
|
|
|
addr_mask)),32,false),32);
|
|
|
|
|
tu.open_if(tu.urem(
|
|
|
|
|
new_pc,
|
|
|
|
|
tu.constant(static_cast<uint32_t>(traits:: INSTR_ALIGNMENT),32)));
|
|
|
|
|
auto new_pc = tu.assignment(tu.ext((tu.bitwise_and((tu.add(tu.load(rs1+ traits::X0, 0),tu.constant((int16_t)sext<12>(imm),16))),addr_mask)),32,false),32);
|
|
|
|
|
tu.open_if(tu.srem(new_pc,tu.constant(static_cast<uint32_t>(traits:: INSTR_ALIGNMENT),32)));
|
|
|
|
|
this->gen_raise_trap(tu, 0, 0);
|
|
|
|
|
tu.open_else();
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.constant((uint32_t)(PC+ 4),32));
|
|
|
|
|
tu.store(rd + traits::X0,tu.constant((uint32_t)(PC+ 4),32));
|
|
|
|
|
}
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", new_pc,32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
@ -513,9 +503,7 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_EQ,
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.load(rs2+ traits::X0, 0)));
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_EQ,tu.load(rs1+ traits::X0, 0),tu.load(rs2+ traits::X0, 0)));
|
|
|
|
|
if(imm%static_cast<uint32_t>(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
@ -556,9 +544,7 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_NE,
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.load(rs2+ traits::X0, 0)));
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_NE,tu.load(rs1+ traits::X0, 0),tu.load(rs2+ traits::X0, 0)));
|
|
|
|
|
if(imm%static_cast<uint32_t>(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
@ -599,9 +585,7 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_SLT,
|
|
|
|
|
tu.ext(tu.load(rs1+ traits::X0, 0),32,true),
|
|
|
|
|
tu.ext(tu.load(rs2+ traits::X0, 0),32,true)));
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_SLT,tu.ext(tu.load(rs1+ traits::X0, 0),32,true),tu.ext(tu.load(rs2+ traits::X0, 0),32,true)));
|
|
|
|
|
if(imm%static_cast<uint32_t>(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
@ -642,9 +626,7 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_SGE,
|
|
|
|
|
tu.ext(tu.load(rs1+ traits::X0, 0),32,true),
|
|
|
|
|
tu.ext(tu.load(rs2+ traits::X0, 0),32,true)));
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_SGE,tu.ext(tu.load(rs1+ traits::X0, 0),32,true),tu.ext(tu.load(rs2+ traits::X0, 0),32,true)));
|
|
|
|
|
if(imm%static_cast<uint32_t>(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
@ -685,9 +667,7 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_ULT,
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.load(rs2+ traits::X0, 0)));
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_SLT,tu.load(rs1+ traits::X0, 0),tu.load(rs2+ traits::X0, 0)));
|
|
|
|
|
if(imm%static_cast<uint32_t>(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
@ -728,9 +708,7 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_UGE,
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.load(rs2+ traits::X0, 0)));
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_SGE,tu.load(rs1+ traits::X0, 0),tu.load(rs2+ traits::X0, 0)));
|
|
|
|
|
if(imm%static_cast<uint32_t>(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
@ -771,13 +749,10 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto load_address = tu.assignment(tu.ext((tu.add(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant((int16_t)sext<12>(imm),16))),32,false),32);
|
|
|
|
|
auto load_address = tu.assignment(tu.ext((tu.add(tu.load(rs1+ traits::X0, 0),tu.constant((int16_t)sext<12>(imm),16))),32,false),32);
|
|
|
|
|
auto res = tu.assignment(tu.ext(tu.read_mem(traits::MEM, load_address, 8),8,true),8);
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext(res,32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext(res,32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -811,13 +786,10 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto load_address = tu.assignment(tu.ext((tu.add(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant((int16_t)sext<12>(imm),16))),32,false),32);
|
|
|
|
|
auto load_address = tu.assignment(tu.ext((tu.add(tu.load(rs1+ traits::X0, 0),tu.constant((int16_t)sext<12>(imm),16))),32,false),32);
|
|
|
|
|
auto res = tu.assignment(tu.ext(tu.read_mem(traits::MEM, load_address, 16),16,true),16);
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext(res,32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext(res,32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -851,13 +823,10 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto load_address = tu.assignment(tu.ext((tu.add(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant((int16_t)sext<12>(imm),16))),32,false),32);
|
|
|
|
|
auto load_address = tu.assignment(tu.ext((tu.add(tu.load(rs1+ traits::X0, 0),tu.constant((int16_t)sext<12>(imm),16))),32,false),32);
|
|
|
|
|
auto res = tu.assignment(tu.ext(tu.read_mem(traits::MEM, load_address, 32),32,true),32);
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext(res,32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext(res,32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -891,13 +860,10 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto load_address = tu.assignment(tu.ext((tu.add(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant((int16_t)sext<12>(imm),16))),32,false),32);
|
|
|
|
|
auto load_address = tu.assignment(tu.ext((tu.add(tu.load(rs1+ traits::X0, 0),tu.constant((int16_t)sext<12>(imm),16))),32,false),32);
|
|
|
|
|
auto res = tu.assignment(tu.read_mem(traits::MEM, load_address, 8),8);
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext(res,32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext(res,32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -931,13 +897,10 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto load_address = tu.assignment(tu.ext((tu.add(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant((int16_t)sext<12>(imm),16))),32,false),32);
|
|
|
|
|
auto load_address = tu.assignment(tu.ext((tu.add(tu.load(rs1+ traits::X0, 0),tu.constant((int16_t)sext<12>(imm),16))),32,false),32);
|
|
|
|
|
auto res = tu.assignment(tu.read_mem(traits::MEM, load_address, 16),16);
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext(res,32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext(res,32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -971,9 +934,7 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto store_address = tu.assignment(tu.ext((tu.add(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant((int16_t)sext<12>(imm),16))),32,false),32);
|
|
|
|
|
auto store_address = tu.assignment(tu.ext((tu.add(tu.load(rs1+ traits::X0, 0),tu.constant((int16_t)sext<12>(imm),16))),32,false),32);
|
|
|
|
|
tu.write_mem(traits::MEM, store_address, tu.ext(tu.load(rs2+ traits::X0, 0),8,false));
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1007,9 +968,7 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto store_address = tu.assignment(tu.ext((tu.add(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant((int16_t)sext<12>(imm),16))),32,false),32);
|
|
|
|
|
auto store_address = tu.assignment(tu.ext((tu.add(tu.load(rs1+ traits::X0, 0),tu.constant((int16_t)sext<12>(imm),16))),32,false),32);
|
|
|
|
|
tu.write_mem(traits::MEM, store_address, tu.ext(tu.load(rs2+ traits::X0, 0),16,false));
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1043,9 +1002,7 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto store_address = tu.assignment(tu.ext((tu.add(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant((int16_t)sext<12>(imm),16))),32,false),32);
|
|
|
|
|
auto store_address = tu.assignment(tu.ext((tu.add(tu.load(rs1+ traits::X0, 0),tu.constant((int16_t)sext<12>(imm),16))),32,false),32);
|
|
|
|
|
tu.write_mem(traits::MEM, store_address, tu.ext(tu.load(rs2+ traits::X0, 0),32,false));
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1080,10 +1037,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext((tu.add(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant((int16_t)sext<12>(imm),16))),32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext((tu.add(tu.load(rs1+ traits::X0, 0),tu.constant((int16_t)sext<12>(imm),16))),32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1118,10 +1072,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.conditionalAssignment((tu.icmp(ICmpInst::ICMP_SLT,
|
|
|
|
|
tu.ext(tu.load(rs1+ traits::X0, 0),32,true),
|
|
|
|
|
tu.constant((int16_t)sext<12>(imm),16))), tu.constant( 1,8),tu.constant( 0,8)));
|
|
|
|
|
tu.store(rd + traits::X0,tu.conditionalAssignment((tu.icmp(ICmpInst::ICMP_SLT,tu.ext(tu.load(rs1+ traits::X0, 0),32,false),tu.constant((int16_t)sext<12>(imm),16))), tu.constant( 1,8),tu.constant( 0,8)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1156,10 +1107,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.conditionalAssignment((tu.icmp(ICmpInst::ICMP_ULT,
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant((uint32_t)((int16_t)sext<12>(imm)),32))), tu.constant( 1,8),tu.constant( 0,8)));
|
|
|
|
|
tu.store(rd + traits::X0,tu.conditionalAssignment((tu.icmp(ICmpInst::ICMP_SLT,tu.load(rs1+ traits::X0, 0),tu.constant((uint32_t)((int16_t)sext<12>(imm)),32))), tu.constant( 1,8),tu.constant( 0,8)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1194,10 +1142,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.bitwise_xor(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant((uint32_t)((int16_t)sext<12>(imm)),32)));
|
|
|
|
|
tu.store(rd + traits::X0,tu.bitwise_xor(tu.load(rs1+ traits::X0, 0),tu.constant((uint32_t)((int16_t)sext<12>(imm)),32)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1232,10 +1177,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.bitwise_or(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant((uint32_t)((int16_t)sext<12>(imm)),32)));
|
|
|
|
|
tu.store(rd + traits::X0,tu.bitwise_or(tu.load(rs1+ traits::X0, 0),tu.constant((uint32_t)((int16_t)sext<12>(imm)),32)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1270,10 +1212,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.bitwise_and(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant((uint32_t)((int16_t)sext<12>(imm)),32)));
|
|
|
|
|
tu.store(rd + traits::X0,tu.bitwise_and(tu.load(rs1+ traits::X0, 0),tu.constant((uint32_t)((int16_t)sext<12>(imm)),32)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1308,10 +1247,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.shl(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant(shamt,8)));
|
|
|
|
|
tu.store(rd + traits::X0,tu.shl(tu.load(rs1+ traits::X0, 0),tu.constant(shamt,8)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1346,10 +1282,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.lshr(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant(shamt,8)));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ashr(tu.load(rs1+ traits::X0, 0),tu.constant(shamt,8)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1384,10 +1317,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext((tu.ashr(
|
|
|
|
|
tu.ext(tu.load(rs1+ traits::X0, 0),32,true),
|
|
|
|
|
tu.constant(shamt,8))),32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext((tu.ashr(tu.ext(tu.load(rs1+ traits::X0, 0),32,false),tu.constant(shamt,8))),32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1422,10 +1352,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext((tu.add(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.load(rs2+ traits::X0, 0))),32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext((tu.add(tu.load(rs1+ traits::X0, 0),tu.load(rs2+ traits::X0, 0))),32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1460,10 +1387,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext((tu.sub(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.load(rs2+ traits::X0, 0))),32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext((tu.sub(tu.load(rs1+ traits::X0, 0),tu.load(rs2+ traits::X0, 0))),32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1498,12 +1422,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.shl(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
(tu.bitwise_and(
|
|
|
|
|
tu.load(rs2+ traits::X0, 0),
|
|
|
|
|
tu.constant((static_cast<uint32_t>(traits:: XLEN)- 1),64)))));
|
|
|
|
|
tu.store(rd + traits::X0,tu.shl(tu.load(rs1+ traits::X0, 0),(tu.bitwise_and(tu.load(rs2+ traits::X0, 0),tu.constant((static_cast<uint32_t>(traits:: XLEN)- 1),64)))));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1538,10 +1457,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.conditionalAssignment(tu.icmp(ICmpInst::ICMP_SLT,
|
|
|
|
|
tu.ext(tu.load(rs1+ traits::X0, 0),32,true),
|
|
|
|
|
tu.ext(tu.load(rs2+ traits::X0, 0),32,true)), tu.constant( 1,8),tu.constant( 0,8)));
|
|
|
|
|
tu.store(rd + traits::X0,tu.conditionalAssignment(tu.icmp(ICmpInst::ICMP_SLT,tu.ext(tu.load(rs1+ traits::X0, 0),32,false),tu.ext(tu.load(rs2+ traits::X0, 0),32,false)), tu.constant( 1,8),tu.constant( 0,8)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1576,10 +1492,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.conditionalAssignment(tu.icmp(ICmpInst::ICMP_ULT,
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.load(rs2+ traits::X0, 0)), tu.constant( 1,8),tu.constant( 0,8)));
|
|
|
|
|
tu.store(rd + traits::X0,tu.conditionalAssignment(tu.icmp(ICmpInst::ICMP_SLT,tu.load(rs1+ traits::X0, 0),tu.load(rs2+ traits::X0, 0)), tu.constant( 1,8),tu.constant( 0,8)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1614,10 +1527,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.bitwise_xor(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.load(rs2+ traits::X0, 0)));
|
|
|
|
|
tu.store(rd + traits::X0,tu.bitwise_xor(tu.load(rs1+ traits::X0, 0),tu.load(rs2+ traits::X0, 0)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1652,12 +1562,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.lshr(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
(tu.bitwise_and(
|
|
|
|
|
tu.load(rs2+ traits::X0, 0),
|
|
|
|
|
tu.constant((static_cast<uint32_t>(traits:: XLEN)- 1),64)))));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ashr(tu.load(rs1+ traits::X0, 0),(tu.bitwise_and(tu.load(rs2+ traits::X0, 0),tu.constant((static_cast<uint32_t>(traits:: XLEN)- 1),64)))));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1692,12 +1597,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext((tu.ashr(
|
|
|
|
|
tu.ext(tu.load(rs1+ traits::X0, 0),32,true),
|
|
|
|
|
(tu.bitwise_and(
|
|
|
|
|
tu.load(rs2+ traits::X0, 0),
|
|
|
|
|
tu.constant((static_cast<uint32_t>(traits:: XLEN)- 1),64))))),32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext((tu.ashr(tu.ext(tu.load(rs1+ traits::X0, 0),32,false),(tu.bitwise_and(tu.load(rs2+ traits::X0, 0),tu.constant((static_cast<uint32_t>(traits:: XLEN)- 1),64))))),32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1732,10 +1632,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.bitwise_or(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.load(rs2+ traits::X0, 0)));
|
|
|
|
|
tu.store(rd + traits::X0,tu.bitwise_or(tu.load(rs1+ traits::X0, 0),tu.load(rs2+ traits::X0, 0)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1770,10 +1667,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.bitwise_and(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.load(rs2+ traits::X0, 0)));
|
|
|
|
|
tu.store(rd + traits::X0,tu.bitwise_and(tu.load(rs1+ traits::X0, 0),tu.load(rs2+ traits::X0, 0)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -1928,8 +1822,7 @@ private:
|
|
|
|
|
auto xrs1 = tu.assignment(tu.load(rs1+ traits::X0, 0),32);
|
|
|
|
|
if(rd!= 0){ auto xrd = tu.assignment(tu.read_mem(traits::CSR, csr, 32),32);
|
|
|
|
|
tu.write_mem(traits::CSR, csr, xrs1);
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
xrd);
|
|
|
|
|
tu.store(rd + traits::X0,xrd);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
tu.write_mem(traits::CSR, csr, xrs1);
|
|
|
|
@ -1969,13 +1862,10 @@ private:
|
|
|
|
|
auto xrd = tu.assignment(tu.read_mem(traits::CSR, csr, 32),32);
|
|
|
|
|
auto xrs1 = tu.assignment(tu.load(rs1+ traits::X0, 0),32);
|
|
|
|
|
if(rs1!= 0) {
|
|
|
|
|
tu.write_mem(traits::CSR, csr, tu.bitwise_or(
|
|
|
|
|
xrd,
|
|
|
|
|
xrs1));
|
|
|
|
|
tu.write_mem(traits::CSR, csr, tu.bitwise_or(xrd,xrs1));
|
|
|
|
|
}
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
xrd);
|
|
|
|
|
tu.store(rd + traits::X0,xrd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -2012,13 +1902,10 @@ private:
|
|
|
|
|
auto xrd = tu.assignment(tu.read_mem(traits::CSR, csr, 32),32);
|
|
|
|
|
auto xrs1 = tu.assignment(tu.load(rs1+ traits::X0, 0),32);
|
|
|
|
|
if(rs1!= 0) {
|
|
|
|
|
tu.write_mem(traits::CSR, csr, tu.bitwise_and(
|
|
|
|
|
xrd,
|
|
|
|
|
tu.logical_neg(xrs1)));
|
|
|
|
|
tu.write_mem(traits::CSR, csr, tu.bitwise_and(xrd,tu.logical_neg(xrs1)));
|
|
|
|
|
}
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
xrd);
|
|
|
|
|
tu.store(rd + traits::X0,xrd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -2055,8 +1942,7 @@ private:
|
|
|
|
|
auto xrd = tu.assignment(tu.read_mem(traits::CSR, csr, 32),32);
|
|
|
|
|
tu.write_mem(traits::CSR, csr, tu.constant((uint32_t)zimm,32));
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
xrd);
|
|
|
|
|
tu.store(rd + traits::X0,xrd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -2092,13 +1978,10 @@ private:
|
|
|
|
|
else{
|
|
|
|
|
auto xrd = tu.assignment(tu.read_mem(traits::CSR, csr, 32),32);
|
|
|
|
|
if(zimm!= 0) {
|
|
|
|
|
tu.write_mem(traits::CSR, csr, tu.bitwise_or(
|
|
|
|
|
xrd,
|
|
|
|
|
tu.constant((uint32_t)zimm,32)));
|
|
|
|
|
tu.write_mem(traits::CSR, csr, tu.bitwise_or(xrd,tu.constant((uint32_t)zimm,32)));
|
|
|
|
|
}
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
xrd);
|
|
|
|
|
tu.store(rd + traits::X0,xrd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -2134,13 +2017,10 @@ private:
|
|
|
|
|
else{
|
|
|
|
|
auto xrd = tu.assignment(tu.read_mem(traits::CSR, csr, 32),32);
|
|
|
|
|
if(zimm!= 0) {
|
|
|
|
|
tu.write_mem(traits::CSR, csr, tu.bitwise_and(
|
|
|
|
|
xrd,
|
|
|
|
|
tu.constant(~ ((uint32_t)zimm),32)));
|
|
|
|
|
tu.write_mem(traits::CSR, csr, tu.bitwise_and(xrd,tu.constant(~ ((uint32_t)zimm),32)));
|
|
|
|
|
}
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
xrd);
|
|
|
|
|
tu.store(rd + traits::X0,xrd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -2202,12 +2082,9 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto res = tu.assignment(tu.ext((tu.mul(
|
|
|
|
|
tu.ext(tu.ext(tu.load(rs1+ traits::X0, 0),32,true),64,true),
|
|
|
|
|
tu.ext(tu.ext(tu.load(rs2+ traits::X0, 0),32,true),64,true))),64,true),64);
|
|
|
|
|
auto res = tu.assignment(tu.ext((tu.mul(tu.ext(tu.ext(tu.load(rs1+ traits::X0, 0),32,false),64,true),tu.ext(tu.ext(tu.load(rs2+ traits::X0, 0),32,false),64,true))),64,true),64);
|
|
|
|
|
if(rd!=0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext(res,32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext(res,32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -2241,14 +2118,9 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto res = tu.assignment(tu.ext((tu.mul(
|
|
|
|
|
tu.ext(tu.ext(tu.load(rs1+ traits::X0, 0),32,true),64,true),
|
|
|
|
|
tu.ext(tu.ext(tu.load(rs2+ traits::X0, 0),32,true),64,true))),64,true),64);
|
|
|
|
|
auto res = tu.assignment(tu.ext((tu.mul(tu.ext(tu.ext(tu.load(rs1+ traits::X0, 0),32,false),64,true),tu.ext(tu.ext(tu.load(rs2+ traits::X0, 0),32,false),64,true))),64,true),64);
|
|
|
|
|
if(rd!=0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext((tu.ashr(
|
|
|
|
|
res,
|
|
|
|
|
tu.constant(static_cast<uint32_t>(traits:: XLEN),32))),32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext((tu.ashr(res,tu.constant(static_cast<uint32_t>(traits:: XLEN),32))),32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -2282,14 +2154,9 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto res = tu.assignment(tu.ext((tu.mul(
|
|
|
|
|
tu.ext(tu.ext(tu.load(rs1+ traits::X0, 0),32,true),64,true),
|
|
|
|
|
tu.ext(tu.load(rs2+ traits::X0, 0),64,false))),64,true),64);
|
|
|
|
|
auto res = tu.assignment(tu.ext((tu.mul(tu.ext(tu.ext(tu.load(rs1+ traits::X0, 0),32,false),64,true),tu.ext(tu.load(rs2+ traits::X0, 0),64,false))),64,true),64);
|
|
|
|
|
if(rd!=0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext((tu.ashr(
|
|
|
|
|
res,
|
|
|
|
|
tu.constant(static_cast<uint32_t>(traits:: XLEN),32))),32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext((tu.ashr(res,tu.constant(static_cast<uint32_t>(traits:: XLEN),32))),32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -2323,14 +2190,9 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto res = tu.assignment(tu.ext((tu.mul(
|
|
|
|
|
tu.ext(tu.load(rs1+ traits::X0, 0),64,false),
|
|
|
|
|
tu.ext(tu.load(rs2+ traits::X0, 0),64,false))),64,false),64);
|
|
|
|
|
auto res = tu.assignment(tu.ext((tu.mul(tu.ext(tu.load(rs1+ traits::X0, 0),64,false),tu.ext(tu.load(rs2+ traits::X0, 0),64,false))),64,false),64);
|
|
|
|
|
if(rd!=0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext((tu.lshr(
|
|
|
|
|
res,
|
|
|
|
|
tu.constant(static_cast<uint32_t>(traits:: XLEN),32))),32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext((tu.ashr(res,tu.constant(static_cast<uint32_t>(traits:: XLEN),32))),32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -2366,28 +2228,15 @@ private:
|
|
|
|
|
else{
|
|
|
|
|
auto dividend = tu.assignment(tu.ext(tu.load(rs1+ traits::X0, 0),32,true),32);
|
|
|
|
|
auto divisor = tu.assignment(tu.ext(tu.load(rs2+ traits::X0, 0),32,true),32);
|
|
|
|
|
if(rd!= 0){ tu.open_if(tu.icmp(ICmpInst::ICMP_NE,
|
|
|
|
|
divisor,
|
|
|
|
|
tu.constant( 0,8)));
|
|
|
|
|
if(rd!= 0){ tu.open_if(tu.icmp(ICmpInst::ICMP_NE,divisor,tu.constant( 0,8)));
|
|
|
|
|
auto MMIN = tu.assignment(tu.constant(((uint32_t)1)<<(static_cast<uint32_t>(traits:: XLEN)-1),32),32);
|
|
|
|
|
tu.open_if(tu.logical_and(
|
|
|
|
|
tu.icmp(ICmpInst::ICMP_EQ,
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
MMIN),
|
|
|
|
|
tu.icmp(ICmpInst::ICMP_EQ,
|
|
|
|
|
divisor,
|
|
|
|
|
tu.constant(- 1,8))));
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
MMIN);
|
|
|
|
|
tu.open_if(tu.logical_and(tu.icmp(ICmpInst::ICMP_EQ,tu.load(rs1+ traits::X0, 0),MMIN),tu.icmp(ICmpInst::ICMP_EQ,divisor,tu.constant(- 1,8))));
|
|
|
|
|
tu.store(rd + traits::X0,MMIN);
|
|
|
|
|
tu.open_else();
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext((tu.sdiv(
|
|
|
|
|
dividend,
|
|
|
|
|
divisor)),32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext((tu.sdiv(dividend,divisor)),32,false));
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
tu.open_else();
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.constant((uint32_t)- 1,32));
|
|
|
|
|
tu.store(rd + traits::X0,tu.constant((uint32_t)- 1,32));
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2422,19 +2271,13 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_NE,
|
|
|
|
|
tu.load(rs2+ traits::X0, 0),
|
|
|
|
|
tu.constant( 0,8)));
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_NE,tu.load(rs2+ traits::X0, 0),tu.constant( 0,8)));
|
|
|
|
|
if(rd!=0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext((tu.udiv(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.load(rs2+ traits::X0, 0))),32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext((tu.sdiv(tu.load(rs1+ traits::X0, 0),tu.load(rs2+ traits::X0, 0))),32,false));
|
|
|
|
|
}
|
|
|
|
|
tu.open_else();
|
|
|
|
|
if(rd!=0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.constant((uint32_t)- 1,32));
|
|
|
|
|
tu.store(rd + traits::X0,tu.constant((uint32_t)- 1,32));
|
|
|
|
|
}
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
}
|
|
|
|
@ -2469,33 +2312,20 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_NE,
|
|
|
|
|
tu.load(rs2+ traits::X0, 0),
|
|
|
|
|
tu.constant( 0,8)));
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_NE,tu.load(rs2+ traits::X0, 0),tu.constant( 0,8)));
|
|
|
|
|
auto MMIN = tu.assignment(tu.constant((uint32_t)1<<(static_cast<uint32_t>(traits:: XLEN)-1),32),32);
|
|
|
|
|
tu.open_if(tu.logical_and(
|
|
|
|
|
tu.icmp(ICmpInst::ICMP_EQ,
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
MMIN),
|
|
|
|
|
tu.icmp(ICmpInst::ICMP_EQ,
|
|
|
|
|
tu.ext(tu.load(rs2+ traits::X0, 0),32,true),
|
|
|
|
|
tu.constant(- 1,8))));
|
|
|
|
|
tu.open_if(tu.logical_and(tu.icmp(ICmpInst::ICMP_EQ,tu.load(rs1+ traits::X0, 0),MMIN),tu.icmp(ICmpInst::ICMP_EQ,tu.ext(tu.load(rs2+ traits::X0, 0),32,true),tu.constant(- 1,8))));
|
|
|
|
|
if(rd!=0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.constant( 0,8));
|
|
|
|
|
tu.store(rd + traits::X0,tu.constant( 0,8));
|
|
|
|
|
}
|
|
|
|
|
tu.open_else();
|
|
|
|
|
if(rd!=0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext((tu.srem(
|
|
|
|
|
tu.ext(tu.load(rs1+ traits::X0, 0),32,true),
|
|
|
|
|
tu.ext(tu.load(rs2+ traits::X0, 0),32,true))),32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext((tu.srem(tu.ext(tu.load(rs1+ traits::X0, 0),32,true),tu.ext(tu.load(rs2+ traits::X0, 0),32,true))),32,false));
|
|
|
|
|
}
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
tu.open_else();
|
|
|
|
|
if(rd!=0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.load(rs1+ traits::X0, 0));
|
|
|
|
|
tu.store(rd + traits::X0,tu.load(rs1+ traits::X0, 0));
|
|
|
|
|
}
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
}
|
|
|
|
@ -2530,19 +2360,13 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_NE,
|
|
|
|
|
tu.load(rs2+ traits::X0, 0),
|
|
|
|
|
tu.constant( 0,8)));
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_NE,tu.load(rs2+ traits::X0, 0),tu.constant( 0,8)));
|
|
|
|
|
if(rd!=0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.urem(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.load(rs2+ traits::X0, 0)));
|
|
|
|
|
tu.store(rd + traits::X0,tu.srem(tu.load(rs1+ traits::X0, 0),tu.load(rs2+ traits::X0, 0)));
|
|
|
|
|
}
|
|
|
|
|
tu.open_else();
|
|
|
|
|
if(rd!=0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.load(rs1+ traits::X0, 0));
|
|
|
|
|
tu.store(rd + traits::X0,tu.load(rs1+ traits::X0, 0));
|
|
|
|
|
}
|
|
|
|
|
tu.close_scope();
|
|
|
|
|
}
|
|
|
|
@ -2573,10 +2397,7 @@ private:
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(imm) {
|
|
|
|
|
tu.store(rd+ 8 + traits::X0,
|
|
|
|
|
tu.ext((tu.add(
|
|
|
|
|
tu.load(2+ traits::X0, 0),
|
|
|
|
|
tu.constant(imm,16))),32,false));
|
|
|
|
|
tu.store(rd+ 8 + traits::X0,tu.ext((tu.add(tu.load(2+ traits::X0, 0),tu.constant(imm,16))),32,false));
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
@ -2608,11 +2429,8 @@ private:
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
auto offs = tu.assignment(tu.ext((tu.add(
|
|
|
|
|
tu.load(rs1+ 8+ traits::X0, 0),
|
|
|
|
|
tu.constant(uimm,8))),32,false),32);
|
|
|
|
|
tu.store(rd+ 8 + traits::X0,
|
|
|
|
|
tu.ext(tu.ext(tu.read_mem(traits::MEM, offs, 32),32,true),32,false));
|
|
|
|
|
auto offs = tu.assignment(tu.ext((tu.add(tu.load(rs1+ 8+ traits::X0, 0),tu.constant(uimm,8))),32,false),32);
|
|
|
|
|
tu.store(rd+ 8 + traits::X0,tu.ext(tu.ext(tu.read_mem(traits::MEM, offs, 32),32,true),32,false));
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
|
|
|
|
|
|
tu.close_scope();
|
|
|
|
@ -2640,9 +2458,7 @@ private:
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
auto offs = tu.assignment(tu.ext((tu.add(
|
|
|
|
|
tu.load(rs1+ 8+ traits::X0, 0),
|
|
|
|
|
tu.constant(uimm,8))),32,false),32);
|
|
|
|
|
auto offs = tu.assignment(tu.ext((tu.add(tu.load(rs1+ 8+ traits::X0, 0),tu.constant(uimm,8))),32,false),32);
|
|
|
|
|
tu.write_mem(traits::MEM, offs, tu.ext(tu.load(rs2+ 8+ traits::X0, 0),32,false));
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
|
|
|
|
|
@ -2675,10 +2491,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rs1!= 0) {
|
|
|
|
|
tu.store(rs1 + traits::X0,
|
|
|
|
|
tu.ext((tu.add(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant((int8_t)sext<6>(imm),8))),32,false));
|
|
|
|
|
tu.store(rs1 + traits::X0,tu.ext((tu.add(tu.load(rs1+ traits::X0, 0),tu.constant((int8_t)sext<6>(imm),8))),32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -2728,8 +2541,7 @@ private:
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
tu.store(1 + traits::X0,
|
|
|
|
|
tu.constant((uint32_t)(PC+ 2),32));
|
|
|
|
|
tu.store(1 + traits::X0,tu.constant((uint32_t)(PC+ 2),32));
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", (uint32_t)(PC+(int16_t)sext<12>(imm)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
@ -2764,8 +2576,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.constant((uint32_t)((int8_t)sext<6>(imm)),32));
|
|
|
|
|
tu.store(rd + traits::X0,tu.constant((uint32_t)((int8_t)sext<6>(imm)),32));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -2798,8 +2609,7 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.constant((uint32_t)((int32_t)sext<18>(imm)),32));
|
|
|
|
|
tu.store(rd + traits::X0,tu.constant((uint32_t)((int32_t)sext<18>(imm)),32));
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
|
|
|
|
|
@ -2827,10 +2637,7 @@ private:
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(nzimm) {
|
|
|
|
|
tu.store(2 + traits::X0,
|
|
|
|
|
tu.ext((tu.add(
|
|
|
|
|
tu.load(2+ traits::X0, 0),
|
|
|
|
|
tu.constant((int16_t)sext<10>(nzimm),16))),32,false));
|
|
|
|
|
tu.store(2 + traits::X0,tu.ext((tu.add(tu.load(2+ traits::X0, 0),tu.constant((int16_t)sext<10>(nzimm),16))),32,false));
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
@ -2884,10 +2691,7 @@ private:
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
tu.store(rs1+ 8 + traits::X0,
|
|
|
|
|
tu.lshr(
|
|
|
|
|
tu.load(rs1+ 8+ traits::X0, 0),
|
|
|
|
|
tu.constant(shamt,8)));
|
|
|
|
|
tu.store(rs1+ 8 + traits::X0,tu.ashr(tu.load(rs1+ 8+ traits::X0, 0),tu.constant(shamt,8)));
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
|
|
|
|
|
|
tu.close_scope();
|
|
|
|
@ -2914,16 +2718,10 @@ private:
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(shamt){ tu.store(rs1+ 8 + traits::X0,
|
|
|
|
|
tu.ext((tu.ashr(
|
|
|
|
|
(tu.ext(tu.load(rs1+ 8+ traits::X0, 0),32,true)),
|
|
|
|
|
tu.constant(shamt,8))),32,false));
|
|
|
|
|
if(shamt){ tu.store(rs1+ 8 + traits::X0,tu.ext((tu.ashr((tu.ext(tu.load(rs1+ 8+ traits::X0, 0),32,true)),tu.constant(shamt,8))),32,false));
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(static_cast<uint32_t>(traits:: XLEN)== 128){ tu.store(rs1+ 8 + traits::X0,
|
|
|
|
|
tu.ext((tu.ashr(
|
|
|
|
|
(tu.ext(tu.load(rs1+ 8+ traits::X0, 0),32,true)),
|
|
|
|
|
tu.constant( 64,8))),32,false));
|
|
|
|
|
if(static_cast<uint32_t>(traits:: XLEN)== 128){ tu.store(rs1+ 8 + traits::X0,tu.ext((tu.ashr((tu.ext(tu.load(rs1+ 8+ traits::X0, 0),32,true)),tu.constant( 64,8))),32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -2952,10 +2750,7 @@ private:
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
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,false));
|
|
|
|
|
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,false));
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
|
|
|
|
|
|
tu.close_scope();
|
|
|
|
@ -2982,10 +2777,7 @@ private:
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
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,false));
|
|
|
|
|
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,false));
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
|
|
|
|
|
|
tu.close_scope();
|
|
|
|
@ -3012,10 +2804,7 @@ private:
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
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)));
|
|
|
|
|
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();
|
|
|
|
@ -3042,10 +2831,7 @@ private:
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
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)));
|
|
|
|
|
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();
|
|
|
|
@ -3072,10 +2858,7 @@ private:
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
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)));
|
|
|
|
|
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();
|
|
|
|
@ -3130,9 +2913,7 @@ private:
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_EQ,
|
|
|
|
|
tu.load(rs1+ 8+ traits::X0, 0),
|
|
|
|
|
tu.constant( 0,8)));
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_EQ,tu.load(rs1+ 8+ traits::X0, 0),tu.constant( 0,8)));
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", (uint32_t)(PC+(int16_t)sext<9>(imm)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
@ -3163,9 +2944,7 @@ private:
|
|
|
|
|
pc=pc+ 2;
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_NE,
|
|
|
|
|
tu.load(rs1+ 8+ traits::X0, 0),
|
|
|
|
|
tu.constant( 0,8)));
|
|
|
|
|
tu.open_if(tu.icmp(ICmpInst::ICMP_NE,tu.load(rs1+ 8+ traits::X0, 0),tu.constant( 0,8)));
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", (uint32_t)(PC+(int16_t)sext<9>(imm)),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
@ -3201,10 +2980,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rs1!= 0) {
|
|
|
|
|
tu.store(rs1 + traits::X0,
|
|
|
|
|
tu.shl(
|
|
|
|
|
tu.load(rs1+ traits::X0, 0),
|
|
|
|
|
tu.constant(nzuimm,8)));
|
|
|
|
|
tu.store(rs1 + traits::X0,tu.shl(tu.load(rs1+ traits::X0, 0),tu.constant(nzuimm,8)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -3237,11 +3013,8 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto offs = tu.assignment(tu.ext((tu.add(
|
|
|
|
|
tu.load(2+ traits::X0, 0),
|
|
|
|
|
tu.constant(uimm,8))),32,false),32);
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext(tu.ext(tu.read_mem(traits::MEM, offs, 32),32,true),32,false));
|
|
|
|
|
auto offs = tu.assignment(tu.ext((tu.add(tu.load(2+ traits::X0, 0),tu.constant(uimm,8))),32,false),32);
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext(tu.ext(tu.read_mem(traits::MEM, offs, 32),32,true),32,false));
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
|
|
|
|
|
@ -3274,8 +3047,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.load(rs2+ traits::X0, 0));
|
|
|
|
|
tu.store(rd + traits::X0,tu.load(rs2+ traits::X0, 0));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -3304,9 +3076,7 @@ private:
|
|
|
|
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
|
|
|
|
tu.open_scope();
|
|
|
|
|
if(rs1&&rs1<static_cast<uint32_t>(traits:: RFS)){ auto addr_mask = tu.assignment(tu.constant((uint32_t)- 2,32),32);
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.bitwise_and(
|
|
|
|
|
tu.load(rs1%static_cast<uint32_t>(traits:: RFS)+ traits::X0, 0),
|
|
|
|
|
addr_mask),32);
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.bitwise_and(tu.load(rs1%static_cast<uint32_t>(traits:: RFS)+ traits::X0, 0),addr_mask),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
|
}
|
|
|
|
@ -3366,10 +3136,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if(rd!= 0) {
|
|
|
|
|
tu.store(rd + traits::X0,
|
|
|
|
|
tu.ext((tu.add(
|
|
|
|
|
tu.load(rd+ traits::X0, 0),
|
|
|
|
|
tu.load(rs2+ traits::X0, 0))),32,false));
|
|
|
|
|
tu.store(rd + traits::X0,tu.ext((tu.add(tu.load(rd+ traits::X0, 0),tu.load(rs2+ traits::X0, 0))),32,false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
@ -3403,11 +3170,8 @@ private:
|
|
|
|
|
else{
|
|
|
|
|
auto addr_mask = tu.assignment(tu.constant((uint32_t)- 2,32),32);
|
|
|
|
|
auto new_pc = tu.assignment(tu.load(rs1+ traits::X0, 0),32);
|
|
|
|
|
tu.store(1 + traits::X0,
|
|
|
|
|
tu.constant((uint32_t)(PC+ 2),32));
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.bitwise_and(
|
|
|
|
|
new_pc,
|
|
|
|
|
addr_mask),32);
|
|
|
|
|
tu.store(1 + traits::X0,tu.constant((uint32_t)(PC+ 2),32));
|
|
|
|
|
auto PC_val_v = tu.assignment("PC_val", tu.bitwise_and(new_pc,addr_mask),32);
|
|
|
|
|
tu.store(traits::NEXT_PC, PC_val_v);
|
|
|
|
|
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
|
|
|
|
|
}
|
|
|
|
@ -3463,9 +3227,7 @@ private:
|
|
|
|
|
this->gen_raise_trap(tu, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
auto offs = tu.assignment(tu.ext((tu.add(
|
|
|
|
|
tu.load(2+ traits::X0, 0),
|
|
|
|
|
tu.constant(uimm,8))),32,false),32);
|
|
|
|
|
auto offs = tu.assignment(tu.ext((tu.add(tu.load(2+ traits::X0, 0),tu.constant(uimm,8))),32,false),32);
|
|
|
|
|
tu.write_mem(traits::MEM, offs, tu.ext(tu.load(rs2+ traits::X0, 0),32,false));
|
|
|
|
|
}
|
|
|
|
|
auto returnValue = std::make_tuple(CONT);
|
|
|
|
|