From a27850f841ad139484664f8e5a8530ac5104673f Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Sat, 18 May 2024 21:00:21 +0200 Subject: [PATCH] adds verilog literal and illegal_instr to asmjit --- gen_input/templates/asmjit/CORENAME.cpp.gtl | 12 +- src/vm/asmjit/vm_tgc5c.cpp | 361 ++++++++++---------- 2 files changed, 194 insertions(+), 179 deletions(-) diff --git a/gen_input/templates/asmjit/CORENAME.cpp.gtl b/gen_input/templates/asmjit/CORENAME.cpp.gtl index 081d9de..b671123 100644 --- a/gen_input/templates/asmjit/CORENAME.cpp.gtl +++ b/gen_input/templates/asmjit/CORENAME.cpp.gtl @@ -174,9 +174,17 @@ private: * end opcode definitions ****************************************************************************/ continuation_e illegal_intruction(virt_addr_t &pc, code_word_t instr, jit_holder& jh ) { - + x86::Compiler& cc = jh.cc; + cc.comment(fmt::format("illegal_intruction{:#x}:",pc.val).c_str()); + this->gen_sync(jh, PRE_SYNC, instr_descr.size()); + pc = pc + ((instr & 3) == 3 ? 4 : 2); + gen_instr_prologue(jh); + cc.comment("//behavior:"); + gen_instr_epilogue(jh); + this->gen_sync(jh, POST_SYNC, instr_descr.size()); return BRANCH; - } + } + //decoding functionality void populate_decoding_tree(decoding_tree_node* root){ diff --git a/src/vm/asmjit/vm_tgc5c.cpp b/src/vm/asmjit/vm_tgc5c.cpp index ac2681c..7d72232 100644 --- a/src/vm/asmjit/vm_tgc5c.cpp +++ b/src/vm/asmjit/vm_tgc5c.cpp @@ -80,7 +80,7 @@ public: protected: using super::get_ptr_for; - using super::get_reg; +using super::get_reg; using super::get_reg_for; using super::load_reg_from_mem; using super::write_reg_to_mem; @@ -339,10 +339,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), (uint32_t)((int32_t)imm)); } @@ -385,10 +385,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), (uint32_t)(PC+(int32_t)imm)); } @@ -431,16 +431,16 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ if(imm%static_cast(traits::INSTR_ALIGNMENT)){ - gen_raise(jh, 0, 0); + gen_raise(jh, 0, 0); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), - (uint32_t)(PC+ 4)); + (uint32_t)(PC+4)); } auto PC_val_v = (uint32_t)(PC+(int32_t)sext<21>(imm)); cc.mov(jh.next_pc, PC_val_v); @@ -486,7 +486,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto addr_mask = (uint32_t)- 2; @@ -500,14 +500,14 @@ private: auto label_else = cc.newLabel(); cc.je(label_else); { - gen_raise(jh, 0, 0); + gen_raise(jh, 0, 0); } cc.jmp(label_merge); cc.bind(label_else); { - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), - (uint32_t)(PC+ 4)); + (uint32_t)(PC+4)); } auto PC_val_v = new_pc; cc.mov(jh.next_pc, PC_val_v); @@ -554,7 +554,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto label_merge = cc.newLabel(); @@ -563,7 +563,7 @@ private: cc.je(label_merge); { if(imm%static_cast(traits::INSTR_ALIGNMENT)){ - gen_raise(jh, 0, 0); + gen_raise(jh, 0, 0); } else{ auto PC_val_v = (uint32_t)(PC+(int16_t)sext<13>(imm)); @@ -612,7 +612,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto label_merge = cc.newLabel(); @@ -621,7 +621,7 @@ private: cc.je(label_merge); { if(imm%static_cast(traits::INSTR_ALIGNMENT)){ - gen_raise(jh, 0, 0); + gen_raise(jh, 0, 0); } else{ auto PC_val_v = (uint32_t)(PC+(int16_t)sext<13>(imm)); @@ -670,7 +670,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto label_merge = cc.newLabel(); @@ -681,7 +681,7 @@ private: cc.je(label_merge); { if(imm%static_cast(traits::INSTR_ALIGNMENT)){ - gen_raise(jh, 0, 0); + gen_raise(jh, 0, 0); } else{ auto PC_val_v = (uint32_t)(PC+(int16_t)sext<13>(imm)); @@ -730,7 +730,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto label_merge = cc.newLabel(); @@ -741,7 +741,7 @@ private: cc.je(label_merge); { if(imm%static_cast(traits::INSTR_ALIGNMENT)){ - gen_raise(jh, 0, 0); + gen_raise(jh, 0, 0); } else{ auto PC_val_v = (uint32_t)(PC+(int16_t)sext<13>(imm)); @@ -790,7 +790,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto label_merge = cc.newLabel(); @@ -799,7 +799,7 @@ private: cc.je(label_merge); { if(imm%static_cast(traits::INSTR_ALIGNMENT)){ - gen_raise(jh, 0, 0); + gen_raise(jh, 0, 0); } else{ auto PC_val_v = (uint32_t)(PC+(int16_t)sext<13>(imm)); @@ -848,7 +848,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto label_merge = cc.newLabel(); @@ -857,7 +857,7 @@ private: cc.je(label_merge); { if(imm%static_cast(traits::INSTR_ALIGNMENT)){ - gen_raise(jh, 0, 0); + gen_raise(jh, 0, 0); } else{ auto PC_val_v = (uint32_t)(PC+(int16_t)sext<13>(imm)); @@ -906,7 +906,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto load_address = gen_ext(jh, @@ -914,7 +914,7 @@ private: ), 32, true); auto res = gen_ext(jh, gen_read_mem(jh, traits::MEM, load_address, 1), 8, false); - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_ext(jh, res, 32, true)); @@ -959,7 +959,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto load_address = gen_ext(jh, @@ -967,7 +967,7 @@ private: ), 32, true); auto res = gen_ext(jh, gen_read_mem(jh, traits::MEM, load_address, 2), 16, false); - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_ext(jh, res, 32, true)); @@ -1012,7 +1012,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto load_address = gen_ext(jh, @@ -1020,7 +1020,7 @@ private: ), 32, true); auto res = gen_ext(jh, gen_read_mem(jh, traits::MEM, load_address, 4), 32, false); - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_ext(jh, res, 32, true)); @@ -1065,14 +1065,14 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto load_address = gen_ext(jh, (gen_operation(jh, add, load_reg_from_mem(jh, traits::X0 + rs1), (int16_t)sext<12>(imm)) ), 32, true); auto res = gen_read_mem(jh, traits::MEM, load_address, 1); - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_ext(jh, res, 32, false)); @@ -1117,14 +1117,14 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto load_address = gen_ext(jh, (gen_operation(jh, add, load_reg_from_mem(jh, traits::X0 + rs1), (int16_t)sext<12>(imm)) ), 32, true); auto res = gen_read_mem(jh, traits::MEM, load_address, 2); - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_ext(jh, res, 32, false)); @@ -1169,7 +1169,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto store_address = gen_ext(jh, @@ -1217,7 +1217,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto store_address = gen_ext(jh, @@ -1265,7 +1265,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rs2>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto store_address = gen_ext(jh, @@ -1313,10 +1313,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_ext(jh, (gen_operation(jh, add, load_reg_from_mem(jh, traits::X0 + rs1), (int16_t)sext<12>(imm)) @@ -1362,10 +1362,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ { auto label_then = cc.newLabel(); auto label_merge = cc.newLabel(); @@ -1373,10 +1373,10 @@ private: cc.cmp(gen_ext(jh, load_reg_from_mem(jh, traits::X0 + rs1), 32, true), (int16_t)sext<12>(imm)); cc.jl(label_then); - cc.mov(tmp_reg, 0); + cc.mov(tmp_reg,0); cc.jmp(label_merge); cc.bind(label_then); - cc.mov(tmp_reg, 1); + cc.mov(tmp_reg,1); cc.bind(label_merge); cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_ext(jh, tmp_reg @@ -1424,20 +1424,20 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ { auto label_then = cc.newLabel(); auto label_merge = cc.newLabel(); auto tmp_reg = get_reg_for(jh, 1); cc.cmp(load_reg_from_mem(jh, traits::X0 + rs1), (uint32_t)((int16_t)sext<12>(imm))); cc.jb(label_then); - cc.mov(tmp_reg, 0); + cc.mov(tmp_reg,0); cc.jmp(label_merge); cc.bind(label_then); - cc.mov(tmp_reg, 1); + cc.mov(tmp_reg,1); cc.bind(label_merge); cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_ext(jh, tmp_reg @@ -1485,10 +1485,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_operation(jh, bxor, load_reg_from_mem(jh, traits::X0 + rs1), (uint32_t)((int16_t)sext<12>(imm))) ); @@ -1533,10 +1533,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_operation(jh, bor, load_reg_from_mem(jh, traits::X0 + rs1), (uint32_t)((int16_t)sext<12>(imm))) ); @@ -1581,10 +1581,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_operation(jh, band, load_reg_from_mem(jh, traits::X0 + rs1), (uint32_t)((int16_t)sext<12>(imm))) ); @@ -1629,10 +1629,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_operation(jh, shl, load_reg_from_mem(jh, traits::X0 + rs1), shamt) ); @@ -1677,10 +1677,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_operation(jh, shr, load_reg_from_mem(jh, traits::X0 + rs1), shamt) ); @@ -1725,10 +1725,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_ext(jh, (gen_operation(jh, sar, gen_ext(jh, @@ -1775,10 +1775,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_ext(jh, (gen_operation(jh, add, load_reg_from_mem(jh, traits::X0 + rs1), load_reg_from_mem(jh, traits::X0 + rs2)) @@ -1824,10 +1824,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_ext(jh, (gen_operation(jh, sub, load_reg_from_mem(jh, traits::X0 + rs1), load_reg_from_mem(jh, traits::X0 + rs2)) @@ -1873,12 +1873,12 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), - gen_ext(jh, gen_operation(jh, shl, load_reg_from_mem(jh, traits::X0 + rs1), (gen_operation(jh, band, load_reg_from_mem(jh, traits::X0 + rs2), (static_cast(traits::XLEN)- 1)) + gen_ext(jh, gen_operation(jh, shl, load_reg_from_mem(jh, traits::X0 + rs1), (gen_operation(jh, band, load_reg_from_mem(jh, traits::X0 + rs2), (static_cast(traits::XLEN)-1)) )) , 32, false)); } @@ -1922,10 +1922,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ { auto label_then = cc.newLabel(); auto label_merge = cc.newLabel(); @@ -1934,10 +1934,10 @@ private: load_reg_from_mem(jh, traits::X0 + rs1), 32, true), gen_ext(jh, load_reg_from_mem(jh, traits::X0 + rs2), 32, true)); cc.jl(label_then); - cc.mov(tmp_reg, 0); + cc.mov(tmp_reg,0); cc.jmp(label_merge); cc.bind(label_then); - cc.mov(tmp_reg, 1); + cc.mov(tmp_reg,1); cc.bind(label_merge); cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_ext(jh, tmp_reg @@ -1985,20 +1985,20 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ { auto label_then = cc.newLabel(); auto label_merge = cc.newLabel(); auto tmp_reg = get_reg_for(jh, 1); cc.cmp(load_reg_from_mem(jh, traits::X0 + rs1), load_reg_from_mem(jh, traits::X0 + rs2)); cc.jb(label_then); - cc.mov(tmp_reg, 0); + cc.mov(tmp_reg,0); cc.jmp(label_merge); cc.bind(label_then); - cc.mov(tmp_reg, 1); + cc.mov(tmp_reg,1); cc.bind(label_merge); cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_ext(jh, tmp_reg @@ -2046,10 +2046,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_operation(jh, bxor, load_reg_from_mem(jh, traits::X0 + rs1), load_reg_from_mem(jh, traits::X0 + rs2)) ); @@ -2094,12 +2094,12 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), - gen_ext(jh, gen_operation(jh, shr, load_reg_from_mem(jh, traits::X0 + rs1), (gen_operation(jh, band, load_reg_from_mem(jh, traits::X0 + rs2), (static_cast(traits::XLEN)- 1)) + gen_ext(jh, gen_operation(jh, shr, load_reg_from_mem(jh, traits::X0 + rs1), (gen_operation(jh, band, load_reg_from_mem(jh, traits::X0 + rs2), (static_cast(traits::XLEN)-1)) )) , 32, false)); } @@ -2143,14 +2143,14 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_ext(jh, (gen_ext(jh, gen_operation(jh, sar, gen_ext(jh, - load_reg_from_mem(jh, traits::X0 + rs1), 32, true), (gen_operation(jh, band, load_reg_from_mem(jh, traits::X0 + rs2), (static_cast(traits::XLEN)- 1)) + load_reg_from_mem(jh, traits::X0 + rs1), 32, true), (gen_operation(jh, band, load_reg_from_mem(jh, traits::X0 + rs2), (static_cast(traits::XLEN)-1)) )) , 32, true)), 32, true)); } @@ -2194,10 +2194,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_operation(jh, bor, load_reg_from_mem(jh, traits::X0 + rs1), load_reg_from_mem(jh, traits::X0 + rs2)) ); @@ -2242,10 +2242,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_operation(jh, band, load_reg_from_mem(jh, traits::X0 + rs1), load_reg_from_mem(jh, traits::X0 + rs2)) ); @@ -2291,7 +2291,7 @@ private: gen_instr_prologue(jh); cc.comment("//behavior:"); /*generate behavior*/ - gen_write_mem(jh, traits::FENCE, static_cast(traits::fence), (uint8_t)pred<< 4|succ, 4); + gen_write_mem(jh, traits::FENCE, static_cast(traits::fence), (uint8_t)pred<<4|succ, 4); auto returnValue = CONT; gen_instr_epilogue(jh); @@ -2326,7 +2326,7 @@ private: gen_instr_prologue(jh); cc.comment("//behavior:"); /*generate behavior*/ - gen_raise(jh, 0, 11); + gen_raise(jh, 0, 11); auto returnValue = TRAP; gen_instr_epilogue(jh); @@ -2361,7 +2361,7 @@ private: gen_instr_prologue(jh); cc.comment("//behavior:"); /*generate behavior*/ - gen_raise(jh, 0, 3); + gen_raise(jh, 0, 3); auto returnValue = TRAP; gen_instr_epilogue(jh); @@ -2471,11 +2471,11 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto xrs1 = load_reg_from_mem(jh, traits::X0 + rs1); - if(rd!= 0){ + if(rd!=0){ auto xrd = gen_read_mem(jh, traits::CSR, csr, 4); gen_write_mem(jh, traits::CSR, csr, xrs1, 4); cc.mov(get_ptr_for(jh, traits::X0+ rd), @@ -2524,16 +2524,16 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto xrd = gen_read_mem(jh, traits::CSR, csr, 4); auto xrs1 = load_reg_from_mem(jh, traits::X0 + rs1); - if(rs1!= 0){ + if(rs1!=0){ gen_write_mem(jh, traits::CSR, csr, gen_operation(jh, bor, xrd, xrs1) , 4); } - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), xrd); } @@ -2577,16 +2577,16 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto xrd = gen_read_mem(jh, traits::CSR, csr, 4); auto xrs1 = load_reg_from_mem(jh, traits::X0 + rs1); - if(rs1!= 0){ + if(rs1!=0){ gen_write_mem(jh, traits::CSR, csr, gen_operation(jh, band, xrd, gen_operation(jh, bnot, xrs1)) , 4); } - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), xrd); } @@ -2630,12 +2630,12 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto xrd = gen_read_mem(jh, traits::CSR, csr, 4); gen_write_mem(jh, traits::CSR, csr, (uint32_t)zimm, 4); - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), xrd); } @@ -2679,15 +2679,15 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto xrd = gen_read_mem(jh, traits::CSR, csr, 4); - if(zimm!= 0){ + if(zimm!=0){ gen_write_mem(jh, traits::CSR, csr, gen_operation(jh, bor, xrd, (uint32_t)zimm) , 4); } - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), xrd); } @@ -2731,15 +2731,15 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto xrd = gen_read_mem(jh, traits::CSR, csr, 4); - if(zimm!= 0){ + if(zimm!=0){ gen_write_mem(jh, traits::CSR, csr, gen_operation(jh, band, xrd, ~ ((uint32_t)zimm)) , 4); } - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), xrd); } @@ -2822,16 +2822,16 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto res = gen_ext(jh, - (gen_operation(jh, imul, - gen_ext(jh, - gen_ext(jh, load_reg_from_mem(jh, traits::X0 + rs1), 32, true), 64, true), - gen_ext(jh, - gen_ext(jh, load_reg_from_mem(jh, traits::X0 + rs2), 32, true), 64, true)) - ), 64, true); + (gen_operation(jh, imul, gen_ext(jh, + gen_ext(jh, + load_reg_from_mem(jh, traits::X0 + rs1), 32, true), 64, true), gen_ext(jh, + gen_ext(jh, + load_reg_from_mem(jh, traits::X0 + rs2), 32, true), 64, true)) + ), 64, true); if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_ext(jh, @@ -2877,7 +2877,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto res = gen_ext(jh, @@ -2933,7 +2933,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto res = gen_ext(jh, @@ -2988,7 +2988,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto res = gen_ext(jh, @@ -3042,16 +3042,16 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto dividend = gen_ext(jh, load_reg_from_mem(jh, traits::X0 + rs1), 32, false); auto divisor = gen_ext(jh, load_reg_from_mem(jh, traits::X0 + rs2), 32, false); - if(rd!= 0){ + if(rd!=0){ auto label_merge = cc.newLabel(); - cc.cmp(gen_operation(jh, ne, divisor, 0) + cc.cmp(gen_operation(jh, ne, divisor, 0) ,0); auto label_else = cc.newLabel(); cc.je(label_else); @@ -3126,11 +3126,11 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto label_merge = cc.newLabel(); - cc.cmp(gen_operation(jh, ne, load_reg_from_mem(jh, traits::X0 + rs2), 0) + cc.cmp(gen_operation(jh, ne, load_reg_from_mem(jh, traits::X0 + rs2), 0) ,0); auto label_else = cc.newLabel(); cc.je(label_else); @@ -3191,11 +3191,11 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto label_merge = cc.newLabel(); - cc.cmp(gen_operation(jh, ne, load_reg_from_mem(jh, traits::X0 + rs2), 0) + cc.cmp(gen_operation(jh, ne, load_reg_from_mem(jh, traits::X0 + rs2), 0) ,0); auto label_else = cc.newLabel(); cc.je(label_else); @@ -3212,7 +3212,7 @@ private: { if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), - gen_ext(jh, 0, 32, false) + gen_ext(jh, 0, 32, false) ); } } @@ -3279,11 +3279,11 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)||rs1>=static_cast(traits::RFS)||rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto label_merge = cc.newLabel(); - cc.cmp(gen_operation(jh, ne, load_reg_from_mem(jh, traits::X0 + rs2), 0) + cc.cmp(gen_operation(jh, ne, load_reg_from_mem(jh, traits::X0 + rs2), 0) ,0); auto label_else = cc.newLabel(); cc.je(label_else); @@ -3342,13 +3342,13 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(imm){ - cc.mov(get_ptr_for(jh, traits::X0+ rd+ 8), + cc.mov(get_ptr_for(jh, traits::X0+ rd+8), gen_ext(jh, (gen_operation(jh, add, load_reg_from_mem(jh, traits::X0 + 2), imm) ), 32, false)); } else{ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } auto returnValue = CONT; @@ -3389,9 +3389,9 @@ private: cc.comment("//behavior:"); /*generate behavior*/ auto offs = gen_ext(jh, - (gen_operation(jh, add, load_reg_from_mem(jh, traits::X0 + rs1+ 8), uimm) + (gen_operation(jh, add, load_reg_from_mem(jh, traits::X0 + rs1+8), uimm) ), 32, false); - cc.mov(get_ptr_for(jh, traits::X0+ rd+ 8), + cc.mov(get_ptr_for(jh, traits::X0+ rd+8), gen_ext(jh, gen_ext(jh, gen_read_mem(jh, traits::MEM, offs, 4), 32, false), 32, true)); @@ -3434,10 +3434,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ auto offs = gen_ext(jh, - (gen_operation(jh, add, load_reg_from_mem(jh, traits::X0 + rs1+ 8), uimm) + (gen_operation(jh, add, load_reg_from_mem(jh, traits::X0 + rs1+8), uimm) ), 32, false); gen_write_mem(jh, traits::MEM, offs, gen_ext(jh, - load_reg_from_mem(jh, traits::X0 + rs2+ 8), 32, false), 4); + load_reg_from_mem(jh, traits::X0 + rs2+8), 32, false), 4); auto returnValue = CONT; gen_instr_epilogue(jh); @@ -3476,10 +3476,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rs1!= 0){ + if(rs1!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rs1), gen_ext(jh, (gen_operation(jh, add, load_reg_from_mem(jh, traits::X0 + rs1), (int8_t)sext<6>(imm)) @@ -3558,7 +3558,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ cc.mov(get_ptr_for(jh, traits::X0+ 1), - (uint32_t)(PC+ 2)); + (uint32_t)(PC+2)); auto PC_val_v = (uint32_t)(PC+(int16_t)sext<12>(imm)); cc.mov(jh.next_pc, PC_val_v); cc.mov(get_ptr_for(jh, traits::LAST_BRANCH), 32U); @@ -3600,10 +3600,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), (uint32_t)((int8_t)sext<6>(imm))); } @@ -3645,10 +3645,10 @@ private: gen_instr_prologue(jh); cc.comment("//behavior:"); /*generate behavior*/ - if(imm== 0||rd>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + if(imm==0||rd>=static_cast(traits::RFS)){ + gen_raise(jh, 0, 2); } - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), (uint32_t)((int32_t)sext<18>(imm))); } @@ -3695,7 +3695,7 @@ private: ), 32, true)); } else{ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } auto returnValue = CONT; @@ -3732,7 +3732,7 @@ private: gen_instr_prologue(jh); cc.comment("//behavior:"); /*generate behavior*/ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); auto returnValue = CONT; gen_instr_epilogue(jh); @@ -3770,8 +3770,8 @@ private: gen_instr_prologue(jh); cc.comment("//behavior:"); /*generate behavior*/ - cc.mov(get_ptr_for(jh, traits::X0+ rs1+ 8), - gen_operation(jh, shr, load_reg_from_mem(jh, traits::X0 + rs1+ 8), shamt) + cc.mov(get_ptr_for(jh, traits::X0+ rs1+8), + gen_operation(jh, shr, load_reg_from_mem(jh, traits::X0 + rs1+8), shamt) ); auto returnValue = CONT; @@ -3811,18 +3811,18 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(shamt){ - cc.mov(get_ptr_for(jh, traits::X0+ rs1+ 8), + cc.mov(get_ptr_for(jh, traits::X0+ rs1+8), gen_ext(jh, (gen_operation(jh, sar, (gen_ext(jh, - load_reg_from_mem(jh, traits::X0 + rs1+ 8), 32, false)), shamt) + load_reg_from_mem(jh, traits::X0 + rs1+8), 32, false)), shamt) ), 32, true)); } else{ - if(static_cast(traits::XLEN)== 128){ - cc.mov(get_ptr_for(jh, traits::X0+ rs1+ 8), + if(static_cast(traits::XLEN)==128){ + cc.mov(get_ptr_for(jh, traits::X0+ rs1+8), gen_ext(jh, (gen_operation(jh, sar, (gen_ext(jh, - load_reg_from_mem(jh, traits::X0 + rs1+ 8), 32, false)), 64) + load_reg_from_mem(jh, traits::X0 + rs1+8), 32, false)), 64) ), 32, true)); } } @@ -3863,9 +3863,9 @@ private: gen_instr_prologue(jh); cc.comment("//behavior:"); /*generate behavior*/ - cc.mov(get_ptr_for(jh, traits::X0+ rs1+ 8), + cc.mov(get_ptr_for(jh, traits::X0+ rs1+8), gen_ext(jh, - (gen_operation(jh, band, load_reg_from_mem(jh, traits::X0 + rs1+ 8), (int8_t)sext<6>(imm)) + (gen_operation(jh, band, load_reg_from_mem(jh, traits::X0 + rs1+8), (int8_t)sext<6>(imm)) ), 32, true)); auto returnValue = CONT; @@ -3904,9 +3904,9 @@ private: gen_instr_prologue(jh); cc.comment("//behavior:"); /*generate behavior*/ - cc.mov(get_ptr_for(jh, traits::X0+ rd+ 8), + cc.mov(get_ptr_for(jh, traits::X0+ rd+8), gen_ext(jh, - (gen_operation(jh, sub, load_reg_from_mem(jh, traits::X0 + rd+ 8), load_reg_from_mem(jh, traits::X0 + rs2+ 8)) + (gen_operation(jh, sub, load_reg_from_mem(jh, traits::X0 + rd+8), load_reg_from_mem(jh, traits::X0 + rs2+8)) ), 32, true)); auto returnValue = CONT; @@ -3945,8 +3945,8 @@ private: gen_instr_prologue(jh); cc.comment("//behavior:"); /*generate behavior*/ - cc.mov(get_ptr_for(jh, traits::X0+ rd+ 8), - gen_operation(jh, bxor, load_reg_from_mem(jh, traits::X0 + rd+ 8), load_reg_from_mem(jh, traits::X0 + rs2+ 8)) + cc.mov(get_ptr_for(jh, traits::X0+ rd+8), + gen_operation(jh, bxor, load_reg_from_mem(jh, traits::X0 + rd+8), load_reg_from_mem(jh, traits::X0 + rs2+8)) ); auto returnValue = CONT; @@ -3985,8 +3985,8 @@ private: gen_instr_prologue(jh); cc.comment("//behavior:"); /*generate behavior*/ - cc.mov(get_ptr_for(jh, traits::X0+ rd+ 8), - gen_operation(jh, bor, load_reg_from_mem(jh, traits::X0 + rd+ 8), load_reg_from_mem(jh, traits::X0 + rs2+ 8)) + cc.mov(get_ptr_for(jh, traits::X0+ rd+8), + gen_operation(jh, bor, load_reg_from_mem(jh, traits::X0 + rd+8), load_reg_from_mem(jh, traits::X0 + rs2+8)) ); auto returnValue = CONT; @@ -4025,8 +4025,8 @@ private: gen_instr_prologue(jh); cc.comment("//behavior:"); /*generate behavior*/ - cc.mov(get_ptr_for(jh, traits::X0+ rd+ 8), - gen_operation(jh, band, load_reg_from_mem(jh, traits::X0 + rd+ 8), load_reg_from_mem(jh, traits::X0 + rs2+ 8)) + cc.mov(get_ptr_for(jh, traits::X0+ rd+8), + gen_operation(jh, band, load_reg_from_mem(jh, traits::X0 + rd+8), load_reg_from_mem(jh, traits::X0 + rs2+8)) ); auto returnValue = CONT; @@ -4105,7 +4105,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ auto label_merge = cc.newLabel(); - cc.cmp(gen_operation(jh, eq, load_reg_from_mem(jh, traits::X0 + rs1+ 8), 0) + cc.cmp(gen_operation(jh, eq, load_reg_from_mem(jh, traits::X0 + rs1+8), 0) ,0); cc.je(label_merge); { @@ -4152,7 +4152,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ auto label_merge = cc.newLabel(); - cc.cmp(gen_operation(jh, ne, load_reg_from_mem(jh, traits::X0 + rs1+ 8), 0) + cc.cmp(gen_operation(jh, ne, load_reg_from_mem(jh, traits::X0 + rs1+8), 0) ,0); cc.je(label_merge); { @@ -4199,10 +4199,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rs1!= 0){ + if(rs1!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rs1), gen_operation(jh, shl, load_reg_from_mem(jh, traits::X0 + rs1), nzuimm) ); @@ -4245,8 +4245,8 @@ private: gen_instr_prologue(jh); cc.comment("//behavior:"); /*generate behavior*/ - if(rd>=static_cast(traits::RFS)||rd== 0){ - gen_raise(jh, 0, 2); + if(rd>=static_cast(traits::RFS)||rd==0){ + gen_raise(jh, 0, 2); } else{ auto offs = gen_ext(jh, @@ -4295,10 +4295,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), load_reg_from_mem(jh, traits::X0 + rs2)); } @@ -4340,7 +4340,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rs1&&rs1(traits::RFS)){ - auto PC_val_v = gen_operation(jh, band, load_reg_from_mem(jh, traits::X0 + rs1%static_cast(traits::RFS)), ~ 0x1) + auto PC_val_v = gen_operation(jh, band, load_reg_from_mem(jh, traits::X0 + rs1%static_cast(traits::RFS)), ~ 1) ; cc.mov(jh.next_pc, PC_val_v); cc.mov(get_ptr_for(jh, traits::LAST_BRANCH), 32U); @@ -4421,10 +4421,10 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rd>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ - if(rd!= 0){ + if(rd!=0){ cc.mov(get_ptr_for(jh, traits::X0+ rd), gen_ext(jh, (gen_operation(jh, add, load_reg_from_mem(jh, traits::X0 + rd), load_reg_from_mem(jh, traits::X0 + rs2)) @@ -4468,13 +4468,13 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rs1>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto new_pc = load_reg_from_mem(jh, traits::X0 + rs1); cc.mov(get_ptr_for(jh, traits::X0+ 1), - (uint32_t)(PC+ 2)); - auto PC_val_v = gen_operation(jh, band, new_pc, ~ 0x1) + (uint32_t)(PC+2)); + auto PC_val_v = gen_operation(jh, band, new_pc, ~ 1) ; cc.mov(jh.next_pc, PC_val_v); cc.mov(get_ptr_for(jh, traits::LAST_BRANCH), 32U); @@ -4513,7 +4513,7 @@ private: gen_instr_prologue(jh); cc.comment("//behavior:"); /*generate behavior*/ - gen_raise(jh, 0, 3); + gen_raise(jh, 0, 3); auto returnValue = CONT; gen_instr_epilogue(jh); @@ -4552,7 +4552,7 @@ private: cc.comment("//behavior:"); /*generate behavior*/ if(rs2>=static_cast(traits::RFS)){ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); } else{ auto offs = gen_ext(jh, @@ -4595,7 +4595,7 @@ private: gen_instr_prologue(jh); cc.comment("//behavior:"); /*generate behavior*/ - gen_raise(jh, 0, 2); + gen_raise(jh, 0, 2); auto returnValue = CONT; gen_instr_epilogue(jh); @@ -4607,7 +4607,14 @@ private: * end opcode definitions ****************************************************************************/ continuation_e illegal_intruction(virt_addr_t &pc, code_word_t instr, jit_holder& jh ) { - + x86::Compiler& cc = jh.cc; + cc.comment(fmt::format("illegal_intruction{:#x}:",pc.val).c_str()); + this->gen_sync(jh, PRE_SYNC, instr_descr.size()); + pc = pc + ((instr & 3) == 3 ? 4 : 2); + gen_instr_prologue(jh); + cc.comment("//behavior:"); + gen_instr_epilogue(jh); + this->gen_sync(jh, POST_SYNC, instr_descr.size()); return BRANCH; } //decoding functionality