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