From 3cc8bd085469219d9fbcd77948a3ffc062d9dc43 Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Sat, 18 May 2024 21:00:54 +0200 Subject: [PATCH] adds reformat bc of verilog literals --- src/vm/llvm/vm_tgc5c.cpp | 356 +++++++++++++++++++-------------------- src/vm/tcc/vm_tgc5c.cpp | 353 +++++++++++++++++++------------------- 2 files changed, 353 insertions(+), 356 deletions(-) diff --git a/src/vm/llvm/vm_tgc5c.cpp b/src/vm/llvm/vm_tgc5c.cpp index 58e3c2c..1212037 100644 --- a/src/vm/llvm/vm_tgc5c.cpp +++ b/src/vm/llvm/vm_tgc5c.cpp @@ -352,10 +352,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_const(32,(uint32_t)((int32_t)imm)), get_reg_ptr(rd + traits::X0), false); @@ -395,10 +395,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_const(32,(uint32_t)(PC+(int32_t)imm)), get_reg_ptr(rd + traits::X0), false); @@ -438,15 +438,15 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(imm%static_cast(traits::INSTR_ALIGNMENT)){ this->gen_raise_trap(0, 0); + if(imm%static_cast(traits::INSTR_ALIGNMENT)){ this->gen_raise_trap(0, 0); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( - this->gen_const(32,(uint32_t)(PC+ 4)), + this->gen_const(32,(uint32_t)(PC+4)), get_reg_ptr(rd + traits::X0), false); } auto PC_val_v = (uint32_t)(PC+(int32_t)sext<21>(imm)); @@ -489,7 +489,7 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto addr_mask =this->gen_const(32,(uint32_t)- 2); @@ -511,14 +511,14 @@ private: , 1), bb_then, bb_else); this->builder.SetInsertPoint(bb_then); { - this->gen_raise_trap(0, 0); + this->gen_raise_trap(0, 0); } this->builder.CreateBr(bb_merge); this->builder.SetInsertPoint(bb_else); { - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( - this->gen_const(32,(uint32_t)(PC+ 4)), + this->gen_const(32,(uint32_t)(PC+4)), get_reg_ptr(rd + traits::X0), false); } auto PC_val_v = new_pc; @@ -563,7 +563,7 @@ private: /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto bb_merge = BasicBlock::Create(this->mod->getContext(), "bb_merge", this->func, this->leave_blk); @@ -574,7 +574,7 @@ private: , 1), bb_then, bb_merge); this->builder.SetInsertPoint(bb_then); { - if(imm%static_cast(traits::INSTR_ALIGNMENT)){ this->gen_raise_trap(0, 0); + if(imm%static_cast(traits::INSTR_ALIGNMENT)){ this->gen_raise_trap(0, 0); } else{ auto PC_val_v = (uint32_t)(PC+(int16_t)sext<13>(imm)); @@ -620,7 +620,7 @@ private: /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto bb_merge = BasicBlock::Create(this->mod->getContext(), "bb_merge", this->func, this->leave_blk); @@ -631,7 +631,7 @@ private: , 1), bb_then, bb_merge); this->builder.SetInsertPoint(bb_then); { - if(imm%static_cast(traits::INSTR_ALIGNMENT)){ this->gen_raise_trap(0, 0); + if(imm%static_cast(traits::INSTR_ALIGNMENT)){ this->gen_raise_trap(0, 0); } else{ auto PC_val_v = (uint32_t)(PC+(int16_t)sext<13>(imm)); @@ -677,7 +677,7 @@ private: /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto bb_merge = BasicBlock::Create(this->mod->getContext(), "bb_merge", this->func, this->leave_blk); @@ -692,7 +692,7 @@ private: , 1), bb_then, bb_merge); this->builder.SetInsertPoint(bb_then); { - if(imm%static_cast(traits::INSTR_ALIGNMENT)){ this->gen_raise_trap(0, 0); + if(imm%static_cast(traits::INSTR_ALIGNMENT)){ this->gen_raise_trap(0, 0); } else{ auto PC_val_v = (uint32_t)(PC+(int16_t)sext<13>(imm)); @@ -738,7 +738,7 @@ private: /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto bb_merge = BasicBlock::Create(this->mod->getContext(), "bb_merge", this->func, this->leave_blk); @@ -753,7 +753,7 @@ private: , 1), bb_then, bb_merge); this->builder.SetInsertPoint(bb_then); { - if(imm%static_cast(traits::INSTR_ALIGNMENT)){ this->gen_raise_trap(0, 0); + if(imm%static_cast(traits::INSTR_ALIGNMENT)){ this->gen_raise_trap(0, 0); } else{ auto PC_val_v = (uint32_t)(PC+(int16_t)sext<13>(imm)); @@ -799,7 +799,7 @@ private: /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto bb_merge = BasicBlock::Create(this->mod->getContext(), "bb_merge", this->func, this->leave_blk); @@ -810,7 +810,7 @@ private: , 1), bb_then, bb_merge); this->builder.SetInsertPoint(bb_then); { - if(imm%static_cast(traits::INSTR_ALIGNMENT)){ this->gen_raise_trap(0, 0); + if(imm%static_cast(traits::INSTR_ALIGNMENT)){ this->gen_raise_trap(0, 0); } else{ auto PC_val_v = (uint32_t)(PC+(int16_t)sext<13>(imm)); @@ -856,7 +856,7 @@ private: /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto bb_merge = BasicBlock::Create(this->mod->getContext(), "bb_merge", this->func, this->leave_blk); @@ -867,7 +867,7 @@ private: , 1), bb_then, bb_merge); this->builder.SetInsertPoint(bb_then); { - if(imm%static_cast(traits::INSTR_ALIGNMENT)){ this->gen_raise_trap(0, 0); + if(imm%static_cast(traits::INSTR_ALIGNMENT)){ this->gen_raise_trap(0, 0); } else{ auto PC_val_v = (uint32_t)(PC+(int16_t)sext<13>(imm)); @@ -913,7 +913,7 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto load_address =this->gen_ext( @@ -925,7 +925,7 @@ private: auto res =this->gen_ext( this->gen_read_mem(traits::MEM, load_address, 1), 8, false); - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext( res, @@ -968,7 +968,7 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto load_address =this->gen_ext( @@ -980,7 +980,7 @@ private: auto res =this->gen_ext( this->gen_read_mem(traits::MEM, load_address, 2), 16, false); - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext( res, @@ -1023,7 +1023,7 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto load_address =this->gen_ext( @@ -1035,7 +1035,7 @@ private: auto res =this->gen_ext( this->gen_read_mem(traits::MEM, load_address, 4), 32, false); - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext( res, @@ -1078,7 +1078,7 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto load_address =this->gen_ext( @@ -1088,7 +1088,7 @@ private: ), 32, true); auto res =this->gen_read_mem(traits::MEM, load_address, 1); - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext( res, @@ -1131,7 +1131,7 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto load_address =this->gen_ext( @@ -1141,7 +1141,7 @@ private: ), 32, true); auto res =this->gen_read_mem(traits::MEM, load_address, 2); - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext( res, @@ -1184,7 +1184,7 @@ private: /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto store_address =this->gen_ext( @@ -1234,7 +1234,7 @@ private: /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto store_address =this->gen_ext( @@ -1284,7 +1284,7 @@ private: /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto store_address =this->gen_ext( @@ -1334,10 +1334,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext( (this->builder.CreateAdd( @@ -1383,18 +1383,18 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext(this->gen_choose((this->builder.CreateICmp(ICmpInst::ICMP_SLT, this->gen_ext( this->gen_reg_load(rs1+ traits::X0, 0), 32,true), this->gen_ext(this->gen_const(16,(int16_t)sext<12>(imm)), 32,true)) ), - this->gen_const(8, 1), - this->gen_const(8, 0), + this->gen_const(8,1), + this->gen_const(8,0), 1), 32), get_reg_ptr(rd + traits::X0), false); } @@ -1434,17 +1434,17 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext(this->gen_choose((this->builder.CreateICmp(ICmpInst::ICMP_ULT, this->gen_reg_load(rs1+ traits::X0, 0), this->gen_const(32,(uint32_t)((int16_t)sext<12>(imm)))) ), - this->gen_const(8, 1), - this->gen_const(8, 0), + this->gen_const(8,1), + this->gen_const(8,0), 1), 32), get_reg_ptr(rd + traits::X0), false); } @@ -1484,10 +1484,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->builder.CreateXor( this->gen_reg_load(rs1+ traits::X0, 0), @@ -1531,10 +1531,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->builder.CreateOr( this->gen_reg_load(rs1+ traits::X0, 0), @@ -1578,10 +1578,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->builder.CreateAnd( this->gen_reg_load(rs1+ traits::X0, 0), @@ -1625,10 +1625,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->builder.CreateShl( this->gen_reg_load(rs1+ traits::X0, 0), @@ -1672,10 +1672,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->builder.CreateLShr( this->gen_reg_load(rs1+ traits::X0, 0), @@ -1719,10 +1719,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext( (this->builder.CreateAShr( @@ -1769,10 +1769,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext( (this->builder.CreateAdd( @@ -1818,10 +1818,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext( (this->builder.CreateSub( @@ -1867,16 +1867,16 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext(this->builder.CreateShl( this->gen_ext(this->gen_reg_load(rs1+ traits::X0, 0), 64,false), (this->builder.CreateAnd( this->gen_ext(this->gen_reg_load(rs2+ traits::X0, 0), 64,false), - this->gen_const(64,(static_cast(traits::XLEN)- 1))) + this->gen_const(64,(static_cast(traits::XLEN)-1))) )) , 32, false), get_reg_ptr(rd + traits::X0), false); @@ -1917,10 +1917,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext(this->gen_choose(this->builder.CreateICmp(ICmpInst::ICMP_SLT, this->gen_ext( @@ -1928,8 +1928,8 @@ private: this->gen_ext( this->gen_reg_load(rs2+ traits::X0, 0), 32,true)) , - this->gen_const(8, 1), - this->gen_const(8, 0), + this->gen_const(8,1), + this->gen_const(8,0), 1), 32), get_reg_ptr(rd + traits::X0), false); } @@ -1969,17 +1969,17 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext(this->gen_choose(this->builder.CreateICmp(ICmpInst::ICMP_ULT, this->gen_reg_load(rs1+ traits::X0, 0), this->gen_reg_load(rs2+ traits::X0, 0)) , - this->gen_const(8, 1), - this->gen_const(8, 0), + this->gen_const(8,1), + this->gen_const(8,0), 1), 32), get_reg_ptr(rd + traits::X0), false); } @@ -2019,10 +2019,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->builder.CreateXor( this->gen_reg_load(rs1+ traits::X0, 0), @@ -2066,16 +2066,16 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext(this->builder.CreateLShr( this->gen_ext(this->gen_reg_load(rs1+ traits::X0, 0), 64,false), (this->builder.CreateAnd( this->gen_ext(this->gen_reg_load(rs2+ traits::X0, 0), 64,false), - this->gen_const(64,(static_cast(traits::XLEN)- 1))) + this->gen_const(64,(static_cast(traits::XLEN)-1))) )) , 32, false), get_reg_ptr(rd + traits::X0), false); @@ -2116,10 +2116,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext( (this->gen_ext(this->builder.CreateAShr( @@ -2127,7 +2127,7 @@ private: this->gen_reg_load(rs1+ traits::X0, 0), 32,true), 64,true), (this->builder.CreateAnd( this->gen_ext(this->gen_reg_load(rs2+ traits::X0, 0), 64,false), - this->gen_const(64,(static_cast(traits::XLEN)- 1))) + this->gen_const(64,(static_cast(traits::XLEN)-1))) )) , 32, true)), 32, true), @@ -2169,10 +2169,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->builder.CreateOr( this->gen_reg_load(rs1+ traits::X0, 0), @@ -2216,10 +2216,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->builder.CreateAnd( this->gen_reg_load(rs1+ traits::X0, 0), @@ -2266,7 +2266,7 @@ private: /*generate behavior*/ this->gen_write_mem(traits::FENCE, static_cast(traits::fence), - this->gen_const(8,(uint8_t)pred<< 4|succ)); + this->gen_const(8,(uint8_t)pred<<4|succ)); bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); auto returnValue = std::make_tuple(CONT,bb); @@ -2290,7 +2290,7 @@ private: this->gen_set_pc(pc, traits::NEXT_PC); /*generate behavior*/ - this->gen_raise_trap(0, 11); + this->gen_raise_trap(0, 11); bb = this->leave_blk; auto returnValue = std::make_tuple(TRAP,nullptr); @@ -2314,7 +2314,7 @@ private: this->gen_set_pc(pc, traits::NEXT_PC); /*generate behavior*/ - this->gen_raise_trap(0, 3); + this->gen_raise_trap(0, 3); bb = this->leave_blk; auto returnValue = std::make_tuple(TRAP,nullptr); @@ -2398,11 +2398,11 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto xrs1 =this->gen_reg_load(rs1+ traits::X0, 0); - if(rd!= 0){ auto xrd =this->gen_read_mem(traits::CSR, csr, 4); + if(rd!=0){ auto xrd =this->gen_read_mem(traits::CSR, csr, 4); this->gen_write_mem(traits::CSR, csr, xrs1); @@ -2451,12 +2451,12 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto xrd =this->gen_read_mem(traits::CSR, csr, 4); auto xrs1 =this->gen_reg_load(rs1+ traits::X0, 0); - if(rs1!= 0) { + if(rs1!=0) { this->gen_write_mem(traits::CSR, csr, this->builder.CreateOr( @@ -2464,7 +2464,7 @@ private: xrs1) ); } - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( xrd, get_reg_ptr(rd + traits::X0), false); @@ -2505,12 +2505,12 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto xrd =this->gen_read_mem(traits::CSR, csr, 4); auto xrs1 =this->gen_reg_load(rs1+ traits::X0, 0); - if(rs1!= 0) { + if(rs1!=0) { this->gen_write_mem(traits::CSR, csr, this->builder.CreateAnd( @@ -2518,7 +2518,7 @@ private: this->builder.CreateNeg(xrs1)) ); } - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( xrd, get_reg_ptr(rd + traits::X0), false); @@ -2559,14 +2559,14 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto xrd =this->gen_read_mem(traits::CSR, csr, 4); this->gen_write_mem(traits::CSR, csr, this->gen_const(32,(uint32_t)zimm)); - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( xrd, get_reg_ptr(rd + traits::X0), false); @@ -2607,11 +2607,11 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto xrd =this->gen_read_mem(traits::CSR, csr, 4); - if(zimm!= 0) { + if(zimm!=0) { this->gen_write_mem(traits::CSR, csr, this->builder.CreateOr( @@ -2619,7 +2619,7 @@ private: this->gen_const(32,(uint32_t)zimm)) ); } - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( xrd, get_reg_ptr(rd + traits::X0), false); @@ -2660,11 +2660,11 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto xrd =this->gen_read_mem(traits::CSR, csr, 4); - if(zimm!= 0) { + if(zimm!=0) { this->gen_write_mem(traits::CSR, csr, this->builder.CreateAnd( @@ -2672,7 +2672,7 @@ private: this->gen_const(32,~ ((uint32_t)zimm))) ); } - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( xrd, get_reg_ptr(rd + traits::X0), false); @@ -2750,7 +2750,7 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto res =this->gen_ext( @@ -2808,7 +2808,7 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto res =this->gen_ext( @@ -2869,7 +2869,7 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto res =this->gen_ext( @@ -2929,7 +2929,7 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto res =this->gen_ext( @@ -2988,7 +2988,7 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto dividend =this->gen_ext( @@ -2997,12 +2997,12 @@ private: auto divisor =this->gen_ext( this->gen_reg_load(rs2+ traits::X0, 0), 32, false); - if(rd!= 0){ auto bb_merge = BasicBlock::Create(this->mod->getContext(), "bb_merge", this->func, this->leave_blk); + if(rd!=0){ auto bb_merge = BasicBlock::Create(this->mod->getContext(), "bb_merge", this->func, this->leave_blk); auto bb_then = BasicBlock::Create(this->mod->getContext(), "bb_then", this->func, bb_merge); auto bb_else = BasicBlock::Create(this->mod->getContext(), "bb_else", this->func, bb_merge); this->builder.CreateCondBr(this->gen_ext(this->builder.CreateICmp(ICmpInst::ICMP_NE, divisor, - this->gen_ext(this->gen_const(8, 0), 32,false)) + this->gen_ext(this->gen_const(8,0), 32,false)) , 1), bb_then, bb_else); this->builder.SetInsertPoint(bb_then); { @@ -3087,7 +3087,7 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto bb_merge = BasicBlock::Create(this->mod->getContext(), "bb_merge", this->func, this->leave_blk); @@ -3095,7 +3095,7 @@ private: auto bb_else = BasicBlock::Create(this->mod->getContext(), "bb_else", this->func, bb_merge); this->builder.CreateCondBr(this->gen_ext(this->builder.CreateICmp(ICmpInst::ICMP_NE, this->gen_reg_load(rs2+ traits::X0, 0), - this->gen_ext(this->gen_const(8, 0), 32,false)) + this->gen_ext(this->gen_const(8,0), 32,false)) , 1), bb_then, bb_else); this->builder.SetInsertPoint(bb_then); { @@ -3157,7 +3157,7 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto bb_merge = BasicBlock::Create(this->mod->getContext(), "bb_merge", this->func, this->leave_blk); @@ -3165,7 +3165,7 @@ private: auto bb_else = BasicBlock::Create(this->mod->getContext(), "bb_else", this->func, bb_merge); this->builder.CreateCondBr(this->gen_ext(this->builder.CreateICmp(ICmpInst::ICMP_NE, this->gen_reg_load(rs2+ traits::X0, 0), - this->gen_ext(this->gen_const(8, 0), 32,false)) + this->gen_ext(this->gen_const(8,0), 32,false)) , 1), bb_then, bb_else); this->builder.SetInsertPoint(bb_then); { @@ -3189,7 +3189,7 @@ private: { if(rd!=0) { this->builder.CreateStore( - this->gen_ext(this->gen_const(8, 0), 32), + this->gen_ext(this->gen_const(8,0), 32), get_reg_ptr(rd + traits::X0), false); } } @@ -3261,7 +3261,7 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto bb_merge = BasicBlock::Create(this->mod->getContext(), "bb_merge", this->func, this->leave_blk); @@ -3269,7 +3269,7 @@ private: auto bb_else = BasicBlock::Create(this->mod->getContext(), "bb_else", this->func, bb_merge); this->builder.CreateCondBr(this->gen_ext(this->builder.CreateICmp(ICmpInst::ICMP_NE, this->gen_reg_load(rs2+ traits::X0, 0), - this->gen_ext(this->gen_const(8, 0), 32,false)) + this->gen_ext(this->gen_const(8,0), 32,false)) , 1), bb_then, bb_else); this->builder.SetInsertPoint(bb_then); { @@ -3335,10 +3335,10 @@ private: this->gen_ext(this->gen_const(16,imm), 64,false)) ), 32, false), - get_reg_ptr(rd+ 8 + traits::X0), false); + get_reg_ptr(rd+8 + traits::X0), false); } else{ - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); auto returnValue = std::make_tuple(CONT,bb); @@ -3376,7 +3376,7 @@ private: /*generate behavior*/ auto offs =this->gen_ext( (this->builder.CreateAdd( - this->gen_ext(this->gen_reg_load(rs1+ 8+ traits::X0, 0), 64,false), + this->gen_ext(this->gen_reg_load(rs1+8+ traits::X0, 0), 64,false), this->gen_ext(this->gen_const(8,uimm), 64,false)) ), 32, false); @@ -3386,7 +3386,7 @@ private: this->gen_read_mem(traits::MEM, offs, 4), 32, false), 32, true), - get_reg_ptr(rd+ 8 + traits::X0), false); + get_reg_ptr(rd+8 + traits::X0), false); bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); auto returnValue = std::make_tuple(CONT,bb); @@ -3423,14 +3423,14 @@ private: /*generate behavior*/ auto offs =this->gen_ext( (this->builder.CreateAdd( - this->gen_ext(this->gen_reg_load(rs1+ 8+ traits::X0, 0), 64,false), + this->gen_ext(this->gen_reg_load(rs1+8+ traits::X0, 0), 64,false), this->gen_ext(this->gen_const(8,uimm), 64,false)) ), 32, false); this->gen_write_mem(traits::MEM, offs, this->gen_ext( - this->gen_reg_load(rs2+ 8+ traits::X0, 0), + this->gen_reg_load(rs2+8+ traits::X0, 0), 32, false)); bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); auto returnValue = std::make_tuple(CONT,bb); @@ -3466,10 +3466,10 @@ private: /*generate behavior*/ if(rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rs1!= 0) { + if(rs1!=0) { this->builder.CreateStore( this->gen_ext( (this->builder.CreateAdd( @@ -3537,7 +3537,7 @@ private: /*generate behavior*/ this->builder.CreateStore( - this->gen_const(32,(uint32_t)(PC+ 2)), + this->gen_const(32,(uint32_t)(PC+2)), get_reg_ptr(1 + traits::X0), false); auto PC_val_v = (uint32_t)(PC+(int16_t)sext<12>(imm)); this->builder.CreateStore(this->gen_const(32,PC_val_v), get_reg_ptr(traits::NEXT_PC), false); @@ -3576,10 +3576,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_const(32,(uint32_t)((int8_t)sext<6>(imm))), get_reg_ptr(rd + traits::X0), false); @@ -3618,10 +3618,10 @@ private: this->gen_set_pc(pc, traits::NEXT_PC); /*generate behavior*/ - if(imm== 0||rd>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + if(imm==0||rd>=static_cast(traits::RFS)) { + this->gen_raise_trap(0, 2); } - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_const(32,(uint32_t)((int32_t)sext<18>(imm))), get_reg_ptr(rd + traits::X0), false); @@ -3669,7 +3669,7 @@ private: get_reg_ptr(2 + traits::X0), false); } else{ - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); auto returnValue = std::make_tuple(CONT,bb); @@ -3695,7 +3695,7 @@ private: this->gen_set_pc(pc, traits::NEXT_PC); /*generate behavior*/ - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); auto returnValue = std::make_tuple(CONT,bb); @@ -3731,10 +3731,10 @@ private: /*generate behavior*/ this->builder.CreateStore( this->builder.CreateLShr( - this->gen_reg_load(rs1+ 8+ traits::X0, 0), + this->gen_reg_load(rs1+8+ traits::X0, 0), this->gen_ext(this->gen_const(8,shamt), 32,false)) , - get_reg_ptr(rs1+ 8 + traits::X0), false); + get_reg_ptr(rs1+8 + traits::X0), false); bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); auto returnValue = std::make_tuple(CONT,bb); @@ -3772,24 +3772,24 @@ private: this->gen_ext( (this->builder.CreateAShr( (this->gen_ext( - this->gen_reg_load(rs1+ 8+ traits::X0, 0), + this->gen_reg_load(rs1+8+ traits::X0, 0), 32, false)), this->gen_ext(this->gen_const(8,shamt), 32,false)) ), 32, true), - get_reg_ptr(rs1+ 8 + traits::X0), false); + get_reg_ptr(rs1+8 + traits::X0), false); } else{ - if(static_cast(traits::XLEN)== 128){ this->builder.CreateStore( + if(static_cast(traits::XLEN)==128){ this->builder.CreateStore( this->gen_ext( (this->builder.CreateAShr( (this->gen_ext( - this->gen_reg_load(rs1+ 8+ traits::X0, 0), + this->gen_reg_load(rs1+8+ traits::X0, 0), 32, false)), - this->gen_ext(this->gen_const(8, 64), 32,false)) + this->gen_ext(this->gen_const(8,64), 32,false)) ), 32, true), - get_reg_ptr(rs1+ 8 + traits::X0), false); + get_reg_ptr(rs1+8 + traits::X0), false); } } bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); @@ -3828,11 +3828,11 @@ private: this->builder.CreateStore( this->gen_ext( (this->builder.CreateAnd( - this->gen_reg_load(rs1+ 8+ traits::X0, 0), + this->gen_reg_load(rs1+8+ traits::X0, 0), this->gen_ext(this->gen_const(8,(int8_t)sext<6>(imm)), 32,true)) ), 32, true), - get_reg_ptr(rs1+ 8 + traits::X0), false); + get_reg_ptr(rs1+8 + traits::X0), false); bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); auto returnValue = std::make_tuple(CONT,bb); @@ -3869,11 +3869,11 @@ private: this->builder.CreateStore( this->gen_ext( (this->builder.CreateSub( - this->gen_ext(this->gen_reg_load(rd+ 8+ traits::X0, 0), 64,false), - this->gen_ext(this->gen_reg_load(rs2+ 8+ traits::X0, 0), 64,false)) + this->gen_ext(this->gen_reg_load(rd+8+ traits::X0, 0), 64,false), + this->gen_ext(this->gen_reg_load(rs2+8+ traits::X0, 0), 64,false)) ), 32, true), - get_reg_ptr(rd+ 8 + traits::X0), false); + get_reg_ptr(rd+8 + traits::X0), false); bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); auto returnValue = std::make_tuple(CONT,bb); @@ -3909,10 +3909,10 @@ private: /*generate behavior*/ this->builder.CreateStore( this->builder.CreateXor( - this->gen_reg_load(rd+ 8+ traits::X0, 0), - this->gen_reg_load(rs2+ 8+ traits::X0, 0)) + this->gen_reg_load(rd+8+ traits::X0, 0), + this->gen_reg_load(rs2+8+ traits::X0, 0)) , - get_reg_ptr(rd+ 8 + traits::X0), false); + get_reg_ptr(rd+8 + traits::X0), false); bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); auto returnValue = std::make_tuple(CONT,bb); @@ -3948,10 +3948,10 @@ private: /*generate behavior*/ this->builder.CreateStore( this->builder.CreateOr( - this->gen_reg_load(rd+ 8+ traits::X0, 0), - this->gen_reg_load(rs2+ 8+ traits::X0, 0)) + this->gen_reg_load(rd+8+ traits::X0, 0), + this->gen_reg_load(rs2+8+ traits::X0, 0)) , - get_reg_ptr(rd+ 8 + traits::X0), false); + get_reg_ptr(rd+8 + traits::X0), false); bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); auto returnValue = std::make_tuple(CONT,bb); @@ -3987,10 +3987,10 @@ private: /*generate behavior*/ this->builder.CreateStore( this->builder.CreateAnd( - this->gen_reg_load(rd+ 8+ traits::X0, 0), - this->gen_reg_load(rs2+ 8+ traits::X0, 0)) + this->gen_reg_load(rd+8+ traits::X0, 0), + this->gen_reg_load(rs2+8+ traits::X0, 0)) , - get_reg_ptr(rd+ 8 + traits::X0), false); + get_reg_ptr(rd+8 + traits::X0), false); bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); auto returnValue = std::make_tuple(CONT,bb); @@ -4062,8 +4062,8 @@ private: auto bb_merge = BasicBlock::Create(this->mod->getContext(), "bb_merge", this->func, this->leave_blk); auto bb_then = BasicBlock::Create(this->mod->getContext(), "bb_then", this->func, bb_merge); this->builder.CreateCondBr(this->gen_ext(this->builder.CreateICmp(ICmpInst::ICMP_EQ, - this->gen_reg_load(rs1+ 8+ traits::X0, 0), - this->gen_ext(this->gen_const(8, 0), 32,false)) + this->gen_reg_load(rs1+8+ traits::X0, 0), + this->gen_ext(this->gen_const(8,0), 32,false)) , 1), bb_then, bb_merge); this->builder.SetInsertPoint(bb_then); { @@ -4109,8 +4109,8 @@ private: auto bb_merge = BasicBlock::Create(this->mod->getContext(), "bb_merge", this->func, this->leave_blk); auto bb_then = BasicBlock::Create(this->mod->getContext(), "bb_then", this->func, bb_merge); this->builder.CreateCondBr(this->gen_ext(this->builder.CreateICmp(ICmpInst::ICMP_NE, - this->gen_reg_load(rs1+ 8+ traits::X0, 0), - this->gen_ext(this->gen_const(8, 0), 32,false)) + this->gen_reg_load(rs1+8+ traits::X0, 0), + this->gen_ext(this->gen_const(8,0), 32,false)) , 1), bb_then, bb_merge); this->builder.SetInsertPoint(bb_then); { @@ -4154,10 +4154,10 @@ private: /*generate behavior*/ if(rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rs1!= 0) { + if(rs1!=0) { this->builder.CreateStore( this->builder.CreateShl( this->gen_reg_load(rs1+ traits::X0, 0), @@ -4199,8 +4199,8 @@ private: this->gen_set_pc(pc, traits::NEXT_PC); /*generate behavior*/ - if(rd>=static_cast(traits::RFS)||rd== 0) { - this->gen_raise_trap(0, 2); + if(rd>=static_cast(traits::RFS)||rd==0) { + this->gen_raise_trap(0, 2); } else{ auto offs =this->gen_ext( @@ -4251,10 +4251,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_reg_load(rs2+ traits::X0, 0), get_reg_ptr(rd + traits::X0), false); @@ -4292,10 +4292,9 @@ private: this->gen_set_pc(pc, traits::NEXT_PC); /*generate behavior*/ - if(rs1&&rs1(traits::RFS)){ auto addr_mask =this->gen_const(32,(uint32_t)- 2); - auto PC_val_v = this->builder.CreateAnd( + if(rs1&&rs1(traits::RFS)){ auto PC_val_v = this->builder.CreateAnd( this->gen_reg_load(rs1%static_cast(traits::RFS)+ traits::X0, 0), - addr_mask) + this->gen_const(32,~ 1)) ; this->builder.CreateStore(PC_val_v, get_reg_ptr(traits::NEXT_PC), false); this->builder.CreateStore(this->gen_const(32,2U), get_reg_ptr(traits::LAST_BRANCH), false); @@ -4361,10 +4360,10 @@ private: /*generate behavior*/ if(rd>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { this->builder.CreateStore( this->gen_ext( (this->builder.CreateAdd( @@ -4408,17 +4407,16 @@ private: /*generate behavior*/ if(rs1>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ - auto addr_mask =this->gen_const(32,(uint32_t)- 2); auto new_pc =this->gen_reg_load(rs1+ traits::X0, 0); this->builder.CreateStore( - this->gen_const(32,(uint32_t)(PC+ 2)), + this->gen_const(32,(uint32_t)(PC+2)), get_reg_ptr(1 + traits::X0), false); auto PC_val_v = this->builder.CreateAnd( new_pc, - addr_mask) + this->gen_const(32,~ 1)) ; this->builder.CreateStore(PC_val_v, get_reg_ptr(traits::NEXT_PC), false); this->builder.CreateStore(this->gen_const(32,2U), get_reg_ptr(traits::LAST_BRANCH), false); @@ -4446,7 +4444,7 @@ private: this->gen_set_pc(pc, traits::NEXT_PC); /*generate behavior*/ - this->gen_raise_trap(0, 3); + this->gen_raise_trap(0, 3); bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); auto returnValue = std::make_tuple(CONT,bb); @@ -4481,7 +4479,7 @@ private: /*generate behavior*/ if(rs2>=static_cast(traits::RFS)) { - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); } else{ auto offs =this->gen_ext( @@ -4519,7 +4517,7 @@ private: this->gen_set_pc(pc, traits::NEXT_PC); /*generate behavior*/ - this->gen_raise_trap(0, 2); + this->gen_raise_trap(0, 2); bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); auto returnValue = std::make_tuple(CONT,bb); diff --git a/src/vm/tcc/vm_tgc5c.cpp b/src/vm/tcc/vm_tgc5c.cpp index 9015757..88c7e9d 100644 --- a/src/vm/tcc/vm_tgc5c.cpp +++ b/src/vm/tcc/vm_tgc5c.cpp @@ -346,10 +346,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.constant((uint32_t)((int32_t)imm),32)); } @@ -381,10 +381,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.constant((uint32_t)(PC+(int32_t)imm),32)); } @@ -416,15 +416,15 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(imm%static_cast(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0); + if(imm%static_cast(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, - tu.constant((uint32_t)(PC+ 4),32)); + 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); @@ -459,7 +459,7 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ auto addr_mask = tu.assignment(tu.constant((uint32_t)- 2,32),32); @@ -471,11 +471,11 @@ private: tu.open_if(tu.urem( new_pc, tu.constant(static_cast(traits:: INSTR_ALIGNMENT),32))); - this->gen_raise_trap(tu, 0, 0); + this->gen_raise_trap(tu, 0, 0); tu.open_else(); - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, - tu.constant((uint32_t)(PC+ 4),32)); + 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); @@ -510,13 +510,13 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rs2>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + 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))); - if(imm%static_cast(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0); + if(imm%static_cast(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0); } else{ auto PC_val_v = tu.assignment("PC_val", (uint32_t)(PC+(int16_t)sext<13>(imm)),32); @@ -553,13 +553,13 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rs2>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + 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))); - if(imm%static_cast(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0); + if(imm%static_cast(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0); } else{ auto PC_val_v = tu.assignment("PC_val", (uint32_t)(PC+(int16_t)sext<13>(imm)),32); @@ -596,13 +596,13 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rs2>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + 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))); - if(imm%static_cast(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0); + if(imm%static_cast(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0); } else{ auto PC_val_v = tu.assignment("PC_val", (uint32_t)(PC+(int16_t)sext<13>(imm)),32); @@ -639,13 +639,13 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rs2>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + 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))); - if(imm%static_cast(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0); + if(imm%static_cast(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0); } else{ auto PC_val_v = tu.assignment("PC_val", (uint32_t)(PC+(int16_t)sext<13>(imm)),32); @@ -682,13 +682,13 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rs2>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + 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))); - if(imm%static_cast(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0); + if(imm%static_cast(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0); } else{ auto PC_val_v = tu.assignment("PC_val", (uint32_t)(PC+(int16_t)sext<13>(imm)),32); @@ -725,13 +725,13 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rs2>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + 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))); - if(imm%static_cast(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0); + if(imm%static_cast(traits:: INSTR_ALIGNMENT)){ this->gen_raise_trap(tu, 0, 0); } else{ auto PC_val_v = tu.assignment("PC_val", (uint32_t)(PC+(int16_t)sext<13>(imm)),32); @@ -768,14 +768,14 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + 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 res = tu.assignment(tu.ext(tu.read_mem(traits::MEM, load_address, 8),8,true),8); - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.ext(res,32,false)); } @@ -808,14 +808,14 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + 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 res = tu.assignment(tu.ext(tu.read_mem(traits::MEM, load_address, 16),16,true),16); - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.ext(res,32,false)); } @@ -848,14 +848,14 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + 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 res = tu.assignment(tu.ext(tu.read_mem(traits::MEM, load_address, 32),32,true),32); - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.ext(res,32,false)); } @@ -888,14 +888,14 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + 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 res = tu.assignment(tu.read_mem(traits::MEM, load_address, 8),8); - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.ext(res,32,false)); } @@ -928,14 +928,14 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + 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 res = tu.assignment(tu.read_mem(traits::MEM, load_address, 16),16); - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.ext(res,32,false)); } @@ -968,7 +968,7 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rs2>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ auto store_address = tu.assignment(tu.ext((tu.add( @@ -1004,7 +1004,7 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rs2>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ auto store_address = tu.assignment(tu.ext((tu.add( @@ -1040,7 +1040,7 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rs2>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ auto store_address = tu.assignment(tu.ext((tu.add( @@ -1076,10 +1076,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.ext((tu.add( tu.load(rs1+ traits::X0, 0), @@ -1114,14 +1114,14 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + 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.constant((int16_t)sext<12>(imm),16))), tu.constant(1,8),tu.constant(0,8))); } } auto returnValue = std::make_tuple(CONT); @@ -1152,14 +1152,14 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + 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.constant((uint32_t)((int16_t)sext<12>(imm)),32))), tu.constant(1,8),tu.constant(0,8))); } } auto returnValue = std::make_tuple(CONT); @@ -1190,10 +1190,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.bitwise_xor( tu.load(rs1+ traits::X0, 0), @@ -1228,10 +1228,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.bitwise_or( tu.load(rs1+ traits::X0, 0), @@ -1266,10 +1266,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.bitwise_and( tu.load(rs1+ traits::X0, 0), @@ -1304,10 +1304,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.shl( tu.load(rs1+ traits::X0, 0), @@ -1342,10 +1342,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.lshr( tu.load(rs1+ traits::X0, 0), @@ -1380,10 +1380,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.ext((tu.ashr( tu.ext(tu.load(rs1+ traits::X0, 0),32,true), @@ -1418,10 +1418,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.ext((tu.add( tu.load(rs1+ traits::X0, 0), @@ -1456,10 +1456,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.ext((tu.sub( tu.load(rs1+ traits::X0, 0), @@ -1494,16 +1494,16 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + 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.constant((static_cast(traits:: XLEN)-1),64))))); } } auto returnValue = std::make_tuple(CONT); @@ -1534,14 +1534,14 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + 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.ext(tu.load(rs2+ traits::X0, 0),32,true)), tu.constant(1,8),tu.constant(0,8))); } } auto returnValue = std::make_tuple(CONT); @@ -1572,14 +1572,14 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + 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.load(rs2+ traits::X0, 0)), tu.constant(1,8),tu.constant(0,8))); } } auto returnValue = std::make_tuple(CONT); @@ -1610,10 +1610,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.bitwise_xor( tu.load(rs1+ traits::X0, 0), @@ -1648,16 +1648,16 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + 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(traits:: XLEN)- 1),64))))); + tu.constant((static_cast(traits:: XLEN)-1),64))))); } } auto returnValue = std::make_tuple(CONT); @@ -1688,16 +1688,16 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + 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(traits:: XLEN)- 1),64))))),32,false)); + tu.constant((static_cast(traits:: XLEN)-1),64))))),32,false)); } } auto returnValue = std::make_tuple(CONT); @@ -1728,10 +1728,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.bitwise_or( tu.load(rs1+ traits::X0, 0), @@ -1766,10 +1766,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.bitwise_and( tu.load(rs1+ traits::X0, 0), @@ -1805,7 +1805,7 @@ private: pc=pc+ 4; gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); - tu.write_mem(traits::FENCE, static_cast(traits:: fence), tu.constant((uint8_t)pred<< 4|succ,8)); + tu.write_mem(traits::FENCE, static_cast(traits:: fence), tu.constant((uint8_t)pred<<4|succ,8)); auto returnValue = std::make_tuple(CONT); tu.close_scope(); @@ -1827,7 +1827,7 @@ private: pc=pc+ 4; gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); - this->gen_raise_trap(tu, 0, 11); + this->gen_raise_trap(tu, 0, 11); auto returnValue = std::make_tuple(TRAP); tu.close_scope(); @@ -1849,7 +1849,7 @@ private: pc=pc+ 4; gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); - this->gen_raise_trap(tu, 0, 3); + this->gen_raise_trap(tu, 0, 3); auto returnValue = std::make_tuple(TRAP); tu.close_scope(); @@ -1922,11 +1922,11 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ 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); + 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); @@ -1963,17 +1963,17 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ 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) { + if(rs1!=0) { tu.write_mem(traits::CSR, csr, tu.bitwise_or( xrd, xrs1)); } - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, xrd); } @@ -2006,17 +2006,17 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ 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) { + if(rs1!=0) { tu.write_mem(traits::CSR, csr, tu.bitwise_and( xrd, tu.logical_neg(xrs1))); } - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, xrd); } @@ -2049,12 +2049,12 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ 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) { + if(rd!=0) { tu.store(rd + traits::X0, xrd); } @@ -2087,16 +2087,16 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ auto xrd = tu.assignment(tu.read_mem(traits::CSR, csr, 32),32); - if(zimm!= 0) { + if(zimm!=0) { tu.write_mem(traits::CSR, csr, tu.bitwise_or( xrd, tu.constant((uint32_t)zimm,32))); } - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, xrd); } @@ -2129,16 +2129,16 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ auto xrd = tu.assignment(tu.read_mem(traits::CSR, csr, 32),32); - if(zimm!= 0) { + if(zimm!=0) { tu.write_mem(traits::CSR, csr, tu.bitwise_and( xrd, tu.constant(~ ((uint32_t)zimm),32))); } - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, xrd); } @@ -2171,7 +2171,7 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); tu.write_mem(traits::FENCE, static_cast(traits:: fencei), tu.constant(imm,16)); - auto returnValue = std::make_tuple(CONT); + auto returnValue = std::make_tuple(FLUSH); tu.close_scope(); gen_trap_check(tu); @@ -2199,7 +2199,7 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ auto res = tu.assignment(tu.ext((tu.mul( @@ -2238,7 +2238,7 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ auto res = tu.assignment(tu.ext((tu.mul( @@ -2279,7 +2279,7 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ auto res = tu.assignment(tu.ext((tu.mul( @@ -2320,7 +2320,7 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ auto res = tu.assignment(tu.ext((tu.mul( @@ -2361,14 +2361,14 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } 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, + if(rd!=0){ tu.open_if(tu.icmp(ICmpInst::ICMP_NE, divisor, - tu.constant( 0,8))); + 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, @@ -2419,12 +2419,12 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + 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.constant(0,8))); if(rd!=0) { tu.store(rd + traits::X0, tu.ext((tu.udiv( @@ -2466,12 +2466,12 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + 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.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, @@ -2482,7 +2482,7 @@ private: tu.constant(- 1,8)))); if(rd!=0) { tu.store(rd + traits::X0, - tu.constant( 0,8)); + tu.constant(0,8)); } tu.open_else(); if(rd!=0) { @@ -2527,12 +2527,12 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)||rs1>=static_cast(traits:: RFS)||rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + 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.constant(0,8))); if(rd!=0) { tu.store(rd + traits::X0, tu.urem( @@ -2573,13 +2573,13 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(imm) { - tu.store(rd+ 8 + traits::X0, + 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); + this->gen_raise_trap(tu, 0, 2); } auto returnValue = std::make_tuple(CONT); @@ -2609,9 +2609,9 @@ private: 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.load(rs1+8+ traits::X0, 0), tu.constant(uimm,8))),32,false),32); - tu.store(rd+ 8 + traits::X0, + 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); @@ -2641,9 +2641,9 @@ private: 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.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)); + tu.write_mem(traits::MEM, offs, tu.ext(tu.load(rs2+8+ traits::X0, 0),32,false)); auto returnValue = std::make_tuple(CONT); tu.close_scope(); @@ -2671,10 +2671,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rs1!= 0) { + if(rs1!=0) { tu.store(rs1 + traits::X0, tu.ext((tu.add( tu.load(rs1+ traits::X0, 0), @@ -2729,7 +2729,7 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); tu.store(1 + traits::X0, - tu.constant((uint32_t)(PC+ 2),32)); + 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)); @@ -2760,10 +2760,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.constant((uint32_t)((int8_t)sext<6>(imm)),32)); } @@ -2794,10 +2794,10 @@ private: pc=pc+ 2; gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); - if(imm== 0||rd>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + if(imm==0||rd>=static_cast(traits:: RFS)) { + this->gen_raise_trap(tu, 0, 2); } - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.constant((uint32_t)((int32_t)sext<18>(imm)),32)); } @@ -2833,7 +2833,7 @@ private: tu.constant((int16_t)sext<10>(nzimm),16))),32,false)); } else{ - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } auto returnValue = std::make_tuple(CONT); @@ -2857,7 +2857,7 @@ private: pc=pc+ 2; gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); auto returnValue = std::make_tuple(CONT); tu.close_scope(); @@ -2884,9 +2884,9 @@ private: pc=pc+ 2; gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); - tu.store(rs1+ 8 + traits::X0, + tu.store(rs1+8 + traits::X0, tu.lshr( - tu.load(rs1+ 8+ traits::X0, 0), + tu.load(rs1+8+ traits::X0, 0), tu.constant(shamt,8))); auto returnValue = std::make_tuple(CONT); @@ -2914,16 +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, + if(shamt){ tu.store(rs1+8 + traits::X0, tu.ext((tu.ashr( - (tu.ext(tu.load(rs1+ 8+ traits::X0, 0),32,true)), + (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, + 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)); + (tu.ext(tu.load(rs1+8+ traits::X0, 0),32,true)), + tu.constant(64,8))),32,false)); } } auto returnValue = std::make_tuple(CONT); @@ -2952,9 +2952,9 @@ private: pc=pc+ 2; gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); - tu.store(rs1+ 8 + traits::X0, + tu.store(rs1+8 + traits::X0, tu.ext((tu.bitwise_and( - tu.load(rs1+ 8+ traits::X0, 0), + tu.load(rs1+8+ traits::X0, 0), tu.constant((int8_t)sext<6>(imm),8))),32,false)); auto returnValue = std::make_tuple(CONT); @@ -2982,10 +2982,10 @@ private: pc=pc+ 2; gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); - tu.store(rd+ 8 + traits::X0, + 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.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 +3012,10 @@ private: pc=pc+ 2; gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); - tu.store(rd+ 8 + traits::X0, + tu.store(rd+8 + traits::X0, tu.bitwise_xor( - tu.load(rd+ 8+ traits::X0, 0), - tu.load(rs2+ 8+ traits::X0, 0))); + 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 +3042,10 @@ private: pc=pc+ 2; gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); - tu.store(rd+ 8 + traits::X0, + tu.store(rd+8 + traits::X0, tu.bitwise_or( - tu.load(rd+ 8+ traits::X0, 0), - tu.load(rs2+ 8+ traits::X0, 0))); + 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 +3072,10 @@ private: pc=pc+ 2; gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); - tu.store(rd+ 8 + traits::X0, + tu.store(rd+8 + traits::X0, tu.bitwise_and( - tu.load(rd+ 8+ traits::X0, 0), - tu.load(rs2+ 8+ traits::X0, 0))); + tu.load(rd+8+ traits::X0, 0), + tu.load(rs2+8+ traits::X0, 0))); auto returnValue = std::make_tuple(CONT); tu.close_scope(); @@ -3131,8 +3131,8 @@ private: 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.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)); @@ -3164,8 +3164,8 @@ private: 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.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)); @@ -3197,10 +3197,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rs1!= 0) { + if(rs1!=0) { tu.store(rs1 + traits::X0, tu.shl( tu.load(rs1+ traits::X0, 0), @@ -3233,8 +3233,8 @@ private: pc=pc+ 2; gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); - if(rd>=static_cast(traits:: RFS)||rd== 0) { - this->gen_raise_trap(tu, 0, 2); + if(rd>=static_cast(traits:: RFS)||rd==0) { + this->gen_raise_trap(tu, 0, 2); } else{ auto offs = tu.assignment(tu.ext((tu.add( @@ -3270,10 +3270,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.load(rs2+ traits::X0, 0)); } @@ -3303,12 +3303,11 @@ private: pc=pc+ 2; gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); - if(rs1&&rs1(traits:: RFS)) { - auto PC_val_v = tu.assignment("PC_val", tu.bitwise_and( - tu.load(rs1%static_cast(traits:: RFS)+ traits::X0, 0), - tu.constant(~ 0x1,8)),32); - tu.store(traits::NEXT_PC, PC_val_v); - tu.store(traits::LAST_BRANCH, tu.constant(2U, 2)); + if(rs1&&rs1(traits:: RFS)){ auto PC_val_v = tu.assignment("PC_val", tu.bitwise_and( + tu.load(rs1%static_cast(traits:: RFS)+ traits::X0, 0), + tu.constant(~ 1,32)),32); + tu.store(traits::NEXT_PC, PC_val_v); + tu.store(traits::LAST_BRANCH, tu.constant(2U, 2)); } else{ this->gen_raise_trap(tu, 0, 2); @@ -3362,10 +3361,10 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rd>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ - if(rd!= 0) { + if(rd!=0) { tu.store(rd + traits::X0, tu.ext((tu.add( tu.load(rd+ traits::X0, 0), @@ -3398,15 +3397,15 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rs1>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ auto new_pc = tu.assignment(tu.load(rs1+ traits::X0, 0),32); tu.store(1 + traits::X0, - tu.constant((uint32_t)(PC+ 2),32)); + tu.constant((uint32_t)(PC+2),32)); auto PC_val_v = tu.assignment("PC_val", tu.bitwise_and( new_pc, - tu.constant(~ 0x1,8)),32); + tu.constant(~ 1,32)),32); tu.store(traits::NEXT_PC, PC_val_v); tu.store(traits::LAST_BRANCH, tu.constant(2U, 2)); } @@ -3431,7 +3430,7 @@ private: pc=pc+ 2; gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); - this->gen_raise_trap(tu, 0, 3); + this->gen_raise_trap(tu, 0, 3); auto returnValue = std::make_tuple(CONT); tu.close_scope(); @@ -3459,7 +3458,7 @@ private: gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); if(rs2>=static_cast(traits:: RFS)) { - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); } else{ auto offs = tu.assignment(tu.ext((tu.add( @@ -3488,7 +3487,7 @@ private: pc=pc+ 2; gen_set_pc(tu, pc, traits::NEXT_PC); tu.open_scope(); - this->gen_raise_trap(tu, 0, 2); + this->gen_raise_trap(tu, 0, 2); auto returnValue = std::make_tuple(CONT); tu.close_scope();