adds verilog literal and illegal_instr to asmjit
This commit is contained in:
parent
fb330cddea
commit
a27850f841
|
@ -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){
|
||||
|
|
|
@ -2826,11 +2826,11 @@ private:
|
|||
}
|
||||
else{
|
||||
auto res = gen_ext(jh,
|
||||
(gen_operation(jh, imul,
|
||||
(gen_operation(jh, imul, gen_ext(jh,
|
||||
gen_ext(jh,
|
||||
gen_ext(jh, load_reg_from_mem(jh, traits::X0 + rs1), 32, true), 64, true),
|
||||
load_reg_from_mem(jh, traits::X0 + rs1), 32, true), 64, true), gen_ext(jh,
|
||||
gen_ext(jh,
|
||||
gen_ext(jh, load_reg_from_mem(jh, traits::X0 + rs2), 32, true), 64, true))
|
||||
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),
|
||||
|
@ -4340,7 +4340,7 @@ private:
|
|||
cc.comment("//behavior:");
|
||||
/*generate behavior*/
|
||||
if(rs1&&rs1<static_cast<uint32_t>(traits::RFS)){
|
||||
auto PC_val_v = gen_operation(jh, band, load_reg_from_mem(jh, traits::X0 + rs1%static_cast<uint32_t>(traits::RFS)), ~ 0x1)
|
||||
auto PC_val_v = gen_operation(jh, band, load_reg_from_mem(jh, traits::X0 + rs1%static_cast<uint32_t>(traits::RFS)), ~ 1)
|
||||
;
|
||||
cc.mov(jh.next_pc, PC_val_v);
|
||||
cc.mov(get_ptr_for(jh, traits::LAST_BRANCH), 32U);
|
||||
|
@ -4474,7 +4474,7 @@ private:
|
|||
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)
|
||||
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);
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue