ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
RV32IMACFD_RV32AInstr.cpp
Go to the documentation of this file.
1 
8 #include "RV32IMACFDArch.h"
9 #include "RV32IMACFDFuncs.h"
10 
11 using namespace etiss;
12 using namespace etiss::instr;
13 
14 
15 // AMOSWAPW --------------------------------------------------------------------
18  "amoswapw",
19  (uint32_t) 0x800202f,
20  (uint32_t) 0xf800707f,
21  [] (BitArray & ba,etiss::CodeSet & cs,InstructionContext & ic)
22  {
23 
24 // -----------------------------------------------------------------------------
25 
26 // -----------------------------------------------------------------------------
27 
28 // -----------------------------------------------------------------------------
29 etiss_uint8 rd = 0;
30 static BitArrayRange R_rd_0(11, 7);
31 rd += R_rd_0.read(ba) << 0;
32 etiss_uint8 rs1 = 0;
33 static BitArrayRange R_rs1_0(19, 15);
34 rs1 += R_rs1_0.read(ba) << 0;
35 etiss_uint8 rs2 = 0;
36 static BitArrayRange R_rs2_0(24, 20);
37 rs2 += R_rs2_0.read(ba) << 0;
38 etiss_uint8 rl = 0;
39 static BitArrayRange R_rl_0(25, 25);
40 rl += R_rl_0.read(ba) << 0;
41 etiss_uint8 aq = 0;
42 static BitArrayRange R_aq_0(26, 26);
43 aq += R_aq_0.read(ba) << 0;
44 
45 // -----------------------------------------------------------------------------
46 
47  {
49 
50  cp.code() = std::string("//AMOSWAPW\n");
51 
52 // -----------------------------------------------------------------------------
53 cp.code() += "etiss_coverage_count(1, 172);\n";
54 { // block
55 cp.code() += "etiss_coverage_count(1, 1169);\n";
56 cp.code() += "{ // block\n";
57 cp.code() += "cpu->nextPc = " + std::to_string(ic.current_address_ + 4) + "ULL;\n";
58 cp.code() += "etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
59 cp.code() += "} // block\n";
60 } // block
61 { // block
62 cp.code() += "etiss_coverage_count(1, 6522);\n";
63 cp.code() += "{ // block\n";
64 cp.code() += "etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) + "ULL];\n";
65 cp.code() += "etiss_coverage_count(4, 6489, 6488, 6487, 6485);\n";
66 cp.code() += "etiss_coverage_count(1, 6490);\n";
67 if ((rd % 32ULL) != 0LL) { // conditional
68 cp.code() += "etiss_coverage_count(5, 6496, 6493, 6491, 6494, 6495);\n";
69 cp.code() += "etiss_uint32 mem_val_0;\n";
70 cp.code() += "cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
71 cp.code() += "if (cpu->exception) { // conditional\n";
72 { // procedure
73 cp.code() += "{ // procedure\n";
74 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
75 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
76 cp.code() += "} // procedure\n";
77 } // procedure
78 cp.code() += "} // conditional\n";
79 cp.code() += "*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) + "ULL] = (etiss_int32)(((etiss_int32)(mem_val_0)));\n";
80 cp.code() += "etiss_coverage_count(9, 6510, 6501, 6500, 6498, 6509, 6506, 6504, 6503, 6507);\n";
81 } // conditional
82 cp.code() += "etiss_uint32 mem_val_1;\n";
83 cp.code() += "mem_val_1 = (etiss_int32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) + "ULL]);\n";
84 cp.code() += "etiss_coverage_count(7, 6521, 6513, 6512, 6520, 6518, 6517, 6515);\n";
85 cp.code() += "cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";
86 cp.code() += "if (cpu->exception) { // conditional\n";
87 { // procedure
88 cp.code() += "{ // procedure\n";
89 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
90 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
91 cp.code() += "} // procedure\n";
92 } // procedure
93 cp.code() += "} // conditional\n";
94 cp.code() += "} // block\n";
95 } // block
96 cp.code() += "instr_exit_" + std::to_string(ic.current_address_) + ":\n";
97 cp.code() += "cpu->instructionPointer = cpu->nextPc;\n";
98 // -----------------------------------------------------------------------------
99  cp.getAffectedRegisters().add("instructionPointer", 32);
100  }
101  {
103 
104  cp.code() = std::string("//AMOSWAPW\n");
105 
106 // -----------------------------------------------------------------------------
107 cp.code() += "if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
108 // -----------------------------------------------------------------------------
109  }
110 
111  return true;
112  },
113  0,
114  [] (BitArray & ba, Instruction & instr)
115  {
116 // -----------------------------------------------------------------------------
117 etiss_uint8 rd = 0;
118 static BitArrayRange R_rd_0(11, 7);
119 rd += R_rd_0.read(ba) << 0;
120 etiss_uint8 rs1 = 0;
121 static BitArrayRange R_rs1_0(19, 15);
122 rs1 += R_rs1_0.read(ba) << 0;
123 etiss_uint8 rs2 = 0;
124 static BitArrayRange R_rs2_0(24, 20);
125 rs2 += R_rs2_0.read(ba) << 0;
126 etiss_uint8 rl = 0;
127 static BitArrayRange R_rl_0(25, 25);
128 rl += R_rl_0.read(ba) << 0;
129 etiss_uint8 aq = 0;
130 static BitArrayRange R_aq_0(26, 26);
131 aq += R_aq_0.read(ba) << 0;
132 
133 // -----------------------------------------------------------------------------
134 
135  std::stringstream ss;
136 // -----------------------------------------------------------------------------
137 ss << "amoswapw" << " # " << 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) + "]");
138 // -----------------------------------------------------------------------------
139  return ss.str();
140  }
141 );
142 
143 // AMOADDW ---------------------------------------------------------------------
146  "amoaddw",
147  (uint32_t) 0x00202f,
148  (uint32_t) 0xf800707f,
149  [] (BitArray & ba,etiss::CodeSet & cs,InstructionContext & ic)
150  {
151 
152 // -----------------------------------------------------------------------------
153 
154 // -----------------------------------------------------------------------------
155 
156 // -----------------------------------------------------------------------------
157 etiss_uint8 rd = 0;
158 static BitArrayRange R_rd_0(11, 7);
159 rd += R_rd_0.read(ba) << 0;
160 etiss_uint8 rs1 = 0;
161 static BitArrayRange R_rs1_0(19, 15);
162 rs1 += R_rs1_0.read(ba) << 0;
163 etiss_uint8 rs2 = 0;
164 static BitArrayRange R_rs2_0(24, 20);
165 rs2 += R_rs2_0.read(ba) << 0;
166 etiss_uint8 rl = 0;
167 static BitArrayRange R_rl_0(25, 25);
168 rl += R_rl_0.read(ba) << 0;
169 etiss_uint8 aq = 0;
170 static BitArrayRange R_aq_0(26, 26);
171 aq += R_aq_0.read(ba) << 0;
172 
173 // -----------------------------------------------------------------------------
174 
175  {
177 
178  cp.code() = std::string("//AMOADDW\n");
179 
180 // -----------------------------------------------------------------------------
181 cp.code() += "etiss_coverage_count(1, 173);\n";
182 { // block
183 cp.code() += "etiss_coverage_count(1, 1169);\n";
184 cp.code() += "{ // block\n";
185 cp.code() += "cpu->nextPc = " + std::to_string(ic.current_address_ + 4) + "ULL;\n";
186 cp.code() += "etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
187 cp.code() += "} // block\n";
188 } // block
189 { // block
190 cp.code() += "etiss_coverage_count(1, 6563);\n";
191 cp.code() += "{ // block\n";
192 cp.code() += "etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) + "ULL];\n";
193 cp.code() += "etiss_coverage_count(4, 6529, 6528, 6527, 6525);\n";
194 cp.code() += "etiss_uint32 mem_val_0;\n";
195 cp.code() += "cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
196 cp.code() += "if (cpu->exception) { // conditional\n";
197 { // procedure
198 cp.code() += "{ // procedure\n";
199 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
200 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
201 cp.code() += "} // procedure\n";
202 } // procedure
203 cp.code() += "} // conditional\n";
204 cp.code() += "etiss_int32 res1 = mem_val_0;\n";
205 cp.code() += "etiss_coverage_count(3, 6534, 6533, 6532);\n";
206 cp.code() += "etiss_coverage_count(1, 6535);\n";
207 if ((rd % 32ULL) != 0LL) { // conditional
208 cp.code() += "etiss_coverage_count(5, 6541, 6538, 6536, 6539, 6540);\n";
209 cp.code() += "*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) + "ULL] = res1;\n";
210 cp.code() += "etiss_coverage_count(5, 6548, 6546, 6545, 6543, 6547);\n";
211 } // conditional
212 cp.code() += "etiss_uint32 res2 = res1 + *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) + "ULL];\n";
213 cp.code() += "etiss_coverage_count(6, 6557, 6556, 6550, 6555, 6554, 6552);\n";
214 cp.code() += "etiss_uint32 mem_val_1;\n";
215 cp.code() += "mem_val_1 = res2;\n";
216 cp.code() += "etiss_coverage_count(4, 6562, 6560, 6559, 6561);\n";
217 cp.code() += "cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";
218 cp.code() += "if (cpu->exception) { // conditional\n";
219 { // procedure
220 cp.code() += "{ // procedure\n";
221 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
222 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
223 cp.code() += "} // procedure\n";
224 } // procedure
225 cp.code() += "} // conditional\n";
226 cp.code() += "} // block\n";
227 } // block
228 cp.code() += "instr_exit_" + std::to_string(ic.current_address_) + ":\n";
229 cp.code() += "cpu->instructionPointer = cpu->nextPc;\n";
230 // -----------------------------------------------------------------------------
231  cp.getAffectedRegisters().add("instructionPointer", 32);
232  }
233  {
235 
236  cp.code() = std::string("//AMOADDW\n");
237 
238 // -----------------------------------------------------------------------------
239 cp.code() += "if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
240 // -----------------------------------------------------------------------------
241  }
242 
243  return true;
244  },
245  0,
246  [] (BitArray & ba, Instruction & instr)
247  {
248 // -----------------------------------------------------------------------------
249 etiss_uint8 rd = 0;
250 static BitArrayRange R_rd_0(11, 7);
251 rd += R_rd_0.read(ba) << 0;
252 etiss_uint8 rs1 = 0;
253 static BitArrayRange R_rs1_0(19, 15);
254 rs1 += R_rs1_0.read(ba) << 0;
255 etiss_uint8 rs2 = 0;
256 static BitArrayRange R_rs2_0(24, 20);
257 rs2 += R_rs2_0.read(ba) << 0;
258 etiss_uint8 rl = 0;
259 static BitArrayRange R_rl_0(25, 25);
260 rl += R_rl_0.read(ba) << 0;
261 etiss_uint8 aq = 0;
262 static BitArrayRange R_aq_0(26, 26);
263 aq += R_aq_0.read(ba) << 0;
264 
265 // -----------------------------------------------------------------------------
266 
267  std::stringstream ss;
268 // -----------------------------------------------------------------------------
269 ss << "amoaddw" << " # " << 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) + "]");
270 // -----------------------------------------------------------------------------
271  return ss.str();
272  }
273 );
274 
275 // AMOXORW ---------------------------------------------------------------------
278  "amoxorw",
279  (uint32_t) 0x2000202f,
280  (uint32_t) 0xf800707f,
281  [] (BitArray & ba,etiss::CodeSet & cs,InstructionContext & ic)
282  {
283 
284 // -----------------------------------------------------------------------------
285 
286 // -----------------------------------------------------------------------------
287 
288 // -----------------------------------------------------------------------------
289 etiss_uint8 rd = 0;
290 static BitArrayRange R_rd_0(11, 7);
291 rd += R_rd_0.read(ba) << 0;
292 etiss_uint8 rs1 = 0;
293 static BitArrayRange R_rs1_0(19, 15);
294 rs1 += R_rs1_0.read(ba) << 0;
295 etiss_uint8 rs2 = 0;
296 static BitArrayRange R_rs2_0(24, 20);
297 rs2 += R_rs2_0.read(ba) << 0;
298 etiss_uint8 rl = 0;
299 static BitArrayRange R_rl_0(25, 25);
300 rl += R_rl_0.read(ba) << 0;
301 etiss_uint8 aq = 0;
302 static BitArrayRange R_aq_0(26, 26);
303 aq += R_aq_0.read(ba) << 0;
304 
305 // -----------------------------------------------------------------------------
306 
307  {
309 
310  cp.code() = std::string("//AMOXORW\n");
311 
312 // -----------------------------------------------------------------------------
313 cp.code() += "etiss_coverage_count(1, 174);\n";
314 { // block
315 cp.code() += "etiss_coverage_count(1, 1169);\n";
316 cp.code() += "{ // block\n";
317 cp.code() += "cpu->nextPc = " + std::to_string(ic.current_address_ + 4) + "ULL;\n";
318 cp.code() += "etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
319 cp.code() += "} // block\n";
320 } // block
321 { // block
322 cp.code() += "etiss_coverage_count(1, 6604);\n";
323 cp.code() += "{ // block\n";
324 cp.code() += "etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) + "ULL];\n";
325 cp.code() += "etiss_coverage_count(4, 6570, 6569, 6568, 6566);\n";
326 cp.code() += "etiss_uint32 mem_val_0;\n";
327 cp.code() += "cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
328 cp.code() += "if (cpu->exception) { // conditional\n";
329 { // procedure
330 cp.code() += "{ // procedure\n";
331 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
332 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
333 cp.code() += "} // procedure\n";
334 } // procedure
335 cp.code() += "} // conditional\n";
336 cp.code() += "etiss_int32 res1 = mem_val_0;\n";
337 cp.code() += "etiss_coverage_count(3, 6575, 6574, 6573);\n";
338 cp.code() += "etiss_coverage_count(1, 6576);\n";
339 if ((rd % 32ULL) != 0LL) { // conditional
340 cp.code() += "etiss_coverage_count(5, 6582, 6579, 6577, 6580, 6581);\n";
341 cp.code() += "*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) + "ULL] = res1;\n";
342 cp.code() += "etiss_coverage_count(5, 6589, 6587, 6586, 6584, 6588);\n";
343 } // conditional
344 cp.code() += "etiss_uint32 res2 = res1 ^ *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) + "ULL];\n";
345 cp.code() += "etiss_coverage_count(6, 6598, 6597, 6591, 6596, 6595, 6593);\n";
346 cp.code() += "etiss_uint32 mem_val_1;\n";
347 cp.code() += "mem_val_1 = res2;\n";
348 cp.code() += "etiss_coverage_count(4, 6603, 6601, 6600, 6602);\n";
349 cp.code() += "cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";
350 cp.code() += "if (cpu->exception) { // conditional\n";
351 { // procedure
352 cp.code() += "{ // procedure\n";
353 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
354 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
355 cp.code() += "} // procedure\n";
356 } // procedure
357 cp.code() += "} // conditional\n";
358 cp.code() += "} // block\n";
359 } // block
360 cp.code() += "instr_exit_" + std::to_string(ic.current_address_) + ":\n";
361 cp.code() += "cpu->instructionPointer = cpu->nextPc;\n";
362 // -----------------------------------------------------------------------------
363  cp.getAffectedRegisters().add("instructionPointer", 32);
364  }
365  {
367 
368  cp.code() = std::string("//AMOXORW\n");
369 
370 // -----------------------------------------------------------------------------
371 cp.code() += "if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
372 // -----------------------------------------------------------------------------
373  }
374 
375  return true;
376  },
377  0,
378  [] (BitArray & ba, Instruction & instr)
379  {
380 // -----------------------------------------------------------------------------
381 etiss_uint8 rd = 0;
382 static BitArrayRange R_rd_0(11, 7);
383 rd += R_rd_0.read(ba) << 0;
384 etiss_uint8 rs1 = 0;
385 static BitArrayRange R_rs1_0(19, 15);
386 rs1 += R_rs1_0.read(ba) << 0;
387 etiss_uint8 rs2 = 0;
388 static BitArrayRange R_rs2_0(24, 20);
389 rs2 += R_rs2_0.read(ba) << 0;
390 etiss_uint8 rl = 0;
391 static BitArrayRange R_rl_0(25, 25);
392 rl += R_rl_0.read(ba) << 0;
393 etiss_uint8 aq = 0;
394 static BitArrayRange R_aq_0(26, 26);
395 aq += R_aq_0.read(ba) << 0;
396 
397 // -----------------------------------------------------------------------------
398 
399  std::stringstream ss;
400 // -----------------------------------------------------------------------------
401 ss << "amoxorw" << " # " << 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) + "]");
402 // -----------------------------------------------------------------------------
403  return ss.str();
404  }
405 );
406 
407 // AMOANDW ---------------------------------------------------------------------
410  "amoandw",
411  (uint32_t) 0x6000202f,
412  (uint32_t) 0xf800707f,
413  [] (BitArray & ba,etiss::CodeSet & cs,InstructionContext & ic)
414  {
415 
416 // -----------------------------------------------------------------------------
417 
418 // -----------------------------------------------------------------------------
419 
420 // -----------------------------------------------------------------------------
421 etiss_uint8 rd = 0;
422 static BitArrayRange R_rd_0(11, 7);
423 rd += R_rd_0.read(ba) << 0;
424 etiss_uint8 rs1 = 0;
425 static BitArrayRange R_rs1_0(19, 15);
426 rs1 += R_rs1_0.read(ba) << 0;
427 etiss_uint8 rs2 = 0;
428 static BitArrayRange R_rs2_0(24, 20);
429 rs2 += R_rs2_0.read(ba) << 0;
430 etiss_uint8 rl = 0;
431 static BitArrayRange R_rl_0(25, 25);
432 rl += R_rl_0.read(ba) << 0;
433 etiss_uint8 aq = 0;
434 static BitArrayRange R_aq_0(26, 26);
435 aq += R_aq_0.read(ba) << 0;
436 
437 // -----------------------------------------------------------------------------
438 
439  {
441 
442  cp.code() = std::string("//AMOANDW\n");
443 
444 // -----------------------------------------------------------------------------
445 cp.code() += "etiss_coverage_count(1, 175);\n";
446 { // block
447 cp.code() += "etiss_coverage_count(1, 1169);\n";
448 cp.code() += "{ // block\n";
449 cp.code() += "cpu->nextPc = " + std::to_string(ic.current_address_ + 4) + "ULL;\n";
450 cp.code() += "etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
451 cp.code() += "} // block\n";
452 } // block
453 { // block
454 cp.code() += "etiss_coverage_count(1, 6645);\n";
455 cp.code() += "{ // block\n";
456 cp.code() += "etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) + "ULL];\n";
457 cp.code() += "etiss_coverage_count(4, 6611, 6610, 6609, 6607);\n";
458 cp.code() += "etiss_uint32 mem_val_0;\n";
459 cp.code() += "cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
460 cp.code() += "if (cpu->exception) { // conditional\n";
461 { // procedure
462 cp.code() += "{ // procedure\n";
463 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
464 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
465 cp.code() += "} // procedure\n";
466 } // procedure
467 cp.code() += "} // conditional\n";
468 cp.code() += "etiss_int32 res1 = mem_val_0;\n";
469 cp.code() += "etiss_coverage_count(3, 6616, 6615, 6614);\n";
470 cp.code() += "etiss_coverage_count(1, 6617);\n";
471 if ((rd % 32ULL) != 0LL) { // conditional
472 cp.code() += "etiss_coverage_count(5, 6623, 6620, 6618, 6621, 6622);\n";
473 cp.code() += "*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) + "ULL] = res1;\n";
474 cp.code() += "etiss_coverage_count(5, 6630, 6628, 6627, 6625, 6629);\n";
475 } // conditional
476 cp.code() += "etiss_uint32 res2 = res1 & *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) + "ULL];\n";
477 cp.code() += "etiss_coverage_count(6, 6639, 6638, 6632, 6637, 6636, 6634);\n";
478 cp.code() += "etiss_uint32 mem_val_1;\n";
479 cp.code() += "mem_val_1 = res2;\n";
480 cp.code() += "etiss_coverage_count(4, 6644, 6642, 6641, 6643);\n";
481 cp.code() += "cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";
482 cp.code() += "if (cpu->exception) { // conditional\n";
483 { // procedure
484 cp.code() += "{ // procedure\n";
485 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
486 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
487 cp.code() += "} // procedure\n";
488 } // procedure
489 cp.code() += "} // conditional\n";
490 cp.code() += "} // block\n";
491 } // block
492 cp.code() += "instr_exit_" + std::to_string(ic.current_address_) + ":\n";
493 cp.code() += "cpu->instructionPointer = cpu->nextPc;\n";
494 // -----------------------------------------------------------------------------
495  cp.getAffectedRegisters().add("instructionPointer", 32);
496  }
497  {
499 
500  cp.code() = std::string("//AMOANDW\n");
501 
502 // -----------------------------------------------------------------------------
503 cp.code() += "if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
504 // -----------------------------------------------------------------------------
505  }
506 
507  return true;
508  },
509  0,
510  [] (BitArray & ba, Instruction & instr)
511  {
512 // -----------------------------------------------------------------------------
513 etiss_uint8 rd = 0;
514 static BitArrayRange R_rd_0(11, 7);
515 rd += R_rd_0.read(ba) << 0;
516 etiss_uint8 rs1 = 0;
517 static BitArrayRange R_rs1_0(19, 15);
518 rs1 += R_rs1_0.read(ba) << 0;
519 etiss_uint8 rs2 = 0;
520 static BitArrayRange R_rs2_0(24, 20);
521 rs2 += R_rs2_0.read(ba) << 0;
522 etiss_uint8 rl = 0;
523 static BitArrayRange R_rl_0(25, 25);
524 rl += R_rl_0.read(ba) << 0;
525 etiss_uint8 aq = 0;
526 static BitArrayRange R_aq_0(26, 26);
527 aq += R_aq_0.read(ba) << 0;
528 
529 // -----------------------------------------------------------------------------
530 
531  std::stringstream ss;
532 // -----------------------------------------------------------------------------
533 ss << "amoandw" << " # " << 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) + "]");
534 // -----------------------------------------------------------------------------
535  return ss.str();
536  }
537 );
538 
539 // AMOORW ----------------------------------------------------------------------
542  "amoorw",
543  (uint32_t) 0x4000202f,
544  (uint32_t) 0xf800707f,
545  [] (BitArray & ba,etiss::CodeSet & cs,InstructionContext & ic)
546  {
547 
548 // -----------------------------------------------------------------------------
549 
550 // -----------------------------------------------------------------------------
551 
552 // -----------------------------------------------------------------------------
553 etiss_uint8 rd = 0;
554 static BitArrayRange R_rd_0(11, 7);
555 rd += R_rd_0.read(ba) << 0;
556 etiss_uint8 rs1 = 0;
557 static BitArrayRange R_rs1_0(19, 15);
558 rs1 += R_rs1_0.read(ba) << 0;
559 etiss_uint8 rs2 = 0;
560 static BitArrayRange R_rs2_0(24, 20);
561 rs2 += R_rs2_0.read(ba) << 0;
562 etiss_uint8 rl = 0;
563 static BitArrayRange R_rl_0(25, 25);
564 rl += R_rl_0.read(ba) << 0;
565 etiss_uint8 aq = 0;
566 static BitArrayRange R_aq_0(26, 26);
567 aq += R_aq_0.read(ba) << 0;
568 
569 // -----------------------------------------------------------------------------
570 
571  {
573 
574  cp.code() = std::string("//AMOORW\n");
575 
576 // -----------------------------------------------------------------------------
577 cp.code() += "etiss_coverage_count(1, 176);\n";
578 { // block
579 cp.code() += "etiss_coverage_count(1, 1169);\n";
580 cp.code() += "{ // block\n";
581 cp.code() += "cpu->nextPc = " + std::to_string(ic.current_address_ + 4) + "ULL;\n";
582 cp.code() += "etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
583 cp.code() += "} // block\n";
584 } // block
585 { // block
586 cp.code() += "etiss_coverage_count(1, 6686);\n";
587 cp.code() += "{ // block\n";
588 cp.code() += "etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) + "ULL];\n";
589 cp.code() += "etiss_coverage_count(4, 6652, 6651, 6650, 6648);\n";
590 cp.code() += "etiss_uint32 mem_val_0;\n";
591 cp.code() += "cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
592 cp.code() += "if (cpu->exception) { // conditional\n";
593 { // procedure
594 cp.code() += "{ // procedure\n";
595 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
596 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
597 cp.code() += "} // procedure\n";
598 } // procedure
599 cp.code() += "} // conditional\n";
600 cp.code() += "etiss_int32 res1 = mem_val_0;\n";
601 cp.code() += "etiss_coverage_count(3, 6657, 6656, 6655);\n";
602 cp.code() += "etiss_coverage_count(1, 6658);\n";
603 if ((rd % 32ULL) != 0LL) { // conditional
604 cp.code() += "etiss_coverage_count(5, 6664, 6661, 6659, 6662, 6663);\n";
605 cp.code() += "*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) + "ULL] = res1;\n";
606 cp.code() += "etiss_coverage_count(5, 6671, 6669, 6668, 6666, 6670);\n";
607 } // conditional
608 cp.code() += "etiss_uint32 res2 = res1 | *((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) + "ULL];\n";
609 cp.code() += "etiss_coverage_count(6, 6680, 6679, 6673, 6678, 6677, 6675);\n";
610 cp.code() += "etiss_uint32 mem_val_1;\n";
611 cp.code() += "mem_val_1 = res2;\n";
612 cp.code() += "etiss_coverage_count(4, 6685, 6683, 6682, 6684);\n";
613 cp.code() += "cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";
614 cp.code() += "if (cpu->exception) { // conditional\n";
615 { // procedure
616 cp.code() += "{ // procedure\n";
617 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
618 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
619 cp.code() += "} // procedure\n";
620 } // procedure
621 cp.code() += "} // conditional\n";
622 cp.code() += "} // block\n";
623 } // block
624 cp.code() += "instr_exit_" + std::to_string(ic.current_address_) + ":\n";
625 cp.code() += "cpu->instructionPointer = cpu->nextPc;\n";
626 // -----------------------------------------------------------------------------
627  cp.getAffectedRegisters().add("instructionPointer", 32);
628  }
629  {
631 
632  cp.code() = std::string("//AMOORW\n");
633 
634 // -----------------------------------------------------------------------------
635 cp.code() += "if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
636 // -----------------------------------------------------------------------------
637  }
638 
639  return true;
640  },
641  0,
642  [] (BitArray & ba, Instruction & instr)
643  {
644 // -----------------------------------------------------------------------------
645 etiss_uint8 rd = 0;
646 static BitArrayRange R_rd_0(11, 7);
647 rd += R_rd_0.read(ba) << 0;
648 etiss_uint8 rs1 = 0;
649 static BitArrayRange R_rs1_0(19, 15);
650 rs1 += R_rs1_0.read(ba) << 0;
651 etiss_uint8 rs2 = 0;
652 static BitArrayRange R_rs2_0(24, 20);
653 rs2 += R_rs2_0.read(ba) << 0;
654 etiss_uint8 rl = 0;
655 static BitArrayRange R_rl_0(25, 25);
656 rl += R_rl_0.read(ba) << 0;
657 etiss_uint8 aq = 0;
658 static BitArrayRange R_aq_0(26, 26);
659 aq += R_aq_0.read(ba) << 0;
660 
661 // -----------------------------------------------------------------------------
662 
663  std::stringstream ss;
664 // -----------------------------------------------------------------------------
665 ss << "amoorw" << " # " << 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) + "]");
666 // -----------------------------------------------------------------------------
667  return ss.str();
668  }
669 );
670 
671 // AMOMINW ---------------------------------------------------------------------
674  "amominw",
675  (uint32_t) 0x8000202f,
676  (uint32_t) 0xf800707f,
677  [] (BitArray & ba,etiss::CodeSet & cs,InstructionContext & ic)
678  {
679 
680 // -----------------------------------------------------------------------------
681 
682 // -----------------------------------------------------------------------------
683 
684 // -----------------------------------------------------------------------------
685 etiss_uint8 rd = 0;
686 static BitArrayRange R_rd_0(11, 7);
687 rd += R_rd_0.read(ba) << 0;
688 etiss_uint8 rs1 = 0;
689 static BitArrayRange R_rs1_0(19, 15);
690 rs1 += R_rs1_0.read(ba) << 0;
691 etiss_uint8 rs2 = 0;
692 static BitArrayRange R_rs2_0(24, 20);
693 rs2 += R_rs2_0.read(ba) << 0;
694 etiss_uint8 rl = 0;
695 static BitArrayRange R_rl_0(25, 25);
696 rl += R_rl_0.read(ba) << 0;
697 etiss_uint8 aq = 0;
698 static BitArrayRange R_aq_0(26, 26);
699 aq += R_aq_0.read(ba) << 0;
700 
701 // -----------------------------------------------------------------------------
702 
703  {
705 
706  cp.code() = std::string("//AMOMINW\n");
707 
708 // -----------------------------------------------------------------------------
709 cp.code() += "etiss_coverage_count(1, 177);\n";
710 { // block
711 cp.code() += "etiss_coverage_count(1, 1169);\n";
712 cp.code() += "{ // block\n";
713 cp.code() += "cpu->nextPc = " + std::to_string(ic.current_address_ + 4) + "ULL;\n";
714 cp.code() += "etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
715 cp.code() += "} // block\n";
716 } // block
717 { // block
718 cp.code() += "etiss_coverage_count(1, 6736);\n";
719 cp.code() += "{ // block\n";
720 cp.code() += "etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) + "ULL];\n";
721 cp.code() += "etiss_coverage_count(4, 6693, 6692, 6691, 6689);\n";
722 cp.code() += "etiss_uint32 mem_val_0;\n";
723 cp.code() += "cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
724 cp.code() += "if (cpu->exception) { // conditional\n";
725 { // procedure
726 cp.code() += "{ // procedure\n";
727 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
728 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
729 cp.code() += "} // procedure\n";
730 } // procedure
731 cp.code() += "} // conditional\n";
732 cp.code() += "etiss_int32 res1 = mem_val_0;\n";
733 cp.code() += "etiss_coverage_count(3, 6698, 6697, 6696);\n";
734 cp.code() += "etiss_coverage_count(1, 6699);\n";
735 if ((rd % 32ULL) != 0LL) { // conditional
736 cp.code() += "etiss_coverage_count(5, 6705, 6702, 6700, 6703, 6704);\n";
737 cp.code() += "*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) + "ULL] = res1;\n";
738 cp.code() += "etiss_coverage_count(5, 6712, 6710, 6709, 6707, 6711);\n";
739 } // conditional
740 cp.code() += "etiss_uint32 res2 = (res1 > (etiss_int32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) + "ULL])) ? (*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) + "ULL]) : (res1);\n";
741 cp.code() += "etiss_coverage_count(12, 6730, 6729, 6722, 6714, 6721, 6719, 6718, 6716, 6727, 6726, 6724, 6728);\n";
742 cp.code() += "etiss_uint32 mem_val_1;\n";
743 cp.code() += "mem_val_1 = res2;\n";
744 cp.code() += "etiss_coverage_count(4, 6735, 6733, 6732, 6734);\n";
745 cp.code() += "cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";
746 cp.code() += "if (cpu->exception) { // conditional\n";
747 { // procedure
748 cp.code() += "{ // procedure\n";
749 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
750 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
751 cp.code() += "} // procedure\n";
752 } // procedure
753 cp.code() += "} // conditional\n";
754 cp.code() += "} // block\n";
755 } // block
756 cp.code() += "instr_exit_" + std::to_string(ic.current_address_) + ":\n";
757 cp.code() += "cpu->instructionPointer = cpu->nextPc;\n";
758 // -----------------------------------------------------------------------------
759  cp.getAffectedRegisters().add("instructionPointer", 32);
760  }
761  {
763 
764  cp.code() = std::string("//AMOMINW\n");
765 
766 // -----------------------------------------------------------------------------
767 cp.code() += "if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
768 // -----------------------------------------------------------------------------
769  }
770 
771  return true;
772  },
773  0,
774  [] (BitArray & ba, Instruction & instr)
775  {
776 // -----------------------------------------------------------------------------
777 etiss_uint8 rd = 0;
778 static BitArrayRange R_rd_0(11, 7);
779 rd += R_rd_0.read(ba) << 0;
780 etiss_uint8 rs1 = 0;
781 static BitArrayRange R_rs1_0(19, 15);
782 rs1 += R_rs1_0.read(ba) << 0;
783 etiss_uint8 rs2 = 0;
784 static BitArrayRange R_rs2_0(24, 20);
785 rs2 += R_rs2_0.read(ba) << 0;
786 etiss_uint8 rl = 0;
787 static BitArrayRange R_rl_0(25, 25);
788 rl += R_rl_0.read(ba) << 0;
789 etiss_uint8 aq = 0;
790 static BitArrayRange R_aq_0(26, 26);
791 aq += R_aq_0.read(ba) << 0;
792 
793 // -----------------------------------------------------------------------------
794 
795  std::stringstream ss;
796 // -----------------------------------------------------------------------------
797 ss << "amominw" << " # " << 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) + "]");
798 // -----------------------------------------------------------------------------
799  return ss.str();
800  }
801 );
802 
803 // AMOMAXW ---------------------------------------------------------------------
806  "amomaxw",
807  (uint32_t) 0xa000202f,
808  (uint32_t) 0xf800707f,
809  [] (BitArray & ba,etiss::CodeSet & cs,InstructionContext & ic)
810  {
811 
812 // -----------------------------------------------------------------------------
813 
814 // -----------------------------------------------------------------------------
815 
816 // -----------------------------------------------------------------------------
817 etiss_uint8 rd = 0;
818 static BitArrayRange R_rd_0(11, 7);
819 rd += R_rd_0.read(ba) << 0;
820 etiss_uint8 rs1 = 0;
821 static BitArrayRange R_rs1_0(19, 15);
822 rs1 += R_rs1_0.read(ba) << 0;
823 etiss_uint8 rs2 = 0;
824 static BitArrayRange R_rs2_0(24, 20);
825 rs2 += R_rs2_0.read(ba) << 0;
826 etiss_uint8 rl = 0;
827 static BitArrayRange R_rl_0(25, 25);
828 rl += R_rl_0.read(ba) << 0;
829 etiss_uint8 aq = 0;
830 static BitArrayRange R_aq_0(26, 26);
831 aq += R_aq_0.read(ba) << 0;
832 
833 // -----------------------------------------------------------------------------
834 
835  {
837 
838  cp.code() = std::string("//AMOMAXW\n");
839 
840 // -----------------------------------------------------------------------------
841 cp.code() += "etiss_coverage_count(1, 178);\n";
842 { // block
843 cp.code() += "etiss_coverage_count(1, 1169);\n";
844 cp.code() += "{ // block\n";
845 cp.code() += "cpu->nextPc = " + std::to_string(ic.current_address_ + 4) + "ULL;\n";
846 cp.code() += "etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
847 cp.code() += "} // block\n";
848 } // block
849 { // block
850 cp.code() += "etiss_coverage_count(1, 6786);\n";
851 cp.code() += "{ // block\n";
852 cp.code() += "etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) + "ULL];\n";
853 cp.code() += "etiss_coverage_count(4, 6743, 6742, 6741, 6739);\n";
854 cp.code() += "etiss_uint32 mem_val_0;\n";
855 cp.code() += "cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
856 cp.code() += "if (cpu->exception) { // conditional\n";
857 { // procedure
858 cp.code() += "{ // procedure\n";
859 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
860 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
861 cp.code() += "} // procedure\n";
862 } // procedure
863 cp.code() += "} // conditional\n";
864 cp.code() += "etiss_int32 res1 = mem_val_0;\n";
865 cp.code() += "etiss_coverage_count(3, 6748, 6747, 6746);\n";
866 cp.code() += "etiss_coverage_count(1, 6749);\n";
867 if ((rd % 32ULL) != 0LL) { // conditional
868 cp.code() += "etiss_coverage_count(5, 6755, 6752, 6750, 6753, 6754);\n";
869 cp.code() += "*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) + "ULL] = res1;\n";
870 cp.code() += "etiss_coverage_count(5, 6762, 6760, 6759, 6757, 6761);\n";
871 } // conditional
872 cp.code() += "etiss_uint32 res2 = (res1 < (etiss_int32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) + "ULL])) ? (*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) + "ULL]) : (res1);\n";
873 cp.code() += "etiss_coverage_count(12, 6780, 6779, 6772, 6764, 6771, 6769, 6768, 6766, 6777, 6776, 6774, 6778);\n";
874 cp.code() += "etiss_uint32 mem_val_1;\n";
875 cp.code() += "mem_val_1 = res2;\n";
876 cp.code() += "etiss_coverage_count(4, 6785, 6783, 6782, 6784);\n";
877 cp.code() += "cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";
878 cp.code() += "if (cpu->exception) { // conditional\n";
879 { // procedure
880 cp.code() += "{ // procedure\n";
881 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
882 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
883 cp.code() += "} // procedure\n";
884 } // procedure
885 cp.code() += "} // conditional\n";
886 cp.code() += "} // block\n";
887 } // block
888 cp.code() += "instr_exit_" + std::to_string(ic.current_address_) + ":\n";
889 cp.code() += "cpu->instructionPointer = cpu->nextPc;\n";
890 // -----------------------------------------------------------------------------
891  cp.getAffectedRegisters().add("instructionPointer", 32);
892  }
893  {
895 
896  cp.code() = std::string("//AMOMAXW\n");
897 
898 // -----------------------------------------------------------------------------
899 cp.code() += "if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
900 // -----------------------------------------------------------------------------
901  }
902 
903  return true;
904  },
905  0,
906  [] (BitArray & ba, Instruction & instr)
907  {
908 // -----------------------------------------------------------------------------
909 etiss_uint8 rd = 0;
910 static BitArrayRange R_rd_0(11, 7);
911 rd += R_rd_0.read(ba) << 0;
912 etiss_uint8 rs1 = 0;
913 static BitArrayRange R_rs1_0(19, 15);
914 rs1 += R_rs1_0.read(ba) << 0;
915 etiss_uint8 rs2 = 0;
916 static BitArrayRange R_rs2_0(24, 20);
917 rs2 += R_rs2_0.read(ba) << 0;
918 etiss_uint8 rl = 0;
919 static BitArrayRange R_rl_0(25, 25);
920 rl += R_rl_0.read(ba) << 0;
921 etiss_uint8 aq = 0;
922 static BitArrayRange R_aq_0(26, 26);
923 aq += R_aq_0.read(ba) << 0;
924 
925 // -----------------------------------------------------------------------------
926 
927  std::stringstream ss;
928 // -----------------------------------------------------------------------------
929 ss << "amomaxw" << " # " << 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) + "]");
930 // -----------------------------------------------------------------------------
931  return ss.str();
932  }
933 );
934 
935 // AMOMINUW --------------------------------------------------------------------
938  "amominuw",
939  (uint32_t) 0xc000202f,
940  (uint32_t) 0xf800707f,
941  [] (BitArray & ba,etiss::CodeSet & cs,InstructionContext & ic)
942  {
943 
944 // -----------------------------------------------------------------------------
945 
946 // -----------------------------------------------------------------------------
947 
948 // -----------------------------------------------------------------------------
949 etiss_uint8 rd = 0;
950 static BitArrayRange R_rd_0(11, 7);
951 rd += R_rd_0.read(ba) << 0;
952 etiss_uint8 rs1 = 0;
953 static BitArrayRange R_rs1_0(19, 15);
954 rs1 += R_rs1_0.read(ba) << 0;
955 etiss_uint8 rs2 = 0;
956 static BitArrayRange R_rs2_0(24, 20);
957 rs2 += R_rs2_0.read(ba) << 0;
958 etiss_uint8 rl = 0;
959 static BitArrayRange R_rl_0(25, 25);
960 rl += R_rl_0.read(ba) << 0;
961 etiss_uint8 aq = 0;
962 static BitArrayRange R_aq_0(26, 26);
963 aq += R_aq_0.read(ba) << 0;
964 
965 // -----------------------------------------------------------------------------
966 
967  {
969 
970  cp.code() = std::string("//AMOMINUW\n");
971 
972 // -----------------------------------------------------------------------------
973 cp.code() += "etiss_coverage_count(1, 179);\n";
974 { // block
975 cp.code() += "etiss_coverage_count(1, 1169);\n";
976 cp.code() += "{ // block\n";
977 cp.code() += "cpu->nextPc = " + std::to_string(ic.current_address_ + 4) + "ULL;\n";
978 cp.code() += "etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
979 cp.code() += "} // block\n";
980 } // block
981 { // block
982 cp.code() += "etiss_coverage_count(1, 6838);\n";
983 cp.code() += "{ // block\n";
984 cp.code() += "etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) + "ULL];\n";
985 cp.code() += "etiss_coverage_count(4, 6793, 6792, 6791, 6789);\n";
986 cp.code() += "etiss_uint32 mem_val_0;\n";
987 cp.code() += "cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
988 cp.code() += "if (cpu->exception) { // conditional\n";
989 { // procedure
990 cp.code() += "{ // procedure\n";
991 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
992 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
993 cp.code() += "} // procedure\n";
994 } // procedure
995 cp.code() += "} // conditional\n";
996 cp.code() += "etiss_uint32 res1 = mem_val_0;\n";
997 cp.code() += "etiss_coverage_count(3, 6798, 6797, 6796);\n";
998 cp.code() += "etiss_coverage_count(1, 6799);\n";
999 if ((rd % 32ULL) != 0LL) { // conditional
1000 cp.code() += "etiss_coverage_count(5, 6805, 6802, 6800, 6803, 6804);\n";
1001 cp.code() += "*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) + "ULL] = (etiss_int32)(res1);\n";
1002 cp.code() += "etiss_coverage_count(6, 6814, 6810, 6809, 6807, 6813, 6811);\n";
1003 } // conditional
1004 cp.code() += "etiss_uint32 res2 = (res1 > (etiss_uint32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) + "ULL])) ? (*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) + "ULL]) : (res1);\n";
1005 cp.code() += "etiss_coverage_count(12, 6832, 6831, 6824, 6816, 6823, 6821, 6820, 6818, 6829, 6828, 6826, 6830);\n";
1006 cp.code() += "etiss_uint32 mem_val_1;\n";
1007 cp.code() += "mem_val_1 = res2;\n";
1008 cp.code() += "etiss_coverage_count(4, 6837, 6835, 6834, 6836);\n";
1009 cp.code() += "cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";
1010 cp.code() += "if (cpu->exception) { // conditional\n";
1011 { // procedure
1012 cp.code() += "{ // procedure\n";
1013 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
1014 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
1015 cp.code() += "} // procedure\n";
1016 } // procedure
1017 cp.code() += "} // conditional\n";
1018 cp.code() += "} // block\n";
1019 } // block
1020 cp.code() += "instr_exit_" + std::to_string(ic.current_address_) + ":\n";
1021 cp.code() += "cpu->instructionPointer = cpu->nextPc;\n";
1022 // -----------------------------------------------------------------------------
1023  cp.getAffectedRegisters().add("instructionPointer", 32);
1024  }
1025  {
1027 
1028  cp.code() = std::string("//AMOMINUW\n");
1029 
1030 // -----------------------------------------------------------------------------
1031 cp.code() += "if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
1032 // -----------------------------------------------------------------------------
1033  }
1034 
1035  return true;
1036  },
1037  0,
1038  [] (BitArray & ba, Instruction & instr)
1039  {
1040 // -----------------------------------------------------------------------------
1041 etiss_uint8 rd = 0;
1042 static BitArrayRange R_rd_0(11, 7);
1043 rd += R_rd_0.read(ba) << 0;
1044 etiss_uint8 rs1 = 0;
1045 static BitArrayRange R_rs1_0(19, 15);
1046 rs1 += R_rs1_0.read(ba) << 0;
1047 etiss_uint8 rs2 = 0;
1048 static BitArrayRange R_rs2_0(24, 20);
1049 rs2 += R_rs2_0.read(ba) << 0;
1050 etiss_uint8 rl = 0;
1051 static BitArrayRange R_rl_0(25, 25);
1052 rl += R_rl_0.read(ba) << 0;
1053 etiss_uint8 aq = 0;
1054 static BitArrayRange R_aq_0(26, 26);
1055 aq += R_aq_0.read(ba) << 0;
1056 
1057 // -----------------------------------------------------------------------------
1058 
1059  std::stringstream ss;
1060 // -----------------------------------------------------------------------------
1061 ss << "amominuw" << " # " << 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) + "]");
1062 // -----------------------------------------------------------------------------
1063  return ss.str();
1064  }
1065 );
1066 
1067 // AMOMAXUW --------------------------------------------------------------------
1070  "amomaxuw",
1071  (uint32_t) 0xe000202f,
1072  (uint32_t) 0xf800707f,
1073  [] (BitArray & ba,etiss::CodeSet & cs,InstructionContext & ic)
1074  {
1075 
1076 // -----------------------------------------------------------------------------
1077 
1078 // -----------------------------------------------------------------------------
1079 
1080 // -----------------------------------------------------------------------------
1081 etiss_uint8 rd = 0;
1082 static BitArrayRange R_rd_0(11, 7);
1083 rd += R_rd_0.read(ba) << 0;
1084 etiss_uint8 rs1 = 0;
1085 static BitArrayRange R_rs1_0(19, 15);
1086 rs1 += R_rs1_0.read(ba) << 0;
1087 etiss_uint8 rs2 = 0;
1088 static BitArrayRange R_rs2_0(24, 20);
1089 rs2 += R_rs2_0.read(ba) << 0;
1090 etiss_uint8 rl = 0;
1091 static BitArrayRange R_rl_0(25, 25);
1092 rl += R_rl_0.read(ba) << 0;
1093 etiss_uint8 aq = 0;
1094 static BitArrayRange R_aq_0(26, 26);
1095 aq += R_aq_0.read(ba) << 0;
1096 
1097 // -----------------------------------------------------------------------------
1098 
1099  {
1101 
1102  cp.code() = std::string("//AMOMAXUW\n");
1103 
1104 // -----------------------------------------------------------------------------
1105 cp.code() += "etiss_coverage_count(1, 180);\n";
1106 { // block
1107 cp.code() += "etiss_coverage_count(1, 1169);\n";
1108 cp.code() += "{ // block\n";
1109 cp.code() += "cpu->nextPc = " + std::to_string(ic.current_address_ + 4) + "ULL;\n";
1110 cp.code() += "etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
1111 cp.code() += "} // block\n";
1112 } // block
1113 { // block
1114 cp.code() += "etiss_coverage_count(1, 6890);\n";
1115 cp.code() += "{ // block\n";
1116 cp.code() += "etiss_uint32 offs = *((RV32IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) + "ULL];\n";
1117 cp.code() += "etiss_coverage_count(4, 6845, 6844, 6843, 6841);\n";
1118 cp.code() += "etiss_uint32 mem_val_0;\n";
1119 cp.code() += "cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";
1120 cp.code() += "if (cpu->exception) { // conditional\n";
1121 { // procedure
1122 cp.code() += "{ // procedure\n";
1123 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
1124 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
1125 cp.code() += "} // procedure\n";
1126 } // procedure
1127 cp.code() += "} // conditional\n";
1128 cp.code() += "etiss_uint32 res1 = mem_val_0;\n";
1129 cp.code() += "etiss_coverage_count(3, 6850, 6849, 6848);\n";
1130 cp.code() += "etiss_coverage_count(1, 6851);\n";
1131 if ((rd % 32ULL) != 0LL) { // conditional
1132 cp.code() += "etiss_coverage_count(5, 6857, 6854, 6852, 6855, 6856);\n";
1133 cp.code() += "*((RV32IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) + "ULL] = (etiss_int32)(res1);\n";
1134 cp.code() += "etiss_coverage_count(6, 6866, 6862, 6861, 6859, 6865, 6863);\n";
1135 } // conditional
1136 cp.code() += "etiss_uint32 res2 = (res1 < (etiss_uint32)(*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) + "ULL])) ? (*((RV32IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) + "ULL]) : (res1);\n";
1137 cp.code() += "etiss_coverage_count(12, 6884, 6883, 6876, 6868, 6875, 6873, 6872, 6870, 6881, 6880, 6878, 6882);\n";
1138 cp.code() += "etiss_uint32 mem_val_1;\n";
1139 cp.code() += "mem_val_1 = res2;\n";
1140 cp.code() += "etiss_coverage_count(4, 6889, 6887, 6886, 6888);\n";
1141 cp.code() += "cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";
1142 cp.code() += "if (cpu->exception) { // conditional\n";
1143 { // procedure
1144 cp.code() += "{ // procedure\n";
1145 cp.code() += "RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";
1146 cp.code() += "goto instr_exit_" + std::to_string(ic.current_address_) + ";\n";
1147 cp.code() += "} // procedure\n";
1148 } // procedure
1149 cp.code() += "} // conditional\n";
1150 cp.code() += "} // block\n";
1151 } // block
1152 cp.code() += "instr_exit_" + std::to_string(ic.current_address_) + ":\n";
1153 cp.code() += "cpu->instructionPointer = cpu->nextPc;\n";
1154 // -----------------------------------------------------------------------------
1155  cp.getAffectedRegisters().add("instructionPointer", 32);
1156  }
1157  {
1159 
1160  cp.code() = std::string("//AMOMAXUW\n");
1161 
1162 // -----------------------------------------------------------------------------
1163 cp.code() += "if (cpu->return_pending || cpu->exception) return cpu->exception;\n";
1164 // -----------------------------------------------------------------------------
1165  }
1166 
1167  return true;
1168  },
1169  0,
1170  [] (BitArray & ba, Instruction & instr)
1171  {
1172 // -----------------------------------------------------------------------------
1173 etiss_uint8 rd = 0;
1174 static BitArrayRange R_rd_0(11, 7);
1175 rd += R_rd_0.read(ba) << 0;
1176 etiss_uint8 rs1 = 0;
1177 static BitArrayRange R_rs1_0(19, 15);
1178 rs1 += R_rs1_0.read(ba) << 0;
1179 etiss_uint8 rs2 = 0;
1180 static BitArrayRange R_rs2_0(24, 20);
1181 rs2 += R_rs2_0.read(ba) << 0;
1182 etiss_uint8 rl = 0;
1183 static BitArrayRange R_rl_0(25, 25);
1184 rl += R_rl_0.read(ba) << 0;
1185 etiss_uint8 aq = 0;
1186 static BitArrayRange R_aq_0(26, 26);
1187 aq += R_aq_0.read(ba) << 0;
1188 
1189 // -----------------------------------------------------------------------------
1190 
1191  std::stringstream ss;
1192 // -----------------------------------------------------------------------------
1193 ss << "amomaxuw" << " # " << 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) + "]");
1194 // -----------------------------------------------------------------------------
1195  return ss.str();
1196  }
1197 );
etiss::instr::InstructionGroup ISA32_RV32IMACFD("ISA32_RV32IMACFD", 32)
static InstructionDefinition amomaxuw_rd_rs1_rs2_rl_aq(ISA32_RV32IMACFD, "amomaxuw",(uint32_t) 0xe000202f,(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("//AMOMAXUW\n");cp.code()+="etiss_coverage_count(1, 180);\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, 6890);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 offs = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 6845, 6844, 6843, 6841);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="etiss_uint32 res1 = mem_val_0;\n";cp.code()+="etiss_coverage_count(3, 6850, 6849, 6848);\n";cp.code()+="etiss_coverage_count(1, 6851);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 6857, 6854, 6852, 6855, 6856);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int32)(res1);\n";cp.code()+="etiss_coverage_count(6, 6866, 6862, 6861, 6859, 6865, 6863);\n";} cp.code()+="etiss_uint32 res2 = (res1 < (etiss_uint32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL])) ? (*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) : (res1);\n";cp.code()+="etiss_coverage_count(12, 6884, 6883, 6876, 6868, 6875, 6873, 6872, 6870, 6881, 6880, 6878, 6882);\n";cp.code()+="etiss_uint32 mem_val_1;\n";cp.code()+="mem_val_1 = res2;\n";cp.code()+="etiss_coverage_count(4, 6889, 6887, 6886, 6888);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_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("//AMOMAXUW\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<< "amomaxuw"<< " # "<< 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 amoorw_rd_rs1_rs2_rl_aq(ISA32_RV32IMACFD, "amoorw",(uint32_t) 0x4000202f,(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("//AMOORW\n");cp.code()+="etiss_coverage_count(1, 176);\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, 6686);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 offs = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 6652, 6651, 6650, 6648);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="etiss_int32 res1 = mem_val_0;\n";cp.code()+="etiss_coverage_count(3, 6657, 6656, 6655);\n";cp.code()+="etiss_coverage_count(1, 6658);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 6664, 6661, 6659, 6662, 6663);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = res1;\n";cp.code()+="etiss_coverage_count(5, 6671, 6669, 6668, 6666, 6670);\n";} cp.code()+="etiss_uint32 res2 = res1 | *((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(6, 6680, 6679, 6673, 6678, 6677, 6675);\n";cp.code()+="etiss_uint32 mem_val_1;\n";cp.code()+="mem_val_1 = res2;\n";cp.code()+="etiss_coverage_count(4, 6685, 6683, 6682, 6684);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_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("//AMOORW\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<< "amoorw"<< " # "<< 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 amominuw_rd_rs1_rs2_rl_aq(ISA32_RV32IMACFD, "amominuw",(uint32_t) 0xc000202f,(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("//AMOMINUW\n");cp.code()+="etiss_coverage_count(1, 179);\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, 6838);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 offs = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 6793, 6792, 6791, 6789);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="etiss_uint32 res1 = mem_val_0;\n";cp.code()+="etiss_coverage_count(3, 6798, 6797, 6796);\n";cp.code()+="etiss_coverage_count(1, 6799);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 6805, 6802, 6800, 6803, 6804);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int32)(res1);\n";cp.code()+="etiss_coverage_count(6, 6814, 6810, 6809, 6807, 6813, 6811);\n";} cp.code()+="etiss_uint32 res2 = (res1 > (etiss_uint32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL])) ? (*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) : (res1);\n";cp.code()+="etiss_coverage_count(12, 6832, 6831, 6824, 6816, 6823, 6821, 6820, 6818, 6829, 6828, 6826, 6830);\n";cp.code()+="etiss_uint32 mem_val_1;\n";cp.code()+="mem_val_1 = res2;\n";cp.code()+="etiss_coverage_count(4, 6837, 6835, 6834, 6836);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_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("//AMOMINUW\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<< "amominuw"<< " # "<< 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 amominw_rd_rs1_rs2_rl_aq(ISA32_RV32IMACFD, "amominw",(uint32_t) 0x8000202f,(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("//AMOMINW\n");cp.code()+="etiss_coverage_count(1, 177);\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, 6736);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 offs = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 6693, 6692, 6691, 6689);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="etiss_int32 res1 = mem_val_0;\n";cp.code()+="etiss_coverage_count(3, 6698, 6697, 6696);\n";cp.code()+="etiss_coverage_count(1, 6699);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 6705, 6702, 6700, 6703, 6704);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = res1;\n";cp.code()+="etiss_coverage_count(5, 6712, 6710, 6709, 6707, 6711);\n";} cp.code()+="etiss_uint32 res2 = (res1 > (etiss_int32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL])) ? (*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) : (res1);\n";cp.code()+="etiss_coverage_count(12, 6730, 6729, 6722, 6714, 6721, 6719, 6718, 6716, 6727, 6726, 6724, 6728);\n";cp.code()+="etiss_uint32 mem_val_1;\n";cp.code()+="mem_val_1 = res2;\n";cp.code()+="etiss_coverage_count(4, 6735, 6733, 6732, 6734);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_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("//AMOMINW\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<< "amominw"<< " # "<< 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 amoaddw_rd_rs1_rs2_rl_aq(ISA32_RV32IMACFD, "amoaddw",(uint32_t) 0x00202f,(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("//AMOADDW\n");cp.code()+="etiss_coverage_count(1, 173);\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, 6563);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 offs = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 6529, 6528, 6527, 6525);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="etiss_int32 res1 = mem_val_0;\n";cp.code()+="etiss_coverage_count(3, 6534, 6533, 6532);\n";cp.code()+="etiss_coverage_count(1, 6535);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 6541, 6538, 6536, 6539, 6540);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = res1;\n";cp.code()+="etiss_coverage_count(5, 6548, 6546, 6545, 6543, 6547);\n";} cp.code()+="etiss_uint32 res2 = res1 + *((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(6, 6557, 6556, 6550, 6555, 6554, 6552);\n";cp.code()+="etiss_uint32 mem_val_1;\n";cp.code()+="mem_val_1 = res2;\n";cp.code()+="etiss_coverage_count(4, 6562, 6560, 6559, 6561);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_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("//AMOADDW\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<< "amoaddw"<< " # "<< 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 amoswapw_rd_rs1_rs2_rl_aq(ISA32_RV32IMACFD, "amoswapw",(uint32_t) 0x800202f,(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("//AMOSWAPW\n");cp.code()+="etiss_coverage_count(1, 172);\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, 6522);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 offs = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 6489, 6488, 6487, 6485);\n";cp.code()+="etiss_coverage_count(1, 6490);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 6496, 6493, 6491, 6494, 6495);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_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()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_int32)(((etiss_int32)(mem_val_0)));\n";cp.code()+="etiss_coverage_count(9, 6510, 6501, 6500, 6498, 6509, 6506, 6504, 6503, 6507);\n";} cp.code()+="etiss_uint32 mem_val_1;\n";cp.code()+="mem_val_1 = (etiss_int32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(7, 6521, 6513, 6512, 6520, 6518, 6517, 6515);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_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("//AMOSWAPW\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<< "amoswapw"<< " # "<< 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 amoandw_rd_rs1_rs2_rl_aq(ISA32_RV32IMACFD, "amoandw",(uint32_t) 0x6000202f,(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("//AMOANDW\n");cp.code()+="etiss_coverage_count(1, 175);\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, 6645);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 offs = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 6611, 6610, 6609, 6607);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="etiss_int32 res1 = mem_val_0;\n";cp.code()+="etiss_coverage_count(3, 6616, 6615, 6614);\n";cp.code()+="etiss_coverage_count(1, 6617);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 6623, 6620, 6618, 6621, 6622);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = res1;\n";cp.code()+="etiss_coverage_count(5, 6630, 6628, 6627, 6625, 6629);\n";} cp.code()+="etiss_uint32 res2 = res1 & *((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(6, 6639, 6638, 6632, 6637, 6636, 6634);\n";cp.code()+="etiss_uint32 mem_val_1;\n";cp.code()+="mem_val_1 = res2;\n";cp.code()+="etiss_coverage_count(4, 6644, 6642, 6641, 6643);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_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("//AMOANDW\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<< "amoandw"<< " # "<< 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 amomaxw_rd_rs1_rs2_rl_aq(ISA32_RV32IMACFD, "amomaxw",(uint32_t) 0xa000202f,(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("//AMOMAXW\n");cp.code()+="etiss_coverage_count(1, 178);\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, 6786);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 offs = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 6743, 6742, 6741, 6739);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="etiss_int32 res1 = mem_val_0;\n";cp.code()+="etiss_coverage_count(3, 6748, 6747, 6746);\n";cp.code()+="etiss_coverage_count(1, 6749);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 6755, 6752, 6750, 6753, 6754);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = res1;\n";cp.code()+="etiss_coverage_count(5, 6762, 6760, 6759, 6757, 6761);\n";} cp.code()+="etiss_uint32 res2 = (res1 < (etiss_int32)(*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL])) ? (*((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]) : (res1);\n";cp.code()+="etiss_coverage_count(12, 6780, 6779, 6772, 6764, 6771, 6769, 6768, 6766, 6777, 6776, 6774, 6778);\n";cp.code()+="etiss_uint32 mem_val_1;\n";cp.code()+="mem_val_1 = res2;\n";cp.code()+="etiss_coverage_count(4, 6785, 6783, 6782, 6784);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_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("//AMOMAXW\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<< "amomaxw"<< " # "<< 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 amoxorw_rd_rs1_rs2_rl_aq(ISA32_RV32IMACFD, "amoxorw",(uint32_t) 0x2000202f,(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("//AMOXORW\n");cp.code()+="etiss_coverage_count(1, 174);\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, 6604);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 offs = *((RV32IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(4, 6570, 6569, 6568, 6566);\n";cp.code()+="etiss_uint32 mem_val_0;\n";cp.code()+="cpu->exception |= (*(system->dread))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_0, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_translate_exc_code(cpu, system, plugin_pointers, cpu->exception);\n";cp.code()+="goto instr_exit_"+std::to_string(ic.current_address_)+";\n";cp.code()+="} // procedure\n";} cp.code()+="} // conditional\n";cp.code()+="etiss_int32 res1 = mem_val_0;\n";cp.code()+="etiss_coverage_count(3, 6575, 6574, 6573);\n";cp.code()+="etiss_coverage_count(1, 6576);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 6582, 6579, 6577, 6580, 6581);\n";cp.code()+="*((RV32IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = res1;\n";cp.code()+="etiss_coverage_count(5, 6589, 6587, 6586, 6584, 6588);\n";} cp.code()+="etiss_uint32 res2 = res1 ^ *((RV32IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL];\n";cp.code()+="etiss_coverage_count(6, 6598, 6597, 6591, 6596, 6595, 6593);\n";cp.code()+="etiss_uint32 mem_val_1;\n";cp.code()+="mem_val_1 = res2;\n";cp.code()+="etiss_coverage_count(4, 6603, 6601, 6600, 6602);\n";cp.code()+="cpu->exception |= (*(system->dwrite))(system->handle, cpu, offs, (etiss_uint8*)&mem_val_1, 4);\n";cp.code()+="if (cpu->exception) { // conditional\n";{ cp.code()+="{ // procedure\n";cp.code()+="RV32IMACFD_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("//AMOXORW\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<< "amoxorw"<< " # "<< 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
Definition: arm_cde.h:25
uint8_t etiss_uint8
Definition: types.h:87
Contains a small code snipped.
Definition: CodePart.h:386
@ APPENDEDRETURNINGREQUIRED
Definition: CodePart.h:402
std::string & code()
Definition: CodePart.h:416
RegisterSet & getAffectedRegisters()
Definition: CodePart.h:414
A set of CodeParts.
Definition: CodePart.h:437
void append(const CodePart &part, CodePart::TYPE type)
Definition: CodePart.h:450
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...
Definition: CodePart.h:222
Reading through it will only return bits within the range.
Definition: Instruction.h:208
I read(const BitArray &ba)
reads bits from the range to the return value starting at the lsb.
stores a bit vector
Definition: Instruction.h:161
this class contains parameters that persist in between instruction lookpus/translation within a trans...
Definition: Instruction.h:337
uint64_t current_address_
start address of current instruction
Definition: Instruction.h:366
holds information and translation callbacks for an instruction.
Definition: Instruction.h:393
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.
Definition: Benchmark.h:53