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