11 using namespace etiss;
31 rd += R_rd_0.
read(ba) << 0;
34 imm += R_imm_3.
read(ba) << 3;
36 imm += R_imm_2.
read(ba) << 2;
38 imm += R_imm_6.
read(ba) << 6;
40 imm += R_imm_4.
read(ba) << 4;
47 cp.
code() = std::string(
"//CADDI4SPN\n");
50 cp.
code() +=
"etiss_coverage_count(1, 42);\n";
52 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
53 cp.
code() +=
"{ // block\n";
55 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
56 cp.
code() +=
"} // block\n";
58 cp.
code() +=
"etiss_coverage_count(1, 2327);\n";
60 cp.
code() +=
"etiss_coverage_count(1, 2328);\n";
61 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] = *((RV64IMACFD*)cpu)->X[2ULL] + " + std::to_string(imm) +
"ULL;\n";
62 cp.
code() +=
"etiss_coverage_count(9, 2339, 2333, 2332, 2330, 2331, 2338, 2336, 2335, 2337);\n";
66 cp.
code() +=
"{ // procedure\n";
67 cp.
code() +=
"RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";
68 cp.
code() +=
"etiss_coverage_count(2, 2342, 2340);\n";
70 cp.
code() +=
"} // procedure\n";
74 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
81 cp.
code() = std::string(
"//CADDI4SPN\n");
84 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
96 rd += R_rd_0.read(ba) << 0;
99 imm += R_imm_3.read(ba) << 3;
101 imm += R_imm_2.read(ba) << 2;
103 imm += R_imm_6.read(ba) << 6;
105 imm += R_imm_4.read(ba) << 4;
109 std::stringstream ss;
111 ss <<
"caddi4spn" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | imm=" + std::to_string(imm) +
"]");
133 rd += R_rd_0.
read(ba) << 0;
136 uimm += R_uimm_6.
read(ba) << 6;
138 uimm += R_uimm_2.
read(ba) << 2;
141 rs1 += R_rs1_0.
read(ba) << 0;
143 uimm += R_uimm_3.
read(ba) << 3;
150 cp.
code() = std::string(
"//CLW\n");
153 cp.
code() +=
"etiss_coverage_count(1, 43);\n";
155 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
156 cp.
code() +=
"{ // block\n";
158 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
159 cp.
code() +=
"} // block\n";
162 cp.
code() +=
"etiss_coverage_count(1, 2363);\n";
163 cp.
code() +=
"{ // block\n";
164 cp.
code() +=
"etiss_uint64 load_address = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] + " + std::to_string(uimm) +
"ULL;\n";
165 cp.
code() +=
"etiss_coverage_count(7, 2351, 2350, 2348, 2347, 2345, 2346, 2349);\n";
166 cp.
code() +=
"etiss_uint32 mem_val_0;\n";
167 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, load_address, (etiss_uint8*)&mem_val_0, 4);\n";
168 cp.
code() +=
"if (cpu->exception) { // conditional\n";
170 cp.
code() +=
"{ // procedure\n";
171 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
173 cp.
code() +=
"} // procedure\n";
175 cp.
code() +=
"} // conditional\n";
176 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] = (etiss_int32)(mem_val_0);\n";
177 cp.
code() +=
"etiss_coverage_count(8, 2362, 2356, 2355, 2353, 2354, 2361, 2359, 2358);\n";
178 cp.
code() +=
"} // block\n";
181 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
188 cp.
code() = std::string(
"//CLW\n");
191 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
203 rd += R_rd_0.read(ba) << 0;
206 uimm += R_uimm_6.read(ba) << 6;
208 uimm += R_uimm_2.read(ba) << 2;
211 rs1 += R_rs1_0.read(ba) << 0;
213 uimm += R_uimm_3.read(ba) << 3;
217 std::stringstream ss;
219 ss <<
"clw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | uimm=" + std::to_string(uimm) +
" | rs1=" + std::to_string(rs1) +
"]");
241 rs2 += R_rs2_0.
read(ba) << 0;
244 uimm += R_uimm_6.
read(ba) << 6;
246 uimm += R_uimm_2.
read(ba) << 2;
249 rs1 += R_rs1_0.
read(ba) << 0;
251 uimm += R_uimm_3.
read(ba) << 3;
258 cp.
code() = std::string(
"//CSW\n");
261 cp.
code() +=
"etiss_coverage_count(1, 44);\n";
263 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
264 cp.
code() +=
"{ // block\n";
266 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
267 cp.
code() +=
"} // block\n";
270 cp.
code() +=
"etiss_coverage_count(1, 2384);\n";
271 cp.
code() +=
"{ // block\n";
272 cp.
code() +=
"etiss_uint64 load_address = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] + " + std::to_string(uimm) +
"ULL;\n";
273 cp.
code() +=
"etiss_coverage_count(7, 2372, 2371, 2369, 2368, 2366, 2367, 2370);\n";
274 cp.
code() +=
"etiss_uint32 mem_val_0;\n";
275 cp.
code() +=
"mem_val_0 = (etiss_int32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 + 8ULL) +
"ULL]);\n";
276 cp.
code() +=
"etiss_coverage_count(8, 2383, 2375, 2374, 2382, 2380, 2379, 2377, 2378);\n";
277 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, load_address, (etiss_uint8*)&mem_val_0, 4);\n";
278 cp.
code() +=
"if (cpu->exception) { // conditional\n";
280 cp.
code() +=
"{ // procedure\n";
281 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
283 cp.
code() +=
"} // procedure\n";
285 cp.
code() +=
"} // conditional\n";
286 cp.
code() +=
"} // block\n";
289 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
296 cp.
code() = std::string(
"//CSW\n");
299 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
311 rs2 += R_rs2_0.read(ba) << 0;
314 uimm += R_uimm_6.read(ba) << 6;
316 uimm += R_uimm_2.read(ba) << 2;
319 rs1 += R_rs1_0.read(ba) << 0;
321 uimm += R_uimm_3.read(ba) << 3;
325 std::stringstream ss;
327 ss <<
"csw" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | uimm=" + std::to_string(uimm) +
" | rs1=" + std::to_string(rs1) +
"]");
349 imm += R_imm_0.
read(ba) << 0;
352 rs1 += R_rs1_0.
read(ba) << 0;
354 imm += R_imm_5.
read(ba) << 5;
361 cp.
code() = std::string(
"//CADDI\n");
364 cp.
code() +=
"etiss_coverage_count(1, 45);\n";
366 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
367 cp.
code() +=
"{ // block\n";
369 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
370 cp.
code() +=
"} // block\n";
372 cp.
code() +=
"etiss_coverage_count(1, 2385);\n";
373 if ((rs1 % 32ULL) != 0LL) {
374 cp.
code() +=
"etiss_coverage_count(5, 2391, 2388, 2386, 2389, 2390);\n";
375 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int8)(((
etiss_int8)imm) << (2)) >> (2))) +
"LL;\n";
376 cp.
code() +=
"etiss_coverage_count(10, 2406, 2396, 2395, 2393, 2405, 2401, 2400, 2398, 2404, 2402);\n";
379 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
392 imm += R_imm_0.read(ba) << 0;
395 rs1 += R_rs1_0.read(ba) << 0;
397 imm += R_imm_5.read(ba) << 5;
401 std::stringstream ss;
403 ss <<
"caddi" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
"]");
425 nzimm += R_nzimm_0.
read(ba) << 0;
427 nzimm += R_nzimm_5.
read(ba) << 5;
434 cp.
code() = std::string(
"//CNOP\n");
437 cp.
code() +=
"etiss_coverage_count(1, 46);\n";
439 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
440 cp.
code() +=
"{ // block\n";
442 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
443 cp.
code() +=
"} // block\n";
446 cp.
code() +=
"etiss_coverage_count(1, 2407);\n";
447 cp.
code() +=
"{ // block\n";
448 cp.
code() +=
"} // block\n";
451 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
464 nzimm += R_nzimm_0.read(ba) << 0;
466 nzimm += R_nzimm_5.read(ba) << 5;
470 std::stringstream ss;
472 ss <<
"cnop" <<
" # " << ba << (
" [nzimm=" + std::to_string(nzimm) +
"]");
494 imm += R_imm_0.
read(ba) << 0;
497 rd += R_rd_0.
read(ba) << 0;
499 imm += R_imm_5.
read(ba) << 5;
506 cp.
code() = std::string(
"//CLI\n");
509 cp.
code() +=
"etiss_coverage_count(1, 48);\n";
511 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
512 cp.
code() +=
"{ // block\n";
514 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
515 cp.
code() +=
"} // block\n";
518 cp.
code() +=
"etiss_coverage_count(1, 2439);\n";
519 cp.
code() +=
"{ // block\n";
520 cp.
code() +=
"etiss_coverage_count(1, 2423);\n";
521 if ((rd % 32ULL) != 0LL) {
522 cp.
code() +=
"etiss_coverage_count(5, 2429, 2426, 2424, 2427, 2428);\n";
523 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = " + std::to_string(((
etiss_int8)(((
etiss_int8)imm) << (2)) >> (2))) +
"LL;\n";
524 cp.
code() +=
"etiss_coverage_count(6, 2438, 2434, 2433, 2431, 2437, 2435);\n";
526 cp.
code() +=
"} // block\n";
529 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
542 imm += R_imm_0.read(ba) << 0;
545 rd += R_rd_0.read(ba) << 0;
547 imm += R_imm_5.read(ba) << 5;
551 std::stringstream ss;
553 ss <<
"cli" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rd=" + std::to_string(rd) +
"]");
575 imm += R_imm_12.
read(ba) << 12;
578 rd += R_rd_0.
read(ba) << 0;
580 imm += R_imm_17.
read(ba) << 17;
587 cp.
code() = std::string(
"//CLUI\n");
590 cp.
code() +=
"etiss_coverage_count(1, 49);\n";
592 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
593 cp.
code() +=
"{ // block\n";
595 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
596 cp.
code() +=
"} // block\n";
599 cp.
code() +=
"etiss_coverage_count(1, 2463);\n";
600 cp.
code() +=
"{ // block\n";
601 cp.
code() +=
"etiss_coverage_count(1, 2440);\n";
603 cp.
code() +=
"etiss_coverage_count(3, 2443, 2441, 2442);\n";
605 cp.
code() +=
"{ // procedure\n";
606 cp.
code() +=
"RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";
607 cp.
code() +=
"etiss_coverage_count(2, 2446, 2444);\n";
609 cp.
code() +=
"} // procedure\n";
612 cp.
code() +=
"etiss_coverage_count(1, 2447);\n";
613 if ((rd % 32ULL) != 0LL) {
614 cp.
code() +=
"etiss_coverage_count(5, 2453, 2450, 2448, 2451, 2452);\n";
615 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = " + std::to_string(((
etiss_int32)(((
etiss_int32)imm) << (14)) >> (14))) +
"LL;\n";
616 cp.
code() +=
"etiss_coverage_count(6, 2462, 2458, 2457, 2455, 2461, 2459);\n";
618 cp.
code() +=
"} // block\n";
621 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
628 cp.
code() = std::string(
"//CLUI\n");
631 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
643 imm += R_imm_12.read(ba) << 12;
646 rd += R_rd_0.read(ba) << 0;
648 imm += R_imm_17.read(ba) << 17;
652 std::stringstream ss;
654 ss <<
"clui" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rd=" + std::to_string(rd) +
"]");
676 nzimm += R_nzimm_5.
read(ba) << 5;
678 nzimm += R_nzimm_7.
read(ba) << 7;
680 nzimm += R_nzimm_6.
read(ba) << 6;
682 nzimm += R_nzimm_4.
read(ba) << 4;
684 nzimm += R_nzimm_9.
read(ba) << 9;
691 cp.
code() = std::string(
"//CADDI16SP\n");
694 cp.
code() +=
"etiss_coverage_count(1, 50);\n";
696 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
697 cp.
code() +=
"{ // block\n";
699 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
700 cp.
code() +=
"} // block\n";
702 cp.
code() +=
"etiss_coverage_count(1, 2464);\n";
704 cp.
code() +=
"etiss_coverage_count(1, 2465);\n";
705 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[2ULL] = *((RV64IMACFD*)cpu)->X[2ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)nzimm) << (6)) >> (6))) +
"LL;\n";
706 cp.
code() +=
"etiss_coverage_count(8, 2476, 2468, 2467, 2475, 2471, 2470, 2474, 2472);\n";
710 cp.
code() +=
"{ // procedure\n";
711 cp.
code() +=
"RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";
712 cp.
code() +=
"etiss_coverage_count(2, 2479, 2477);\n";
714 cp.
code() +=
"} // procedure\n";
718 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
725 cp.
code() = std::string(
"//CADDI16SP\n");
728 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
740 nzimm += R_nzimm_5.read(ba) << 5;
742 nzimm += R_nzimm_7.read(ba) << 7;
744 nzimm += R_nzimm_6.read(ba) << 6;
746 nzimm += R_nzimm_4.read(ba) << 4;
748 nzimm += R_nzimm_9.read(ba) << 9;
752 std::stringstream ss;
754 ss <<
"caddi16sp" <<
" # " << ba << (
" [nzimm=" + std::to_string(nzimm) +
"]");
776 rd += R_rd_0.
read(ba) << 0;
783 cp.
code() = std::string(
"//__reserved_clui\n");
786 cp.
code() +=
"etiss_coverage_count(1, 51);\n";
788 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
789 cp.
code() +=
"{ // block\n";
791 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
792 cp.
code() +=
"} // block\n";
795 cp.
code() +=
"{ // procedure\n";
796 cp.
code() +=
"RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";
797 cp.
code() +=
"etiss_coverage_count(2, 2482, 2480);\n";
799 cp.
code() +=
"} // procedure\n";
802 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
809 cp.
code() = std::string(
"//__reserved_clui\n");
812 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
824 rd += R_rd_0.read(ba) << 0;
828 std::stringstream ss;
830 ss <<
"__reserved_clui" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
"]");
852 shamt += R_shamt_0.
read(ba) << 0;
855 rs1 += R_rs1_0.
read(ba) << 0;
862 cp.
code() = std::string(
"//CSRLI\n");
865 cp.
code() +=
"etiss_coverage_count(1, 52);\n";
867 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
868 cp.
code() +=
"{ // block\n";
870 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
871 cp.
code() +=
"} // block\n";
874 cp.
code() +=
"etiss_coverage_count(1, 2496);\n";
875 cp.
code() +=
"{ // block\n";
876 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] >> " + std::to_string(shamt) +
"ULL;\n";
877 cp.
code() +=
"etiss_coverage_count(11, 2495, 2487, 2486, 2484, 2485, 2494, 2492, 2491, 2489, 2490, 2493);\n";
878 cp.
code() +=
"} // block\n";
881 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
894 shamt += R_shamt_0.read(ba) << 0;
897 rs1 += R_rs1_0.read(ba) << 0;
901 std::stringstream ss;
903 ss <<
"csrli" <<
" # " << ba << (
" [shamt=" + std::to_string(shamt) +
" | rs1=" + std::to_string(rs1) +
"]");
925 shamt += R_shamt_0.
read(ba) << 0;
928 rs1 += R_rs1_0.
read(ba) << 0;
935 cp.
code() = std::string(
"//CSRAI\n");
938 cp.
code() +=
"etiss_coverage_count(1, 53);\n";
940 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
941 cp.
code() +=
"{ // block\n";
943 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
944 cp.
code() +=
"} // block\n";
947 cp.
code() +=
"etiss_coverage_count(1, 2536);\n";
948 cp.
code() +=
"{ // block\n";
949 cp.
code() +=
"etiss_coverage_count(1, 2497);\n";
951 cp.
code() +=
"etiss_coverage_count(1, 2498);\n";
953 cp.
code() +=
"etiss_coverage_count(1, 2518);\n";
954 cp.
code() +=
"{ // block\n";
955 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] = ((etiss_int64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL])) >> " + std::to_string(shamt) +
"ULL;\n";
956 cp.
code() +=
"etiss_coverage_count(13, 2517, 2506, 2505, 2503, 2504, 2516, 2513, 2511, 2510, 2508, 2509, 2514, 2515);\n";
957 cp.
code() +=
"} // block\n";
960 cp.
code() +=
"} // block\n";
963 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
976 shamt += R_shamt_0.read(ba) << 0;
979 rs1 += R_rs1_0.read(ba) << 0;
983 std::stringstream ss;
985 ss <<
"csrai" <<
" # " << ba << (
" [shamt=" + std::to_string(shamt) +
" | rs1=" + std::to_string(rs1) +
"]");
1007 imm += R_imm_0.
read(ba) << 0;
1010 rs1 += R_rs1_0.
read(ba) << 0;
1012 imm += R_imm_5.
read(ba) << 5;
1019 cp.
code() = std::string(
"//CANDI\n");
1022 cp.
code() +=
"etiss_coverage_count(1, 54);\n";
1024 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1025 cp.
code() +=
"{ // block\n";
1027 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1028 cp.
code() +=
"} // block\n";
1031 cp.
code() +=
"etiss_coverage_count(1, 2552);\n";
1032 cp.
code() +=
"{ // block\n";
1033 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] & " + std::to_string(((
etiss_int8)(((
etiss_int8)imm) << (2)) >> (2))) +
"LL;\n";
1034 cp.
code() +=
"etiss_coverage_count(12, 2551, 2541, 2540, 2538, 2539, 2550, 2546, 2545, 2543, 2544, 2549, 2547);\n";
1035 cp.
code() +=
"} // block\n";
1038 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1051 imm += R_imm_0.read(ba) << 0;
1054 rs1 += R_rs1_0.read(ba) << 0;
1056 imm += R_imm_5.read(ba) << 5;
1060 std::stringstream ss;
1062 ss <<
"candi" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
"]");
1084 rs2 += R_rs2_0.
read(ba) << 0;
1087 rd += R_rd_0.
read(ba) << 0;
1094 cp.
code() = std::string(
"//CSUB\n");
1097 cp.
code() +=
"etiss_coverage_count(1, 55);\n";
1099 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1100 cp.
code() +=
"{ // block\n";
1102 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1103 cp.
code() +=
"} // block\n";
1106 cp.
code() +=
"etiss_coverage_count(1, 2570);\n";
1107 cp.
code() +=
"{ // block\n";
1108 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] = *((RV64IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] - *((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 + 8ULL) +
"ULL];\n";
1109 cp.
code() +=
"etiss_coverage_count(14, 2569, 2557, 2556, 2554, 2555, 2568, 2562, 2561, 2559, 2560, 2567, 2566, 2564, 2565);\n";
1110 cp.
code() +=
"} // block\n";
1113 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1126 rs2 += R_rs2_0.read(ba) << 0;
1129 rd += R_rd_0.read(ba) << 0;
1133 std::stringstream ss;
1135 ss <<
"csub" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | rd=" + std::to_string(rd) +
"]");
1157 rs2 += R_rs2_0.
read(ba) << 0;
1160 rd += R_rd_0.
read(ba) << 0;
1167 cp.
code() = std::string(
"//CXOR\n");
1170 cp.
code() +=
"etiss_coverage_count(1, 56);\n";
1172 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1173 cp.
code() +=
"{ // block\n";
1175 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1176 cp.
code() +=
"} // block\n";
1179 cp.
code() +=
"etiss_coverage_count(1, 2588);\n";
1180 cp.
code() +=
"{ // block\n";
1181 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] = *((RV64IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] ^ *((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 + 8ULL) +
"ULL];\n";
1182 cp.
code() +=
"etiss_coverage_count(14, 2587, 2575, 2574, 2572, 2573, 2586, 2580, 2579, 2577, 2578, 2585, 2584, 2582, 2583);\n";
1183 cp.
code() +=
"} // block\n";
1186 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1199 rs2 += R_rs2_0.read(ba) << 0;
1202 rd += R_rd_0.read(ba) << 0;
1206 std::stringstream ss;
1208 ss <<
"cxor" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | rd=" + std::to_string(rd) +
"]");
1230 rs2 += R_rs2_0.
read(ba) << 0;
1233 rd += R_rd_0.
read(ba) << 0;
1240 cp.
code() = std::string(
"//COR\n");
1243 cp.
code() +=
"etiss_coverage_count(1, 57);\n";
1245 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1246 cp.
code() +=
"{ // block\n";
1248 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1249 cp.
code() +=
"} // block\n";
1252 cp.
code() +=
"etiss_coverage_count(1, 2606);\n";
1253 cp.
code() +=
"{ // block\n";
1254 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] = *((RV64IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] | *((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 + 8ULL) +
"ULL];\n";
1255 cp.
code() +=
"etiss_coverage_count(14, 2605, 2593, 2592, 2590, 2591, 2604, 2598, 2597, 2595, 2596, 2603, 2602, 2600, 2601);\n";
1256 cp.
code() +=
"} // block\n";
1259 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1272 rs2 += R_rs2_0.read(ba) << 0;
1275 rd += R_rd_0.read(ba) << 0;
1279 std::stringstream ss;
1281 ss <<
"cor" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | rd=" + std::to_string(rd) +
"]");
1303 rs2 += R_rs2_0.
read(ba) << 0;
1306 rd += R_rd_0.
read(ba) << 0;
1313 cp.
code() = std::string(
"//CAND\n");
1316 cp.
code() +=
"etiss_coverage_count(1, 58);\n";
1318 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1319 cp.
code() +=
"{ // block\n";
1321 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1322 cp.
code() +=
"} // block\n";
1325 cp.
code() +=
"etiss_coverage_count(1, 2624);\n";
1326 cp.
code() +=
"{ // block\n";
1327 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] = *((RV64IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] & *((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 + 8ULL) +
"ULL];\n";
1328 cp.
code() +=
"etiss_coverage_count(14, 2623, 2611, 2610, 2608, 2609, 2622, 2616, 2615, 2613, 2614, 2621, 2620, 2618, 2619);\n";
1329 cp.
code() +=
"} // block\n";
1332 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1345 rs2 += R_rs2_0.read(ba) << 0;
1348 rd += R_rd_0.read(ba) << 0;
1352 std::stringstream ss;
1354 ss <<
"cand" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | rd=" + std::to_string(rd) +
"]");
1376 imm += R_imm_5.
read(ba) << 5;
1378 imm += R_imm_1.
read(ba) << 1;
1380 imm += R_imm_7.
read(ba) << 7;
1382 imm += R_imm_6.
read(ba) << 6;
1384 imm += R_imm_10.
read(ba) << 10;
1386 imm += R_imm_8.
read(ba) << 8;
1388 imm += R_imm_4.
read(ba) << 4;
1390 imm += R_imm_11.
read(ba) << 11;
1397 cp.
code() = std::string(
"//CJ\n");
1400 cp.
code() +=
"etiss_coverage_count(1, 59);\n";
1402 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1403 cp.
code() +=
"{ // block\n";
1405 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1406 cp.
code() +=
"} // block\n";
1409 cp.
code() +=
"etiss_coverage_count(6, 2631, 2625, 2630, 2626, 2629, 2627);\n";
1411 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1418 cp.
code() = std::string(
"//CJ\n");
1421 cp.
code() +=
"return cpu->exception;\n";
1433 imm += R_imm_5.read(ba) << 5;
1435 imm += R_imm_1.read(ba) << 1;
1437 imm += R_imm_7.read(ba) << 7;
1439 imm += R_imm_6.read(ba) << 6;
1441 imm += R_imm_10.read(ba) << 10;
1443 imm += R_imm_8.read(ba) << 8;
1445 imm += R_imm_4.read(ba) << 4;
1447 imm += R_imm_11.read(ba) << 11;
1451 std::stringstream ss;
1453 ss <<
"cj" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
"]");
1475 imm += R_imm_5.
read(ba) << 5;
1477 imm += R_imm_1.
read(ba) << 1;
1479 imm += R_imm_6.
read(ba) << 6;
1482 rs1 += R_rs1_0.
read(ba) << 0;
1484 imm += R_imm_3.
read(ba) << 3;
1486 imm += R_imm_8.
read(ba) << 8;
1493 cp.
code() = std::string(
"//CBEQZ\n");
1496 cp.
code() +=
"etiss_coverage_count(1, 60);\n";
1498 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1499 cp.
code() +=
"{ // block\n";
1501 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1502 cp.
code() +=
"} // block\n";
1504 cp.
code() +=
"etiss_coverage_count(1, 2632);\n";
1505 cp.
code() +=
"if (*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] == 0LL) { // conditional\n";
1506 cp.
code() +=
"etiss_coverage_count(6, 2639, 2637, 2636, 2634, 2635, 2638);\n";
1508 cp.
code() +=
"etiss_coverage_count(6, 2646, 2640, 2645, 2641, 2644, 2642);\n";
1509 cp.
code() +=
"} // conditional\n";
1511 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1518 cp.
code() = std::string(
"//CBEQZ\n");
1521 cp.
code() +=
"if (cpu->nextPc != " + std::to_string(ic.
current_address_ + 2) +
"ULL) return cpu->exception;\n";
1533 imm += R_imm_5.read(ba) << 5;
1535 imm += R_imm_1.read(ba) << 1;
1537 imm += R_imm_6.read(ba) << 6;
1540 rs1 += R_rs1_0.read(ba) << 0;
1542 imm += R_imm_3.read(ba) << 3;
1544 imm += R_imm_8.read(ba) << 8;
1548 std::stringstream ss;
1550 ss <<
"cbeqz" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
"]");
1572 imm += R_imm_5.
read(ba) << 5;
1574 imm += R_imm_1.
read(ba) << 1;
1576 imm += R_imm_6.
read(ba) << 6;
1579 rs1 += R_rs1_0.
read(ba) << 0;
1581 imm += R_imm_3.
read(ba) << 3;
1583 imm += R_imm_8.
read(ba) << 8;
1590 cp.
code() = std::string(
"//CBNEZ\n");
1593 cp.
code() +=
"etiss_coverage_count(1, 61);\n";
1595 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1596 cp.
code() +=
"{ // block\n";
1598 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1599 cp.
code() +=
"} // block\n";
1601 cp.
code() +=
"etiss_coverage_count(1, 2647);\n";
1602 cp.
code() +=
"if (*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] != 0LL) { // conditional\n";
1603 cp.
code() +=
"etiss_coverage_count(6, 2654, 2652, 2651, 2649, 2650, 2653);\n";
1605 cp.
code() +=
"etiss_coverage_count(6, 2661, 2655, 2660, 2656, 2659, 2657);\n";
1606 cp.
code() +=
"} // conditional\n";
1608 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1615 cp.
code() = std::string(
"//CBNEZ\n");
1618 cp.
code() +=
"if (cpu->nextPc != " + std::to_string(ic.
current_address_ + 2) +
"ULL) return cpu->exception;\n";
1630 imm += R_imm_5.read(ba) << 5;
1632 imm += R_imm_1.read(ba) << 1;
1634 imm += R_imm_6.read(ba) << 6;
1637 rs1 += R_rs1_0.read(ba) << 0;
1639 imm += R_imm_3.read(ba) << 3;
1641 imm += R_imm_8.read(ba) << 8;
1645 std::stringstream ss;
1647 ss <<
"cbnez" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
"]");
1669 nzuimm += R_nzuimm_0.
read(ba) << 0;
1672 rs1 += R_rs1_0.
read(ba) << 0;
1679 cp.
code() = std::string(
"//CSLLI\n");
1682 cp.
code() +=
"etiss_coverage_count(1, 62);\n";
1684 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1685 cp.
code() +=
"{ // block\n";
1687 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1688 cp.
code() +=
"} // block\n";
1690 cp.
code() +=
"etiss_coverage_count(1, 2662);\n";
1692 cp.
code() +=
"etiss_coverage_count(1, 2663);\n";
1693 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] << " + std::to_string(nzuimm) +
"ULL;\n";
1694 cp.
code() +=
"etiss_coverage_count(9, 2676, 2668, 2667, 2665, 2675, 2673, 2672, 2670, 2674);\n";
1697 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1710 nzuimm += R_nzuimm_0.read(ba) << 0;
1713 rs1 += R_rs1_0.read(ba) << 0;
1717 std::stringstream ss;
1719 ss <<
"cslli" <<
" # " << ba << (
" [nzuimm=" + std::to_string(nzuimm) +
" | rs1=" + std::to_string(rs1) +
"]");
1741 uimm += R_uimm_6.
read(ba) << 6;
1743 uimm += R_uimm_2.
read(ba) << 2;
1746 rd += R_rd_0.
read(ba) << 0;
1748 uimm += R_uimm_5.
read(ba) << 5;
1755 cp.
code() = std::string(
"//CLWSP\n");
1758 cp.
code() +=
"etiss_coverage_count(1, 63);\n";
1760 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1761 cp.
code() +=
"{ // block\n";
1763 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1764 cp.
code() +=
"} // block\n";
1767 cp.
code() +=
"etiss_coverage_count(1, 2703);\n";
1768 cp.
code() +=
"{ // block\n";
1769 cp.
code() +=
"etiss_coverage_count(1, 2677);\n";
1771 cp.
code() +=
"etiss_coverage_count(2, 2680, 2678);\n";
1773 cp.
code() +=
"etiss_coverage_count(1, 2699);\n";
1774 cp.
code() +=
"{ // block\n";
1775 cp.
code() +=
"etiss_uint32 mem_val_0;\n";
1776 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, *((RV64IMACFD*)cpu)->X[2ULL] + " + std::to_string(uimm) +
"ULL, (etiss_uint8*)&mem_val_0, 4);\n";
1777 cp.
code() +=
"if (cpu->exception) { // conditional\n";
1779 cp.
code() +=
"{ // procedure\n";
1780 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
1782 cp.
code() +=
"} // procedure\n";
1784 cp.
code() +=
"} // conditional\n";
1785 cp.
code() +=
"etiss_int32 res = mem_val_0;\n";
1786 cp.
code() +=
"etiss_coverage_count(6, 2689, 2688, 2687, 2685, 2684, 2686);\n";
1787 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int64)(res);\n";
1788 cp.
code() +=
"etiss_coverage_count(6, 2698, 2694, 2693, 2691, 2697, 2695);\n";
1789 cp.
code() +=
"} // block\n";
1794 cp.
code() +=
"{ // procedure\n";
1795 cp.
code() +=
"RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2ULL);\n";
1796 cp.
code() +=
"etiss_coverage_count(3, 2702, 2700, 2701);\n";
1798 cp.
code() +=
"} // procedure\n";
1801 cp.
code() +=
"} // block\n";
1804 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1811 cp.
code() = std::string(
"//CLWSP\n");
1814 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
1826 uimm += R_uimm_6.read(ba) << 6;
1828 uimm += R_uimm_2.read(ba) << 2;
1831 rd += R_rd_0.read(ba) << 0;
1833 uimm += R_uimm_5.read(ba) << 5;
1837 std::stringstream ss;
1839 ss <<
"clwsp" <<
" # " << ba << (
" [uimm=" + std::to_string(uimm) +
" | rd=" + std::to_string(rd) +
"]");
1861 rs2 += R_rs2_0.
read(ba) << 0;
1864 rd += R_rd_0.
read(ba) << 0;
1871 cp.
code() = std::string(
"//CMV\n");
1874 cp.
code() +=
"etiss_coverage_count(1, 64);\n";
1876 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1877 cp.
code() +=
"{ // block\n";
1879 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1880 cp.
code() +=
"} // block\n";
1882 cp.
code() +=
"etiss_coverage_count(1, 2704);\n";
1883 if ((rd % 32ULL) != 0LL) {
1884 cp.
code() +=
"etiss_coverage_count(5, 2710, 2707, 2705, 2708, 2709);\n";
1885 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL];\n";
1886 cp.
code() +=
"etiss_coverage_count(7, 2721, 2715, 2714, 2712, 2720, 2719, 2717);\n";
1889 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1902 rs2 += R_rs2_0.read(ba) << 0;
1905 rd += R_rd_0.read(ba) << 0;
1909 std::stringstream ss;
1911 ss <<
"cmv" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | rd=" + std::to_string(rd) +
"]");
1933 rs1 += R_rs1_0.
read(ba) << 0;
1940 cp.
code() = std::string(
"//CJR\n");
1943 cp.
code() +=
"etiss_coverage_count(1, 65);\n";
1945 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1946 cp.
code() +=
"{ // block\n";
1948 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1949 cp.
code() +=
"} // block\n";
1951 cp.
code() +=
"etiss_coverage_count(1, 2722);\n";
1953 cp.
code() +=
"etiss_coverage_count(1, 2723);\n";
1954 cp.
code() +=
"cpu->nextPc = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] & -2LL;\n";
1955 cp.
code() +=
"etiss_coverage_count(6, 2733, 2724, 2732, 2729, 2728, 2726);\n";
1959 cp.
code() +=
"{ // procedure\n";
1960 cp.
code() +=
"RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2ULL);\n";
1961 cp.
code() +=
"etiss_coverage_count(3, 2736, 2734, 2735);\n";
1963 cp.
code() +=
"} // procedure\n";
1967 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1974 cp.
code() = std::string(
"//CJR\n");
1977 cp.
code() +=
"return cpu->exception;\n";
1989 rs1 += R_rs1_0.read(ba) << 0;
1993 std::stringstream ss;
1995 ss <<
"cjr" <<
" # " << ba << (
" [rs1=" + std::to_string(rs1) +
"]");
2021 cp.
code() = std::string(
"//__reserved_cmv\n");
2024 cp.
code() +=
"etiss_coverage_count(1, 66);\n";
2026 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2027 cp.
code() +=
"{ // block\n";
2029 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2030 cp.
code() +=
"} // block\n";
2033 cp.
code() +=
"{ // procedure\n";
2034 cp.
code() +=
"RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2ULL);\n";
2035 cp.
code() +=
"etiss_coverage_count(3, 2739, 2737, 2738);\n";
2037 cp.
code() +=
"} // procedure\n";
2040 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2047 cp.
code() = std::string(
"//__reserved_cmv\n");
2050 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
2063 std::stringstream ss;
2065 ss <<
"__reserved_cmv" <<
" # " << ba << (
" []");
2087 rs2 += R_rs2_0.
read(ba) << 0;
2090 rd += R_rd_0.
read(ba) << 0;
2097 cp.
code() = std::string(
"//CADD\n");
2100 cp.
code() +=
"etiss_coverage_count(1, 67);\n";
2102 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2103 cp.
code() +=
"{ // block\n";
2105 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2106 cp.
code() +=
"} // block\n";
2108 cp.
code() +=
"etiss_coverage_count(1, 2740);\n";
2109 if ((rd % 32ULL) != 0LL) {
2110 cp.
code() +=
"etiss_coverage_count(5, 2746, 2743, 2741, 2744, 2745);\n";
2111 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] + *((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL];\n";
2112 cp.
code() +=
"etiss_coverage_count(11, 2763, 2751, 2750, 2748, 2762, 2756, 2755, 2753, 2761, 2760, 2758);\n";
2115 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2128 rs2 += R_rs2_0.read(ba) << 0;
2131 rd += R_rd_0.read(ba) << 0;
2135 std::stringstream ss;
2137 ss <<
"cadd" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | rd=" + std::to_string(rd) +
"]");
2159 rs1 += R_rs1_0.
read(ba) << 0;
2166 cp.
code() = std::string(
"//CJALR\n");
2169 cp.
code() +=
"etiss_coverage_count(1, 68);\n";
2171 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2172 cp.
code() +=
"{ // block\n";
2174 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2175 cp.
code() +=
"} // block\n";
2178 cp.
code() +=
"etiss_coverage_count(1, 2784);\n";
2179 cp.
code() +=
"{ // block\n";
2180 cp.
code() +=
"etiss_uint64 new_pc = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
2181 cp.
code() +=
"etiss_coverage_count(4, 2770, 2769, 2768, 2766);\n";
2182 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[1ULL] = " + std::to_string(ic.
current_address_ + 2ULL) +
"ULL;\n";
2183 cp.
code() +=
"etiss_coverage_count(6, 2777, 2773, 2772, 2776, 2774, 2775);\n";
2184 cp.
code() +=
"cpu->nextPc = new_pc & -2LL;\n";
2185 cp.
code() +=
"etiss_coverage_count(4, 2783, 2778, 2782, 2779);\n";
2186 cp.
code() +=
"} // block\n";
2189 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2196 cp.
code() = std::string(
"//CJALR\n");
2199 cp.
code() +=
"return cpu->exception;\n";
2211 rs1 += R_rs1_0.read(ba) << 0;
2215 std::stringstream ss;
2217 ss <<
"cjalr" <<
" # " << ba << (
" [rs1=" + std::to_string(rs1) +
"]");
2243 cp.
code() = std::string(
"//CEBREAK\n");
2246 cp.
code() +=
"etiss_coverage_count(1, 69);\n";
2248 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2249 cp.
code() +=
"{ // block\n";
2251 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2252 cp.
code() +=
"} // block\n";
2255 cp.
code() +=
"{ // procedure\n";
2256 cp.
code() +=
"RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 3LL);\n";
2257 cp.
code() +=
"etiss_coverage_count(2, 2787, 2785);\n";
2259 cp.
code() +=
"} // procedure\n";
2262 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2269 cp.
code() = std::string(
"//CEBREAK\n");
2272 cp.
code() +=
"return cpu->exception;\n";
2285 std::stringstream ss;
2287 ss <<
"cebreak" <<
" # " << ba << (
" []");
2309 rs2 += R_rs2_0.
read(ba) << 0;
2312 uimm += R_uimm_6.
read(ba) << 6;
2314 uimm += R_uimm_2.
read(ba) << 2;
2321 cp.
code() = std::string(
"//CSWSP\n");
2324 cp.
code() +=
"etiss_coverage_count(1, 70);\n";
2326 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2327 cp.
code() +=
"{ // block\n";
2329 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2330 cp.
code() +=
"} // block\n";
2333 cp.
code() +=
"etiss_coverage_count(1, 2806);\n";
2334 cp.
code() +=
"{ // block\n";
2335 cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[2ULL] + " + std::to_string(uimm) +
"ULL;\n";
2336 cp.
code() +=
"etiss_coverage_count(5, 2794, 2793, 2791, 2790, 2792);\n";
2337 cp.
code() +=
"etiss_uint32 mem_val_0;\n";
2338 cp.
code() +=
"mem_val_0 = (etiss_uint32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
2339 cp.
code() +=
"etiss_coverage_count(7, 2805, 2797, 2796, 2804, 2802, 2801, 2799);\n";
2340 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
2341 cp.
code() +=
"if (cpu->exception) { // conditional\n";
2343 cp.
code() +=
"{ // procedure\n";
2344 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
2346 cp.
code() +=
"} // procedure\n";
2348 cp.
code() +=
"} // conditional\n";
2349 cp.
code() +=
"} // block\n";
2352 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2359 cp.
code() = std::string(
"//CSWSP\n");
2362 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
2374 rs2 += R_rs2_0.read(ba) << 0;
2377 uimm += R_uimm_6.read(ba) << 6;
2379 uimm += R_uimm_2.read(ba) << 2;
2383 std::stringstream ss;
2385 ss <<
"cswsp" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | uimm=" + std::to_string(uimm) +
"]");
2411 cp.
code() = std::string(
"//DII\n");
2414 cp.
code() +=
"etiss_coverage_count(1, 71);\n";
2416 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
2417 cp.
code() +=
"{ // block\n";
2419 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
2420 cp.
code() +=
"} // block\n";
2423 cp.
code() +=
"{ // procedure\n";
2424 cp.
code() +=
"RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";
2425 cp.
code() +=
"etiss_coverage_count(2, 2809, 2807);\n";
2427 cp.
code() +=
"} // procedure\n";
2430 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
2437 cp.
code() = std::string(
"//DII\n");
2440 cp.
code() +=
"return cpu->exception;\n";
2453 std::stringstream ss;
2455 ss <<
"dii" <<
" # " << ba << (
" []");
etiss::instr::InstructionGroup ISA16_RV64IMACFD("ISA16_RV64IMACFD", 16)
static InstructionDefinition cnop_nzimm(ISA16_RV64IMACFD, "cnop",(uint16_t) 0x01,(uint16_t) 0xef83, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 nzimm=0;static BitArrayRange R_nzimm_0(6, 2);nzimm+=R_nzimm_0.read(ba)<< 0;static BitArrayRange R_nzimm_5(12, 12);nzimm+=R_nzimm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CNOP\n");cp.code()+="etiss_coverage_count(1, 46);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2407);\n";cp.code()+="{ // block\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);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 nzimm=0;static BitArrayRange R_nzimm_0(6, 2);nzimm+=R_nzimm_0.read(ba)<< 0;static BitArrayRange R_nzimm_5(12, 12);nzimm+=R_nzimm_5.read(ba)<< 5;std::stringstream ss;ss<< "cnop"<< " # "<< ba<<(" [nzimm="+std::to_string(nzimm)+"]");return ss.str();})
static InstructionDefinition cjr_rs1(ISA16_RV64IMACFD, "cjr",(uint16_t) 0x8002,(uint16_t) 0xf07f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(11, 7);rs1+=R_rs1_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CJR\n");cp.code()+="etiss_coverage_count(1, 65);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2722);\n";if(rs1) { cp.code()+="etiss_coverage_count(1, 2723);\n";cp.code()+="cpu->nextPc = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] & -2LL;\n";cp.code()+="etiss_coverage_count(6, 2733, 2724, 2732, 2729, 2728, 2726);\n";} else { { cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2ULL);\n";cp.code()+="etiss_coverage_count(3, 2736, 2734, 2735);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\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("//CJR\n");cp.code()+="return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(11, 7);rs1+=R_rs1_0.read(ba)<< 0;std::stringstream ss;ss<< "cjr"<< " # "<< ba<<(" [rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition clwsp_uimm_rd(ISA16_RV64IMACFD, "clwsp",(uint16_t) 0x4002,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(3, 2);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 4);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;static BitArrayRange R_uimm_5(12, 12);uimm+=R_uimm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CLWSP\n");cp.code()+="etiss_coverage_count(1, 63);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2703);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 2677);\n";if(rd % 32ULL) { cp.code()+="etiss_coverage_count(2, 2680, 2678);\n";{ cp.code()+="etiss_coverage_count(1, 2699);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, *((RV64IMACFD*)cpu)->X[2ULL] + "+std::to_string(uimm)+"ULL, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="etiss_int32 res = mem_val_0;\n";cp.code()+="etiss_coverage_count(6, 2689, 2688, 2687, 2685, 2684, 2686);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int64)(res);\n";cp.code()+="etiss_coverage_count(6, 2698, 2694, 2693, 2691, 2697, 2695);\n";cp.code()+="} // block\n";} } else { { cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2ULL);\n";cp.code()+="etiss_coverage_count(3, 2702, 2700, 2701);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\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("//CLWSP\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(3, 2);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 4);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;static BitArrayRange R_uimm_5(12, 12);uimm+=R_uimm_5.read(ba)<< 5;std::stringstream ss;ss<< "clwsp"<< " # "<< ba<<(" [uimm="+std::to_string(uimm)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition cli_imm_rd(ISA16_RV64IMACFD, "cli",(uint16_t) 0x4001,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 imm=0;static BitArrayRange R_imm_0(6, 2);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;static BitArrayRange R_imm_5(12, 12);imm+=R_imm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CLI\n");cp.code()+="etiss_coverage_count(1, 48);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2439);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 2423);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 2429, 2426, 2424, 2427, 2428);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = "+std::to_string(((etiss_int8)(((etiss_int8) imm)<<(2)) >>(2)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 2438, 2434, 2433, 2431, 2437, 2435);\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);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 imm=0;static BitArrayRange R_imm_0(6, 2);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;static BitArrayRange R_imm_5(12, 12);imm+=R_imm_5.read(ba)<< 5;std::stringstream ss;ss<< "cli"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition clui_imm_rd(ISA16_RV64IMACFD, "clui",(uint16_t) 0x6001,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint32 imm=0;static BitArrayRange R_imm_12(6, 2);imm+=R_imm_12.read(ba)<< 12;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;static BitArrayRange R_imm_17(12, 12);imm+=R_imm_17.read(ba)<< 17;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CLUI\n");cp.code()+="etiss_coverage_count(1, 49);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2463);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 2440);\n";if(imm==0LL) { cp.code()+="etiss_coverage_count(3, 2443, 2441, 2442);\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";cp.code()+="etiss_coverage_count(2, 2446, 2444);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} } cp.code()+="etiss_coverage_count(1, 2447);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 2453, 2450, 2448, 2451, 2452);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = "+std::to_string(((etiss_int32)(((etiss_int32) imm)<<(14)) >>(14)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 2462, 2458, 2457, 2455, 2461, 2459);\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("//CLUI\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint32 imm=0;static BitArrayRange R_imm_12(6, 2);imm+=R_imm_12.read(ba)<< 12;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;static BitArrayRange R_imm_17(12, 12);imm+=R_imm_17.read(ba)<< 17;std::stringstream ss;ss<< "clui"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition caddi16sp_nzimm(ISA16_RV64IMACFD, "caddi16sp",(uint16_t) 0x6101,(uint16_t) 0xef83, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 nzimm=0;static BitArrayRange R_nzimm_5(2, 2);nzimm+=R_nzimm_5.read(ba)<< 5;static BitArrayRange R_nzimm_7(4, 3);nzimm+=R_nzimm_7.read(ba)<< 7;static BitArrayRange R_nzimm_6(5, 5);nzimm+=R_nzimm_6.read(ba)<< 6;static BitArrayRange R_nzimm_4(6, 6);nzimm+=R_nzimm_4.read(ba)<< 4;static BitArrayRange R_nzimm_9(12, 12);nzimm+=R_nzimm_9.read(ba)<< 9;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CADDI16SP\n");cp.code()+="etiss_coverage_count(1, 50);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2464);\n";if(nzimm) { cp.code()+="etiss_coverage_count(1, 2465);\n";cp.code()+="*((RV64IMACFD*)cpu)->X[2ULL] = *((RV64IMACFD*)cpu)->X[2ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) nzimm)<<(6)) >>(6)))+"LL;\n";cp.code()+="etiss_coverage_count(8, 2476, 2468, 2467, 2475, 2471, 2470, 2474, 2472);\n";} else { { cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";cp.code()+="etiss_coverage_count(2, 2479, 2477);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\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("//CADDI16SP\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 nzimm=0;static BitArrayRange R_nzimm_5(2, 2);nzimm+=R_nzimm_5.read(ba)<< 5;static BitArrayRange R_nzimm_7(4, 3);nzimm+=R_nzimm_7.read(ba)<< 7;static BitArrayRange R_nzimm_6(5, 5);nzimm+=R_nzimm_6.read(ba)<< 6;static BitArrayRange R_nzimm_4(6, 6);nzimm+=R_nzimm_4.read(ba)<< 4;static BitArrayRange R_nzimm_9(12, 12);nzimm+=R_nzimm_9.read(ba)<< 9;std::stringstream ss;ss<< "caddi16sp"<< " # "<< ba<<(" [nzimm="+std::to_string(nzimm)+"]");return ss.str();})
static InstructionDefinition cjalr_rs1(ISA16_RV64IMACFD, "cjalr",(uint16_t) 0x9002,(uint16_t) 0xf07f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(11, 7);rs1+=R_rs1_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CJALR\n");cp.code()+="etiss_coverage_count(1, 68);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2784);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 new_pc = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 2770, 2769, 2768, 2766);\n";cp.code()+="*((RV64IMACFD*)cpu)->X[1ULL] = "+std::to_string(ic.current_address_+2ULL)+"ULL;\n";cp.code()+="etiss_coverage_count(6, 2777, 2773, 2772, 2776, 2774, 2775);\n";cp.code()+="cpu->nextPc = new_pc & -2LL;\n";cp.code()+="etiss_coverage_count(4, 2783, 2778, 2782, 2779);\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("//CJALR\n");cp.code()+="return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(11, 7);rs1+=R_rs1_0.read(ba)<< 0;std::stringstream ss;ss<< "cjalr"<< " # "<< ba<<(" [rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition csrai_shamt_rs1(ISA16_RV64IMACFD, "csrai",(uint16_t) 0x8401,(uint16_t) 0xfc03, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(6, 2);shamt+=R_shamt_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSRAI\n");cp.code()+="etiss_coverage_count(1, 53);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2536);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 2497);\n";if(shamt) { cp.code()+="etiss_coverage_count(1, 2498);\n";{ cp.code()+="etiss_coverage_count(1, 2518);\n";cp.code()+="{ // block\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] = ((etiss_int64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL])) >> "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(13, 2517, 2506, 2505, 2503, 2504, 2516, 2513, 2511, 2510, 2508, 2509, 2514, 2515);\n";cp.code()+="} // block\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);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(6, 2);shamt+=R_shamt_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;std::stringstream ss;ss<< "csrai"<< " # "<< ba<<(" [shamt="+std::to_string(shamt)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition caddi_imm_rs1(ISA16_RV64IMACFD, "caddi",(uint16_t) 0x01,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 imm=0;static BitArrayRange R_imm_0(6, 2);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(11, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_imm_5(12, 12);imm+=R_imm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CADDI\n");cp.code()+="etiss_coverage_count(1, 45);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2385);\n";if((rs1 % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 2391, 2388, 2386, 2389, 2390);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int8)(((etiss_int8) imm)<<(2)) >>(2)))+"LL;\n";cp.code()+="etiss_coverage_count(10, 2406, 2396, 2395, 2393, 2405, 2401, 2400, 2398, 2404, 2402);\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 imm=0;static BitArrayRange R_imm_0(6, 2);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(11, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_imm_5(12, 12);imm+=R_imm_5.read(ba)<< 5;std::stringstream ss;ss<< "caddi"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition cand_rs2_rd(ISA16_RV64IMACFD, "cand",(uint16_t) 0x8c61,(uint16_t) 0xfc63, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(9, 7);rd+=R_rd_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CAND\n");cp.code()+="etiss_coverage_count(1, 58);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2624);\n";cp.code()+="{ // block\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] = *((RV64IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] & *((RV64IMACFD*)cpu)->X["+std::to_string(rs2+8ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(14, 2623, 2611, 2610, 2608, 2609, 2622, 2616, 2615, 2613, 2614, 2621, 2620, 2618, 2619);\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);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(9, 7);rd+=R_rd_0.read(ba)<< 0;std::stringstream ss;ss<< "cand"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition caddi4spn_rd_imm(ISA16_RV64IMACFD, "caddi4spn",(uint16_t) 0x00,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(4, 2);rd+=R_rd_0.read(ba)<< 0;etiss_uint16 imm=0;static BitArrayRange R_imm_3(5, 5);imm+=R_imm_3.read(ba)<< 3;static BitArrayRange R_imm_2(6, 6);imm+=R_imm_2.read(ba)<< 2;static BitArrayRange R_imm_6(10, 7);imm+=R_imm_6.read(ba)<< 6;static BitArrayRange R_imm_4(12, 11);imm+=R_imm_4.read(ba)<< 4;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CADDI4SPN\n");cp.code()+="etiss_coverage_count(1, 42);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2327);\n";if(imm) { cp.code()+="etiss_coverage_count(1, 2328);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] = *((RV64IMACFD*)cpu)->X[2ULL] + "+std::to_string(imm)+"ULL;\n";cp.code()+="etiss_coverage_count(9, 2339, 2333, 2332, 2330, 2331, 2338, 2336, 2335, 2337);\n";} else { { cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";cp.code()+="etiss_coverage_count(2, 2342, 2340);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\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("//CADDI4SPN\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(4, 2);rd+=R_rd_0.read(ba)<< 0;etiss_uint16 imm=0;static BitArrayRange R_imm_3(5, 5);imm+=R_imm_3.read(ba)<< 3;static BitArrayRange R_imm_2(6, 6);imm+=R_imm_2.read(ba)<< 2;static BitArrayRange R_imm_6(10, 7);imm+=R_imm_6.read(ba)<< 6;static BitArrayRange R_imm_4(12, 11);imm+=R_imm_4.read(ba)<< 4;std::stringstream ss;ss<< "caddi4spn"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition cebreak_(ISA16_RV64IMACFD, "cebreak",(uint16_t) 0x9002,(uint16_t) 0xffff, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { { CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CEBREAK\n");cp.code()+="etiss_coverage_count(1, 69);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 3LL);\n";cp.code()+="etiss_coverage_count(2, 2787, 2785);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\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("//CEBREAK\n");cp.code()+="return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { std::stringstream ss;ss<< "cebreak"<< " # "<< ba<<(" []");return ss.str();})
static InstructionDefinition cj_imm(ISA16_RV64IMACFD, "cj",(uint16_t) 0xa001,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_5(2, 2);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_1(5, 3);imm+=R_imm_1.read(ba)<< 1;static BitArrayRange R_imm_7(6, 6);imm+=R_imm_7.read(ba)<< 7;static BitArrayRange R_imm_6(7, 7);imm+=R_imm_6.read(ba)<< 6;static BitArrayRange R_imm_10(8, 8);imm+=R_imm_10.read(ba)<< 10;static BitArrayRange R_imm_8(10, 9);imm+=R_imm_8.read(ba)<< 8;static BitArrayRange R_imm_4(11, 11);imm+=R_imm_4.read(ba)<< 4;static BitArrayRange R_imm_11(12, 12);imm+=R_imm_11.read(ba)<< 11;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CJ\n");cp.code()+="etiss_coverage_count(1, 59);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+((etiss_int16)(((etiss_int16) imm)<<(4)) >>(4)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 2631, 2625, 2630, 2626, 2629, 2627);\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("//CJ\n");cp.code()+="return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_5(2, 2);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_1(5, 3);imm+=R_imm_1.read(ba)<< 1;static BitArrayRange R_imm_7(6, 6);imm+=R_imm_7.read(ba)<< 7;static BitArrayRange R_imm_6(7, 7);imm+=R_imm_6.read(ba)<< 6;static BitArrayRange R_imm_10(8, 8);imm+=R_imm_10.read(ba)<< 10;static BitArrayRange R_imm_8(10, 9);imm+=R_imm_8.read(ba)<< 8;static BitArrayRange R_imm_4(11, 11);imm+=R_imm_4.read(ba)<< 4;static BitArrayRange R_imm_11(12, 12);imm+=R_imm_11.read(ba)<< 11;std::stringstream ss;ss<< "cj"<< " # "<< ba<<(" [imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition csw_rs2_uimm_rs1(ISA16_RV64IMACFD, "csw",(uint16_t) 0xc000,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(5, 5);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 6);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSW\n");cp.code()+="etiss_coverage_count(1, 44);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2384);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 load_address = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] + "+std::to_string(uimm)+"ULL;\n";cp.code()+="etiss_coverage_count(7, 2372, 2371, 2369, 2368, 2366, 2367, 2370);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="mem_val_0 = (etiss_int32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2+8ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(8, 2383, 2375, 2374, 2382, 2380, 2379, 2377, 2378);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, load_address, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\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("//CSW\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(5, 5);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 6);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;std::stringstream ss;ss<< "csw"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | uimm="+std::to_string(uimm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition cxor_rs2_rd(ISA16_RV64IMACFD, "cxor",(uint16_t) 0x8c21,(uint16_t) 0xfc63, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(9, 7);rd+=R_rd_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CXOR\n");cp.code()+="etiss_coverage_count(1, 56);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2588);\n";cp.code()+="{ // block\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] = *((RV64IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] ^ *((RV64IMACFD*)cpu)->X["+std::to_string(rs2+8ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(14, 2587, 2575, 2574, 2572, 2573, 2586, 2580, 2579, 2577, 2578, 2585, 2584, 2582, 2583);\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);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(9, 7);rd+=R_rd_0.read(ba)<< 0;std::stringstream ss;ss<< "cxor"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition cor_rs2_rd(ISA16_RV64IMACFD, "cor",(uint16_t) 0x8c41,(uint16_t) 0xfc63, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(9, 7);rd+=R_rd_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//COR\n");cp.code()+="etiss_coverage_count(1, 57);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2606);\n";cp.code()+="{ // block\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] = *((RV64IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] | *((RV64IMACFD*)cpu)->X["+std::to_string(rs2+8ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(14, 2605, 2593, 2592, 2590, 2591, 2604, 2598, 2597, 2595, 2596, 2603, 2602, 2600, 2601);\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);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(9, 7);rd+=R_rd_0.read(ba)<< 0;std::stringstream ss;ss<< "cor"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition cbnez_imm_rs1(ISA16_RV64IMACFD, "cbnez",(uint16_t) 0xe001,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_5(2, 2);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_1(4, 3);imm+=R_imm_1.read(ba)<< 1;static BitArrayRange R_imm_6(6, 5);imm+=R_imm_6.read(ba)<< 6;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_imm_3(11, 10);imm+=R_imm_3.read(ba)<< 3;static BitArrayRange R_imm_8(12, 12);imm+=R_imm_8.read(ba)<< 8;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CBNEZ\n");cp.code()+="etiss_coverage_count(1, 61);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2647);\n";cp.code()+="if (*((RV64IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] != 0LL) { // conditional\n";cp.code()+="etiss_coverage_count(6, 2654, 2652, 2651, 2649, 2650, 2653);\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+((etiss_int16)(((etiss_int16) imm)<<(7)) >>(7)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 2661, 2655, 2660, 2656, 2659, 2657);\n";cp.code()+="} // conditional\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("//CBNEZ\n");cp.code()+="if (cpu->nextPc != "+std::to_string(ic.current_address_+2)+"ULL) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_5(2, 2);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_1(4, 3);imm+=R_imm_1.read(ba)<< 1;static BitArrayRange R_imm_6(6, 5);imm+=R_imm_6.read(ba)<< 6;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_imm_3(11, 10);imm+=R_imm_3.read(ba)<< 3;static BitArrayRange R_imm_8(12, 12);imm+=R_imm_8.read(ba)<< 8;std::stringstream ss;ss<< "cbnez"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition cslli_nzuimm_rs1(ISA16_RV64IMACFD, "cslli",(uint16_t) 0x02,(uint16_t) 0xf003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 nzuimm=0;static BitArrayRange R_nzuimm_0(6, 2);nzuimm+=R_nzuimm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(11, 7);rs1+=R_rs1_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSLLI\n");cp.code()+="etiss_coverage_count(1, 62);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2662);\n";if(nzuimm) { cp.code()+="etiss_coverage_count(1, 2663);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] << "+std::to_string(nzuimm)+"ULL;\n";cp.code()+="etiss_coverage_count(9, 2676, 2668, 2667, 2665, 2675, 2673, 2672, 2670, 2674);\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 nzuimm=0;static BitArrayRange R_nzuimm_0(6, 2);nzuimm+=R_nzuimm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(11, 7);rs1+=R_rs1_0.read(ba)<< 0;std::stringstream ss;ss<< "cslli"<< " # "<< ba<<(" [nzuimm="+std::to_string(nzuimm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition dii_(ISA16_RV64IMACFD, "dii",(uint16_t) 0x00,(uint16_t) 0xffff, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { { CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//DII\n");cp.code()+="etiss_coverage_count(1, 71);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";cp.code()+="etiss_coverage_count(2, 2809, 2807);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\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("//DII\n");cp.code()+="return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { std::stringstream ss;ss<< "dii"<< " # "<< ba<<(" []");return ss.str();})
static InstructionDefinition cmv_rs2_rd(ISA16_RV64IMACFD, "cmv",(uint16_t) 0x8002,(uint16_t) 0xf003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(6, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CMV\n");cp.code()+="etiss_coverage_count(1, 64);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2704);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 2710, 2707, 2705, 2708, 2709);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(7, 2721, 2715, 2714, 2712, 2720, 2719, 2717);\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(6, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;std::stringstream ss;ss<< "cmv"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition csrli_shamt_rs1(ISA16_RV64IMACFD, "csrli",(uint16_t) 0x8001,(uint16_t) 0xfc03, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(6, 2);shamt+=R_shamt_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSRLI\n");cp.code()+="etiss_coverage_count(1, 52);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2496);\n";cp.code()+="{ // block\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] >> "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(11, 2495, 2487, 2486, 2484, 2485, 2494, 2492, 2491, 2489, 2490, 2493);\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);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(6, 2);shamt+=R_shamt_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;std::stringstream ss;ss<< "csrli"<< " # "<< ba<<(" [shamt="+std::to_string(shamt)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition __reserved_cmv_(ISA16_RV64IMACFD, "__reserved_cmv",(uint16_t) 0x8002,(uint16_t) 0xffff, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { { CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//__reserved_cmv\n");cp.code()+="etiss_coverage_count(1, 66);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2ULL);\n";cp.code()+="etiss_coverage_count(3, 2739, 2737, 2738);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\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("//__reserved_cmv\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { std::stringstream ss;ss<< "__reserved_cmv"<< " # "<< ba<<(" []");return ss.str();})
static InstructionDefinition cadd_rs2_rd(ISA16_RV64IMACFD, "cadd",(uint16_t) 0x9002,(uint16_t) 0xf003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(6, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CADD\n");cp.code()+="etiss_coverage_count(1, 67);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2740);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 2746, 2743, 2741, 2744, 2745);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] + *((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(11, 2763, 2751, 2750, 2748, 2762, 2756, 2755, 2753, 2761, 2760, 2758);\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(6, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;std::stringstream ss;ss<< "cadd"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition __reserved_clui_rd(ISA16_RV64IMACFD, "__reserved_clui",(uint16_t) 0x6001,(uint16_t) 0xf07f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//__reserved_clui\n");cp.code()+="etiss_coverage_count(1, 51);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";cp.code()+="etiss_coverage_count(2, 2482, 2480);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\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("//__reserved_clui\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;std::stringstream ss;ss<< "__reserved_clui"<< " # "<< ba<<(" [rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition clw_rd_uimm_rs1(ISA16_RV64IMACFD, "clw",(uint16_t) 0x4000,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(4, 2);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(5, 5);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 6);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CLW\n");cp.code()+="etiss_coverage_count(1, 43);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2363);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 load_address = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] + "+std::to_string(uimm)+"ULL;\n";cp.code()+="etiss_coverage_count(7, 2351, 2350, 2348, 2347, 2345, 2346, 2349);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, load_address, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] = (etiss_int32)(mem_val_0);\n";cp.code()+="etiss_coverage_count(8, 2362, 2356, 2355, 2353, 2354, 2361, 2359, 2358);\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("//CLW\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(4, 2);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(5, 5);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(6, 6);uimm+=R_uimm_2.read(ba)<< 2;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;std::stringstream ss;ss<< "clw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | uimm="+std::to_string(uimm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition candi_imm_rs1(ISA16_RV64IMACFD, "candi",(uint16_t) 0x8801,(uint16_t) 0xec03, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 imm=0;static BitArrayRange R_imm_0(6, 2);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_imm_5(12, 12);imm+=R_imm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CANDI\n");cp.code()+="etiss_coverage_count(1, 54);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2552);\n";cp.code()+="{ // block\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] & "+std::to_string(((etiss_int8)(((etiss_int8) imm)<<(2)) >>(2)))+"LL;\n";cp.code()+="etiss_coverage_count(12, 2551, 2541, 2540, 2538, 2539, 2550, 2546, 2545, 2543, 2544, 2549, 2547);\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);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 imm=0;static BitArrayRange R_imm_0(6, 2);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_imm_5(12, 12);imm+=R_imm_5.read(ba)<< 5;std::stringstream ss;ss<< "candi"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition cswsp_rs2_uimm(ISA16_RV64IMACFD, "cswsp",(uint16_t) 0xc002,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(6, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(8, 7);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(12, 9);uimm+=R_uimm_2.read(ba)<< 2;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSWSP\n");cp.code()+="etiss_coverage_count(1, 70);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2806);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[2ULL] + "+std::to_string(uimm)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 2794, 2793, 2791, 2790, 2792);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="mem_val_0 = (etiss_uint32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(7, 2805, 2797, 2796, 2804, 2802, 2801, 2799);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\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("//CSWSP\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(6, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 uimm=0;static BitArrayRange R_uimm_6(8, 7);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_2(12, 9);uimm+=R_uimm_2.read(ba)<< 2;std::stringstream ss;ss<< "cswsp"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | uimm="+std::to_string(uimm)+"]");return ss.str();})
static InstructionDefinition cbeqz_imm_rs1(ISA16_RV64IMACFD, "cbeqz",(uint16_t) 0xc001,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_5(2, 2);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_1(4, 3);imm+=R_imm_1.read(ba)<< 1;static BitArrayRange R_imm_6(6, 5);imm+=R_imm_6.read(ba)<< 6;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_imm_3(11, 10);imm+=R_imm_3.read(ba)<< 3;static BitArrayRange R_imm_8(12, 12);imm+=R_imm_8.read(ba)<< 8;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CBEQZ\n");cp.code()+="etiss_coverage_count(1, 60);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 2632);\n";cp.code()+="if (*((RV64IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] == 0LL) { // conditional\n";cp.code()+="etiss_coverage_count(6, 2639, 2637, 2636, 2634, 2635, 2638);\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+((etiss_int16)(((etiss_int16) imm)<<(7)) >>(7)))+"LL;\n";cp.code()+="etiss_coverage_count(6, 2646, 2640, 2645, 2641, 2644, 2642);\n";cp.code()+="} // conditional\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("//CBEQZ\n");cp.code()+="if (cpu->nextPc != "+std::to_string(ic.current_address_+2)+"ULL) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_5(2, 2);imm+=R_imm_5.read(ba)<< 5;static BitArrayRange R_imm_1(4, 3);imm+=R_imm_1.read(ba)<< 1;static BitArrayRange R_imm_6(6, 5);imm+=R_imm_6.read(ba)<< 6;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_imm_3(11, 10);imm+=R_imm_3.read(ba)<< 3;static BitArrayRange R_imm_8(12, 12);imm+=R_imm_8.read(ba)<< 8;std::stringstream ss;ss<< "cbeqz"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition csub_rs2_rd(ISA16_RV64IMACFD, "csub",(uint16_t) 0x8c01,(uint16_t) 0xfc63, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(9, 7);rd+=R_rd_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSUB\n");cp.code()+="etiss_coverage_count(1, 55);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+2)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 2570);\n";cp.code()+="{ // block\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] = *((RV64IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] - *((RV64IMACFD*)cpu)->X["+std::to_string(rs2+8ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(14, 2569, 2557, 2556, 2554, 2555, 2568, 2562, 2561, 2559, 2560, 2567, 2566, 2564, 2565);\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);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(4, 2);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rd=0;static BitArrayRange R_rd_0(9, 7);rd+=R_rd_0.read(ba)<< 0;std::stringstream ss;ss<< "csub"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static __inline__ uint16_t
Contains a small code snipped.
@ APPENDEDRETURNINGREQUIRED
RegisterSet & getAffectedRegisters()
void append(const CodePart &part, CodePart::TYPE type)
void add(const RegisterPart &rp)
add a registerPart to the set or just its relevant bits if a register with the same name is already p...
Reading through it will only return bits within the range.
I read(const BitArray &ba)
reads bits from the range to the return value starting at the lsb.
this class contains parameters that persist in between instruction lookpus/translation within a trans...
uint64_t current_address_
start address of current instruction
holds information and translation callbacks for an instruction.
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.