31rd += R_rd_0.
read(ba) << 0;
34rs1 += R_rs1_0.
read(ba) << 0;
37imm += R_imm_0.
read(ba) << 0;
44 cp.
code() = std::string(
"//LWU\n");
47cp.
code() +=
"etiss_coverage_count(1, 184);\n";
49cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
50cp.
code() +=
"{ // block\n";
52cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
53cp.
code() +=
"} // block\n";
56cp.
code() +=
"etiss_coverage_count(1, 6976);\n";
57cp.
code() +=
"{ // block\n";
58cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
59cp.
code() +=
"etiss_coverage_count(7, 6952, 6951, 6947, 6946, 6944, 6950, 6948);\n";
60cp.
code() +=
"etiss_uint32 mem_val_0;\n";
61cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
62cp.
code() +=
"if (cpu->exception) { // conditional\n";
64cp.
code() +=
"{ // procedure\n";
65cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
67cp.
code() +=
"} // procedure\n";
69cp.
code() +=
"} // conditional\n";
70cp.
code() +=
"etiss_uint32 res = (etiss_uint32)(mem_val_0);\n";
71cp.
code() +=
"etiss_coverage_count(4, 6959, 6958, 6956, 6955);\n";
72cp.
code() +=
"etiss_coverage_count(1, 6960);\n";
73if ((rd % 32ULL) != 0LL) {
74cp.
code() +=
"etiss_coverage_count(5, 6966, 6963, 6961, 6964, 6965);\n";
75cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint64)(res);\n";
76cp.
code() +=
"etiss_coverage_count(6, 6975, 6971, 6970, 6968, 6974, 6972);\n";
78cp.
code() +=
"} // block\n";
81cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
88 cp.
code() = std::string(
"//LWU\n");
91cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
103rd += R_rd_0.read(ba) << 0;
106rs1 += R_rs1_0.read(ba) << 0;
109imm += R_imm_0.read(ba) << 0;
113 std::stringstream ss;
115ss <<
"lwu" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
137rd += R_rd_0.
read(ba) << 0;
140rs1 += R_rs1_0.
read(ba) << 0;
143imm += R_imm_0.
read(ba) << 0;
150 cp.
code() = std::string(
"//LD\n");
153cp.
code() +=
"etiss_coverage_count(1, 185);\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, 7010);\n";
163cp.
code() +=
"{ // block\n";
164cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
165cp.
code() +=
"etiss_coverage_count(7, 6986, 6985, 6982, 6981, 6979, 6984, 6983);\n";
166cp.
code() +=
"etiss_uint64 mem_val_0;\n";
167cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\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() +=
"etiss_int64 res = (etiss_int64)(mem_val_0);\n";
177cp.
code() +=
"etiss_coverage_count(4, 6993, 6992, 6990, 6989);\n";
178cp.
code() +=
"etiss_coverage_count(1, 6994);\n";
179if ((rd % 32ULL) != 0LL) {
180cp.
code() +=
"etiss_coverage_count(5, 7000, 6997, 6995, 6998, 6999);\n";
181cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint64)(res);\n";
182cp.
code() +=
"etiss_coverage_count(6, 7009, 7005, 7004, 7002, 7008, 7006);\n";
184cp.
code() +=
"} // block\n";
187cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
194 cp.
code() = std::string(
"//LD\n");
197cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
209rd += R_rd_0.read(ba) << 0;
212rs1 += R_rs1_0.read(ba) << 0;
215imm += R_imm_0.read(ba) << 0;
219 std::stringstream ss;
221ss <<
"ld" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
243imm += R_imm_0.
read(ba) << 0;
246rs1 += R_rs1_0.
read(ba) << 0;
249rs2 += R_rs2_0.
read(ba) << 0;
251imm += R_imm_5.
read(ba) << 5;
258 cp.
code() = std::string(
"//SD\n");
261cp.
code() +=
"etiss_coverage_count(1, 186);\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, 7032);\n";
271cp.
code() +=
"{ // block\n";
272cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
273cp.
code() +=
"etiss_coverage_count(7, 7020, 7019, 7016, 7015, 7013, 7018, 7017);\n";
274cp.
code() +=
"etiss_uint64 mem_val_0;\n";
275cp.
code() +=
"mem_val_0 = (etiss_uint64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
276cp.
code() +=
"etiss_coverage_count(7, 7031, 7023, 7022, 7030, 7028, 7027, 7025);\n";
277cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\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(
"//SD\n");
299cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
311imm += R_imm_0.read(ba) << 0;
314rs1 += R_rs1_0.read(ba) << 0;
317rs2 += R_rs2_0.read(ba) << 0;
319imm += R_imm_5.read(ba) << 5;
323 std::stringstream ss;
325ss <<
"sd" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
336 (uint32_t) 0xfc00707f,
347rd += R_rd_0.
read(ba) << 0;
350rs1 += R_rs1_0.
read(ba) << 0;
353shamt += R_shamt_0.
read(ba) << 0;
360 cp.
code() = std::string(
"//SLLI\n");
363cp.
code() +=
"etiss_coverage_count(1, 187);\n";
365cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
366cp.
code() +=
"{ // block\n";
368cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
369cp.
code() +=
"} // block\n";
371cp.
code() +=
"etiss_coverage_count(1, 7033);\n";
372if ((rd % 32ULL) != 0LL) {
373cp.
code() +=
"etiss_coverage_count(5, 7039, 7036, 7034, 7037, 7038);\n";
374cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] << " + std::to_string(shamt) +
"ULL;\n";
375cp.
code() +=
"etiss_coverage_count(9, 7052, 7044, 7043, 7041, 7051, 7049, 7048, 7046, 7050);\n";
378cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
391rd += R_rd_0.read(ba) << 0;
394rs1 += R_rs1_0.read(ba) << 0;
397shamt += R_shamt_0.read(ba) << 0;
401 std::stringstream ss;
403ss <<
"slli" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | shamt=" + std::to_string(shamt) +
"]");
414 (uint32_t) 0xfc00707f,
425rd += R_rd_0.
read(ba) << 0;
428rs1 += R_rs1_0.
read(ba) << 0;
431shamt += R_shamt_0.
read(ba) << 0;
438 cp.
code() = std::string(
"//SRLI\n");
441cp.
code() +=
"etiss_coverage_count(1, 188);\n";
443cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
444cp.
code() +=
"{ // block\n";
446cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
447cp.
code() +=
"} // block\n";
449cp.
code() +=
"etiss_coverage_count(1, 7053);\n";
450if ((rd % 32ULL) != 0LL) {
451cp.
code() +=
"etiss_coverage_count(5, 7059, 7056, 7054, 7057, 7058);\n";
452cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] >> " + std::to_string(shamt) +
"ULL;\n";
453cp.
code() +=
"etiss_coverage_count(9, 7072, 7064, 7063, 7061, 7071, 7069, 7068, 7066, 7070);\n";
456cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
469rd += R_rd_0.read(ba) << 0;
472rs1 += R_rs1_0.read(ba) << 0;
475shamt += R_shamt_0.read(ba) << 0;
479 std::stringstream ss;
481ss <<
"srli" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | shamt=" + std::to_string(shamt) +
"]");
491 (uint32_t) 0x40005013,
492 (uint32_t) 0xfc00707f,
503rd += R_rd_0.
read(ba) << 0;
506rs1 += R_rs1_0.
read(ba) << 0;
509shamt += R_shamt_0.
read(ba) << 0;
516 cp.
code() = std::string(
"//SRAI\n");
519cp.
code() +=
"etiss_coverage_count(1, 189);\n";
521cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
522cp.
code() +=
"{ // block\n";
524cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
525cp.
code() +=
"} // block\n";
527cp.
code() +=
"etiss_coverage_count(1, 7073);\n";
528if ((rd % 32ULL) != 0LL) {
529cp.
code() +=
"etiss_coverage_count(5, 7079, 7076, 7074, 7077, 7078);\n";
530cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = ((etiss_int64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL])) >> " + std::to_string(shamt) +
"ULL;\n";
531cp.
code() +=
"etiss_coverage_count(11, 7094, 7084, 7083, 7081, 7093, 7090, 7089, 7088, 7086, 7091, 7092);\n";
534cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
547rd += R_rd_0.read(ba) << 0;
550rs1 += R_rs1_0.read(ba) << 0;
553shamt += R_shamt_0.read(ba) << 0;
557 std::stringstream ss;
559ss <<
"srai" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | shamt=" + std::to_string(shamt) +
"]");
581rd += R_rd_0.
read(ba) << 0;
584rs1 += R_rs1_0.
read(ba) << 0;
587imm += R_imm_0.
read(ba) << 0;
594 cp.
code() = std::string(
"//ADDIW\n");
597cp.
code() +=
"etiss_coverage_count(1, 190);\n";
599cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
600cp.
code() +=
"{ // block\n";
602cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
603cp.
code() +=
"} // block\n";
606cp.
code() +=
"etiss_coverage_count(1, 7122);\n";
607cp.
code() +=
"{ // block\n";
608cp.
code() +=
"etiss_coverage_count(1, 7095);\n";
609if ((rd % 32ULL) != 0LL) {
610cp.
code() +=
"etiss_coverage_count(5, 7101, 7098, 7096, 7099, 7100);\n";
612cp.
code() +=
"etiss_coverage_count(1, 7121);\n";
613cp.
code() +=
"{ // block\n";
614cp.
code() +=
"etiss_int32 res = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] + " + std::to_string(((
etiss_int16)(((
etiss_int16)imm) << (4)) >> (4))) +
"LL;\n";
615cp.
code() +=
"etiss_coverage_count(7, 7111, 7110, 7107, 7106, 7104, 7109, 7108);\n";
616cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int64)(res);\n";
617cp.
code() +=
"etiss_coverage_count(6, 7120, 7116, 7115, 7113, 7119, 7117);\n";
618cp.
code() +=
"} // block\n";
621cp.
code() +=
"} // block\n";
624cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
637rd += R_rd_0.read(ba) << 0;
640rs1 += R_rs1_0.read(ba) << 0;
643imm += R_imm_0.read(ba) << 0;
647 std::stringstream ss;
649ss <<
"addiw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | imm=" + std::to_string(imm) +
"]");
660 (uint32_t) 0xfe00707f,
671rd += R_rd_0.
read(ba) << 0;
674rs1 += R_rs1_0.
read(ba) << 0;
677shamt += R_shamt_0.
read(ba) << 0;
684 cp.
code() = std::string(
"//SLLIW\n");
687cp.
code() +=
"etiss_coverage_count(1, 191);\n";
689cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
690cp.
code() +=
"{ // block\n";
692cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
693cp.
code() +=
"} // block\n";
696cp.
code() +=
"etiss_coverage_count(1, 7153);\n";
697cp.
code() +=
"{ // block\n";
698cp.
code() +=
"etiss_coverage_count(1, 7123);\n";
699if ((rd % 32ULL) != 0LL) {
700cp.
code() +=
"etiss_coverage_count(5, 7129, 7126, 7124, 7127, 7128);\n";
702cp.
code() +=
"etiss_coverage_count(1, 7152);\n";
703cp.
code() +=
"{ // block\n";
704cp.
code() +=
"etiss_uint32 sh_val = ((etiss_uint32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL])) << " + std::to_string(shamt) +
"ULL;\n";
705cp.
code() +=
"etiss_coverage_count(8, 7141, 7140, 7137, 7135, 7134, 7132, 7138, 7139);\n";
706cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint64)((etiss_int32)(sh_val));\n";
707cp.
code() +=
"etiss_coverage_count(7, 7151, 7146, 7145, 7143, 7150, 7148, 7147);\n";
708cp.
code() +=
"} // block\n";
711cp.
code() +=
"} // block\n";
714cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
727rd += R_rd_0.read(ba) << 0;
730rs1 += R_rs1_0.read(ba) << 0;
733shamt += R_shamt_0.read(ba) << 0;
737 std::stringstream ss;
739ss <<
"slliw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | shamt=" + std::to_string(shamt) +
"]");
750 (uint32_t) 0xfe00707f,
761rd += R_rd_0.
read(ba) << 0;
764rs1 += R_rs1_0.
read(ba) << 0;
767shamt += R_shamt_0.
read(ba) << 0;
774 cp.
code() = std::string(
"//SRLIW\n");
777cp.
code() +=
"etiss_coverage_count(1, 192);\n";
779cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
780cp.
code() +=
"{ // block\n";
782cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
783cp.
code() +=
"} // block\n";
786cp.
code() +=
"etiss_coverage_count(1, 7184);\n";
787cp.
code() +=
"{ // block\n";
788cp.
code() +=
"etiss_coverage_count(1, 7154);\n";
789if ((rd % 32ULL) != 0LL) {
790cp.
code() +=
"etiss_coverage_count(5, 7160, 7157, 7155, 7158, 7159);\n";
792cp.
code() +=
"etiss_coverage_count(1, 7183);\n";
793cp.
code() +=
"{ // block\n";
794cp.
code() +=
"etiss_uint32 sh_val = ((etiss_uint32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL])) >> " + std::to_string(shamt) +
"ULL;\n";
795cp.
code() +=
"etiss_coverage_count(8, 7172, 7171, 7168, 7166, 7165, 7163, 7169, 7170);\n";
796cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint64)((etiss_int32)(sh_val));\n";
797cp.
code() +=
"etiss_coverage_count(7, 7182, 7177, 7176, 7174, 7181, 7179, 7178);\n";
798cp.
code() +=
"} // block\n";
801cp.
code() +=
"} // block\n";
804cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
817rd += R_rd_0.read(ba) << 0;
820rs1 += R_rs1_0.read(ba) << 0;
823shamt += R_shamt_0.read(ba) << 0;
827 std::stringstream ss;
829ss <<
"srliw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | shamt=" + std::to_string(shamt) +
"]");
839 (uint32_t) 0x4000501b,
840 (uint32_t) 0xfe00707f,
851rd += R_rd_0.
read(ba) << 0;
854rs1 += R_rs1_0.
read(ba) << 0;
857shamt += R_shamt_0.
read(ba) << 0;
864 cp.
code() = std::string(
"//SRAIW\n");
867cp.
code() +=
"etiss_coverage_count(1, 193);\n";
869cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
870cp.
code() +=
"{ // block\n";
872cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
873cp.
code() +=
"} // block\n";
876cp.
code() +=
"etiss_coverage_count(1, 7214);\n";
877cp.
code() +=
"{ // block\n";
878cp.
code() +=
"etiss_coverage_count(1, 7185);\n";
879if ((rd % 32ULL) != 0LL) {
880cp.
code() +=
"etiss_coverage_count(5, 7191, 7188, 7186, 7189, 7190);\n";
882cp.
code() +=
"etiss_coverage_count(1, 7213);\n";
883cp.
code() +=
"{ // block\n";
884cp.
code() +=
"etiss_int32 sh_val = ((etiss_int32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL])) >> " + std::to_string(shamt) +
"ULL;\n";
885cp.
code() +=
"etiss_coverage_count(8, 7203, 7202, 7199, 7197, 7196, 7194, 7200, 7201);\n";
886cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint64)(sh_val);\n";
887cp.
code() +=
"etiss_coverage_count(6, 7212, 7208, 7207, 7205, 7211, 7209);\n";
888cp.
code() +=
"} // block\n";
891cp.
code() +=
"} // block\n";
894cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
907rd += R_rd_0.read(ba) << 0;
910rs1 += R_rs1_0.read(ba) << 0;
913shamt += R_shamt_0.read(ba) << 0;
917 std::stringstream ss;
919ss <<
"sraiw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | shamt=" + std::to_string(shamt) +
"]");
930 (uint32_t) 0xfe00707f,
941rd += R_rd_0.
read(ba) << 0;
944rs1 += R_rs1_0.
read(ba) << 0;
947rs2 += R_rs2_0.
read(ba) << 0;
954 cp.
code() = std::string(
"//ADDW\n");
957cp.
code() +=
"etiss_coverage_count(1, 194);\n";
959cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
960cp.
code() +=
"{ // block\n";
962cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
963cp.
code() +=
"} // block\n";
966cp.
code() +=
"etiss_coverage_count(1, 7249);\n";
967cp.
code() +=
"{ // block\n";
968cp.
code() +=
"etiss_coverage_count(1, 7215);\n";
969if ((rd % 32ULL) != 0LL) {
970cp.
code() +=
"etiss_coverage_count(5, 7221, 7218, 7216, 7219, 7220);\n";
972cp.
code() +=
"etiss_coverage_count(1, 7248);\n";
973cp.
code() +=
"{ // block\n";
974cp.
code() +=
"etiss_int32 res = (etiss_int32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL]) + (etiss_int32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
975cp.
code() +=
"etiss_coverage_count(10, 7238, 7237, 7229, 7227, 7226, 7224, 7236, 7234, 7233, 7231);\n";
976cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int64)(res);\n";
977cp.
code() +=
"etiss_coverage_count(6, 7247, 7243, 7242, 7240, 7246, 7244);\n";
978cp.
code() +=
"} // block\n";
981cp.
code() +=
"} // block\n";
984cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
997rd += R_rd_0.read(ba) << 0;
1000rs1 += R_rs1_0.read(ba) << 0;
1003rs2 += R_rs2_0.read(ba) << 0;
1007 std::stringstream ss;
1009ss <<
"addw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
1019 (uint32_t) 0x4000003b,
1020 (uint32_t) 0xfe00707f,
1031rd += R_rd_0.
read(ba) << 0;
1034rs1 += R_rs1_0.
read(ba) << 0;
1037rs2 += R_rs2_0.
read(ba) << 0;
1044 cp.
code() = std::string(
"//SUBW\n");
1047cp.
code() +=
"etiss_coverage_count(1, 195);\n";
1049cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1050cp.
code() +=
"{ // block\n";
1052cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1053cp.
code() +=
"} // block\n";
1056cp.
code() +=
"etiss_coverage_count(1, 7284);\n";
1057cp.
code() +=
"{ // block\n";
1058cp.
code() +=
"etiss_coverage_count(1, 7250);\n";
1059if ((rd % 32ULL) != 0LL) {
1060cp.
code() +=
"etiss_coverage_count(5, 7256, 7253, 7251, 7254, 7255);\n";
1062cp.
code() +=
"etiss_coverage_count(1, 7283);\n";
1063cp.
code() +=
"{ // block\n";
1064cp.
code() +=
"etiss_int32 res = (etiss_int32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL]) - (etiss_int32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
1065cp.
code() +=
"etiss_coverage_count(10, 7273, 7272, 7264, 7262, 7261, 7259, 7271, 7269, 7268, 7266);\n";
1066cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int64)(res);\n";
1067cp.
code() +=
"etiss_coverage_count(6, 7282, 7278, 7277, 7275, 7281, 7279);\n";
1068cp.
code() +=
"} // block\n";
1071cp.
code() +=
"} // block\n";
1074cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1087rd += R_rd_0.read(ba) << 0;
1090rs1 += R_rs1_0.read(ba) << 0;
1093rs2 += R_rs2_0.read(ba) << 0;
1097 std::stringstream ss;
1099ss <<
"subw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
1109 (uint32_t) 0x00103b,
1110 (uint32_t) 0xfe00707f,
1121rd += R_rd_0.
read(ba) << 0;
1124rs1 += R_rs1_0.
read(ba) << 0;
1127rs2 += R_rs2_0.
read(ba) << 0;
1134 cp.
code() = std::string(
"//SLLW\n");
1137cp.
code() +=
"etiss_coverage_count(1, 196);\n";
1139cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1140cp.
code() +=
"{ // block\n";
1142cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1143cp.
code() +=
"} // block\n";
1146cp.
code() +=
"etiss_coverage_count(1, 7325);\n";
1147cp.
code() +=
"{ // block\n";
1148cp.
code() +=
"etiss_coverage_count(1, 7285);\n";
1149if ((rd % 32ULL) != 0LL) {
1150cp.
code() +=
"etiss_coverage_count(5, 7291, 7288, 7286, 7289, 7290);\n";
1152cp.
code() +=
"etiss_coverage_count(1, 7324);\n";
1153cp.
code() +=
"{ // block\n";
1154cp.
code() +=
"etiss_uint32 count = (etiss_uint64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) & 31ULL;\n";
1155cp.
code() +=
"etiss_coverage_count(7, 7301, 7300, 7298, 7297, 7296, 7294, 7299);\n";
1156cp.
code() +=
"etiss_uint32 sh_val = ((etiss_uint32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL])) << count;\n";
1157cp.
code() +=
"etiss_coverage_count(8, 7313, 7312, 7309, 7307, 7306, 7304, 7310, 7311);\n";
1158cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint64)((etiss_int32)(sh_val));\n";
1159cp.
code() +=
"etiss_coverage_count(7, 7323, 7318, 7317, 7315, 7322, 7320, 7319);\n";
1160cp.
code() +=
"} // block\n";
1163cp.
code() +=
"} // block\n";
1166cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1179rd += R_rd_0.read(ba) << 0;
1182rs1 += R_rs1_0.read(ba) << 0;
1185rs2 += R_rs2_0.read(ba) << 0;
1189 std::stringstream ss;
1191ss <<
"sllw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
1201 (uint32_t) 0x00503b,
1202 (uint32_t) 0xfe00707f,
1213rd += R_rd_0.
read(ba) << 0;
1216rs1 += R_rs1_0.
read(ba) << 0;
1219rs2 += R_rs2_0.
read(ba) << 0;
1226 cp.
code() = std::string(
"//SRLW\n");
1229cp.
code() +=
"etiss_coverage_count(1, 197);\n";
1231cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1232cp.
code() +=
"{ // block\n";
1234cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1235cp.
code() +=
"} // block\n";
1238cp.
code() +=
"etiss_coverage_count(1, 7366);\n";
1239cp.
code() +=
"{ // block\n";
1240cp.
code() +=
"etiss_coverage_count(1, 7326);\n";
1241if ((rd % 32ULL) != 0LL) {
1242cp.
code() +=
"etiss_coverage_count(5, 7332, 7329, 7327, 7330, 7331);\n";
1244cp.
code() +=
"etiss_coverage_count(1, 7365);\n";
1245cp.
code() +=
"{ // block\n";
1246cp.
code() +=
"etiss_uint32 count = (etiss_uint64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) & 31ULL;\n";
1247cp.
code() +=
"etiss_coverage_count(7, 7342, 7341, 7339, 7338, 7337, 7335, 7340);\n";
1248cp.
code() +=
"etiss_uint32 sh_val = ((etiss_uint32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL])) >> count;\n";
1249cp.
code() +=
"etiss_coverage_count(8, 7354, 7353, 7350, 7348, 7347, 7345, 7351, 7352);\n";
1250cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint64)((etiss_int32)(sh_val));\n";
1251cp.
code() +=
"etiss_coverage_count(7, 7364, 7359, 7358, 7356, 7363, 7361, 7360);\n";
1252cp.
code() +=
"} // block\n";
1255cp.
code() +=
"} // block\n";
1258cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1271rd += R_rd_0.read(ba) << 0;
1274rs1 += R_rs1_0.read(ba) << 0;
1277rs2 += R_rs2_0.read(ba) << 0;
1281 std::stringstream ss;
1283ss <<
"srlw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
1293 (uint32_t) 0x4000503b,
1294 (uint32_t) 0xfe00707f,
1305rd += R_rd_0.
read(ba) << 0;
1308rs1 += R_rs1_0.
read(ba) << 0;
1311rs2 += R_rs2_0.
read(ba) << 0;
1318 cp.
code() = std::string(
"//SRAW\n");
1321cp.
code() +=
"etiss_coverage_count(1, 198);\n";
1323cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1324cp.
code() +=
"{ // block\n";
1326cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1327cp.
code() +=
"} // block\n";
1330cp.
code() +=
"etiss_coverage_count(1, 7406);\n";
1331cp.
code() +=
"{ // block\n";
1332cp.
code() +=
"etiss_coverage_count(1, 7367);\n";
1333if ((rd % 32ULL) != 0LL) {
1334cp.
code() +=
"etiss_coverage_count(5, 7373, 7370, 7368, 7371, 7372);\n";
1336cp.
code() +=
"etiss_coverage_count(1, 7405);\n";
1337cp.
code() +=
"{ // block\n";
1338cp.
code() +=
"etiss_uint32 count = (etiss_uint64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) & 31ULL;\n";
1339cp.
code() +=
"etiss_coverage_count(7, 7383, 7382, 7380, 7379, 7378, 7376, 7381);\n";
1340cp.
code() +=
"etiss_int32 sh_val = ((etiss_int32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL])) >> count;\n";
1341cp.
code() +=
"etiss_coverage_count(8, 7395, 7394, 7391, 7389, 7388, 7386, 7392, 7393);\n";
1342cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int64)(sh_val);\n";
1343cp.
code() +=
"etiss_coverage_count(6, 7404, 7400, 7399, 7397, 7403, 7401);\n";
1344cp.
code() +=
"} // block\n";
1347cp.
code() +=
"} // block\n";
1350cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1363rd += R_rd_0.read(ba) << 0;
1366rs1 += R_rs1_0.read(ba) << 0;
1369rs2 += R_rs2_0.read(ba) << 0;
1373 std::stringstream ss;
1375ss <<
"sraw" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
etiss::instr::InstructionGroup ISA32_RV64IMACFD("ISA32_RV64IMACFD", 32)
static InstructionDefinition lwu_rd_rs1_imm(ISA32_RV64IMACFD, "lwu",(uint32_t) 0x006003,(uint32_t) 0x00707f, [](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;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//LWU\n");cp.code()+="etiss_coverage_count(1, 184);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 6976);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) > >(4)))+"LL;\n";cp.code()+="etiss_coverage_count(7, 6952, 6951, 6947, 6946, 6944, 6950, 6948);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(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()+="etiss_uint32 res = (etiss_uint32)(mem_val_0);\n";cp.code()+="etiss_coverage_count(4, 6959, 6958, 6956, 6955);\n";cp.code()+="etiss_coverage_count(1, 6960);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 6966, 6963, 6961, 6964, 6965);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint64)(res);\n";cp.code()+="etiss_coverage_count(6, 6975, 6971, 6970, 6968, 6974, 6972);\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("//LWU\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;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "lwu"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition addw_rd_rs1_rs2(ISA32_RV64IMACFD, "addw",(uint32_t) 0x00003b,(uint32_t) 0xfe00707f, [](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;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//ADDW\n");cp.code()+="etiss_coverage_count(1, 194);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7249);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7215);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7221, 7218, 7216, 7219, 7220);\n";{ cp.code()+="etiss_coverage_count(1, 7248);\n";cp.code()+="{ // block\n";cp.code()+="etiss_int32 res = (etiss_int32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL]) + (etiss_int32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(10, 7238, 7237, 7229, 7227, 7226, 7224, 7236, 7234, 7233, 7231);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int64)(res);\n";cp.code()+="etiss_coverage_count(6, 7247, 7243, 7242, 7240, 7246, 7244);\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 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "addw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition srai_rd_rs1_shamt(ISA32_RV64IMACFD, "srai",(uint32_t) 0x40005013,(uint32_t) 0xfc00707f, [](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;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(25, 20);shamt+=R_shamt_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SRAI\n");cp.code()+="etiss_coverage_count(1, 189);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 7073);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7079, 7076, 7074, 7077, 7078);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = ((etiss_int64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL])) >> "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(11, 7094, 7084, 7083, 7081, 7093, 7090, 7089, 7088, 7086, 7091, 7092);\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 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(25, 20);shamt+=R_shamt_0.read(ba)<< 0;std::stringstream ss;ss<< "srai"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | shamt="+std::to_string(shamt)+"]");return ss.str();})
static InstructionDefinition subw_rd_rs1_rs2(ISA32_RV64IMACFD, "subw",(uint32_t) 0x4000003b,(uint32_t) 0xfe00707f, [](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;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SUBW\n");cp.code()+="etiss_coverage_count(1, 195);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7284);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7250);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7256, 7253, 7251, 7254, 7255);\n";{ cp.code()+="etiss_coverage_count(1, 7283);\n";cp.code()+="{ // block\n";cp.code()+="etiss_int32 res = (etiss_int32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL]) - (etiss_int32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(10, 7273, 7272, 7264, 7262, 7261, 7259, 7271, 7269, 7268, 7266);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int64)(res);\n";cp.code()+="etiss_coverage_count(6, 7282, 7278, 7277, 7275, 7281, 7279);\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 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "subw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition sllw_rd_rs1_rs2(ISA32_RV64IMACFD, "sllw",(uint32_t) 0x00103b,(uint32_t) 0xfe00707f, [](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;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SLLW\n");cp.code()+="etiss_coverage_count(1, 196);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7325);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7285);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7291, 7288, 7286, 7289, 7290);\n";{ cp.code()+="etiss_coverage_count(1, 7324);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 count = (etiss_uint64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) & 31ULL;\n";cp.code()+="etiss_coverage_count(7, 7301, 7300, 7298, 7297, 7296, 7294, 7299);\n";cp.code()+="etiss_uint32 sh_val = ((etiss_uint32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL])) << count;\n";cp.code()+="etiss_coverage_count(8, 7313, 7312, 7309, 7307, 7306, 7304, 7310, 7311);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint64)((etiss_int32)(sh_val));\n";cp.code()+="etiss_coverage_count(7, 7323, 7318, 7317, 7315, 7322, 7320, 7319);\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 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "sllw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition addiw_rd_rs1_imm(ISA32_RV64IMACFD, "addiw",(uint32_t) 0x00001b,(uint32_t) 0x00707f, [](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;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//ADDIW\n");cp.code()+="etiss_coverage_count(1, 190);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7122);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7095);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7101, 7098, 7096, 7099, 7100);\n";{ cp.code()+="etiss_coverage_count(1, 7121);\n";cp.code()+="{ // block\n";cp.code()+="etiss_int32 res = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) > >(4)))+"LL;\n";cp.code()+="etiss_coverage_count(7, 7111, 7110, 7107, 7106, 7104, 7109, 7108);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int64)(res);\n";cp.code()+="etiss_coverage_count(6, 7120, 7116, 7115, 7113, 7119, 7117);\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 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "addiw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition sraw_rd_rs1_rs2(ISA32_RV64IMACFD, "sraw",(uint32_t) 0x4000503b,(uint32_t) 0xfe00707f, [](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;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SRAW\n");cp.code()+="etiss_coverage_count(1, 198);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7406);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7367);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7373, 7370, 7368, 7371, 7372);\n";{ cp.code()+="etiss_coverage_count(1, 7405);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 count = (etiss_uint64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) & 31ULL;\n";cp.code()+="etiss_coverage_count(7, 7383, 7382, 7380, 7379, 7378, 7376, 7381);\n";cp.code()+="etiss_int32 sh_val = ((etiss_int32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL])) >> count;\n";cp.code()+="etiss_coverage_count(8, 7395, 7394, 7391, 7389, 7388, 7386, 7392, 7393);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int64)(sh_val);\n";cp.code()+="etiss_coverage_count(6, 7404, 7400, 7399, 7397, 7403, 7401);\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 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "sraw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition srliw_rd_rs1_shamt(ISA32_RV64IMACFD, "srliw",(uint32_t) 0x00501b,(uint32_t) 0xfe00707f, [](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;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SRLIW\n");cp.code()+="etiss_coverage_count(1, 192);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7184);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7154);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7160, 7157, 7155, 7158, 7159);\n";{ cp.code()+="etiss_coverage_count(1, 7183);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 sh_val = ((etiss_uint32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL])) >> "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(8, 7172, 7171, 7168, 7166, 7165, 7163, 7169, 7170);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint64)((etiss_int32)(sh_val));\n";cp.code()+="etiss_coverage_count(7, 7182, 7177, 7176, 7174, 7181, 7179, 7178);\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 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;std::stringstream ss;ss<< "srliw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | shamt="+std::to_string(shamt)+"]");return ss.str();})
static InstructionDefinition sd_imm_rs1_rs2(ISA32_RV64IMACFD, "sd",(uint32_t) 0x003023,(uint32_t) 0x00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 imm=0;static BitArrayRange R_imm_0(11, 7);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(31, 25);imm+=R_imm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SD\n");cp.code()+="etiss_coverage_count(1, 186);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7032);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) > >(4)))+"LL;\n";cp.code()+="etiss_coverage_count(7, 7020, 7019, 7016, 7015, 7013, 7018, 7017);\n";cp.code()+="etiss_uint64 mem_val_0;\n";cp.code()+="mem_val_0 = (etiss_uint64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(7, 7031, 7023, 7022, 7030, 7028, 7027, 7025);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\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("//SD\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 imm=0;static BitArrayRange R_imm_0(11, 7);imm+=R_imm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;static BitArrayRange R_imm_5(31, 25);imm+=R_imm_5.read(ba)<< 5;std::stringstream ss;ss<< "sd"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition slliw_rd_rs1_shamt(ISA32_RV64IMACFD, "slliw",(uint32_t) 0x00101b,(uint32_t) 0xfe00707f, [](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;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SLLIW\n");cp.code()+="etiss_coverage_count(1, 191);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7153);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7123);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7129, 7126, 7124, 7127, 7128);\n";{ cp.code()+="etiss_coverage_count(1, 7152);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 sh_val = ((etiss_uint32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL])) << "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(8, 7141, 7140, 7137, 7135, 7134, 7132, 7138, 7139);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint64)((etiss_int32)(sh_val));\n";cp.code()+="etiss_coverage_count(7, 7151, 7146, 7145, 7143, 7150, 7148, 7147);\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 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;std::stringstream ss;ss<< "slliw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | shamt="+std::to_string(shamt)+"]");return ss.str();})
static InstructionDefinition ld_rd_rs1_imm(ISA32_RV64IMACFD, "ld",(uint32_t) 0x003003,(uint32_t) 0x00707f, [](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;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//LD\n");cp.code()+="etiss_coverage_count(1, 185);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7010);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] + "+std::to_string(((etiss_int16)(((etiss_int16) imm)<<(4)) > >(4)))+"LL;\n";cp.code()+="etiss_coverage_count(7, 6986, 6985, 6982, 6981, 6979, 6984, 6983);\n";cp.code()+="etiss_uint64 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\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_int64 res = (etiss_int64)(mem_val_0);\n";cp.code()+="etiss_coverage_count(4, 6993, 6992, 6990, 6989);\n";cp.code()+="etiss_coverage_count(1, 6994);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7000, 6997, 6995, 6998, 6999);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint64)(res);\n";cp.code()+="etiss_coverage_count(6, 7009, 7005, 7004, 7002, 7008, 7006);\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("//LD\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;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint16 imm=0;static BitArrayRange R_imm_0(31, 20);imm+=R_imm_0.read(ba)<< 0;std::stringstream ss;ss<< "ld"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | imm="+std::to_string(imm)+"]");return ss.str();})
static InstructionDefinition slli_rd_rs1_shamt(ISA32_RV64IMACFD, "slli",(uint32_t) 0x001013,(uint32_t) 0xfc00707f, [](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;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(25, 20);shamt+=R_shamt_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SLLI\n");cp.code()+="etiss_coverage_count(1, 187);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 7033);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7039, 7036, 7034, 7037, 7038);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] << "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(9, 7052, 7044, 7043, 7041, 7051, 7049, 7048, 7046, 7050);\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 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(25, 20);shamt+=R_shamt_0.read(ba)<< 0;std::stringstream ss;ss<< "slli"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | shamt="+std::to_string(shamt)+"]");return ss.str();})
static InstructionDefinition srli_rd_rs1_shamt(ISA32_RV64IMACFD, "srli",(uint32_t) 0x005013,(uint32_t) 0xfc00707f, [](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;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(25, 20);shamt+=R_shamt_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SRLI\n");cp.code()+="etiss_coverage_count(1, 188);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} cp.code()+="etiss_coverage_count(1, 7053);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7059, 7056, 7054, 7057, 7058);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] >> "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(9, 7072, 7064, 7063, 7061, 7071, 7069, 7068, 7066, 7070);\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 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(25, 20);shamt+=R_shamt_0.read(ba)<< 0;std::stringstream ss;ss<< "srli"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | shamt="+std::to_string(shamt)+"]");return ss.str();})
static InstructionDefinition sraiw_rd_rs1_shamt(ISA32_RV64IMACFD, "sraiw",(uint32_t) 0x4000501b,(uint32_t) 0xfe00707f, [](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;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SRAIW\n");cp.code()+="etiss_coverage_count(1, 193);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7214);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7185);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7191, 7188, 7186, 7189, 7190);\n";{ cp.code()+="etiss_coverage_count(1, 7213);\n";cp.code()+="{ // block\n";cp.code()+="etiss_int32 sh_val = ((etiss_int32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL])) >> "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(8, 7203, 7202, 7199, 7197, 7196, 7194, 7200, 7201);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint64)(sh_val);\n";cp.code()+="etiss_coverage_count(6, 7212, 7208, 7207, 7205, 7211, 7209);\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 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 shamt=0;static BitArrayRange R_shamt_0(24, 20);shamt+=R_shamt_0.read(ba)<< 0;std::stringstream ss;ss<< "sraiw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | shamt="+std::to_string(shamt)+"]");return ss.str();})
static InstructionDefinition srlw_rd_rs1_rs2(ISA32_RV64IMACFD, "srlw",(uint32_t) 0x00503b,(uint32_t) 0xfe00707f, [](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;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//SRLW\n");cp.code()+="etiss_coverage_count(1, 197);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7366);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7326);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7332, 7329, 7327, 7330, 7331);\n";{ cp.code()+="etiss_coverage_count(1, 7365);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 count = (etiss_uint64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) & 31ULL;\n";cp.code()+="etiss_coverage_count(7, 7342, 7341, 7339, 7338, 7337, 7335, 7340);\n";cp.code()+="etiss_uint32 sh_val = ((etiss_uint32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL])) >> count;\n";cp.code()+="etiss_coverage_count(8, 7354, 7353, 7350, 7348, 7347, 7345, 7351, 7352);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint64)((etiss_int32)(sh_val));\n";cp.code()+="etiss_coverage_count(7, 7364, 7359, 7358, 7356, 7363, 7361, 7360);\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 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "srlw"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");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.