11 using namespace etiss;
31 rd += R_rd_0.
read(ba) << 0;
34 rs1 += R_rs1_0.
read(ba) << 0;
37 rs2 += R_rs2_0.
read(ba) << 0;
40 rl += R_rl_0.
read(ba) << 0;
43 aq += R_aq_0.
read(ba) << 0;
50 cp.
code() = std::string(
"//AMOSWAPD\n");
53 cp.
code() +=
"etiss_coverage_count(1, 226);\n";
55 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
56 cp.
code() +=
"{ // block\n";
58 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
59 cp.
code() +=
"} // block\n";
62 cp.
code() +=
"etiss_coverage_count(1, 8465);\n";
63 cp.
code() +=
"{ // block\n";
64 cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
65 cp.
code() +=
"etiss_coverage_count(4, 8432, 8431, 8430, 8428);\n";
66 cp.
code() +=
"etiss_coverage_count(1, 8433);\n";
67 if ((rd % 32ULL) != 0LL) {
68 cp.
code() +=
"etiss_coverage_count(5, 8439, 8436, 8434, 8437, 8438);\n";
69 cp.
code() +=
"etiss_uint64 mem_val_0;\n";
70 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
71 cp.
code() +=
"if (cpu->exception) { // conditional\n";
73 cp.
code() +=
"{ // procedure\n";
74 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
76 cp.
code() +=
"} // procedure\n";
78 cp.
code() +=
"} // conditional\n";
79 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int64)(((etiss_int64)(mem_val_0)));\n";
80 cp.
code() +=
"etiss_coverage_count(9, 8453, 8444, 8443, 8441, 8452, 8449, 8447, 8446, 8450);\n";
82 cp.
code() +=
"etiss_uint64 mem_val_1;\n";
83 cp.
code() +=
"mem_val_1 = (etiss_int64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
84 cp.
code() +=
"etiss_coverage_count(7, 8464, 8456, 8455, 8463, 8461, 8460, 8458);\n";
85 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 8);\n";
86 cp.
code() +=
"if (cpu->exception) { // conditional\n";
88 cp.
code() +=
"{ // procedure\n";
89 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
91 cp.
code() +=
"} // procedure\n";
93 cp.
code() +=
"} // conditional\n";
94 cp.
code() +=
"} // block\n";
97 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
104 cp.
code() = std::string(
"//AMOSWAPD\n");
107 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
119 rd += R_rd_0.read(ba) << 0;
122 rs1 += R_rs1_0.read(ba) << 0;
125 rs2 += R_rs2_0.read(ba) << 0;
128 rl += R_rl_0.read(ba) << 0;
131 aq += R_aq_0.read(ba) << 0;
135 std::stringstream ss;
137 ss <<
"amoswapd" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
" | rl=" + std::to_string(rl) +
" | aq=" + std::to_string(aq) +
"]");
159 rd += R_rd_0.
read(ba) << 0;
162 rs1 += R_rs1_0.
read(ba) << 0;
165 rs2 += R_rs2_0.
read(ba) << 0;
168 rl += R_rl_0.
read(ba) << 0;
171 aq += R_aq_0.
read(ba) << 0;
178 cp.
code() = std::string(
"//AMOADDD\n");
181 cp.
code() +=
"etiss_coverage_count(1, 227);\n";
183 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
184 cp.
code() +=
"{ // block\n";
186 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
187 cp.
code() +=
"} // block\n";
190 cp.
code() +=
"etiss_coverage_count(1, 8506);\n";
191 cp.
code() +=
"{ // block\n";
192 cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
193 cp.
code() +=
"etiss_coverage_count(4, 8472, 8471, 8470, 8468);\n";
194 cp.
code() +=
"etiss_uint64 mem_val_0;\n";
195 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
196 cp.
code() +=
"if (cpu->exception) { // conditional\n";
198 cp.
code() +=
"{ // procedure\n";
199 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
201 cp.
code() +=
"} // procedure\n";
203 cp.
code() +=
"} // conditional\n";
204 cp.
code() +=
"etiss_int64 res = mem_val_0;\n";
205 cp.
code() +=
"etiss_coverage_count(3, 8477, 8476, 8475);\n";
206 cp.
code() +=
"etiss_coverage_count(1, 8478);\n";
207 if ((rd % 32ULL) != 0LL) {
208 cp.
code() +=
"etiss_coverage_count(5, 8484, 8481, 8479, 8482, 8483);\n";
209 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = res;\n";
210 cp.
code() +=
"etiss_coverage_count(5, 8491, 8489, 8488, 8486, 8490);\n";
212 cp.
code() +=
"etiss_uint64 res2 = res + *((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL];\n";
213 cp.
code() +=
"etiss_coverage_count(6, 8500, 8499, 8493, 8498, 8497, 8495);\n";
214 cp.
code() +=
"etiss_uint64 mem_val_1;\n";
215 cp.
code() +=
"mem_val_1 = res2;\n";
216 cp.
code() +=
"etiss_coverage_count(4, 8505, 8503, 8502, 8504);\n";
217 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 8);\n";
218 cp.
code() +=
"if (cpu->exception) { // conditional\n";
220 cp.
code() +=
"{ // procedure\n";
221 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
223 cp.
code() +=
"} // procedure\n";
225 cp.
code() +=
"} // conditional\n";
226 cp.
code() +=
"} // block\n";
229 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
236 cp.
code() = std::string(
"//AMOADDD\n");
239 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
251 rd += R_rd_0.read(ba) << 0;
254 rs1 += R_rs1_0.read(ba) << 0;
257 rs2 += R_rs2_0.read(ba) << 0;
260 rl += R_rl_0.read(ba) << 0;
263 aq += R_aq_0.read(ba) << 0;
267 std::stringstream ss;
269 ss <<
"amoaddd" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
" | rl=" + std::to_string(rl) +
" | aq=" + std::to_string(aq) +
"]");
291 rd += R_rd_0.
read(ba) << 0;
294 rs1 += R_rs1_0.
read(ba) << 0;
297 rs2 += R_rs2_0.
read(ba) << 0;
300 rl += R_rl_0.
read(ba) << 0;
303 aq += R_aq_0.
read(ba) << 0;
310 cp.
code() = std::string(
"//AMOXORD\n");
313 cp.
code() +=
"etiss_coverage_count(1, 228);\n";
315 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
316 cp.
code() +=
"{ // block\n";
318 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
319 cp.
code() +=
"} // block\n";
322 cp.
code() +=
"etiss_coverage_count(1, 8547);\n";
323 cp.
code() +=
"{ // block\n";
324 cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
325 cp.
code() +=
"etiss_coverage_count(4, 8513, 8512, 8511, 8509);\n";
326 cp.
code() +=
"etiss_uint64 mem_val_0;\n";
327 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
328 cp.
code() +=
"if (cpu->exception) { // conditional\n";
330 cp.
code() +=
"{ // procedure\n";
331 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
333 cp.
code() +=
"} // procedure\n";
335 cp.
code() +=
"} // conditional\n";
336 cp.
code() +=
"etiss_int64 res = mem_val_0;\n";
337 cp.
code() +=
"etiss_coverage_count(3, 8518, 8517, 8516);\n";
338 cp.
code() +=
"etiss_coverage_count(1, 8519);\n";
339 if ((rd % 32ULL) != 0LL) {
340 cp.
code() +=
"etiss_coverage_count(5, 8525, 8522, 8520, 8523, 8524);\n";
341 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = res;\n";
342 cp.
code() +=
"etiss_coverage_count(5, 8532, 8530, 8529, 8527, 8531);\n";
344 cp.
code() +=
"etiss_uint64 res2 = res ^ *((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL];\n";
345 cp.
code() +=
"etiss_coverage_count(6, 8541, 8540, 8534, 8539, 8538, 8536);\n";
346 cp.
code() +=
"etiss_uint64 mem_val_1;\n";
347 cp.
code() +=
"mem_val_1 = res2;\n";
348 cp.
code() +=
"etiss_coverage_count(4, 8546, 8544, 8543, 8545);\n";
349 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 8);\n";
350 cp.
code() +=
"if (cpu->exception) { // conditional\n";
352 cp.
code() +=
"{ // procedure\n";
353 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
355 cp.
code() +=
"} // procedure\n";
357 cp.
code() +=
"} // conditional\n";
358 cp.
code() +=
"} // block\n";
361 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
368 cp.
code() = std::string(
"//AMOXORD\n");
371 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
383 rd += R_rd_0.read(ba) << 0;
386 rs1 += R_rs1_0.read(ba) << 0;
389 rs2 += R_rs2_0.read(ba) << 0;
392 rl += R_rl_0.read(ba) << 0;
395 aq += R_aq_0.read(ba) << 0;
399 std::stringstream ss;
401 ss <<
"amoxord" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
" | rl=" + std::to_string(rl) +
" | aq=" + std::to_string(aq) +
"]");
423 rd += R_rd_0.
read(ba) << 0;
426 rs1 += R_rs1_0.
read(ba) << 0;
429 rs2 += R_rs2_0.
read(ba) << 0;
432 rl += R_rl_0.
read(ba) << 0;
435 aq += R_aq_0.
read(ba) << 0;
442 cp.
code() = std::string(
"//AMOANDD\n");
445 cp.
code() +=
"etiss_coverage_count(1, 229);\n";
447 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
448 cp.
code() +=
"{ // block\n";
450 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
451 cp.
code() +=
"} // block\n";
454 cp.
code() +=
"etiss_coverage_count(1, 8588);\n";
455 cp.
code() +=
"{ // block\n";
456 cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
457 cp.
code() +=
"etiss_coverage_count(4, 8554, 8553, 8552, 8550);\n";
458 cp.
code() +=
"etiss_uint64 mem_val_0;\n";
459 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
460 cp.
code() +=
"if (cpu->exception) { // conditional\n";
462 cp.
code() +=
"{ // procedure\n";
463 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
465 cp.
code() +=
"} // procedure\n";
467 cp.
code() +=
"} // conditional\n";
468 cp.
code() +=
"etiss_int64 res = mem_val_0;\n";
469 cp.
code() +=
"etiss_coverage_count(3, 8559, 8558, 8557);\n";
470 cp.
code() +=
"etiss_coverage_count(1, 8560);\n";
471 if ((rd % 32ULL) != 0LL) {
472 cp.
code() +=
"etiss_coverage_count(5, 8566, 8563, 8561, 8564, 8565);\n";
473 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = res;\n";
474 cp.
code() +=
"etiss_coverage_count(5, 8573, 8571, 8570, 8568, 8572);\n";
476 cp.
code() +=
"etiss_uint64 res2 = res & *((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL];\n";
477 cp.
code() +=
"etiss_coverage_count(6, 8582, 8581, 8575, 8580, 8579, 8577);\n";
478 cp.
code() +=
"etiss_uint64 mem_val_1;\n";
479 cp.
code() +=
"mem_val_1 = res2;\n";
480 cp.
code() +=
"etiss_coverage_count(4, 8587, 8585, 8584, 8586);\n";
481 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 8);\n";
482 cp.
code() +=
"if (cpu->exception) { // conditional\n";
484 cp.
code() +=
"{ // procedure\n";
485 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
487 cp.
code() +=
"} // procedure\n";
489 cp.
code() +=
"} // conditional\n";
490 cp.
code() +=
"} // block\n";
493 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
500 cp.
code() = std::string(
"//AMOANDD\n");
503 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
515 rd += R_rd_0.read(ba) << 0;
518 rs1 += R_rs1_0.read(ba) << 0;
521 rs2 += R_rs2_0.read(ba) << 0;
524 rl += R_rl_0.read(ba) << 0;
527 aq += R_aq_0.read(ba) << 0;
531 std::stringstream ss;
533 ss <<
"amoandd" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
" | rl=" + std::to_string(rl) +
" | aq=" + std::to_string(aq) +
"]");
555 rd += R_rd_0.
read(ba) << 0;
558 rs1 += R_rs1_0.
read(ba) << 0;
561 rs2 += R_rs2_0.
read(ba) << 0;
564 rl += R_rl_0.
read(ba) << 0;
567 aq += R_aq_0.
read(ba) << 0;
574 cp.
code() = std::string(
"//AMOORD\n");
577 cp.
code() +=
"etiss_coverage_count(1, 230);\n";
579 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
580 cp.
code() +=
"{ // block\n";
582 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
583 cp.
code() +=
"} // block\n";
586 cp.
code() +=
"etiss_coverage_count(1, 8629);\n";
587 cp.
code() +=
"{ // block\n";
588 cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
589 cp.
code() +=
"etiss_coverage_count(4, 8595, 8594, 8593, 8591);\n";
590 cp.
code() +=
"etiss_uint64 mem_val_0;\n";
591 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
592 cp.
code() +=
"if (cpu->exception) { // conditional\n";
594 cp.
code() +=
"{ // procedure\n";
595 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
597 cp.
code() +=
"} // procedure\n";
599 cp.
code() +=
"} // conditional\n";
600 cp.
code() +=
"etiss_int64 res = mem_val_0;\n";
601 cp.
code() +=
"etiss_coverage_count(3, 8600, 8599, 8598);\n";
602 cp.
code() +=
"etiss_coverage_count(1, 8601);\n";
603 if ((rd % 32ULL) != 0LL) {
604 cp.
code() +=
"etiss_coverage_count(5, 8607, 8604, 8602, 8605, 8606);\n";
605 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = res;\n";
606 cp.
code() +=
"etiss_coverage_count(5, 8614, 8612, 8611, 8609, 8613);\n";
608 cp.
code() +=
"etiss_uint64 res2 = res | *((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL];\n";
609 cp.
code() +=
"etiss_coverage_count(6, 8623, 8622, 8616, 8621, 8620, 8618);\n";
610 cp.
code() +=
"etiss_uint64 mem_val_1;\n";
611 cp.
code() +=
"mem_val_1 = res2;\n";
612 cp.
code() +=
"etiss_coverage_count(4, 8628, 8626, 8625, 8627);\n";
613 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 8);\n";
614 cp.
code() +=
"if (cpu->exception) { // conditional\n";
616 cp.
code() +=
"{ // procedure\n";
617 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
619 cp.
code() +=
"} // procedure\n";
621 cp.
code() +=
"} // conditional\n";
622 cp.
code() +=
"} // block\n";
625 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
632 cp.
code() = std::string(
"//AMOORD\n");
635 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
647 rd += R_rd_0.read(ba) << 0;
650 rs1 += R_rs1_0.read(ba) << 0;
653 rs2 += R_rs2_0.read(ba) << 0;
656 rl += R_rl_0.read(ba) << 0;
659 aq += R_aq_0.read(ba) << 0;
663 std::stringstream ss;
665 ss <<
"amoord" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
" | rl=" + std::to_string(rl) +
" | aq=" + std::to_string(aq) +
"]");
687 rd += R_rd_0.
read(ba) << 0;
690 rs1 += R_rs1_0.
read(ba) << 0;
693 rs2 += R_rs2_0.
read(ba) << 0;
696 rl += R_rl_0.
read(ba) << 0;
699 aq += R_aq_0.
read(ba) << 0;
706 cp.
code() = std::string(
"//AMOMIND\n");
709 cp.
code() +=
"etiss_coverage_count(1, 231);\n";
711 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
712 cp.
code() +=
"{ // block\n";
714 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
715 cp.
code() +=
"} // block\n";
718 cp.
code() +=
"etiss_coverage_count(1, 8679);\n";
719 cp.
code() +=
"{ // block\n";
720 cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
721 cp.
code() +=
"etiss_coverage_count(4, 8636, 8635, 8634, 8632);\n";
722 cp.
code() +=
"etiss_uint64 mem_val_0;\n";
723 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
724 cp.
code() +=
"if (cpu->exception) { // conditional\n";
726 cp.
code() +=
"{ // procedure\n";
727 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
729 cp.
code() +=
"} // procedure\n";
731 cp.
code() +=
"} // conditional\n";
732 cp.
code() +=
"etiss_int64 res1 = mem_val_0;\n";
733 cp.
code() +=
"etiss_coverage_count(3, 8641, 8640, 8639);\n";
734 cp.
code() +=
"etiss_coverage_count(1, 8642);\n";
735 if ((rd % 32ULL) != 0LL) {
736 cp.
code() +=
"etiss_coverage_count(5, 8648, 8645, 8643, 8646, 8647);\n";
737 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = res1;\n";
738 cp.
code() +=
"etiss_coverage_count(5, 8655, 8653, 8652, 8650, 8654);\n";
740 cp.
code() +=
"etiss_uint64 res2 = (res1 > (etiss_int64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL])) ? (*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) : (res1);\n";
741 cp.
code() +=
"etiss_coverage_count(12, 8673, 8672, 8665, 8657, 8664, 8662, 8661, 8659, 8670, 8669, 8667, 8671);\n";
742 cp.
code() +=
"etiss_uint64 mem_val_1;\n";
743 cp.
code() +=
"mem_val_1 = res2;\n";
744 cp.
code() +=
"etiss_coverage_count(4, 8678, 8676, 8675, 8677);\n";
745 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 8);\n";
746 cp.
code() +=
"if (cpu->exception) { // conditional\n";
748 cp.
code() +=
"{ // procedure\n";
749 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
751 cp.
code() +=
"} // procedure\n";
753 cp.
code() +=
"} // conditional\n";
754 cp.
code() +=
"} // block\n";
757 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
764 cp.
code() = std::string(
"//AMOMIND\n");
767 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
779 rd += R_rd_0.read(ba) << 0;
782 rs1 += R_rs1_0.read(ba) << 0;
785 rs2 += R_rs2_0.read(ba) << 0;
788 rl += R_rl_0.read(ba) << 0;
791 aq += R_aq_0.read(ba) << 0;
795 std::stringstream ss;
797 ss <<
"amomind" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
" | rl=" + std::to_string(rl) +
" | aq=" + std::to_string(aq) +
"]");
819 rd += R_rd_0.
read(ba) << 0;
822 rs1 += R_rs1_0.
read(ba) << 0;
825 rs2 += R_rs2_0.
read(ba) << 0;
828 rl += R_rl_0.
read(ba) << 0;
831 aq += R_aq_0.
read(ba) << 0;
838 cp.
code() = std::string(
"//AMOMAXD\n");
841 cp.
code() +=
"etiss_coverage_count(1, 232);\n";
843 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
844 cp.
code() +=
"{ // block\n";
846 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
847 cp.
code() +=
"} // block\n";
850 cp.
code() +=
"etiss_coverage_count(1, 8729);\n";
851 cp.
code() +=
"{ // block\n";
852 cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
853 cp.
code() +=
"etiss_coverage_count(4, 8686, 8685, 8684, 8682);\n";
854 cp.
code() +=
"etiss_uint64 mem_val_0;\n";
855 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
856 cp.
code() +=
"if (cpu->exception) { // conditional\n";
858 cp.
code() +=
"{ // procedure\n";
859 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
861 cp.
code() +=
"} // procedure\n";
863 cp.
code() +=
"} // conditional\n";
864 cp.
code() +=
"etiss_int64 res = mem_val_0;\n";
865 cp.
code() +=
"etiss_coverage_count(3, 8691, 8690, 8689);\n";
866 cp.
code() +=
"etiss_coverage_count(1, 8692);\n";
867 if ((rd % 32ULL) != 0LL) {
868 cp.
code() +=
"etiss_coverage_count(5, 8698, 8695, 8693, 8696, 8697);\n";
869 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = res;\n";
870 cp.
code() +=
"etiss_coverage_count(5, 8705, 8703, 8702, 8700, 8704);\n";
872 cp.
code() +=
"etiss_uint64 res2 = (res < (etiss_int64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL])) ? (*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) : (res);\n";
873 cp.
code() +=
"etiss_coverage_count(12, 8723, 8722, 8715, 8707, 8714, 8712, 8711, 8709, 8720, 8719, 8717, 8721);\n";
874 cp.
code() +=
"etiss_uint64 mem_val_1;\n";
875 cp.
code() +=
"mem_val_1 = res2;\n";
876 cp.
code() +=
"etiss_coverage_count(4, 8728, 8726, 8725, 8727);\n";
877 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 8);\n";
878 cp.
code() +=
"if (cpu->exception) { // conditional\n";
880 cp.
code() +=
"{ // procedure\n";
881 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
883 cp.
code() +=
"} // procedure\n";
885 cp.
code() +=
"} // conditional\n";
886 cp.
code() +=
"} // block\n";
889 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
896 cp.
code() = std::string(
"//AMOMAXD\n");
899 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
911 rd += R_rd_0.read(ba) << 0;
914 rs1 += R_rs1_0.read(ba) << 0;
917 rs2 += R_rs2_0.read(ba) << 0;
920 rl += R_rl_0.read(ba) << 0;
923 aq += R_aq_0.read(ba) << 0;
927 std::stringstream ss;
929 ss <<
"amomaxd" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
" | rl=" + std::to_string(rl) +
" | aq=" + std::to_string(aq) +
"]");
951 rd += R_rd_0.
read(ba) << 0;
954 rs1 += R_rs1_0.
read(ba) << 0;
957 rs2 += R_rs2_0.
read(ba) << 0;
960 rl += R_rl_0.
read(ba) << 0;
963 aq += R_aq_0.
read(ba) << 0;
970 cp.
code() = std::string(
"//AMOMINUD\n");
973 cp.
code() +=
"etiss_coverage_count(1, 233);\n";
975 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
976 cp.
code() +=
"{ // block\n";
978 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
979 cp.
code() +=
"} // block\n";
982 cp.
code() +=
"etiss_coverage_count(1, 8779);\n";
983 cp.
code() +=
"{ // block\n";
984 cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
985 cp.
code() +=
"etiss_coverage_count(4, 8736, 8735, 8734, 8732);\n";
986 cp.
code() +=
"etiss_uint64 mem_val_0;\n";
987 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
988 cp.
code() +=
"if (cpu->exception) { // conditional\n";
990 cp.
code() +=
"{ // procedure\n";
991 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
993 cp.
code() +=
"} // procedure\n";
995 cp.
code() +=
"} // conditional\n";
996 cp.
code() +=
"etiss_uint64 res = mem_val_0;\n";
997 cp.
code() +=
"etiss_coverage_count(3, 8741, 8740, 8739);\n";
998 cp.
code() +=
"etiss_coverage_count(1, 8742);\n";
999 if ((rd % 32ULL) != 0LL) {
1000 cp.
code() +=
"etiss_coverage_count(5, 8748, 8745, 8743, 8746, 8747);\n";
1001 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int64)(res);\n";
1002 cp.
code() +=
"etiss_coverage_count(6, 8757, 8753, 8752, 8750, 8756, 8754);\n";
1004 cp.
code() +=
"etiss_uint64 res2 = (res > *((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) ? (*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) : (res);\n";
1005 cp.
code() +=
"etiss_coverage_count(11, 8773, 8772, 8765, 8759, 8764, 8763, 8761, 8770, 8769, 8767, 8771);\n";
1006 cp.
code() +=
"etiss_uint64 mem_val_1;\n";
1007 cp.
code() +=
"mem_val_1 = res2;\n";
1008 cp.
code() +=
"etiss_coverage_count(4, 8778, 8776, 8775, 8777);\n";
1009 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 8);\n";
1010 cp.
code() +=
"if (cpu->exception) { // conditional\n";
1012 cp.
code() +=
"{ // procedure\n";
1013 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
1015 cp.
code() +=
"} // procedure\n";
1017 cp.
code() +=
"} // conditional\n";
1018 cp.
code() +=
"} // block\n";
1021 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1028 cp.
code() = std::string(
"//AMOMINUD\n");
1031 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
1043 rd += R_rd_0.read(ba) << 0;
1046 rs1 += R_rs1_0.read(ba) << 0;
1049 rs2 += R_rs2_0.read(ba) << 0;
1052 rl += R_rl_0.read(ba) << 0;
1055 aq += R_aq_0.read(ba) << 0;
1059 std::stringstream ss;
1061 ss <<
"amominud" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
" | rl=" + std::to_string(rl) +
" | aq=" + std::to_string(aq) +
"]");
1083 rd += R_rd_0.
read(ba) << 0;
1086 rs1 += R_rs1_0.
read(ba) << 0;
1089 rs2 += R_rs2_0.
read(ba) << 0;
1092 rl += R_rl_0.
read(ba) << 0;
1095 aq += R_aq_0.
read(ba) << 0;
1102 cp.
code() = std::string(
"//AMOMAXUD\n");
1105 cp.
code() +=
"etiss_coverage_count(1, 234);\n";
1107 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
1108 cp.
code() +=
"{ // block\n";
1110 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1111 cp.
code() +=
"} // block\n";
1114 cp.
code() +=
"etiss_coverage_count(1, 8829);\n";
1115 cp.
code() +=
"{ // block\n";
1116 cp.
code() +=
"etiss_uint64 offs = *((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL];\n";
1117 cp.
code() +=
"etiss_coverage_count(4, 8786, 8785, 8784, 8782);\n";
1118 cp.
code() +=
"etiss_uint64 mem_val_0;\n";
1119 cp.
code() +=
"cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 8);\n";
1120 cp.
code() +=
"if (cpu->exception) { // conditional\n";
1122 cp.
code() +=
"{ // procedure\n";
1123 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
1125 cp.
code() +=
"} // procedure\n";
1127 cp.
code() +=
"} // conditional\n";
1128 cp.
code() +=
"etiss_uint64 res1 = mem_val_0;\n";
1129 cp.
code() +=
"etiss_coverage_count(3, 8791, 8790, 8789);\n";
1130 cp.
code() +=
"etiss_coverage_count(1, 8792);\n";
1131 if ((rd % 32ULL) != 0LL) {
1132 cp.
code() +=
"etiss_coverage_count(5, 8798, 8795, 8793, 8796, 8797);\n";
1133 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_int64)(res1);\n";
1134 cp.
code() +=
"etiss_coverage_count(6, 8807, 8803, 8802, 8800, 8806, 8804);\n";
1136 cp.
code() +=
"etiss_uint64 res2 = (res1 < *((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) ? (*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]) : (res1);\n";
1137 cp.
code() +=
"etiss_coverage_count(11, 8823, 8822, 8815, 8809, 8814, 8813, 8811, 8820, 8819, 8817, 8821);\n";
1138 cp.
code() +=
"etiss_uint64 mem_val_1;\n";
1139 cp.
code() +=
"mem_val_1 = res2;\n";
1140 cp.
code() +=
"etiss_coverage_count(4, 8828, 8826, 8825, 8827);\n";
1141 cp.
code() +=
"cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 8);\n";
1142 cp.
code() +=
"if (cpu->exception) { // conditional\n";
1144 cp.
code() +=
"{ // procedure\n";
1145 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
1147 cp.
code() +=
"} // procedure\n";
1149 cp.
code() +=
"} // conditional\n";
1150 cp.
code() +=
"} // block\n";
1153 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
1160 cp.
code() = std::string(
"//AMOMAXUD\n");
1163 cp.
code() +=
"if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
1175 rd += R_rd_0.read(ba) << 0;
1178 rs1 += R_rs1_0.read(ba) << 0;
1181 rs2 += R_rs2_0.read(ba) << 0;
1184 rl += R_rl_0.read(ba) << 0;
1187 aq += R_aq_0.read(ba) << 0;
1191 std::stringstream ss;
1193 ss <<
"amomaxud" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
" | rl=" + std::to_string(rl) +
" | aq=" + std::to_string(aq) +
"]");
etiss::instr::InstructionGroup ISA32_RV64IMACFD("ISA32_RV64IMACFD", 32)
static InstructionDefinition amoord_rd_rs1_rs2_rl_aq(ISA32_RV64IMACFD, "amoord",(uint32_t) 0x4000302f,(uint32_t) 0xf800707f, [](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;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//AMOORD\n");cp.code()+="etiss_coverage_count(1, 230);\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, 8629);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 8595, 8594, 8593, 8591);\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, 8600, 8599, 8598);\n";cp.code()+="etiss_coverage_count(1, 8601);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 8607, 8604, 8602, 8605, 8606);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = res;\n";cp.code()+="etiss_coverage_count(5, 8614, 8612, 8611, 8609, 8613);\n";} cp.code()+="etiss_uint64 res2 = res | *((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(6, 8623, 8622, 8616, 8621, 8620, 8618);\n";cp.code()+="etiss_uint64 mem_val_1;\n";cp.code()+="mem_val_1 = res2;\n";cp.code()+="etiss_coverage_count(4, 8628, 8626, 8625, 8627);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 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("//AMOORD\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;std::stringstream ss;ss<< "amoord"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+" | rl="+std::to_string(rl)+" | aq="+std::to_string(aq)+"]");return ss.str();})
static InstructionDefinition amomaxud_rd_rs1_rs2_rl_aq(ISA32_RV64IMACFD, "amomaxud",(uint32_t) 0xe000302f,(uint32_t) 0xf800707f, [](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;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//AMOMAXUD\n");cp.code()+="etiss_coverage_count(1, 234);\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, 8829);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 8786, 8785, 8784, 8782);\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_uint64 res1 = mem_val_0;\n";cp.code()+="etiss_coverage_count(3, 8791, 8790, 8789);\n";cp.code()+="etiss_coverage_count(1, 8792);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 8798, 8795, 8793, 8796, 8797);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int64)(res1);\n";cp.code()+="etiss_coverage_count(6, 8807, 8803, 8802, 8800, 8806, 8804);\n";} cp.code()+="etiss_uint64 res2 = (res1 < *((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) ? (*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) : (res1);\n";cp.code()+="etiss_coverage_count(11, 8823, 8822, 8815, 8809, 8814, 8813, 8811, 8820, 8819, 8817, 8821);\n";cp.code()+="etiss_uint64 mem_val_1;\n";cp.code()+="mem_val_1 = res2;\n";cp.code()+="etiss_coverage_count(4, 8828, 8826, 8825, 8827);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 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("//AMOMAXUD\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;std::stringstream ss;ss<< "amomaxud"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+" | rl="+std::to_string(rl)+" | aq="+std::to_string(aq)+"]");return ss.str();})
static InstructionDefinition amoswapd_rd_rs1_rs2_rl_aq(ISA32_RV64IMACFD, "amoswapd",(uint32_t) 0x800302f,(uint32_t) 0xf800707f, [](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;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//AMOSWAPD\n");cp.code()+="etiss_coverage_count(1, 226);\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, 8465);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 8432, 8431, 8430, 8428);\n";cp.code()+="etiss_coverage_count(1, 8433);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 8439, 8436, 8434, 8437, 8438);\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 % 32ULL)+"ULL] = (etiss_int64)(((etiss_int64)(mem_val_0)));\n";cp.code()+="etiss_coverage_count(9, 8453, 8444, 8443, 8441, 8452, 8449, 8447, 8446, 8450);\n";} cp.code()+="etiss_uint64 mem_val_1;\n";cp.code()+="mem_val_1 = (etiss_int64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(7, 8464, 8456, 8455, 8463, 8461, 8460, 8458);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 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("//AMOSWAPD\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;std::stringstream ss;ss<< "amoswapd"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+" | rl="+std::to_string(rl)+" | aq="+std::to_string(aq)+"]");return ss.str();})
static InstructionDefinition amoxord_rd_rs1_rs2_rl_aq(ISA32_RV64IMACFD, "amoxord",(uint32_t) 0x2000302f,(uint32_t) 0xf800707f, [](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;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//AMOXORD\n");cp.code()+="etiss_coverage_count(1, 228);\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, 8547);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 8513, 8512, 8511, 8509);\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, 8518, 8517, 8516);\n";cp.code()+="etiss_coverage_count(1, 8519);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 8525, 8522, 8520, 8523, 8524);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = res;\n";cp.code()+="etiss_coverage_count(5, 8532, 8530, 8529, 8527, 8531);\n";} cp.code()+="etiss_uint64 res2 = res ^ *((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(6, 8541, 8540, 8534, 8539, 8538, 8536);\n";cp.code()+="etiss_uint64 mem_val_1;\n";cp.code()+="mem_val_1 = res2;\n";cp.code()+="etiss_coverage_count(4, 8546, 8544, 8543, 8545);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 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("//AMOXORD\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;std::stringstream ss;ss<< "amoxord"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+" | rl="+std::to_string(rl)+" | aq="+std::to_string(aq)+"]");return ss.str();})
static InstructionDefinition amoandd_rd_rs1_rs2_rl_aq(ISA32_RV64IMACFD, "amoandd",(uint32_t) 0x6000302f,(uint32_t) 0xf800707f, [](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;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//AMOANDD\n");cp.code()+="etiss_coverage_count(1, 229);\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, 8588);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 8554, 8553, 8552, 8550);\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, 8559, 8558, 8557);\n";cp.code()+="etiss_coverage_count(1, 8560);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 8566, 8563, 8561, 8564, 8565);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = res;\n";cp.code()+="etiss_coverage_count(5, 8573, 8571, 8570, 8568, 8572);\n";} cp.code()+="etiss_uint64 res2 = res & *((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(6, 8582, 8581, 8575, 8580, 8579, 8577);\n";cp.code()+="etiss_uint64 mem_val_1;\n";cp.code()+="mem_val_1 = res2;\n";cp.code()+="etiss_coverage_count(4, 8587, 8585, 8584, 8586);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 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("//AMOANDD\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;std::stringstream ss;ss<< "amoandd"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+" | rl="+std::to_string(rl)+" | aq="+std::to_string(aq)+"]");return ss.str();})
static InstructionDefinition amomaxd_rd_rs1_rs2_rl_aq(ISA32_RV64IMACFD, "amomaxd",(uint32_t) 0xa000302f,(uint32_t) 0xf800707f, [](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;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//AMOMAXD\n");cp.code()+="etiss_coverage_count(1, 232);\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, 8729);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 8686, 8685, 8684, 8682);\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, 8691, 8690, 8689);\n";cp.code()+="etiss_coverage_count(1, 8692);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 8698, 8695, 8693, 8696, 8697);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = res;\n";cp.code()+="etiss_coverage_count(5, 8705, 8703, 8702, 8700, 8704);\n";} cp.code()+="etiss_uint64 res2 = (res < (etiss_int64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL])) ? (*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) : (res);\n";cp.code()+="etiss_coverage_count(12, 8723, 8722, 8715, 8707, 8714, 8712, 8711, 8709, 8720, 8719, 8717, 8721);\n";cp.code()+="etiss_uint64 mem_val_1;\n";cp.code()+="mem_val_1 = res2;\n";cp.code()+="etiss_coverage_count(4, 8728, 8726, 8725, 8727);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 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("//AMOMAXD\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;std::stringstream ss;ss<< "amomaxd"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+" | rl="+std::to_string(rl)+" | aq="+std::to_string(aq)+"]");return ss.str();})
static InstructionDefinition amoaddd_rd_rs1_rs2_rl_aq(ISA32_RV64IMACFD, "amoaddd",(uint32_t) 0x00302f,(uint32_t) 0xf800707f, [](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;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//AMOADDD\n");cp.code()+="etiss_coverage_count(1, 227);\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, 8506);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 8472, 8471, 8470, 8468);\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, 8477, 8476, 8475);\n";cp.code()+="etiss_coverage_count(1, 8478);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 8484, 8481, 8479, 8482, 8483);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = res;\n";cp.code()+="etiss_coverage_count(5, 8491, 8489, 8488, 8486, 8490);\n";} cp.code()+="etiss_uint64 res2 = res + *((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(6, 8500, 8499, 8493, 8498, 8497, 8495);\n";cp.code()+="etiss_uint64 mem_val_1;\n";cp.code()+="mem_val_1 = res2;\n";cp.code()+="etiss_coverage_count(4, 8505, 8503, 8502, 8504);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 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("//AMOADDD\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;std::stringstream ss;ss<< "amoaddd"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+" | rl="+std::to_string(rl)+" | aq="+std::to_string(aq)+"]");return ss.str();})
static InstructionDefinition amominud_rd_rs1_rs2_rl_aq(ISA32_RV64IMACFD, "amominud",(uint32_t) 0xc000302f,(uint32_t) 0xf800707f, [](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;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//AMOMINUD\n");cp.code()+="etiss_coverage_count(1, 233);\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, 8779);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 8736, 8735, 8734, 8732);\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_uint64 res = mem_val_0;\n";cp.code()+="etiss_coverage_count(3, 8741, 8740, 8739);\n";cp.code()+="etiss_coverage_count(1, 8742);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 8748, 8745, 8743, 8746, 8747);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int64)(res);\n";cp.code()+="etiss_coverage_count(6, 8757, 8753, 8752, 8750, 8756, 8754);\n";} cp.code()+="etiss_uint64 res2 = (res > *((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) ? (*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) : (res);\n";cp.code()+="etiss_coverage_count(11, 8773, 8772, 8765, 8759, 8764, 8763, 8761, 8770, 8769, 8767, 8771);\n";cp.code()+="etiss_uint64 mem_val_1;\n";cp.code()+="mem_val_1 = res2;\n";cp.code()+="etiss_coverage_count(4, 8778, 8776, 8775, 8777);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 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("//AMOMINUD\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;std::stringstream ss;ss<< "amominud"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+" | rl="+std::to_string(rl)+" | aq="+std::to_string(aq)+"]");return ss.str();})
static InstructionDefinition amomind_rd_rs1_rs2_rl_aq(ISA32_RV64IMACFD, "amomind",(uint32_t) 0x8000302f,(uint32_t) 0xf800707f, [](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;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//AMOMIND\n");cp.code()+="etiss_coverage_count(1, 231);\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, 8679);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 offs = *((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 8636, 8635, 8634, 8632);\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 res1 = mem_val_0;\n";cp.code()+="etiss_coverage_count(3, 8641, 8640, 8639);\n";cp.code()+="etiss_coverage_count(1, 8642);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 8648, 8645, 8643, 8646, 8647);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = res1;\n";cp.code()+="etiss_coverage_count(5, 8655, 8653, 8652, 8650, 8654);\n";} cp.code()+="etiss_uint64 res2 = (res1 > (etiss_int64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL])) ? (*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) : (res1);\n";cp.code()+="etiss_coverage_count(12, 8673, 8672, 8665, 8657, 8664, 8662, 8661, 8659, 8670, 8669, 8667, 8671);\n";cp.code()+="etiss_uint64 mem_val_1;\n";cp.code()+="mem_val_1 = res2;\n";cp.code()+="etiss_coverage_count(4, 8678, 8676, 8675, 8677);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 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("//AMOMIND\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_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;etiss_uint8 rl=0;static BitArrayRange R_rl_0(25, 25);rl+=R_rl_0.read(ba)<< 0;etiss_uint8 aq=0;static BitArrayRange R_aq_0(26, 26);aq+=R_aq_0.read(ba)<< 0;std::stringstream ss;ss<< "amomind"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+" | rl="+std::to_string(rl)+" | aq="+std::to_string(aq)+"]");return ss.str();})
static __inline__ uint32_t
Contains a small code snipped.
@ APPENDEDRETURNINGREQUIRED
RegisterSet & getAffectedRegisters()
void append(const CodePart &part, CodePart::TYPE type)
void add(const RegisterPart &rp)
add a registerPart to the set or just its relevant bits if a register with the same name is already p...
Reading through it will only return bits within the range.
I read(const BitArray &ba)
reads bits from the range to the return value starting at the lsb.
this class contains parameters that persist in between instruction lookpus/translation within a trans...
uint64_t current_address_
start address of current instruction
holds information and translation callbacks for an instruction.
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.