InstructionDefinition mret_(ISA32_RV64IMACFD, "mret",(uint32_t) 0x30200073,(uint32_t) 0xffffffff,[](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { { CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//MRET\n"); cp.code()+="etiss_coverage_count(1, 166);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2325);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 2264);\n";cp.code()+="if (((RV64IMACFD*)cpu)->PRIV < 3LL) { // conditional\n";cp.code()+="etiss_coverage_count(2, 2267, 2265);\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";cp.code()+="etiss_coverage_count(2, 2270, 2268);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="cpu->nextPc = *((RV64IMACFD*)cpu)->CSR[833LL];\n";cp.code()+="etiss_coverage_count(3, 2275, 2271, 2274);\n";cp.code()+="etiss_uint64 s = RV64IMACFD_csr_read(cpu, system, plugin_pointers, 768LL);\n";cp.code()+="etiss_coverage_count(2, 2279, 2278);\n";cp.code()+="etiss_uint64 prev_prv = RV64IMACFD_get_field(s, 6144LL);\n";cp.code()+="etiss_coverage_count(3, 2284, 2283, 2281);\n";cp.code()+="etiss_coverage_count(1, 2285);\n";cp.code()+="if (prev_prv != 3LL) { // conditional\n";cp.code()+="etiss_coverage_count(2, 2288, 2286);\n";cp.code()+="s = RV64IMACFD_set_field(s, 131072LL, 0LL);\n";cp.code()+="etiss_coverage_count(5, 2294, 2289, 2293, 2290, 2292);\n";cp.code()+="} // conditional\n";cp.code()+="s = RV64IMACFD_set_field(s, 8LL, RV64IMACFD_get_field(s, 128LL));\n";cp.code()+="etiss_coverage_count(6, 2302, 2295, 2301, 2296, 2300, 2298);\n";cp.code()+="s = RV64IMACFD_set_field(s, 128LL, 1ULL);\n";cp.code()+="etiss_coverage_count(5, 2308, 2303, 2307, 2304, 2306);\n";cp.code()+="s = RV64IMACFD_set_field(s, 6144LL, (RV64IMACFD_extension_enabled(cpu, system, plugin_pointers, 85ULL)) ? (0LL) : (3LL));\n";cp.code()+="etiss_coverage_count(7, 2318, 2309, 2317, 2310, 2316, 2313, 2312);\n";cp.code()+="RV64IMACFD_csr_write(cpu, system, plugin_pointers, 768LL, s);\n";cp.code()+="etiss_coverage_count(2, 2321, 2320);\n";cp.code()+="((RV64IMACFD*)cpu)->PRIV = (prev_prv) & 0x7;\n";cp.code()+="etiss_coverage_count(3, 2324, 2322, 2323);\n";cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n"; cp.getAffectedRegisters().add("instructionPointer", 32);} { CodePart &cp=cs.append(CodePart::APPENDEDRETURNINGREQUIRED);cp.code()=std::string("//MRET\n"); cp.code()+="return cpu->exception;\n"; } return true;}, 0,[](BitArray &ba, Instruction &instr) { std::stringstream ss; ss<< "mret"<< " # "<< ba<<(" []"); return ss.str();}) |
( |
ISA32_RV64IMACFD |
, |
|
|
"mret" |
, |
|
|
(uint32_t) |
0x30200073, |
|
|
(uint32_t) |
0xffffffff, |
|
|
[] (BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { { CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//MRET\n");cp.code()+="etiss_coverage_count(1, 166);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2325);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 2264);\n";cp.code()+="if (((RV64IMACFD*)cpu)->PRIV < 3LL) { // conditional\n";cp.code()+="etiss_coverage_count(2, 2267, 2265);\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";cp.code()+="etiss_coverage_count(2, 2270, 2268);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="cpu->nextPc = *((RV64IMACFD*)cpu)->CSR[833LL];\n";cp.code()+="etiss_coverage_count(3, 2275, 2271, 2274);\n";cp.code()+="etiss_uint64 s = RV64IMACFD_csr_read(cpu, system, plugin_pointers, 768LL);\n";cp.code()+="etiss_coverage_count(2, 2279, 2278);\n";cp.code()+="etiss_uint64 prev_prv = RV64IMACFD_get_field(s, 6144LL);\n";cp.code()+="etiss_coverage_count(3, 2284, 2283, 2281);\n";cp.code()+="etiss_coverage_count(1, 2285);\n";cp.code()+="if (prev_prv != 3LL) { // conditional\n";cp.code()+="etiss_coverage_count(2, 2288, 2286);\n";cp.code()+="s = RV64IMACFD_set_field(s, 131072LL, 0LL);\n";cp.code()+="etiss_coverage_count(5, 2294, 2289, 2293, 2290, 2292);\n";cp.code()+="} // conditional\n";cp.code()+="s = RV64IMACFD_set_field(s, 8LL, RV64IMACFD_get_field(s, 128LL));\n";cp.code()+="etiss_coverage_count(6, 2302, 2295, 2301, 2296, 2300, 2298);\n";cp.code()+="s = RV64IMACFD_set_field(s, 128LL, 1ULL);\n";cp.code()+="etiss_coverage_count(5, 2308, 2303, 2307, 2304, 2306);\n";cp.code()+="s = RV64IMACFD_set_field(s, 6144LL, (RV64IMACFD_extension_enabled(cpu, system, plugin_pointers, 85ULL)) ? (0LL) : (3LL));\n";cp.code()+="etiss_coverage_count(7, 2318, 2309, 2317, 2310, 2316, 2313, 2312);\n";cp.code()+="RV64IMACFD_csr_write(cpu, system, plugin_pointers, 768LL, s);\n";cp.code()+="etiss_coverage_count(2, 2321, 2320);\n";cp.code()+="((RV64IMACFD*)cpu)->PRIV = (prev_prv) & 0x7;\n";cp.code()+="etiss_coverage_count(3, 2324, 2322, 2323);\n";cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} { CodePart &cp=cs.append(CodePart::APPENDEDRETURNINGREQUIRED);cp.code()=std::string("//MRET\n");cp.code()+="return cpu->exception;\n";} return true;} |
, |
|
|
0 |
, |
|
|
[] (BitArray &ba, Instruction &instr) { std::stringstream ss;ss<< "mret"<< " # "<< ba<<(" []");return ss.str();} |
|
|
) |
| |
|
static |