31imm += R_imm_0.
read(ba) << 0;
34rs1 += R_rs1_0.
read(ba) << 0;
36imm += R_imm_5.
read(ba) << 5;
43 cp.
code() = std::string(
"//CADDIW\n");
46cp.
code() +=
"etiss_coverage_count(1, 206);\n";
48cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
49cp.
code() +=
"{ // block\n";
51cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
52cp.
code() +=
"} // block\n";
54cp.
code() +=
"etiss_coverage_count(1, 7407);\n";
55if ((rs1 % 32ULL) != 0LL) {
56cp.
code() +=
"etiss_coverage_count(5, 7413, 7410, 7408, 7411, 7412);\n";
57cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL] = (etiss_int32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL]) + " + std::to_string(((
etiss_int8)(((
etiss_int8)imm) << (2)) >> (2))) +
"LL;\n";
58cp.
code() +=
"etiss_coverage_count(11, 7430, 7418, 7417, 7415, 7429, 7425, 7423, 7422, 7420, 7428, 7426);\n";
61cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
74imm += R_imm_0.read(ba) << 0;
77rs1 += R_rs1_0.read(ba) << 0;
79imm += R_imm_5.read(ba) << 5;
85ss <<
"caddiw" <<
" # " << ba << (
" [imm=" + std::to_string(imm) +
" | rs1=" + std::to_string(rs1) +
"]");
107nzuimm += R_nzuimm_0.
read(ba) << 0;
110rs1 += R_rs1_0.
read(ba) << 0;
112nzuimm += R_nzuimm_5.
read(ba) << 5;
119 cp.
code() = std::string(
"//CSRLI\n");
122cp.
code() +=
"etiss_coverage_count(1, 199);\n";
124cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
125cp.
code() +=
"{ // block\n";
127cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
128cp.
code() +=
"} // block\n";
131cp.
code() +=
"etiss_coverage_count(1, 7444);\n";
132cp.
code() +=
"{ // block\n";
133cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] >> " + std::to_string(nzuimm) +
"ULL;\n";
134cp.
code() +=
"etiss_coverage_count(11, 7443, 7435, 7434, 7432, 7433, 7442, 7440, 7439, 7437, 7438, 7441);\n";
135cp.
code() +=
"} // block\n";
138cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
151nzuimm += R_nzuimm_0.read(ba) << 0;
154rs1 += R_rs1_0.read(ba) << 0;
156nzuimm += R_nzuimm_5.read(ba) << 5;
160 std::stringstream ss;
162ss <<
"csrli" <<
" # " << ba << (
" [nzuimm=" + std::to_string(nzuimm) +
" | rs1=" + std::to_string(rs1) +
"]");
184shamt += R_shamt_0.
read(ba) << 0;
187rs1 += R_rs1_0.
read(ba) << 0;
189shamt += R_shamt_5.
read(ba) << 5;
196 cp.
code() = std::string(
"//CSRAI\n");
199cp.
code() +=
"etiss_coverage_count(1, 200);\n";
201cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
202cp.
code() +=
"{ // block\n";
204cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
205cp.
code() +=
"} // block\n";
208cp.
code() +=
"etiss_coverage_count(1, 7461);\n";
209cp.
code() +=
"{ // block\n";
210cp.
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";
211cp.
code() +=
"etiss_coverage_count(13, 7460, 7449, 7448, 7446, 7447, 7459, 7456, 7454, 7453, 7451, 7452, 7457, 7458);\n";
212cp.
code() +=
"} // block\n";
215cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
228shamt += R_shamt_0.read(ba) << 0;
231rs1 += R_rs1_0.read(ba) << 0;
233shamt += R_shamt_5.read(ba) << 5;
237 std::stringstream ss;
239ss <<
"csrai" <<
" # " << ba << (
" [shamt=" + std::to_string(shamt) +
" | rs1=" + std::to_string(rs1) +
"]");
261shamt += R_shamt_0.
read(ba) << 0;
264rs1 += R_rs1_0.
read(ba) << 0;
266shamt += R_shamt_5.
read(ba) << 5;
273 cp.
code() = std::string(
"//CSLLI\n");
276cp.
code() +=
"etiss_coverage_count(1, 201);\n";
278cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
279cp.
code() +=
"{ // block\n";
281cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
282cp.
code() +=
"} // block\n";
285cp.
code() +=
"etiss_coverage_count(1, 7478);\n";
286cp.
code() +=
"{ // block\n";
287cp.
code() +=
"etiss_coverage_count(1, 7462);\n";
289cp.
code() +=
"etiss_coverage_count(3, 7465, 7463, 7464);\n";
291cp.
code() +=
"{ // procedure\n";
292cp.
code() +=
"RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";
293cp.
code() +=
"etiss_coverage_count(2, 7468, 7466);\n";
295cp.
code() +=
"} // procedure\n";
298cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1) +
"ULL] = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1) +
"ULL] << " + std::to_string(shamt) +
"ULL;\n";
299cp.
code() +=
"etiss_coverage_count(7, 7477, 7471, 7470, 7476, 7474, 7473, 7475);\n";
300cp.
code() +=
"} // block\n";
303cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
310 cp.
code() = std::string(
"//CSLLI\n");
313cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
325shamt += R_shamt_0.read(ba) << 0;
328rs1 += R_rs1_0.read(ba) << 0;
330shamt += R_shamt_5.read(ba) << 5;
334 std::stringstream ss;
336ss <<
"cslli" <<
" # " << ba << (
" [shamt=" + std::to_string(shamt) +
" | rs1=" + std::to_string(rs1) +
"]");
358rd += R_rd_0.
read(ba) << 0;
361uimm += R_uimm_6.
read(ba) << 6;
364rs1 += R_rs1_0.
read(ba) << 0;
366uimm += R_uimm_3.
read(ba) << 3;
373 cp.
code() = std::string(
"//CLD\n");
376cp.
code() +=
"etiss_coverage_count(1, 202);\n";
378cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
379cp.
code() +=
"{ // block\n";
381cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
382cp.
code() +=
"} // block\n";
385cp.
code() +=
"etiss_coverage_count(1, 7499);\n";
386cp.
code() +=
"{ // block\n";
387cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] + " + std::to_string(uimm) +
"ULL;\n";
388cp.
code() +=
"etiss_coverage_count(7, 7487, 7486, 7484, 7483, 7481, 7482, 7485);\n";
389cp.
code() +=
"etiss_uint64 mem_val_0;\n";
390cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
391cp.
code() +=
"if (cpu->exception) { // conditional\n";
393cp.
code() +=
"{ // procedure\n";
394cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
396cp.
code() +=
"} // procedure\n";
398cp.
code() +=
"} // conditional\n";
399cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] = (etiss_int64)(mem_val_0);\n";
400cp.
code() +=
"etiss_coverage_count(8, 7498, 7492, 7491, 7489, 7490, 7497, 7495, 7494);\n";
401cp.
code() +=
"} // block\n";
404cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
411 cp.
code() = std::string(
"//CLD\n");
414cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
426rd += R_rd_0.read(ba) << 0;
429uimm += R_uimm_6.read(ba) << 6;
432rs1 += R_rs1_0.read(ba) << 0;
434uimm += R_uimm_3.read(ba) << 3;
438 std::stringstream ss;
440ss <<
"cld" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | uimm=" + std::to_string(uimm) +
" | rs1=" + std::to_string(rs1) +
"]");
462rs2 += R_rs2_0.
read(ba) << 0;
465uimm += R_uimm_6.
read(ba) << 6;
468rs1 += R_rs1_0.
read(ba) << 0;
470uimm += R_uimm_3.
read(ba) << 3;
477 cp.
code() = std::string(
"//CSD\n");
480cp.
code() +=
"etiss_coverage_count(1, 203);\n";
482cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
483cp.
code() +=
"{ // block\n";
485cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
486cp.
code() +=
"} // block\n";
489cp.
code() +=
"etiss_coverage_count(1, 7520);\n";
490cp.
code() +=
"{ // block\n";
491cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 + 8ULL) +
"ULL] + " + std::to_string(uimm) +
"ULL;\n";
492cp.
code() +=
"etiss_coverage_count(7, 7508, 7507, 7505, 7504, 7502, 7503, 7506);\n";
493cp.
code() +=
"etiss_uint64 mem_val_0;\n";
494cp.
code() +=
"mem_val_0 = (etiss_uint64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 + 8ULL) +
"ULL]);\n";
495cp.
code() +=
"etiss_coverage_count(8, 7519, 7511, 7510, 7518, 7516, 7515, 7513, 7514);\n";
496cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
497cp.
code() +=
"if (cpu->exception) { // conditional\n";
499cp.
code() +=
"{ // procedure\n";
500cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
502cp.
code() +=
"} // procedure\n";
504cp.
code() +=
"} // conditional\n";
505cp.
code() +=
"} // block\n";
508cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
515 cp.
code() = std::string(
"//CSD\n");
518cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
530rs2 += R_rs2_0.read(ba) << 0;
533uimm += R_uimm_6.read(ba) << 6;
536rs1 += R_rs1_0.read(ba) << 0;
538uimm += R_uimm_3.read(ba) << 3;
542 std::stringstream ss;
544ss <<
"csd" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | uimm=" + std::to_string(uimm) +
" | rs1=" + std::to_string(rs1) +
"]");
566rs2 += R_rs2_0.
read(ba) << 0;
569rd += R_rd_0.
read(ba) << 0;
576 cp.
code() = std::string(
"//CSUBW\n");
579cp.
code() +=
"etiss_coverage_count(1, 204);\n";
581cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
582cp.
code() +=
"{ // block\n";
584cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
585cp.
code() +=
"} // block\n";
588cp.
code() +=
"etiss_coverage_count(1, 7548);\n";
589cp.
code() +=
"{ // block\n";
590cp.
code() +=
"etiss_uint32 res = (etiss_uint32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL]) - (etiss_uint32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 + 8ULL) +
"ULL]);\n";
591cp.
code() +=
"etiss_coverage_count(12, 7537, 7536, 7528, 7526, 7525, 7523, 7524, 7535, 7533, 7532, 7530, 7531);\n";
592cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] = (etiss_uint64)((etiss_int32)(res));\n";
593cp.
code() +=
"etiss_coverage_count(8, 7547, 7542, 7541, 7539, 7540, 7546, 7544, 7543);\n";
594cp.
code() +=
"} // block\n";
597cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
610rs2 += R_rs2_0.read(ba) << 0;
613rd += R_rd_0.read(ba) << 0;
617 std::stringstream ss;
619ss <<
"csubw" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | rd=" + std::to_string(rd) +
"]");
641rs2 += R_rs2_0.
read(ba) << 0;
644rd += R_rd_0.
read(ba) << 0;
651 cp.
code() = std::string(
"//CADDW\n");
654cp.
code() +=
"etiss_coverage_count(1, 205);\n";
656cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
657cp.
code() +=
"{ // block\n";
659cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
660cp.
code() +=
"} // block\n";
663cp.
code() +=
"etiss_coverage_count(1, 7576);\n";
664cp.
code() +=
"{ // block\n";
665cp.
code() +=
"etiss_uint32 res = (etiss_uint32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL]) + (etiss_uint32)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 + 8ULL) +
"ULL]);\n";
666cp.
code() +=
"etiss_coverage_count(12, 7565, 7564, 7556, 7554, 7553, 7551, 7552, 7563, 7561, 7560, 7558, 7559);\n";
667cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd + 8ULL) +
"ULL] = (etiss_uint64)((etiss_int32)(res));\n";
668cp.
code() +=
"etiss_coverage_count(8, 7575, 7570, 7569, 7567, 7568, 7574, 7572, 7571);\n";
669cp.
code() +=
"} // block\n";
672cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
685rs2 += R_rs2_0.read(ba) << 0;
688rd += R_rd_0.read(ba) << 0;
692 std::stringstream ss;
694ss <<
"caddw" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | rd=" + std::to_string(rd) +
"]");
716uimm += R_uimm_6.
read(ba) << 6;
718uimm += R_uimm_3.
read(ba) << 3;
721rd += R_rd_0.
read(ba) << 0;
723uimm += R_uimm_5.
read(ba) << 5;
730 cp.
code() = std::string(
"//CLDSP\n");
733cp.
code() +=
"etiss_coverage_count(1, 207);\n";
735cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
736cp.
code() +=
"{ // block\n";
738cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
739cp.
code() +=
"} // block\n";
742cp.
code() +=
"etiss_coverage_count(1, 7603);\n";
743cp.
code() +=
"{ // block\n";
744cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[2ULL] + " + std::to_string(uimm) +
"ULL;\n";
745cp.
code() +=
"etiss_coverage_count(5, 7583, 7582, 7580, 7579, 7581);\n";
746cp.
code() +=
"etiss_uint64 mem_val_0;\n";
747cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
748cp.
code() +=
"if (cpu->exception) { // conditional\n";
750cp.
code() +=
"{ // procedure\n";
751cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
753cp.
code() +=
"} // procedure\n";
755cp.
code() +=
"} // conditional\n";
756cp.
code() +=
"etiss_int64 res = mem_val_0;\n";
757cp.
code() +=
"etiss_coverage_count(3, 7588, 7587, 7586);\n";
758cp.
code() +=
"etiss_coverage_count(1, 7589);\n";
760cp.
code() +=
"etiss_coverage_count(2, 7592, 7590);\n";
761cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = res;\n";
762cp.
code() +=
"etiss_coverage_count(5, 7599, 7597, 7596, 7594, 7598);\n";
766cp.
code() +=
"{ // procedure\n";
767cp.
code() +=
"RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2ULL);\n";
768cp.
code() +=
"etiss_coverage_count(3, 7602, 7600, 7601);\n";
770cp.
code() +=
"} // procedure\n";
773cp.
code() +=
"} // block\n";
776cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
783 cp.
code() = std::string(
"//CLDSP\n");
786cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
798uimm += R_uimm_6.read(ba) << 6;
800uimm += R_uimm_3.read(ba) << 3;
803rd += R_rd_0.read(ba) << 0;
805uimm += R_uimm_5.read(ba) << 5;
809 std::stringstream ss;
811ss <<
"cldsp" <<
" # " << ba << (
" [uimm=" + std::to_string(uimm) +
" | rd=" + std::to_string(rd) +
"]");
833rs2 += R_rs2_0.
read(ba) << 0;
836uimm += R_uimm_6.
read(ba) << 6;
838uimm += R_uimm_3.
read(ba) << 3;
845 cp.
code() = std::string(
"//CSDSP\n");
848cp.
code() +=
"etiss_coverage_count(1, 208);\n";
850cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
851cp.
code() +=
"{ // block\n";
853cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
854cp.
code() +=
"} // block\n";
857cp.
code() +=
"etiss_coverage_count(1, 7622);\n";
858cp.
code() +=
"{ // block\n";
859cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[2ULL] + " + std::to_string(uimm) +
"ULL;\n";
860cp.
code() +=
"etiss_coverage_count(5, 7610, 7609, 7607, 7606, 7608);\n";
861cp.
code() +=
"etiss_uint64 mem_val_0;\n";
862cp.
code() +=
"mem_val_0 = (etiss_uint64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
863cp.
code() +=
"etiss_coverage_count(7, 7621, 7613, 7612, 7620, 7618, 7617, 7615);\n";
864cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
865cp.
code() +=
"if (cpu->exception) { // conditional\n";
867cp.
code() +=
"{ // procedure\n";
868cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
870cp.
code() +=
"} // procedure\n";
872cp.
code() +=
"} // conditional\n";
873cp.
code() +=
"} // block\n";
876cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
883 cp.
code() = std::string(
"//CSDSP\n");
886cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
898rs2 += R_rs2_0.read(ba) << 0;
901uimm += R_uimm_6.read(ba) << 6;
903uimm += R_uimm_3.read(ba) << 3;
907 std::stringstream ss;
909ss <<
"csdsp" <<
" # " << ba << (
" [rs2=" + std::to_string(rs2) +
" | uimm=" + std::to_string(uimm) +
"]");
etiss::instr::InstructionGroup ISA16_RV64IMACFD("ISA16_RV64IMACFD", 16)
static InstructionDefinition csrai_shamt_rs1(ISA16_RV64IMACFD, "csrai",(uint16_t) 0x8401,(uint16_t) 0xec03, [](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;static BitArrayRange R_shamt_5(12, 12);shamt+=R_shamt_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSRAI\n");cp.code()+="etiss_coverage_count(1, 200);\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, 7461);\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, 7460, 7449, 7448, 7446, 7447, 7459, 7456, 7454, 7453, 7451, 7452, 7457, 7458);\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;static BitArrayRange R_shamt_5(12, 12);shamt+=R_shamt_5.read(ba)<< 5;std::stringstream ss;ss<< "csrai"<< " # "<< ba<<(" [shamt="+std::to_string(shamt)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition csubw_rs2_rd(ISA16_RV64IMACFD, "csubw",(uint16_t) 0x9c01,(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("//CSUBW\n");cp.code()+="etiss_coverage_count(1, 204);\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, 7548);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 res = (etiss_uint32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL]) - (etiss_uint32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2+8ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(12, 7537, 7536, 7528, 7526, 7525, 7523, 7524, 7535, 7533, 7532, 7530, 7531);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] = (etiss_uint64)((etiss_int32)(res));\n";cp.code()+="etiss_coverage_count(8, 7547, 7542, 7541, 7539, 7540, 7546, 7544, 7543);\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<< "csubw"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition csdsp_rs2_uimm(ISA16_RV64IMACFD, "csdsp",(uint16_t) 0xe002,(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_uint16 uimm=0;static BitArrayRange R_uimm_6(9, 7);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSDSP\n");cp.code()+="etiss_coverage_count(1, 208);\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, 7622);\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, 7610, 7609, 7607, 7606, 7608);\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, 7621, 7613, 7612, 7620, 7618, 7617, 7615);\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("//CSDSP\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_uint16 uimm=0;static BitArrayRange R_uimm_6(9, 7);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;std::stringstream ss;ss<< "csdsp"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | uimm="+std::to_string(uimm)+"]");return ss.str();})
static InstructionDefinition caddiw_imm_rs1(ISA16_RV64IMACFD, "caddiw",(uint16_t) 0x2001,(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("//CADDIW\n");cp.code()+="etiss_coverage_count(1, 206);\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, 7407);\n";if((rs1 % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7413, 7410, 7408, 7411, 7412);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL] = (etiss_int32)(*((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(11, 7430, 7418, 7417, 7415, 7429, 7425, 7423, 7422, 7420, 7428, 7426);\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<< "caddiw"<< " # "<< ba<<(" [imm="+std::to_string(imm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition caddw_rs2_rd(ISA16_RV64IMACFD, "caddw",(uint16_t) 0x9c21,(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("//CADDW\n");cp.code()+="etiss_coverage_count(1, 205);\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, 7576);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 res = (etiss_uint32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL]) + (etiss_uint32)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2+8ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(12, 7565, 7564, 7556, 7554, 7553, 7551, 7552, 7563, 7561, 7560, 7558, 7559);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] = (etiss_uint64)((etiss_int32)(res));\n";cp.code()+="etiss_coverage_count(8, 7575, 7570, 7569, 7567, 7568, 7574, 7572, 7571);\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<< "caddw"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition cldsp_uimm_rd(ISA16_RV64IMACFD, "cldsp",(uint16_t) 0x6002,(uint16_t) 0xe003, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint16 uimm=0;static BitArrayRange R_uimm_6(4, 2);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_3(6, 5);uimm+=R_uimm_3.read(ba)<< 3;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("//CLDSP\n");cp.code()+="etiss_coverage_count(1, 207);\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, 7603);\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, 7583, 7582, 7580, 7579, 7581);\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 = mem_val_0;\n";cp.code()+="etiss_coverage_count(3, 7588, 7587, 7586);\n";cp.code()+="etiss_coverage_count(1, 7589);\n";if(rd % 32ULL) { cp.code()+="etiss_coverage_count(2, 7592, 7590);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = res;\n";cp.code()+="etiss_coverage_count(5, 7599, 7597, 7596, 7594, 7598);\n";} else { { cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2ULL);\n";cp.code()+="etiss_coverage_count(3, 7602, 7600, 7601);\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("//CLDSP\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint16 uimm=0;static BitArrayRange R_uimm_6(4, 2);uimm+=R_uimm_6.read(ba)<< 6;static BitArrayRange R_uimm_3(6, 5);uimm+=R_uimm_3.read(ba)<< 3;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<< "cldsp"<< " # "<< ba<<(" [uimm="+std::to_string(uimm)+" | rd="+std::to_string(rd)+"]");return ss.str();})
static InstructionDefinition csrli_nzuimm_rs1(ISA16_RV64IMACFD, "csrli",(uint16_t) 0x8001,(uint16_t) 0xec03, [](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(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_nzuimm_5(12, 12);nzuimm+=R_nzuimm_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSRLI\n");cp.code()+="etiss_coverage_count(1, 199);\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, 7444);\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(nzuimm)+"ULL;\n";cp.code()+="etiss_coverage_count(11, 7443, 7435, 7434, 7432, 7433, 7442, 7440, 7439, 7437, 7438, 7441);\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 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(9, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_nzuimm_5(12, 12);nzuimm+=R_nzuimm_5.read(ba)<< 5;std::stringstream ss;ss<< "csrli"<< " # "<< ba<<(" [nzuimm="+std::to_string(nzuimm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition cslli_shamt_rs1(ISA16_RV64IMACFD, "cslli",(uint16_t) 0x02,(uint16_t) 0xe003, [](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(11, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_shamt_5(12, 12);shamt+=R_shamt_5.read(ba)<< 5;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSLLI\n");cp.code()+="etiss_coverage_count(1, 201);\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, 7478);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7462);\n";if(rs1==0LL) { cp.code()+="etiss_coverage_count(3, 7465, 7463, 7464);\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV64IMACFD_raise(cpu, system, plugin_pointers, 0LL, 2LL);\n";cp.code()+="etiss_coverage_count(2, 7468, 7466);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} } cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rs1)+"ULL] = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1)+"ULL] << "+std::to_string(shamt)+"ULL;\n";cp.code()+="etiss_coverage_count(7, 7477, 7471, 7470, 7476, 7474, 7473, 7475);\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("//CSLLI\n");cp.code()+="if (cpu->return_pending || cpu->exception) return cpu->exception;\n";} 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(11, 7);rs1+=R_rs1_0.read(ba)<< 0;static BitArrayRange R_shamt_5(12, 12);shamt+=R_shamt_5.read(ba)<< 5;std::stringstream ss;ss<< "cslli"<< " # "<< ba<<(" [shamt="+std::to_string(shamt)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition csd_rs2_uimm_rs1(ISA16_RV64IMACFD, "csd",(uint16_t) 0xe000,(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(6, 5);uimm+=R_uimm_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_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CSD\n");cp.code()+="etiss_coverage_count(1, 203);\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, 7520);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] + "+std::to_string(uimm)+"ULL;\n";cp.code()+="etiss_coverage_count(7, 7508, 7507, 7505, 7504, 7502, 7503, 7506);\n";cp.code()+="etiss_uint64 mem_val_0;\n";cp.code()+="mem_val_0 = (etiss_uint64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2+8ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(8, 7519, 7511, 7510, 7518, 7516, 7515, 7513, 7514);\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("//CSD\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(6, 5);uimm+=R_uimm_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_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;std::stringstream ss;ss<< "csd"<< " # "<< ba<<(" [rs2="+std::to_string(rs2)+" | uimm="+std::to_string(uimm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition cld_rd_uimm_rs1(ISA16_RV64IMACFD, "cld",(uint16_t) 0x6000,(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(6, 5);uimm+=R_uimm_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_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//CLD\n");cp.code()+="etiss_coverage_count(1, 202);\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, 7499);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1+8ULL)+"ULL] + "+std::to_string(uimm)+"ULL;\n";cp.code()+="etiss_coverage_count(7, 7487, 7486, 7484, 7483, 7481, 7482, 7485);\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()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd+8ULL)+"ULL] = (etiss_int64)(mem_val_0);\n";cp.code()+="etiss_coverage_count(8, 7498, 7492, 7491, 7489, 7490, 7497, 7495, 7494);\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("//CLD\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(6, 5);uimm+=R_uimm_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_uimm_3(12, 10);uimm+=R_uimm_3.read(ba)<< 3;std::stringstream ss;ss<< "cld"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | uimm="+std::to_string(uimm)+" | rs1="+std::to_string(rs1)+"]");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.