1 /* Simulator instruction semantics for thumb.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright (C) 2000-2009 Red Hat, Inc.
7 This file is part of the Red Hat simulators.
18 using namespace arm7f; // FIXME: namespace organization still wip
19 #define GET_ATTR(name) GET_ATTR_##name ()
22 // ********** x-invalid: --invalid--
25 thumb_sem_x_invalid (arm7f_cpu* current_cpu, thumb_scache* sem)
27 #define FLD(f) abuf->fields.fmt_empty.f
28 sem_status status = SEM_STATUS_NORMAL;
29 thumb_scache* abuf = sem;
30 PCADDR pc = abuf->addr;
34 current_cpu->invalid_insn (pc);
39 current_cpu->done_insn (npc, status);
44 // ********** lsl: lsl $rd,$rs,#$offset5
47 thumb_sem_lsl (arm7f_cpu* current_cpu, thumb_scache* sem)
49 #define FLD(f) abuf->fields.sfmt_lsl.f
50 sem_status status = SEM_STATUS_NORMAL;
51 thumb_scache* abuf = sem;
52 PCADDR pc = abuf->addr;
57 tmp_carry_out = current_cpu->compute_carry_out_immshift (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), SHIFT_TYPE_LSL, FLD (f_offset5), current_cpu->hardware.h_cbit);
59 SI opval = SLLSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), FLD (f_offset5));
60 if (UNLIKELY(current_cpu->trace_result_p))
61 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
62 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
67 BI opval = EQSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
68 if (UNLIKELY(current_cpu->trace_result_p))
69 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
70 current_cpu->hardware.h_zbit = opval;
73 BI opval = LTSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
74 if (UNLIKELY(current_cpu->trace_result_p))
75 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
76 current_cpu->hardware.h_nbit = opval;
80 BI opval = tmp_carry_out;
81 if (UNLIKELY(current_cpu->trace_result_p))
82 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
83 current_cpu->hardware.h_cbit = opval;
88 current_cpu->done_insn (npc, status);
93 // ********** lsr: lsr $rd,$rs,#$offset5
96 thumb_sem_lsr (arm7f_cpu* current_cpu, thumb_scache* sem)
98 #define FLD(f) abuf->fields.sfmt_lsl.f
99 sem_status status = SEM_STATUS_NORMAL;
100 thumb_scache* abuf = sem;
101 PCADDR pc = abuf->addr;
106 tmp_carry_out = current_cpu->compute_carry_out_immshift (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), SHIFT_TYPE_LSR, FLD (f_offset5), current_cpu->hardware.h_cbit);
108 SI opval = SRLSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), FLD (f_offset5));
109 if (UNLIKELY(current_cpu->trace_result_p))
110 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
111 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
116 BI opval = EQSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
117 if (UNLIKELY(current_cpu->trace_result_p))
118 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
119 current_cpu->hardware.h_zbit = opval;
122 BI opval = LTSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
123 if (UNLIKELY(current_cpu->trace_result_p))
124 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
125 current_cpu->hardware.h_nbit = opval;
129 BI opval = tmp_carry_out;
130 if (UNLIKELY(current_cpu->trace_result_p))
131 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
132 current_cpu->hardware.h_cbit = opval;
137 current_cpu->done_insn (npc, status);
142 // ********** asr: asr $rd,$rs,#$offset5
145 thumb_sem_asr (arm7f_cpu* current_cpu, thumb_scache* sem)
147 #define FLD(f) abuf->fields.sfmt_lsl.f
148 sem_status status = SEM_STATUS_NORMAL;
149 thumb_scache* abuf = sem;
150 PCADDR pc = abuf->addr;
155 tmp_carry_out = current_cpu->compute_carry_out_immshift (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), SHIFT_TYPE_ASR, FLD (f_offset5), current_cpu->hardware.h_cbit);
157 SI opval = SRASI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), FLD (f_offset5));
158 if (UNLIKELY(current_cpu->trace_result_p))
159 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
160 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
165 BI opval = EQSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
166 if (UNLIKELY(current_cpu->trace_result_p))
167 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
168 current_cpu->hardware.h_zbit = opval;
171 BI opval = LTSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
172 if (UNLIKELY(current_cpu->trace_result_p))
173 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
174 current_cpu->hardware.h_nbit = opval;
178 BI opval = tmp_carry_out;
179 if (UNLIKELY(current_cpu->trace_result_p))
180 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
181 current_cpu->hardware.h_cbit = opval;
186 current_cpu->done_insn (npc, status);
191 // ********** add: add $rd,$rs,$rn
194 thumb_sem_add (arm7f_cpu* current_cpu, thumb_scache* sem)
196 #define FLD(f) abuf->fields.sfmt_add.f
197 sem_status status = SEM_STATUS_NORMAL;
198 thumb_scache* abuf = sem;
199 PCADDR pc = abuf->addr;
205 tmp_result = ADDCSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), current_cpu->thumb_h_gr_t_get (FLD (f_rn)), 0);
208 BI opval = EQSI (tmp_result, 0);
209 if (UNLIKELY(current_cpu->trace_result_p))
210 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
211 current_cpu->hardware.h_zbit = opval;
214 BI opval = LTSI (tmp_result, 0);
215 if (UNLIKELY(current_cpu->trace_result_p))
216 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
217 current_cpu->hardware.h_nbit = opval;
221 BI opval = ADDCFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), current_cpu->thumb_h_gr_t_get (FLD (f_rn)), 0);
222 if (UNLIKELY(current_cpu->trace_result_p))
223 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
224 current_cpu->hardware.h_cbit = opval;
227 BI opval = ADDOFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), current_cpu->thumb_h_gr_t_get (FLD (f_rn)), 0);
228 if (UNLIKELY(current_cpu->trace_result_p))
229 current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << " ";
230 current_cpu->hardware.h_vbit = opval;
234 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), current_cpu->thumb_h_gr_t_get (FLD (f_rn)));
235 if (UNLIKELY(current_cpu->trace_result_p))
236 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
237 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
241 current_cpu->done_insn (npc, status);
246 // ********** addi: add $rd,$rs,#$offset3
249 thumb_sem_addi (arm7f_cpu* current_cpu, thumb_scache* sem)
251 #define FLD(f) abuf->fields.sfmt_addi.f
252 sem_status status = SEM_STATUS_NORMAL;
253 thumb_scache* abuf = sem;
254 PCADDR pc = abuf->addr;
260 tmp_result = ADDCSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), FLD (f_offset3), 0);
263 BI opval = EQSI (tmp_result, 0);
264 if (UNLIKELY(current_cpu->trace_result_p))
265 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
266 current_cpu->hardware.h_zbit = opval;
269 BI opval = LTSI (tmp_result, 0);
270 if (UNLIKELY(current_cpu->trace_result_p))
271 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
272 current_cpu->hardware.h_nbit = opval;
276 BI opval = ADDCFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), FLD (f_offset3), 0);
277 if (UNLIKELY(current_cpu->trace_result_p))
278 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
279 current_cpu->hardware.h_cbit = opval;
282 BI opval = ADDOFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), FLD (f_offset3), 0);
283 if (UNLIKELY(current_cpu->trace_result_p))
284 current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << " ";
285 current_cpu->hardware.h_vbit = opval;
289 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), FLD (f_offset3));
290 if (UNLIKELY(current_cpu->trace_result_p))
291 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
292 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
296 current_cpu->done_insn (npc, status);
301 // ********** sub: sub $rd,$rs,$rn
304 thumb_sem_sub (arm7f_cpu* current_cpu, thumb_scache* sem)
306 #define FLD(f) abuf->fields.sfmt_add.f
307 sem_status status = SEM_STATUS_NORMAL;
308 thumb_scache* abuf = sem;
309 PCADDR pc = abuf->addr;
315 tmp_result = SUBCSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), current_cpu->thumb_h_gr_t_get (FLD (f_rn)), 0);
318 BI opval = EQSI (tmp_result, 0);
319 if (UNLIKELY(current_cpu->trace_result_p))
320 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
321 current_cpu->hardware.h_zbit = opval;
324 BI opval = LTSI (tmp_result, 0);
325 if (UNLIKELY(current_cpu->trace_result_p))
326 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
327 current_cpu->hardware.h_nbit = opval;
331 BI opval = NOTBI (SUBCFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), current_cpu->thumb_h_gr_t_get (FLD (f_rn)), 0));
332 if (UNLIKELY(current_cpu->trace_result_p))
333 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
334 current_cpu->hardware.h_cbit = opval;
337 BI opval = SUBOFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), current_cpu->thumb_h_gr_t_get (FLD (f_rn)), 0);
338 if (UNLIKELY(current_cpu->trace_result_p))
339 current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << " ";
340 current_cpu->hardware.h_vbit = opval;
344 SI opval = SUBSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), current_cpu->thumb_h_gr_t_get (FLD (f_rn)));
345 if (UNLIKELY(current_cpu->trace_result_p))
346 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
347 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
351 current_cpu->done_insn (npc, status);
356 // ********** subi: sub $rd,$rs,#$offset3
359 thumb_sem_subi (arm7f_cpu* current_cpu, thumb_scache* sem)
361 #define FLD(f) abuf->fields.sfmt_addi.f
362 sem_status status = SEM_STATUS_NORMAL;
363 thumb_scache* abuf = sem;
364 PCADDR pc = abuf->addr;
370 tmp_result = SUBCSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), FLD (f_offset3), 0);
373 BI opval = EQSI (tmp_result, 0);
374 if (UNLIKELY(current_cpu->trace_result_p))
375 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
376 current_cpu->hardware.h_zbit = opval;
379 BI opval = LTSI (tmp_result, 0);
380 if (UNLIKELY(current_cpu->trace_result_p))
381 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
382 current_cpu->hardware.h_nbit = opval;
386 BI opval = NOTBI (SUBCFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), FLD (f_offset3), 0));
387 if (UNLIKELY(current_cpu->trace_result_p))
388 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
389 current_cpu->hardware.h_cbit = opval;
392 BI opval = SUBOFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), FLD (f_offset3), 0);
393 if (UNLIKELY(current_cpu->trace_result_p))
394 current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << " ";
395 current_cpu->hardware.h_vbit = opval;
399 SI opval = SUBSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), FLD (f_offset3));
400 if (UNLIKELY(current_cpu->trace_result_p))
401 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
402 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
406 current_cpu->done_insn (npc, status);
411 // ********** mov: mov ${bit10-rd},#$offset8
414 thumb_sem_mov (arm7f_cpu* current_cpu, thumb_scache* sem)
416 #define FLD(f) abuf->fields.sfmt_mov.f
417 sem_status status = SEM_STATUS_NORMAL;
418 thumb_scache* abuf = sem;
419 PCADDR pc = abuf->addr;
424 SI opval = FLD (f_offset8);
425 if (UNLIKELY(current_cpu->trace_result_p))
426 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rd) << ']' << ":=0x" << hex << opval << dec << " ";
427 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rd), opval);
431 BI opval = EQSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rd)), 0);
432 if (UNLIKELY(current_cpu->trace_result_p))
433 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
434 current_cpu->hardware.h_zbit = opval;
437 BI opval = LTSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rd)), 0);
438 if (UNLIKELY(current_cpu->trace_result_p))
439 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
440 current_cpu->hardware.h_nbit = opval;
445 current_cpu->done_insn (npc, status);
450 // ********** cmp: cmp ${bit10-rd},#$offset8
453 thumb_sem_cmp (arm7f_cpu* current_cpu, thumb_scache* sem)
455 #define FLD(f) abuf->fields.sfmt_mov.f
456 sem_status status = SEM_STATUS_NORMAL;
457 thumb_scache* abuf = sem;
458 PCADDR pc = abuf->addr;
463 tmp_result = SUBCSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rd)), FLD (f_offset8), 0);
466 BI opval = EQSI (tmp_result, 0);
467 if (UNLIKELY(current_cpu->trace_result_p))
468 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
469 current_cpu->hardware.h_zbit = opval;
472 BI opval = LTSI (tmp_result, 0);
473 if (UNLIKELY(current_cpu->trace_result_p))
474 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
475 current_cpu->hardware.h_nbit = opval;
479 BI opval = NOTBI (SUBCFSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rd)), FLD (f_offset8), 0));
480 if (UNLIKELY(current_cpu->trace_result_p))
481 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
482 current_cpu->hardware.h_cbit = opval;
485 BI opval = SUBOFSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rd)), FLD (f_offset8), 0);
486 if (UNLIKELY(current_cpu->trace_result_p))
487 current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << " ";
488 current_cpu->hardware.h_vbit = opval;
492 current_cpu->done_insn (npc, status);
497 // ********** addi8: add ${bit10-rd},#$offset8
500 thumb_sem_addi8 (arm7f_cpu* current_cpu, thumb_scache* sem)
502 #define FLD(f) abuf->fields.sfmt_mov.f
503 sem_status status = SEM_STATUS_NORMAL;
504 thumb_scache* abuf = sem;
505 PCADDR pc = abuf->addr;
511 tmp_result = ADDCSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rd)), FLD (f_offset8), 0);
514 BI opval = EQSI (tmp_result, 0);
515 if (UNLIKELY(current_cpu->trace_result_p))
516 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
517 current_cpu->hardware.h_zbit = opval;
520 BI opval = LTSI (tmp_result, 0);
521 if (UNLIKELY(current_cpu->trace_result_p))
522 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
523 current_cpu->hardware.h_nbit = opval;
527 BI opval = ADDCFSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rd)), FLD (f_offset8), 0);
528 if (UNLIKELY(current_cpu->trace_result_p))
529 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
530 current_cpu->hardware.h_cbit = opval;
533 BI opval = ADDOFSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rd)), FLD (f_offset8), 0);
534 if (UNLIKELY(current_cpu->trace_result_p))
535 current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << " ";
536 current_cpu->hardware.h_vbit = opval;
540 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rd)), FLD (f_offset8));
541 if (UNLIKELY(current_cpu->trace_result_p))
542 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rd) << ']' << ":=0x" << hex << opval << dec << " ";
543 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rd), opval);
547 current_cpu->done_insn (npc, status);
552 // ********** subi8: sub ${bit10-rd},#$offset8
555 thumb_sem_subi8 (arm7f_cpu* current_cpu, thumb_scache* sem)
557 #define FLD(f) abuf->fields.sfmt_mov.f
558 sem_status status = SEM_STATUS_NORMAL;
559 thumb_scache* abuf = sem;
560 PCADDR pc = abuf->addr;
566 tmp_result = SUBCSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rd)), FLD (f_offset8), 0);
569 BI opval = EQSI (tmp_result, 0);
570 if (UNLIKELY(current_cpu->trace_result_p))
571 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
572 current_cpu->hardware.h_zbit = opval;
575 BI opval = LTSI (tmp_result, 0);
576 if (UNLIKELY(current_cpu->trace_result_p))
577 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
578 current_cpu->hardware.h_nbit = opval;
582 BI opval = NOTBI (SUBCFSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rd)), FLD (f_offset8), 0));
583 if (UNLIKELY(current_cpu->trace_result_p))
584 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
585 current_cpu->hardware.h_cbit = opval;
588 BI opval = SUBOFSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rd)), FLD (f_offset8), 0);
589 if (UNLIKELY(current_cpu->trace_result_p))
590 current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << " ";
591 current_cpu->hardware.h_vbit = opval;
595 SI opval = SUBSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rd)), FLD (f_offset8));
596 if (UNLIKELY(current_cpu->trace_result_p))
597 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rd) << ']' << ":=0x" << hex << opval << dec << " ";
598 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rd), opval);
602 current_cpu->done_insn (npc, status);
607 // ********** alu-and: and $rd,$rs
610 thumb_sem_alu_and (arm7f_cpu* current_cpu, thumb_scache* sem)
612 #define FLD(f) abuf->fields.sfmt_addi.f
613 sem_status status = SEM_STATUS_NORMAL;
614 thumb_scache* abuf = sem;
615 PCADDR pc = abuf->addr;
620 SI opval = ANDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)));
621 if (UNLIKELY(current_cpu->trace_result_p))
622 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
623 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
627 BI opval = EQSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
628 if (UNLIKELY(current_cpu->trace_result_p))
629 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
630 current_cpu->hardware.h_zbit = opval;
633 BI opval = LTSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
634 if (UNLIKELY(current_cpu->trace_result_p))
635 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
636 current_cpu->hardware.h_nbit = opval;
641 current_cpu->done_insn (npc, status);
646 // ********** alu-eor: eor $rd,$rs
649 thumb_sem_alu_eor (arm7f_cpu* current_cpu, thumb_scache* sem)
651 #define FLD(f) abuf->fields.sfmt_addi.f
652 sem_status status = SEM_STATUS_NORMAL;
653 thumb_scache* abuf = sem;
654 PCADDR pc = abuf->addr;
659 SI opval = XORSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)));
660 if (UNLIKELY(current_cpu->trace_result_p))
661 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
662 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
666 BI opval = EQSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
667 if (UNLIKELY(current_cpu->trace_result_p))
668 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
669 current_cpu->hardware.h_zbit = opval;
672 BI opval = LTSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
673 if (UNLIKELY(current_cpu->trace_result_p))
674 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
675 current_cpu->hardware.h_nbit = opval;
680 current_cpu->done_insn (npc, status);
685 // ********** alu-lsl: lsl $rd,$rs
688 thumb_sem_alu_lsl (arm7f_cpu* current_cpu, thumb_scache* sem)
690 #define FLD(f) abuf->fields.sfmt_addi.f
691 sem_status status = SEM_STATUS_NORMAL;
692 thumb_scache* abuf = sem;
693 PCADDR pc = abuf->addr;
699 tmp_carry_out = current_cpu->compute_carry_out_regshift (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), SHIFT_TYPE_LSL, current_cpu->thumb_h_gr_t_get (FLD (f_rs)), current_cpu->hardware.h_cbit);
700 tmp_result = SLLSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)));
702 SI opval = tmp_result;
703 if (UNLIKELY(current_cpu->trace_result_p))
704 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
705 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
710 BI opval = EQSI (tmp_result, 0);
711 if (UNLIKELY(current_cpu->trace_result_p))
712 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
713 current_cpu->hardware.h_zbit = opval;
716 BI opval = LTSI (tmp_result, 0);
717 if (UNLIKELY(current_cpu->trace_result_p))
718 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
719 current_cpu->hardware.h_nbit = opval;
723 BI opval = tmp_carry_out;
724 if (UNLIKELY(current_cpu->trace_result_p))
725 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
726 current_cpu->hardware.h_cbit = opval;
731 current_cpu->done_insn (npc, status);
736 // ********** alu-lsr: lsr $rd,$rs
739 thumb_sem_alu_lsr (arm7f_cpu* current_cpu, thumb_scache* sem)
741 #define FLD(f) abuf->fields.sfmt_addi.f
742 sem_status status = SEM_STATUS_NORMAL;
743 thumb_scache* abuf = sem;
744 PCADDR pc = abuf->addr;
750 tmp_carry_out = current_cpu->compute_carry_out_regshift (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), SHIFT_TYPE_LSR, current_cpu->thumb_h_gr_t_get (FLD (f_rs)), current_cpu->hardware.h_cbit);
751 tmp_result = SRLSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)));
753 SI opval = tmp_result;
754 if (UNLIKELY(current_cpu->trace_result_p))
755 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
756 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
761 BI opval = EQSI (tmp_result, 0);
762 if (UNLIKELY(current_cpu->trace_result_p))
763 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
764 current_cpu->hardware.h_zbit = opval;
767 BI opval = LTSI (tmp_result, 0);
768 if (UNLIKELY(current_cpu->trace_result_p))
769 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
770 current_cpu->hardware.h_nbit = opval;
774 BI opval = tmp_carry_out;
775 if (UNLIKELY(current_cpu->trace_result_p))
776 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
777 current_cpu->hardware.h_cbit = opval;
782 current_cpu->done_insn (npc, status);
787 // ********** alu-asr: asr $rd,$rs
790 thumb_sem_alu_asr (arm7f_cpu* current_cpu, thumb_scache* sem)
792 #define FLD(f) abuf->fields.sfmt_addi.f
793 sem_status status = SEM_STATUS_NORMAL;
794 thumb_scache* abuf = sem;
795 PCADDR pc = abuf->addr;
801 tmp_carry_out = current_cpu->compute_carry_out_regshift (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), SHIFT_TYPE_ASR, current_cpu->thumb_h_gr_t_get (FLD (f_rs)), current_cpu->hardware.h_cbit);
802 tmp_result = SRASI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)));
804 SI opval = tmp_result;
805 if (UNLIKELY(current_cpu->trace_result_p))
806 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
807 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
812 BI opval = EQSI (tmp_result, 0);
813 if (UNLIKELY(current_cpu->trace_result_p))
814 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
815 current_cpu->hardware.h_zbit = opval;
818 BI opval = LTSI (tmp_result, 0);
819 if (UNLIKELY(current_cpu->trace_result_p))
820 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
821 current_cpu->hardware.h_nbit = opval;
825 BI opval = tmp_carry_out;
826 if (UNLIKELY(current_cpu->trace_result_p))
827 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
828 current_cpu->hardware.h_cbit = opval;
833 current_cpu->done_insn (npc, status);
838 // ********** alu-ror: ror $rd,$rs
841 thumb_sem_alu_ror (arm7f_cpu* current_cpu, thumb_scache* sem)
843 #define FLD(f) abuf->fields.sfmt_addi.f
844 sem_status status = SEM_STATUS_NORMAL;
845 thumb_scache* abuf = sem;
846 PCADDR pc = abuf->addr;
852 tmp_carry_out = current_cpu->compute_carry_out_regshift (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), SHIFT_TYPE_ROR, current_cpu->thumb_h_gr_t_get (FLD (f_rs)), current_cpu->hardware.h_cbit);
853 tmp_result = RORSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)));
855 SI opval = tmp_result;
856 if (UNLIKELY(current_cpu->trace_result_p))
857 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
858 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
863 BI opval = EQSI (tmp_result, 0);
864 if (UNLIKELY(current_cpu->trace_result_p))
865 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
866 current_cpu->hardware.h_zbit = opval;
869 BI opval = LTSI (tmp_result, 0);
870 if (UNLIKELY(current_cpu->trace_result_p))
871 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
872 current_cpu->hardware.h_nbit = opval;
876 BI opval = tmp_carry_out;
877 if (UNLIKELY(current_cpu->trace_result_p))
878 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
879 current_cpu->hardware.h_cbit = opval;
884 current_cpu->done_insn (npc, status);
889 // ********** alu-adc: adc $rd,$rs
892 thumb_sem_alu_adc (arm7f_cpu* current_cpu, thumb_scache* sem)
894 #define FLD(f) abuf->fields.sfmt_addi.f
895 sem_status status = SEM_STATUS_NORMAL;
896 thumb_scache* abuf = sem;
897 PCADDR pc = abuf->addr;
902 tmp_result = ADDCSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), current_cpu->hardware.h_cbit);
905 tmp_result = ADDCSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), current_cpu->hardware.h_cbit);
908 BI opval = EQSI (tmp_result, 0);
909 if (UNLIKELY(current_cpu->trace_result_p))
910 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
911 current_cpu->hardware.h_zbit = opval;
914 BI opval = LTSI (tmp_result, 0);
915 if (UNLIKELY(current_cpu->trace_result_p))
916 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
917 current_cpu->hardware.h_nbit = opval;
921 BI opval = ADDCFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), current_cpu->hardware.h_cbit);
922 if (UNLIKELY(current_cpu->trace_result_p))
923 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
924 current_cpu->hardware.h_cbit = opval;
927 BI opval = ADDOFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), current_cpu->hardware.h_cbit);
928 if (UNLIKELY(current_cpu->trace_result_p))
929 current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << " ";
930 current_cpu->hardware.h_vbit = opval;
934 SI opval = tmp_result;
935 if (UNLIKELY(current_cpu->trace_result_p))
936 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
937 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
941 current_cpu->done_insn (npc, status);
946 // ********** alu-sbc: sbc $rd,$rs
949 thumb_sem_alu_sbc (arm7f_cpu* current_cpu, thumb_scache* sem)
951 #define FLD(f) abuf->fields.sfmt_addi.f
952 sem_status status = SEM_STATUS_NORMAL;
953 thumb_scache* abuf = sem;
954 PCADDR pc = abuf->addr;
959 tmp_result = SUBCSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), NOTBI (current_cpu->hardware.h_cbit));
962 tmp_result = SUBCSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), NOTBI (current_cpu->hardware.h_cbit));
965 BI opval = EQSI (tmp_result, 0);
966 if (UNLIKELY(current_cpu->trace_result_p))
967 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
968 current_cpu->hardware.h_zbit = opval;
971 BI opval = LTSI (tmp_result, 0);
972 if (UNLIKELY(current_cpu->trace_result_p))
973 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
974 current_cpu->hardware.h_nbit = opval;
978 BI opval = NOTBI (SUBCFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), NOTBI (current_cpu->hardware.h_cbit)));
979 if (UNLIKELY(current_cpu->trace_result_p))
980 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
981 current_cpu->hardware.h_cbit = opval;
984 BI opval = SUBOFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), NOTBI (current_cpu->hardware.h_cbit));
985 if (UNLIKELY(current_cpu->trace_result_p))
986 current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << " ";
987 current_cpu->hardware.h_vbit = opval;
991 SI opval = tmp_result;
992 if (UNLIKELY(current_cpu->trace_result_p))
993 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
994 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
998 current_cpu->done_insn (npc, status);
1003 // ********** alu-tst: tst $rd,$rs
1006 thumb_sem_alu_tst (arm7f_cpu* current_cpu, thumb_scache* sem)
1008 #define FLD(f) abuf->fields.sfmt_addi.f
1009 sem_status status = SEM_STATUS_NORMAL;
1010 thumb_scache* abuf = sem;
1011 PCADDR pc = abuf->addr;
1012 PCADDR npc = pc + 2;
1016 tmp_x = ANDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)));
1019 BI opval = EQSI (tmp_x, 0);
1020 if (UNLIKELY(current_cpu->trace_result_p))
1021 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
1022 current_cpu->hardware.h_zbit = opval;
1025 BI opval = LTSI (tmp_x, 0);
1026 if (UNLIKELY(current_cpu->trace_result_p))
1027 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
1028 current_cpu->hardware.h_nbit = opval;
1033 current_cpu->done_insn (npc, status);
1038 // ********** alu-neg: neg $rd,$rs
1041 thumb_sem_alu_neg (arm7f_cpu* current_cpu, thumb_scache* sem)
1043 #define FLD(f) abuf->fields.sfmt_addi.f
1044 sem_status status = SEM_STATUS_NORMAL;
1045 thumb_scache* abuf = sem;
1046 PCADDR pc = abuf->addr;
1047 PCADDR npc = pc + 2;
1051 tmp_result = NEGSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)));
1054 tmp_result = SUBCSI (0, current_cpu->thumb_h_gr_t_get (FLD (f_rs)), 0);
1057 BI opval = EQSI (tmp_result, 0);
1058 if (UNLIKELY(current_cpu->trace_result_p))
1059 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
1060 current_cpu->hardware.h_zbit = opval;
1063 BI opval = LTSI (tmp_result, 0);
1064 if (UNLIKELY(current_cpu->trace_result_p))
1065 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
1066 current_cpu->hardware.h_nbit = opval;
1070 BI opval = NOTBI (SUBCFSI (0, current_cpu->thumb_h_gr_t_get (FLD (f_rs)), 0));
1071 if (UNLIKELY(current_cpu->trace_result_p))
1072 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
1073 current_cpu->hardware.h_cbit = opval;
1076 BI opval = SUBOFSI (0, current_cpu->thumb_h_gr_t_get (FLD (f_rs)), 0);
1077 if (UNLIKELY(current_cpu->trace_result_p))
1078 current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << " ";
1079 current_cpu->hardware.h_vbit = opval;
1083 SI opval = tmp_result;
1084 if (UNLIKELY(current_cpu->trace_result_p))
1085 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1086 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
1090 current_cpu->done_insn (npc, status);
1095 // ********** alu-cmp: cmp $rd,$rs
1098 thumb_sem_alu_cmp (arm7f_cpu* current_cpu, thumb_scache* sem)
1100 #define FLD(f) abuf->fields.sfmt_addi.f
1101 sem_status status = SEM_STATUS_NORMAL;
1102 thumb_scache* abuf = sem;
1103 PCADDR pc = abuf->addr;
1104 PCADDR npc = pc + 2;
1108 tmp_result = SUBCSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), 0);
1111 BI opval = EQSI (tmp_result, 0);
1112 if (UNLIKELY(current_cpu->trace_result_p))
1113 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
1114 current_cpu->hardware.h_zbit = opval;
1117 BI opval = LTSI (tmp_result, 0);
1118 if (UNLIKELY(current_cpu->trace_result_p))
1119 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
1120 current_cpu->hardware.h_nbit = opval;
1124 BI opval = NOTBI (SUBCFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), 0));
1125 if (UNLIKELY(current_cpu->trace_result_p))
1126 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
1127 current_cpu->hardware.h_cbit = opval;
1130 BI opval = SUBOFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), 0);
1131 if (UNLIKELY(current_cpu->trace_result_p))
1132 current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << " ";
1133 current_cpu->hardware.h_vbit = opval;
1137 current_cpu->done_insn (npc, status);
1142 // ********** alu-cmn: cmn $rd,$rs
1145 thumb_sem_alu_cmn (arm7f_cpu* current_cpu, thumb_scache* sem)
1147 #define FLD(f) abuf->fields.sfmt_addi.f
1148 sem_status status = SEM_STATUS_NORMAL;
1149 thumb_scache* abuf = sem;
1150 PCADDR pc = abuf->addr;
1151 PCADDR npc = pc + 2;
1155 tmp_result = ADDCSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), 0);
1158 BI opval = EQSI (tmp_result, 0);
1159 if (UNLIKELY(current_cpu->trace_result_p))
1160 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
1161 current_cpu->hardware.h_zbit = opval;
1164 BI opval = LTSI (tmp_result, 0);
1165 if (UNLIKELY(current_cpu->trace_result_p))
1166 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
1167 current_cpu->hardware.h_nbit = opval;
1171 BI opval = ADDCFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), 0);
1172 if (UNLIKELY(current_cpu->trace_result_p))
1173 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
1174 current_cpu->hardware.h_cbit = opval;
1177 BI opval = ADDOFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), 0);
1178 if (UNLIKELY(current_cpu->trace_result_p))
1179 current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << " ";
1180 current_cpu->hardware.h_vbit = opval;
1184 current_cpu->done_insn (npc, status);
1189 // ********** alu-orr: orr $rd,$rs
1192 thumb_sem_alu_orr (arm7f_cpu* current_cpu, thumb_scache* sem)
1194 #define FLD(f) abuf->fields.sfmt_addi.f
1195 sem_status status = SEM_STATUS_NORMAL;
1196 thumb_scache* abuf = sem;
1197 PCADDR pc = abuf->addr;
1198 PCADDR npc = pc + 2;
1202 SI opval = ORSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)));
1203 if (UNLIKELY(current_cpu->trace_result_p))
1204 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1205 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
1209 BI opval = EQSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
1210 if (UNLIKELY(current_cpu->trace_result_p))
1211 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
1212 current_cpu->hardware.h_zbit = opval;
1215 BI opval = LTSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
1216 if (UNLIKELY(current_cpu->trace_result_p))
1217 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
1218 current_cpu->hardware.h_nbit = opval;
1223 current_cpu->done_insn (npc, status);
1228 // ********** alu-mul: mul $rd,$rs
1231 thumb_sem_alu_mul (arm7f_cpu* current_cpu, thumb_scache* sem)
1233 #define FLD(f) abuf->fields.sfmt_addi.f
1234 sem_status status = SEM_STATUS_NORMAL;
1235 thumb_scache* abuf = sem;
1236 PCADDR pc = abuf->addr;
1237 PCADDR npc = pc + 2;
1241 SI opval = MULSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)));
1242 if (UNLIKELY(current_cpu->trace_result_p))
1243 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1244 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
1248 BI opval = EQSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
1249 if (UNLIKELY(current_cpu->trace_result_p))
1250 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
1251 current_cpu->hardware.h_zbit = opval;
1254 BI opval = LTSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
1255 if (UNLIKELY(current_cpu->trace_result_p))
1256 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
1257 current_cpu->hardware.h_nbit = opval;
1262 current_cpu->done_insn (npc, status);
1267 // ********** alu-bic: bic $rd,$rs
1270 thumb_sem_alu_bic (arm7f_cpu* current_cpu, thumb_scache* sem)
1272 #define FLD(f) abuf->fields.sfmt_addi.f
1273 sem_status status = SEM_STATUS_NORMAL;
1274 thumb_scache* abuf = sem;
1275 PCADDR pc = abuf->addr;
1276 PCADDR npc = pc + 2;
1280 SI opval = ANDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), INVSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs))));
1281 if (UNLIKELY(current_cpu->trace_result_p))
1282 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1283 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
1287 BI opval = EQSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
1288 if (UNLIKELY(current_cpu->trace_result_p))
1289 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
1290 current_cpu->hardware.h_zbit = opval;
1293 BI opval = LTSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
1294 if (UNLIKELY(current_cpu->trace_result_p))
1295 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
1296 current_cpu->hardware.h_nbit = opval;
1301 current_cpu->done_insn (npc, status);
1306 // ********** alu-mvn: mvn $rd,$rs
1309 thumb_sem_alu_mvn (arm7f_cpu* current_cpu, thumb_scache* sem)
1311 #define FLD(f) abuf->fields.sfmt_addi.f
1312 sem_status status = SEM_STATUS_NORMAL;
1313 thumb_scache* abuf = sem;
1314 PCADDR pc = abuf->addr;
1315 PCADDR npc = pc + 2;
1319 SI opval = INVSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)));
1320 if (UNLIKELY(current_cpu->trace_result_p))
1321 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1322 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
1326 BI opval = EQSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
1327 if (UNLIKELY(current_cpu->trace_result_p))
1328 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
1329 current_cpu->hardware.h_zbit = opval;
1332 BI opval = LTSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), 0);
1333 if (UNLIKELY(current_cpu->trace_result_p))
1334 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
1335 current_cpu->hardware.h_nbit = opval;
1340 current_cpu->done_insn (npc, status);
1345 // ********** add-rd-hs: add $rd,$hs
1348 thumb_sem_add_rd_hs (arm7f_cpu* current_cpu, thumb_scache* sem)
1350 #define FLD(f) abuf->fields.sfmt_addi.f
1351 sem_status status = SEM_STATUS_NORMAL;
1352 thumb_scache* abuf = sem;
1353 PCADDR pc = abuf->addr;
1354 PCADDR npc = pc + 2;
1357 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_hiregs_get (FLD (f_rs)));
1358 if (UNLIKELY(current_cpu->trace_result_p))
1359 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1360 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
1363 current_cpu->done_insn (npc, status);
1368 // ********** add-hd-rs: add $hd,$rs
1371 thumb_sem_add_hd_rs (arm7f_cpu* current_cpu, thumb_scache* sem)
1373 #define FLD(f) abuf->fields.sfmt_addi.f
1374 sem_status status = SEM_STATUS_NORMAL;
1375 thumb_scache* abuf = sem;
1376 PCADDR pc = abuf->addr;
1377 PCADDR npc = pc + 2;
1379 if (EQSI (FLD (f_rd), 7)) {
1381 USI opval = ADDSI (current_cpu->thumb_h_hiregs_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)));
1382 if (UNLIKELY(current_cpu->trace_result_p))
1383 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
1384 current_cpu->branch (opval, npc, status);
1388 SI opval = ADDSI (current_cpu->thumb_h_hiregs_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)));
1389 if (UNLIKELY(current_cpu->trace_result_p))
1390 current_cpu->trace_stream << "hiregs" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1391 current_cpu->thumb_h_hiregs_set (FLD (f_rd), opval);
1395 current_cpu->done_cti_insn (npc, status);
1400 // ********** add-hd-hs: add $hd,$hs
1403 thumb_sem_add_hd_hs (arm7f_cpu* current_cpu, thumb_scache* sem)
1405 #define FLD(f) abuf->fields.sfmt_addi.f
1406 sem_status status = SEM_STATUS_NORMAL;
1407 thumb_scache* abuf = sem;
1408 PCADDR pc = abuf->addr;
1409 PCADDR npc = pc + 2;
1411 if (EQSI (FLD (f_rd), 7)) {
1413 USI opval = ADDSI (current_cpu->thumb_h_hiregs_get (FLD (f_rd)), current_cpu->thumb_h_hiregs_get (FLD (f_rs)));
1414 if (UNLIKELY(current_cpu->trace_result_p))
1415 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
1416 current_cpu->branch (opval, npc, status);
1420 SI opval = ADDSI (current_cpu->thumb_h_hiregs_get (FLD (f_rd)), current_cpu->thumb_h_hiregs_get (FLD (f_rs)));
1421 if (UNLIKELY(current_cpu->trace_result_p))
1422 current_cpu->trace_stream << "hiregs" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1423 current_cpu->thumb_h_hiregs_set (FLD (f_rd), opval);
1427 current_cpu->done_cti_insn (npc, status);
1432 // ********** cmp-rd-hs: cmp $rd,$hs
1435 thumb_sem_cmp_rd_hs (arm7f_cpu* current_cpu, thumb_scache* sem)
1437 #define FLD(f) abuf->fields.sfmt_addi.f
1438 sem_status status = SEM_STATUS_NORMAL;
1439 thumb_scache* abuf = sem;
1440 PCADDR pc = abuf->addr;
1441 PCADDR npc = pc + 2;
1445 tmp_result = SUBCSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_hiregs_get (FLD (f_rs)), 0);
1448 BI opval = EQSI (tmp_result, 0);
1449 if (UNLIKELY(current_cpu->trace_result_p))
1450 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
1451 current_cpu->hardware.h_zbit = opval;
1454 BI opval = LTSI (tmp_result, 0);
1455 if (UNLIKELY(current_cpu->trace_result_p))
1456 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
1457 current_cpu->hardware.h_nbit = opval;
1461 BI opval = NOTBI (SUBCFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_hiregs_get (FLD (f_rs)), 0));
1462 if (UNLIKELY(current_cpu->trace_result_p))
1463 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
1464 current_cpu->hardware.h_cbit = opval;
1467 BI opval = SUBOFSI (current_cpu->thumb_h_gr_t_get (FLD (f_rd)), current_cpu->thumb_h_hiregs_get (FLD (f_rs)), 0);
1468 if (UNLIKELY(current_cpu->trace_result_p))
1469 current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << " ";
1470 current_cpu->hardware.h_vbit = opval;
1474 current_cpu->done_insn (npc, status);
1479 // ********** cmp-hd-rs: cmp $hd,$rs
1482 thumb_sem_cmp_hd_rs (arm7f_cpu* current_cpu, thumb_scache* sem)
1484 #define FLD(f) abuf->fields.sfmt_addi.f
1485 sem_status status = SEM_STATUS_NORMAL;
1486 thumb_scache* abuf = sem;
1487 PCADDR pc = abuf->addr;
1488 PCADDR npc = pc + 2;
1492 tmp_result = SUBCSI (current_cpu->thumb_h_hiregs_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), 0);
1495 BI opval = EQSI (tmp_result, 0);
1496 if (UNLIKELY(current_cpu->trace_result_p))
1497 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
1498 current_cpu->hardware.h_zbit = opval;
1501 BI opval = LTSI (tmp_result, 0);
1502 if (UNLIKELY(current_cpu->trace_result_p))
1503 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
1504 current_cpu->hardware.h_nbit = opval;
1508 BI opval = NOTBI (SUBCFSI (current_cpu->thumb_h_hiregs_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), 0));
1509 if (UNLIKELY(current_cpu->trace_result_p))
1510 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
1511 current_cpu->hardware.h_cbit = opval;
1514 BI opval = SUBOFSI (current_cpu->thumb_h_hiregs_get (FLD (f_rd)), current_cpu->thumb_h_gr_t_get (FLD (f_rs)), 0);
1515 if (UNLIKELY(current_cpu->trace_result_p))
1516 current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << " ";
1517 current_cpu->hardware.h_vbit = opval;
1521 current_cpu->done_insn (npc, status);
1526 // ********** cmp-hd-hs: cmp $hd,$hs
1529 thumb_sem_cmp_hd_hs (arm7f_cpu* current_cpu, thumb_scache* sem)
1531 #define FLD(f) abuf->fields.sfmt_addi.f
1532 sem_status status = SEM_STATUS_NORMAL;
1533 thumb_scache* abuf = sem;
1534 PCADDR pc = abuf->addr;
1535 PCADDR npc = pc + 2;
1539 tmp_result = SUBCSI (current_cpu->thumb_h_hiregs_get (FLD (f_rd)), current_cpu->thumb_h_hiregs_get (FLD (f_rs)), 0);
1542 BI opval = EQSI (tmp_result, 0);
1543 if (UNLIKELY(current_cpu->trace_result_p))
1544 current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << " ";
1545 current_cpu->hardware.h_zbit = opval;
1548 BI opval = LTSI (tmp_result, 0);
1549 if (UNLIKELY(current_cpu->trace_result_p))
1550 current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << " ";
1551 current_cpu->hardware.h_nbit = opval;
1555 BI opval = NOTBI (SUBCFSI (current_cpu->thumb_h_hiregs_get (FLD (f_rd)), current_cpu->thumb_h_hiregs_get (FLD (f_rs)), 0));
1556 if (UNLIKELY(current_cpu->trace_result_p))
1557 current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << " ";
1558 current_cpu->hardware.h_cbit = opval;
1561 BI opval = SUBOFSI (current_cpu->thumb_h_hiregs_get (FLD (f_rd)), current_cpu->thumb_h_hiregs_get (FLD (f_rs)), 0);
1562 if (UNLIKELY(current_cpu->trace_result_p))
1563 current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << " ";
1564 current_cpu->hardware.h_vbit = opval;
1568 current_cpu->done_insn (npc, status);
1573 // ********** mov-rd-hs: mov $rd,$hs
1576 thumb_sem_mov_rd_hs (arm7f_cpu* current_cpu, thumb_scache* sem)
1578 #define FLD(f) abuf->fields.sfmt_addi.f
1579 sem_status status = SEM_STATUS_NORMAL;
1580 thumb_scache* abuf = sem;
1581 PCADDR pc = abuf->addr;
1582 PCADDR npc = pc + 2;
1585 SI opval = current_cpu->thumb_h_hiregs_get (FLD (f_rs));
1586 if (UNLIKELY(current_cpu->trace_result_p))
1587 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1588 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
1591 current_cpu->done_insn (npc, status);
1596 // ********** mov-hd-rs: mov $hd,$rs
1599 thumb_sem_mov_hd_rs (arm7f_cpu* current_cpu, thumb_scache* sem)
1601 #define FLD(f) abuf->fields.sfmt_addi.f
1602 sem_status status = SEM_STATUS_NORMAL;
1603 thumb_scache* abuf = sem;
1604 PCADDR pc = abuf->addr;
1605 PCADDR npc = pc + 2;
1607 if (EQSI (FLD (f_rd), 7)) {
1609 USI opval = current_cpu->thumb_h_gr_t_get (FLD (f_rs));
1610 if (UNLIKELY(current_cpu->trace_result_p))
1611 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
1612 current_cpu->branch (opval, npc, status);
1616 SI opval = current_cpu->thumb_h_gr_t_get (FLD (f_rs));
1617 if (UNLIKELY(current_cpu->trace_result_p))
1618 current_cpu->trace_stream << "hiregs" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1619 current_cpu->thumb_h_hiregs_set (FLD (f_rd), opval);
1623 current_cpu->done_cti_insn (npc, status);
1628 // ********** mov-hd-hs: mov $hd,$hs
1631 thumb_sem_mov_hd_hs (arm7f_cpu* current_cpu, thumb_scache* sem)
1633 #define FLD(f) abuf->fields.sfmt_addi.f
1634 sem_status status = SEM_STATUS_NORMAL;
1635 thumb_scache* abuf = sem;
1636 PCADDR pc = abuf->addr;
1637 PCADDR npc = pc + 2;
1639 if (EQSI (FLD (f_rd), 7)) {
1641 USI opval = current_cpu->thumb_h_hiregs_get (FLD (f_rs));
1642 if (UNLIKELY(current_cpu->trace_result_p))
1643 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
1644 current_cpu->branch (opval, npc, status);
1648 SI opval = current_cpu->thumb_h_hiregs_get (FLD (f_rs));
1649 if (UNLIKELY(current_cpu->trace_result_p))
1650 current_cpu->trace_stream << "hiregs" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1651 current_cpu->thumb_h_hiregs_set (FLD (f_rd), opval);
1655 current_cpu->done_cti_insn (npc, status);
1660 // ********** bx-rs: bx $rs
1663 thumb_sem_bx_rs (arm7f_cpu* current_cpu, thumb_scache* sem)
1665 #define FLD(f) abuf->fields.sfmt_addi.f
1666 sem_status status = SEM_STATUS_NORMAL;
1667 thumb_scache* abuf = sem;
1668 PCADDR pc = abuf->addr;
1669 PCADDR npc = pc + 2;
1673 USI opval = current_cpu->thumb_h_gr_t_get (FLD (f_rs));
1674 if (UNLIKELY(current_cpu->trace_result_p))
1675 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
1676 current_cpu->branch (opval, npc, status);
1678 if (NOTSI (ANDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rs)), 1))) {
1681 if (UNLIKELY(current_cpu->trace_result_p))
1682 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
1683 current_cpu->h_tbit_set (opval);
1688 current_cpu->done_cti_insn (npc, status);
1693 // ********** bx-hs: bx $hs
1696 thumb_sem_bx_hs (arm7f_cpu* current_cpu, thumb_scache* sem)
1698 #define FLD(f) abuf->fields.sfmt_addi.f
1699 sem_status status = SEM_STATUS_NORMAL;
1700 thumb_scache* abuf = sem;
1701 PCADDR pc = abuf->addr;
1702 PCADDR npc = pc + 2;
1706 USI opval = current_cpu->thumb_h_hiregs_get (FLD (f_rs));
1707 if (UNLIKELY(current_cpu->trace_result_p))
1708 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
1709 current_cpu->branch (opval, npc, status);
1711 if (NOTSI (ANDSI (current_cpu->thumb_h_hiregs_get (FLD (f_rs)), 1))) {
1714 if (UNLIKELY(current_cpu->trace_result_p))
1715 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
1716 current_cpu->h_tbit_set (opval);
1721 current_cpu->done_cti_insn (npc, status);
1726 // ********** ldr-pc: ldr ${bit10-rd},[pc,#$word8]
1729 thumb_sem_ldr_pc (arm7f_cpu* current_cpu, thumb_scache* sem)
1731 #define FLD(f) abuf->fields.sfmt_ldr_pc.f
1732 sem_status status = SEM_STATUS_NORMAL;
1733 thumb_scache* abuf = sem;
1734 PCADDR pc = abuf->addr;
1735 PCADDR npc = pc + 2;
1738 SI opval = current_cpu->GETMEMSI (pc, ADDSI (ANDSI (ADDSI (pc, 4), -4), FLD (f_word8)));
1739 if (UNLIKELY(current_cpu->trace_result_p))
1740 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1741 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rd), opval);
1744 current_cpu->done_insn (npc, status);
1749 // ********** str: str $rd,[$rb,$ro]
1752 thumb_sem_str (arm7f_cpu* current_cpu, thumb_scache* sem)
1754 #define FLD(f) abuf->fields.sfmt_str.f
1755 sem_status status = SEM_STATUS_NORMAL;
1756 thumb_scache* abuf = sem;
1757 PCADDR pc = abuf->addr;
1758 PCADDR npc = pc + 2;
1761 SI opval = current_cpu->thumb_h_gr_t_get (FLD (f_rd));
1762 if (UNLIKELY(current_cpu->trace_result_p))
1763 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), current_cpu->thumb_h_gr_t_get (FLD (f_ro))) << dec << ']' << ":=0x" << hex << opval << dec << " ";
1764 current_cpu->SETMEMSI (pc, ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), current_cpu->thumb_h_gr_t_get (FLD (f_ro))), opval);
1767 current_cpu->done_insn (npc, status);
1772 // ********** strb: strb $rd,[$rb,$ro]
1775 thumb_sem_strb (arm7f_cpu* current_cpu, thumb_scache* sem)
1777 #define FLD(f) abuf->fields.sfmt_str.f
1778 sem_status status = SEM_STATUS_NORMAL;
1779 thumb_scache* abuf = sem;
1780 PCADDR pc = abuf->addr;
1781 PCADDR npc = pc + 2;
1784 QI opval = current_cpu->thumb_h_gr_t_get (FLD (f_rd));
1785 if (UNLIKELY(current_cpu->trace_result_p))
1786 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), current_cpu->thumb_h_gr_t_get (FLD (f_ro))) << dec << ']' << ":=0x" << hex << (SI) opval << dec << " ";
1787 current_cpu->SETMEMQI (pc, ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), current_cpu->thumb_h_gr_t_get (FLD (f_ro))), opval);
1790 current_cpu->done_insn (npc, status);
1795 // ********** ldr: ldr $rd,[$rb,$ro]
1798 thumb_sem_ldr (arm7f_cpu* current_cpu, thumb_scache* sem)
1800 #define FLD(f) abuf->fields.sfmt_str.f
1801 sem_status status = SEM_STATUS_NORMAL;
1802 thumb_scache* abuf = sem;
1803 PCADDR pc = abuf->addr;
1804 PCADDR npc = pc + 2;
1807 SI opval = current_cpu->GETMEMSI (pc, ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), current_cpu->thumb_h_gr_t_get (FLD (f_ro))));
1808 if (UNLIKELY(current_cpu->trace_result_p))
1809 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1810 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
1813 current_cpu->done_insn (npc, status);
1818 // ********** ldrb: ldrb $rd,[$rb,$ro]
1821 thumb_sem_ldrb (arm7f_cpu* current_cpu, thumb_scache* sem)
1823 #define FLD(f) abuf->fields.sfmt_str.f
1824 sem_status status = SEM_STATUS_NORMAL;
1825 thumb_scache* abuf = sem;
1826 PCADDR pc = abuf->addr;
1827 PCADDR npc = pc + 2;
1830 SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), current_cpu->thumb_h_gr_t_get (FLD (f_ro)))));
1831 if (UNLIKELY(current_cpu->trace_result_p))
1832 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1833 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
1836 current_cpu->done_insn (npc, status);
1841 // ********** strh: strh $rd,[$rb,$ro]
1844 thumb_sem_strh (arm7f_cpu* current_cpu, thumb_scache* sem)
1846 #define FLD(f) abuf->fields.sfmt_str.f
1847 sem_status status = SEM_STATUS_NORMAL;
1848 thumb_scache* abuf = sem;
1849 PCADDR pc = abuf->addr;
1850 PCADDR npc = pc + 2;
1853 HI opval = current_cpu->thumb_h_gr_t_get (FLD (f_rd));
1854 if (UNLIKELY(current_cpu->trace_result_p))
1855 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), current_cpu->thumb_h_gr_t_get (FLD (f_ro))) << dec << ']' << ":=0x" << hex << opval << dec << " ";
1856 current_cpu->SETMEMHI (pc, ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), current_cpu->thumb_h_gr_t_get (FLD (f_ro))), opval);
1859 current_cpu->done_insn (npc, status);
1864 // ********** ldrh: ldrh $rd,[$rb,$ro]
1867 thumb_sem_ldrh (arm7f_cpu* current_cpu, thumb_scache* sem)
1869 #define FLD(f) abuf->fields.sfmt_str.f
1870 sem_status status = SEM_STATUS_NORMAL;
1871 thumb_scache* abuf = sem;
1872 PCADDR pc = abuf->addr;
1873 PCADDR npc = pc + 2;
1876 SI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), current_cpu->thumb_h_gr_t_get (FLD (f_ro)))));
1877 if (UNLIKELY(current_cpu->trace_result_p))
1878 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1879 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
1882 current_cpu->done_insn (npc, status);
1887 // ********** ldsb: ldsb $rd,[$rb,$ro]
1890 thumb_sem_ldsb (arm7f_cpu* current_cpu, thumb_scache* sem)
1892 #define FLD(f) abuf->fields.sfmt_str.f
1893 sem_status status = SEM_STATUS_NORMAL;
1894 thumb_scache* abuf = sem;
1895 PCADDR pc = abuf->addr;
1896 PCADDR npc = pc + 2;
1899 SI opval = EXTQISI (current_cpu->GETMEMQI (pc, ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), current_cpu->thumb_h_gr_t_get (FLD (f_ro)))));
1900 if (UNLIKELY(current_cpu->trace_result_p))
1901 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1902 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
1905 current_cpu->done_insn (npc, status);
1910 // ********** ldsh: ldsh $rd,[$rb,$ro]
1913 thumb_sem_ldsh (arm7f_cpu* current_cpu, thumb_scache* sem)
1915 #define FLD(f) abuf->fields.sfmt_str.f
1916 sem_status status = SEM_STATUS_NORMAL;
1917 thumb_scache* abuf = sem;
1918 PCADDR pc = abuf->addr;
1919 PCADDR npc = pc + 2;
1922 SI opval = EXTHISI (current_cpu->GETMEMHI (pc, ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), current_cpu->thumb_h_gr_t_get (FLD (f_ro)))));
1923 if (UNLIKELY(current_cpu->trace_result_p))
1924 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1925 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
1928 current_cpu->done_insn (npc, status);
1933 // ********** str-imm: str $rd,[$rb,#${offset5-7}]
1936 thumb_sem_str_imm (arm7f_cpu* current_cpu, thumb_scache* sem)
1938 #define FLD(f) abuf->fields.sfmt_str_imm.f
1939 sem_status status = SEM_STATUS_NORMAL;
1940 thumb_scache* abuf = sem;
1941 PCADDR pc = abuf->addr;
1942 PCADDR npc = pc + 2;
1945 SI opval = current_cpu->thumb_h_gr_t_get (FLD (f_rd));
1946 if (UNLIKELY(current_cpu->trace_result_p))
1947 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), FLD (f_offset5_7)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
1948 current_cpu->SETMEMSI (pc, ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), FLD (f_offset5_7)), opval);
1951 current_cpu->done_insn (npc, status);
1956 // ********** ldr-imm: ldr $rd,[$rb,#${offset5-7}]
1959 thumb_sem_ldr_imm (arm7f_cpu* current_cpu, thumb_scache* sem)
1961 #define FLD(f) abuf->fields.sfmt_str_imm.f
1962 sem_status status = SEM_STATUS_NORMAL;
1963 thumb_scache* abuf = sem;
1964 PCADDR pc = abuf->addr;
1965 PCADDR npc = pc + 2;
1968 SI opval = current_cpu->GETMEMSI (pc, ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), FLD (f_offset5_7)));
1969 if (UNLIKELY(current_cpu->trace_result_p))
1970 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
1971 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
1974 current_cpu->done_insn (npc, status);
1979 // ********** strb-imm: strb $rd,[$rb,#$offset5]
1982 thumb_sem_strb_imm (arm7f_cpu* current_cpu, thumb_scache* sem)
1984 #define FLD(f) abuf->fields.sfmt_strb_imm.f
1985 sem_status status = SEM_STATUS_NORMAL;
1986 thumb_scache* abuf = sem;
1987 PCADDR pc = abuf->addr;
1988 PCADDR npc = pc + 2;
1991 QI opval = current_cpu->thumb_h_gr_t_get (FLD (f_rd));
1992 if (UNLIKELY(current_cpu->trace_result_p))
1993 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), FLD (f_offset5)) << dec << ']' << ":=0x" << hex << (SI) opval << dec << " ";
1994 current_cpu->SETMEMQI (pc, ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), FLD (f_offset5)), opval);
1997 current_cpu->done_insn (npc, status);
2002 // ********** ldrb-imm: ldrb $rd,[$rb,#$offset5]
2005 thumb_sem_ldrb_imm (arm7f_cpu* current_cpu, thumb_scache* sem)
2007 #define FLD(f) abuf->fields.sfmt_strb_imm.f
2008 sem_status status = SEM_STATUS_NORMAL;
2009 thumb_scache* abuf = sem;
2010 PCADDR pc = abuf->addr;
2011 PCADDR npc = pc + 2;
2014 SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), FLD (f_offset5))));
2015 if (UNLIKELY(current_cpu->trace_result_p))
2016 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
2017 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
2020 current_cpu->done_insn (npc, status);
2025 // ********** strh-imm: strh $rd,[$rb,#${offset5-6}]
2028 thumb_sem_strh_imm (arm7f_cpu* current_cpu, thumb_scache* sem)
2030 #define FLD(f) abuf->fields.sfmt_strh_imm.f
2031 sem_status status = SEM_STATUS_NORMAL;
2032 thumb_scache* abuf = sem;
2033 PCADDR pc = abuf->addr;
2034 PCADDR npc = pc + 2;
2037 HI opval = current_cpu->thumb_h_gr_t_get (FLD (f_rd));
2038 if (UNLIKELY(current_cpu->trace_result_p))
2039 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), FLD (f_offset5_6)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
2040 current_cpu->SETMEMHI (pc, ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), FLD (f_offset5_6)), opval);
2043 current_cpu->done_insn (npc, status);
2048 // ********** ldrh-imm: ldrh $rd,[$rb,#${offset5-6}]
2051 thumb_sem_ldrh_imm (arm7f_cpu* current_cpu, thumb_scache* sem)
2053 #define FLD(f) abuf->fields.sfmt_strh_imm.f
2054 sem_status status = SEM_STATUS_NORMAL;
2055 thumb_scache* abuf = sem;
2056 PCADDR pc = abuf->addr;
2057 PCADDR npc = pc + 2;
2060 SI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_rb)), FLD (f_offset5_6))));
2061 if (UNLIKELY(current_cpu->trace_result_p))
2062 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << " ";
2063 current_cpu->thumb_h_gr_t_set (FLD (f_rd), opval);
2066 current_cpu->done_insn (npc, status);
2071 // ********** str-sprel: str ${bit10-rd},[sp,#$word8]
2074 thumb_sem_str_sprel (arm7f_cpu* current_cpu, thumb_scache* sem)
2076 #define FLD(f) abuf->fields.sfmt_ldr_pc.f
2077 sem_status status = SEM_STATUS_NORMAL;
2078 thumb_scache* abuf = sem;
2079 PCADDR pc = abuf->addr;
2080 PCADDR npc = pc + 2;
2083 SI opval = current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rd));
2084 if (UNLIKELY(current_cpu->trace_result_p))
2085 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->thumb_h_sp_t_get (), FLD (f_word8)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
2086 current_cpu->SETMEMSI (pc, ADDSI (current_cpu->thumb_h_sp_t_get (), FLD (f_word8)), opval);
2089 current_cpu->done_insn (npc, status);
2094 // ********** ldr-sprel: ldr ${bit10-rd},[sp,#$word8]
2097 thumb_sem_ldr_sprel (arm7f_cpu* current_cpu, thumb_scache* sem)
2099 #define FLD(f) abuf->fields.sfmt_ldr_pc.f
2100 sem_status status = SEM_STATUS_NORMAL;
2101 thumb_scache* abuf = sem;
2102 PCADDR pc = abuf->addr;
2103 PCADDR npc = pc + 2;
2106 SI opval = current_cpu->GETMEMSI (pc, ADDSI (current_cpu->thumb_h_sp_t_get (), FLD (f_word8)));
2107 if (UNLIKELY(current_cpu->trace_result_p))
2108 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rd) << ']' << ":=0x" << hex << opval << dec << " ";
2109 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rd), opval);
2112 current_cpu->done_insn (npc, status);
2117 // ********** lda-pc: add ${bit10-rd},pc,$word8
2120 thumb_sem_lda_pc (arm7f_cpu* current_cpu, thumb_scache* sem)
2122 #define FLD(f) abuf->fields.sfmt_ldr_pc.f
2123 sem_status status = SEM_STATUS_NORMAL;
2124 thumb_scache* abuf = sem;
2125 PCADDR pc = abuf->addr;
2126 PCADDR npc = pc + 2;
2129 SI opval = ADDSI (ANDSI (ADDSI (pc, 4), -4), FLD (f_word8));
2130 if (UNLIKELY(current_cpu->trace_result_p))
2131 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rd) << ']' << ":=0x" << hex << opval << dec << " ";
2132 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rd), opval);
2135 current_cpu->done_insn (npc, status);
2140 // ********** lda-sp: add ${bit10-rd},sp,$word8
2143 thumb_sem_lda_sp (arm7f_cpu* current_cpu, thumb_scache* sem)
2145 #define FLD(f) abuf->fields.sfmt_ldr_pc.f
2146 sem_status status = SEM_STATUS_NORMAL;
2147 thumb_scache* abuf = sem;
2148 PCADDR pc = abuf->addr;
2149 PCADDR npc = pc + 2;
2152 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), FLD (f_word8));
2153 if (UNLIKELY(current_cpu->trace_result_p))
2154 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rd) << ']' << ":=0x" << hex << opval << dec << " ";
2155 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rd), opval);
2158 current_cpu->done_insn (npc, status);
2163 // ********** add-sp: add sp,#$sword7
2166 thumb_sem_add_sp (arm7f_cpu* current_cpu, thumb_scache* sem)
2168 #define FLD(f) abuf->fields.sfmt_add_sp.f
2169 sem_status status = SEM_STATUS_NORMAL;
2170 thumb_scache* abuf = sem;
2171 PCADDR pc = abuf->addr;
2172 PCADDR npc = pc + 2;
2175 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), FLD (f_sword7));
2176 if (UNLIKELY(current_cpu->trace_result_p))
2177 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2178 current_cpu->thumb_h_sp_t_set (opval);
2181 current_cpu->done_insn (npc, status);
2186 // ********** sub-sp: add sp,#-$sword7
2189 thumb_sem_sub_sp (arm7f_cpu* current_cpu, thumb_scache* sem)
2191 #define FLD(f) abuf->fields.sfmt_add_sp.f
2192 sem_status status = SEM_STATUS_NORMAL;
2193 thumb_scache* abuf = sem;
2194 PCADDR pc = abuf->addr;
2195 PCADDR npc = pc + 2;
2198 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), FLD (f_sword7));
2199 if (UNLIKELY(current_cpu->trace_result_p))
2200 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2201 current_cpu->thumb_h_sp_t_set (opval);
2204 current_cpu->done_insn (npc, status);
2209 // ********** push: push {$rlist}
2212 thumb_sem_push (arm7f_cpu* current_cpu, thumb_scache* sem)
2214 #define FLD(f) abuf->fields.sfmt_stmia.f
2215 sem_status status = SEM_STATUS_NORMAL;
2216 thumb_scache* abuf = sem;
2217 PCADDR pc = abuf->addr;
2218 PCADDR npc = pc + 2;
2221 if (ANDSI (FLD (f_rlist), SLLSI (1, 7))) {
2224 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2225 if (UNLIKELY(current_cpu->trace_result_p))
2226 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2227 current_cpu->thumb_h_sp_t_set (opval);
2230 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 7));
2231 if (UNLIKELY(current_cpu->trace_result_p))
2232 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2233 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2237 if (ANDSI (FLD (f_rlist), SLLSI (1, 6))) {
2240 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2241 if (UNLIKELY(current_cpu->trace_result_p))
2242 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2243 current_cpu->thumb_h_sp_t_set (opval);
2246 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 6));
2247 if (UNLIKELY(current_cpu->trace_result_p))
2248 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2249 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2253 if (ANDSI (FLD (f_rlist), SLLSI (1, 5))) {
2256 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2257 if (UNLIKELY(current_cpu->trace_result_p))
2258 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2259 current_cpu->thumb_h_sp_t_set (opval);
2262 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 5));
2263 if (UNLIKELY(current_cpu->trace_result_p))
2264 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2265 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2269 if (ANDSI (FLD (f_rlist), SLLSI (1, 4))) {
2272 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2273 if (UNLIKELY(current_cpu->trace_result_p))
2274 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2275 current_cpu->thumb_h_sp_t_set (opval);
2278 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 4));
2279 if (UNLIKELY(current_cpu->trace_result_p))
2280 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2281 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2285 if (ANDSI (FLD (f_rlist), SLLSI (1, 3))) {
2288 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2289 if (UNLIKELY(current_cpu->trace_result_p))
2290 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2291 current_cpu->thumb_h_sp_t_set (opval);
2294 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 3));
2295 if (UNLIKELY(current_cpu->trace_result_p))
2296 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2297 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2301 if (ANDSI (FLD (f_rlist), SLLSI (1, 2))) {
2304 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2305 if (UNLIKELY(current_cpu->trace_result_p))
2306 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2307 current_cpu->thumb_h_sp_t_set (opval);
2310 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 2));
2311 if (UNLIKELY(current_cpu->trace_result_p))
2312 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2313 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2317 if (ANDSI (FLD (f_rlist), SLLSI (1, 1))) {
2320 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2321 if (UNLIKELY(current_cpu->trace_result_p))
2322 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2323 current_cpu->thumb_h_sp_t_set (opval);
2326 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 1));
2327 if (UNLIKELY(current_cpu->trace_result_p))
2328 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2329 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2333 if (ANDSI (FLD (f_rlist), SLLSI (1, 0))) {
2336 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2337 if (UNLIKELY(current_cpu->trace_result_p))
2338 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2339 current_cpu->thumb_h_sp_t_set (opval);
2342 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 0));
2343 if (UNLIKELY(current_cpu->trace_result_p))
2344 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2345 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2351 current_cpu->done_insn (npc, status);
2356 // ********** push-lr: push {${rlist-lr}}
2359 thumb_sem_push_lr (arm7f_cpu* current_cpu, thumb_scache* sem)
2361 #define FLD(f) abuf->fields.sfmt_stmia.f
2362 sem_status status = SEM_STATUS_NORMAL;
2363 thumb_scache* abuf = sem;
2364 PCADDR pc = abuf->addr;
2365 PCADDR npc = pc + 2;
2369 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2370 if (UNLIKELY(current_cpu->trace_result_p))
2371 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2372 current_cpu->thumb_h_sp_t_set (opval);
2375 SI opval = current_cpu->thumb_h_lr_t_get ();
2376 if (UNLIKELY(current_cpu->trace_result_p))
2377 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2378 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2380 if (ANDSI (FLD (f_rlist), SLLSI (1, 7))) {
2383 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2384 if (UNLIKELY(current_cpu->trace_result_p))
2385 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2386 current_cpu->thumb_h_sp_t_set (opval);
2389 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 7));
2390 if (UNLIKELY(current_cpu->trace_result_p))
2391 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2392 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2396 if (ANDSI (FLD (f_rlist), SLLSI (1, 6))) {
2399 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2400 if (UNLIKELY(current_cpu->trace_result_p))
2401 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2402 current_cpu->thumb_h_sp_t_set (opval);
2405 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 6));
2406 if (UNLIKELY(current_cpu->trace_result_p))
2407 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2408 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2412 if (ANDSI (FLD (f_rlist), SLLSI (1, 5))) {
2415 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2416 if (UNLIKELY(current_cpu->trace_result_p))
2417 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2418 current_cpu->thumb_h_sp_t_set (opval);
2421 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 5));
2422 if (UNLIKELY(current_cpu->trace_result_p))
2423 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2424 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2428 if (ANDSI (FLD (f_rlist), SLLSI (1, 4))) {
2431 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2432 if (UNLIKELY(current_cpu->trace_result_p))
2433 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2434 current_cpu->thumb_h_sp_t_set (opval);
2437 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 4));
2438 if (UNLIKELY(current_cpu->trace_result_p))
2439 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2440 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2444 if (ANDSI (FLD (f_rlist), SLLSI (1, 3))) {
2447 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2448 if (UNLIKELY(current_cpu->trace_result_p))
2449 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2450 current_cpu->thumb_h_sp_t_set (opval);
2453 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 3));
2454 if (UNLIKELY(current_cpu->trace_result_p))
2455 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2456 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2460 if (ANDSI (FLD (f_rlist), SLLSI (1, 2))) {
2463 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2464 if (UNLIKELY(current_cpu->trace_result_p))
2465 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2466 current_cpu->thumb_h_sp_t_set (opval);
2469 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 2));
2470 if (UNLIKELY(current_cpu->trace_result_p))
2471 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2472 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2476 if (ANDSI (FLD (f_rlist), SLLSI (1, 1))) {
2479 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2480 if (UNLIKELY(current_cpu->trace_result_p))
2481 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2482 current_cpu->thumb_h_sp_t_set (opval);
2485 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 1));
2486 if (UNLIKELY(current_cpu->trace_result_p))
2487 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2488 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2492 if (ANDSI (FLD (f_rlist), SLLSI (1, 0))) {
2495 SI opval = SUBSI (current_cpu->thumb_h_sp_t_get (), 4);
2496 if (UNLIKELY(current_cpu->trace_result_p))
2497 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2498 current_cpu->thumb_h_sp_t_set (opval);
2501 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 0));
2502 if (UNLIKELY(current_cpu->trace_result_p))
2503 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_sp_t_get () << dec << ']' << ":=0x" << hex << opval << dec << " ";
2504 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_sp_t_get (), opval);
2510 current_cpu->done_insn (npc, status);
2515 // ********** pop: pop {$rlist}
2518 thumb_sem_pop (arm7f_cpu* current_cpu, thumb_scache* sem)
2520 #define FLD(f) abuf->fields.sfmt_stmia.f
2521 sem_status status = SEM_STATUS_NORMAL;
2522 thumb_scache* abuf = sem;
2523 PCADDR pc = abuf->addr;
2524 PCADDR npc = pc + 2;
2527 if (ANDSI (FLD (f_rlist), SLLSI (1, 0))) {
2530 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2531 if (UNLIKELY(current_cpu->trace_result_p))
2532 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << " ";
2533 current_cpu->thumb_h_gr_t_set (((UINT) 0), opval);
2536 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2537 if (UNLIKELY(current_cpu->trace_result_p))
2538 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2539 current_cpu->thumb_h_sp_t_set (opval);
2543 if (ANDSI (FLD (f_rlist), SLLSI (1, 1))) {
2546 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2547 if (UNLIKELY(current_cpu->trace_result_p))
2548 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 1) << ']' << ":=0x" << hex << opval << dec << " ";
2549 current_cpu->thumb_h_gr_t_set (((UINT) 1), opval);
2552 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2553 if (UNLIKELY(current_cpu->trace_result_p))
2554 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2555 current_cpu->thumb_h_sp_t_set (opval);
2559 if (ANDSI (FLD (f_rlist), SLLSI (1, 2))) {
2562 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2563 if (UNLIKELY(current_cpu->trace_result_p))
2564 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 2) << ']' << ":=0x" << hex << opval << dec << " ";
2565 current_cpu->thumb_h_gr_t_set (((UINT) 2), opval);
2568 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2569 if (UNLIKELY(current_cpu->trace_result_p))
2570 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2571 current_cpu->thumb_h_sp_t_set (opval);
2575 if (ANDSI (FLD (f_rlist), SLLSI (1, 3))) {
2578 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2579 if (UNLIKELY(current_cpu->trace_result_p))
2580 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 3) << ']' << ":=0x" << hex << opval << dec << " ";
2581 current_cpu->thumb_h_gr_t_set (((UINT) 3), opval);
2584 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2585 if (UNLIKELY(current_cpu->trace_result_p))
2586 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2587 current_cpu->thumb_h_sp_t_set (opval);
2591 if (ANDSI (FLD (f_rlist), SLLSI (1, 4))) {
2594 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2595 if (UNLIKELY(current_cpu->trace_result_p))
2596 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 4) << ']' << ":=0x" << hex << opval << dec << " ";
2597 current_cpu->thumb_h_gr_t_set (((UINT) 4), opval);
2600 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2601 if (UNLIKELY(current_cpu->trace_result_p))
2602 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2603 current_cpu->thumb_h_sp_t_set (opval);
2607 if (ANDSI (FLD (f_rlist), SLLSI (1, 5))) {
2610 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2611 if (UNLIKELY(current_cpu->trace_result_p))
2612 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 5) << ']' << ":=0x" << hex << opval << dec << " ";
2613 current_cpu->thumb_h_gr_t_set (((UINT) 5), opval);
2616 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2617 if (UNLIKELY(current_cpu->trace_result_p))
2618 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2619 current_cpu->thumb_h_sp_t_set (opval);
2623 if (ANDSI (FLD (f_rlist), SLLSI (1, 6))) {
2626 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2627 if (UNLIKELY(current_cpu->trace_result_p))
2628 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 6) << ']' << ":=0x" << hex << opval << dec << " ";
2629 current_cpu->thumb_h_gr_t_set (((UINT) 6), opval);
2632 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2633 if (UNLIKELY(current_cpu->trace_result_p))
2634 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2635 current_cpu->thumb_h_sp_t_set (opval);
2639 if (ANDSI (FLD (f_rlist), SLLSI (1, 7))) {
2642 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2643 if (UNLIKELY(current_cpu->trace_result_p))
2644 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 7) << ']' << ":=0x" << hex << opval << dec << " ";
2645 current_cpu->thumb_h_gr_t_set (((UINT) 7), opval);
2648 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2649 if (UNLIKELY(current_cpu->trace_result_p))
2650 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2651 current_cpu->thumb_h_sp_t_set (opval);
2657 current_cpu->done_insn (npc, status);
2662 // ********** pop-pc: pop {${rlist-pc}}
2665 thumb_sem_pop_pc (arm7f_cpu* current_cpu, thumb_scache* sem)
2667 #define FLD(f) abuf->fields.sfmt_stmia.f
2668 sem_status status = SEM_STATUS_NORMAL;
2669 thumb_scache* abuf = sem;
2670 PCADDR pc = abuf->addr;
2671 PCADDR npc = pc + 2;
2674 if (ANDSI (FLD (f_rlist), SLLSI (1, 0))) {
2677 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2678 if (UNLIKELY(current_cpu->trace_result_p))
2679 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << " ";
2680 current_cpu->thumb_h_gr_t_set (((UINT) 0), opval);
2683 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2684 if (UNLIKELY(current_cpu->trace_result_p))
2685 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2686 current_cpu->thumb_h_sp_t_set (opval);
2690 if (ANDSI (FLD (f_rlist), SLLSI (1, 1))) {
2693 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2694 if (UNLIKELY(current_cpu->trace_result_p))
2695 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 1) << ']' << ":=0x" << hex << opval << dec << " ";
2696 current_cpu->thumb_h_gr_t_set (((UINT) 1), opval);
2699 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2700 if (UNLIKELY(current_cpu->trace_result_p))
2701 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2702 current_cpu->thumb_h_sp_t_set (opval);
2706 if (ANDSI (FLD (f_rlist), SLLSI (1, 2))) {
2709 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2710 if (UNLIKELY(current_cpu->trace_result_p))
2711 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 2) << ']' << ":=0x" << hex << opval << dec << " ";
2712 current_cpu->thumb_h_gr_t_set (((UINT) 2), opval);
2715 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2716 if (UNLIKELY(current_cpu->trace_result_p))
2717 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2718 current_cpu->thumb_h_sp_t_set (opval);
2722 if (ANDSI (FLD (f_rlist), SLLSI (1, 3))) {
2725 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2726 if (UNLIKELY(current_cpu->trace_result_p))
2727 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 3) << ']' << ":=0x" << hex << opval << dec << " ";
2728 current_cpu->thumb_h_gr_t_set (((UINT) 3), opval);
2731 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2732 if (UNLIKELY(current_cpu->trace_result_p))
2733 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2734 current_cpu->thumb_h_sp_t_set (opval);
2738 if (ANDSI (FLD (f_rlist), SLLSI (1, 4))) {
2741 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2742 if (UNLIKELY(current_cpu->trace_result_p))
2743 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 4) << ']' << ":=0x" << hex << opval << dec << " ";
2744 current_cpu->thumb_h_gr_t_set (((UINT) 4), opval);
2747 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2748 if (UNLIKELY(current_cpu->trace_result_p))
2749 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2750 current_cpu->thumb_h_sp_t_set (opval);
2754 if (ANDSI (FLD (f_rlist), SLLSI (1, 5))) {
2757 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2758 if (UNLIKELY(current_cpu->trace_result_p))
2759 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 5) << ']' << ":=0x" << hex << opval << dec << " ";
2760 current_cpu->thumb_h_gr_t_set (((UINT) 5), opval);
2763 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2764 if (UNLIKELY(current_cpu->trace_result_p))
2765 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2766 current_cpu->thumb_h_sp_t_set (opval);
2770 if (ANDSI (FLD (f_rlist), SLLSI (1, 6))) {
2773 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2774 if (UNLIKELY(current_cpu->trace_result_p))
2775 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 6) << ']' << ":=0x" << hex << opval << dec << " ";
2776 current_cpu->thumb_h_gr_t_set (((UINT) 6), opval);
2779 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2780 if (UNLIKELY(current_cpu->trace_result_p))
2781 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2782 current_cpu->thumb_h_sp_t_set (opval);
2786 if (ANDSI (FLD (f_rlist), SLLSI (1, 7))) {
2789 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2790 if (UNLIKELY(current_cpu->trace_result_p))
2791 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 7) << ']' << ":=0x" << hex << opval << dec << " ";
2792 current_cpu->thumb_h_gr_t_set (((UINT) 7), opval);
2795 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2796 if (UNLIKELY(current_cpu->trace_result_p))
2797 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2798 current_cpu->thumb_h_sp_t_set (opval);
2803 USI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_sp_t_get ());
2804 if (UNLIKELY(current_cpu->trace_result_p))
2805 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
2806 current_cpu->branch (opval, npc, status);
2809 SI opval = ADDSI (current_cpu->thumb_h_sp_t_get (), 4);
2810 if (UNLIKELY(current_cpu->trace_result_p))
2811 current_cpu->trace_stream << "sp-t" << ":=0x" << hex << opval << dec << " ";
2812 current_cpu->thumb_h_sp_t_set (opval);
2816 current_cpu->done_cti_insn (npc, status);
2821 // ********** stmia: stmia $rb!,{$rlist}
2824 thumb_sem_stmia (arm7f_cpu* current_cpu, thumb_scache* sem)
2826 #define FLD(f) abuf->fields.sfmt_stmia.f
2827 sem_status status = SEM_STATUS_NORMAL;
2828 thumb_scache* abuf = sem;
2829 PCADDR pc = abuf->addr;
2830 PCADDR npc = pc + 2;
2833 if (ANDSI (FLD (f_rlist), SLLSI (1, 0))) {
2836 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 0));
2837 if (UNLIKELY(current_cpu->trace_result_p))
2838 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
2839 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), opval);
2842 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), 4);
2843 if (UNLIKELY(current_cpu->trace_result_p))
2844 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rb) << ']' << ":=0x" << hex << opval << dec << " ";
2845 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rb), opval);
2849 if (ANDSI (FLD (f_rlist), SLLSI (1, 1))) {
2852 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 1));
2853 if (UNLIKELY(current_cpu->trace_result_p))
2854 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
2855 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), opval);
2858 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), 4);
2859 if (UNLIKELY(current_cpu->trace_result_p))
2860 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rb) << ']' << ":=0x" << hex << opval << dec << " ";
2861 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rb), opval);
2865 if (ANDSI (FLD (f_rlist), SLLSI (1, 2))) {
2868 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 2));
2869 if (UNLIKELY(current_cpu->trace_result_p))
2870 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
2871 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), opval);
2874 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), 4);
2875 if (UNLIKELY(current_cpu->trace_result_p))
2876 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rb) << ']' << ":=0x" << hex << opval << dec << " ";
2877 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rb), opval);
2881 if (ANDSI (FLD (f_rlist), SLLSI (1, 3))) {
2884 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 3));
2885 if (UNLIKELY(current_cpu->trace_result_p))
2886 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
2887 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), opval);
2890 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), 4);
2891 if (UNLIKELY(current_cpu->trace_result_p))
2892 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rb) << ']' << ":=0x" << hex << opval << dec << " ";
2893 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rb), opval);
2897 if (ANDSI (FLD (f_rlist), SLLSI (1, 4))) {
2900 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 4));
2901 if (UNLIKELY(current_cpu->trace_result_p))
2902 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
2903 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), opval);
2906 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), 4);
2907 if (UNLIKELY(current_cpu->trace_result_p))
2908 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rb) << ']' << ":=0x" << hex << opval << dec << " ";
2909 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rb), opval);
2913 if (ANDSI (FLD (f_rlist), SLLSI (1, 5))) {
2916 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 5));
2917 if (UNLIKELY(current_cpu->trace_result_p))
2918 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
2919 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), opval);
2922 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), 4);
2923 if (UNLIKELY(current_cpu->trace_result_p))
2924 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rb) << ']' << ":=0x" << hex << opval << dec << " ";
2925 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rb), opval);
2929 if (ANDSI (FLD (f_rlist), SLLSI (1, 6))) {
2932 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 6));
2933 if (UNLIKELY(current_cpu->trace_result_p))
2934 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
2935 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), opval);
2938 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), 4);
2939 if (UNLIKELY(current_cpu->trace_result_p))
2940 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rb) << ']' << ":=0x" << hex << opval << dec << " ";
2941 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rb), opval);
2945 if (ANDSI (FLD (f_rlist), SLLSI (1, 7))) {
2948 SI opval = current_cpu->thumb_h_gr_t_get (((UINT) 7));
2949 if (UNLIKELY(current_cpu->trace_result_p))
2950 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
2951 current_cpu->SETMEMSI (pc, current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), opval);
2954 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), 4);
2955 if (UNLIKELY(current_cpu->trace_result_p))
2956 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rb) << ']' << ":=0x" << hex << opval << dec << " ";
2957 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rb), opval);
2963 current_cpu->done_insn (npc, status);
2968 // ********** ldmia: ldmia $rb!,{$rlist}
2971 thumb_sem_ldmia (arm7f_cpu* current_cpu, thumb_scache* sem)
2973 #define FLD(f) abuf->fields.sfmt_stmia.f
2974 sem_status status = SEM_STATUS_NORMAL;
2975 thumb_scache* abuf = sem;
2976 PCADDR pc = abuf->addr;
2977 PCADDR npc = pc + 2;
2980 if (ANDSI (FLD (f_rlist), SLLSI (1, 0))) {
2983 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)));
2984 if (UNLIKELY(current_cpu->trace_result_p))
2985 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << " ";
2986 current_cpu->thumb_h_gr_t_set (((UINT) 0), opval);
2989 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), 4);
2990 if (UNLIKELY(current_cpu->trace_result_p))
2991 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rb) << ']' << ":=0x" << hex << opval << dec << " ";
2992 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rb), opval);
2996 if (ANDSI (FLD (f_rlist), SLLSI (1, 1))) {
2999 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)));
3000 if (UNLIKELY(current_cpu->trace_result_p))
3001 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 1) << ']' << ":=0x" << hex << opval << dec << " ";
3002 current_cpu->thumb_h_gr_t_set (((UINT) 1), opval);
3005 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), 4);
3006 if (UNLIKELY(current_cpu->trace_result_p))
3007 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rb) << ']' << ":=0x" << hex << opval << dec << " ";
3008 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rb), opval);
3012 if (ANDSI (FLD (f_rlist), SLLSI (1, 2))) {
3015 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)));
3016 if (UNLIKELY(current_cpu->trace_result_p))
3017 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 2) << ']' << ":=0x" << hex << opval << dec << " ";
3018 current_cpu->thumb_h_gr_t_set (((UINT) 2), opval);
3021 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), 4);
3022 if (UNLIKELY(current_cpu->trace_result_p))
3023 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rb) << ']' << ":=0x" << hex << opval << dec << " ";
3024 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rb), opval);
3028 if (ANDSI (FLD (f_rlist), SLLSI (1, 3))) {
3031 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)));
3032 if (UNLIKELY(current_cpu->trace_result_p))
3033 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 3) << ']' << ":=0x" << hex << opval << dec << " ";
3034 current_cpu->thumb_h_gr_t_set (((UINT) 3), opval);
3037 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), 4);
3038 if (UNLIKELY(current_cpu->trace_result_p))
3039 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rb) << ']' << ":=0x" << hex << opval << dec << " ";
3040 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rb), opval);
3044 if (ANDSI (FLD (f_rlist), SLLSI (1, 4))) {
3047 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)));
3048 if (UNLIKELY(current_cpu->trace_result_p))
3049 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 4) << ']' << ":=0x" << hex << opval << dec << " ";
3050 current_cpu->thumb_h_gr_t_set (((UINT) 4), opval);
3053 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), 4);
3054 if (UNLIKELY(current_cpu->trace_result_p))
3055 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rb) << ']' << ":=0x" << hex << opval << dec << " ";
3056 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rb), opval);
3060 if (ANDSI (FLD (f_rlist), SLLSI (1, 5))) {
3063 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)));
3064 if (UNLIKELY(current_cpu->trace_result_p))
3065 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 5) << ']' << ":=0x" << hex << opval << dec << " ";
3066 current_cpu->thumb_h_gr_t_set (((UINT) 5), opval);
3069 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), 4);
3070 if (UNLIKELY(current_cpu->trace_result_p))
3071 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rb) << ']' << ":=0x" << hex << opval << dec << " ";
3072 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rb), opval);
3076 if (ANDSI (FLD (f_rlist), SLLSI (1, 6))) {
3079 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)));
3080 if (UNLIKELY(current_cpu->trace_result_p))
3081 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 6) << ']' << ":=0x" << hex << opval << dec << " ";
3082 current_cpu->thumb_h_gr_t_set (((UINT) 6), opval);
3085 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), 4);
3086 if (UNLIKELY(current_cpu->trace_result_p))
3087 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rb) << ']' << ":=0x" << hex << opval << dec << " ";
3088 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rb), opval);
3092 if (ANDSI (FLD (f_rlist), SLLSI (1, 7))) {
3095 SI opval = current_cpu->GETMEMSI (pc, current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)));
3096 if (UNLIKELY(current_cpu->trace_result_p))
3097 current_cpu->trace_stream << "gr-t" << '[' << ((UINT) 7) << ']' << ":=0x" << hex << opval << dec << " ";
3098 current_cpu->thumb_h_gr_t_set (((UINT) 7), opval);
3101 SI opval = ADDSI (current_cpu->thumb_h_gr_t_get (FLD (f_bit10_rb)), 4);
3102 if (UNLIKELY(current_cpu->trace_result_p))
3103 current_cpu->trace_stream << "gr-t" << '[' << FLD (f_bit10_rb) << ']' << ":=0x" << hex << opval << dec << " ";
3104 current_cpu->thumb_h_gr_t_set (FLD (f_bit10_rb), opval);
3110 current_cpu->done_insn (npc, status);
3115 // ********** beq: beq $soffset8
3118 thumb_sem_beq (arm7f_cpu* current_cpu, thumb_scache* sem)
3120 #define FLD(f) abuf->fields.sfmt_beq.f
3121 sem_status status = SEM_STATUS_NORMAL;
3122 thumb_scache* abuf = sem;
3123 PCADDR pc = abuf->addr;
3124 PCADDR npc = pc + 2;
3126 if (current_cpu->hardware.h_zbit) {
3128 USI opval = FLD (i_soffset8);
3129 if (UNLIKELY(current_cpu->trace_result_p))
3130 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3131 current_cpu->branch (opval, npc, status);
3135 current_cpu->done_cti_insn (npc, status);
3140 // ********** bne: bne $soffset8
3143 thumb_sem_bne (arm7f_cpu* current_cpu, thumb_scache* sem)
3145 #define FLD(f) abuf->fields.sfmt_beq.f
3146 sem_status status = SEM_STATUS_NORMAL;
3147 thumb_scache* abuf = sem;
3148 PCADDR pc = abuf->addr;
3149 PCADDR npc = pc + 2;
3151 if (NOTBI (current_cpu->hardware.h_zbit)) {
3153 USI opval = FLD (i_soffset8);
3154 if (UNLIKELY(current_cpu->trace_result_p))
3155 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3156 current_cpu->branch (opval, npc, status);
3160 current_cpu->done_cti_insn (npc, status);
3165 // ********** bcs: bcs $soffset8
3168 thumb_sem_bcs (arm7f_cpu* current_cpu, thumb_scache* sem)
3170 #define FLD(f) abuf->fields.sfmt_beq.f
3171 sem_status status = SEM_STATUS_NORMAL;
3172 thumb_scache* abuf = sem;
3173 PCADDR pc = abuf->addr;
3174 PCADDR npc = pc + 2;
3176 if (current_cpu->hardware.h_cbit) {
3178 USI opval = FLD (i_soffset8);
3179 if (UNLIKELY(current_cpu->trace_result_p))
3180 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3181 current_cpu->branch (opval, npc, status);
3185 current_cpu->done_cti_insn (npc, status);
3190 // ********** bcc: bcc $soffset8
3193 thumb_sem_bcc (arm7f_cpu* current_cpu, thumb_scache* sem)
3195 #define FLD(f) abuf->fields.sfmt_beq.f
3196 sem_status status = SEM_STATUS_NORMAL;
3197 thumb_scache* abuf = sem;
3198 PCADDR pc = abuf->addr;
3199 PCADDR npc = pc + 2;
3201 if (NOTBI (current_cpu->hardware.h_cbit)) {
3203 USI opval = FLD (i_soffset8);
3204 if (UNLIKELY(current_cpu->trace_result_p))
3205 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3206 current_cpu->branch (opval, npc, status);
3210 current_cpu->done_cti_insn (npc, status);
3215 // ********** bmi: bmi $soffset8
3218 thumb_sem_bmi (arm7f_cpu* current_cpu, thumb_scache* sem)
3220 #define FLD(f) abuf->fields.sfmt_beq.f
3221 sem_status status = SEM_STATUS_NORMAL;
3222 thumb_scache* abuf = sem;
3223 PCADDR pc = abuf->addr;
3224 PCADDR npc = pc + 2;
3226 if (current_cpu->hardware.h_nbit) {
3228 USI opval = FLD (i_soffset8);
3229 if (UNLIKELY(current_cpu->trace_result_p))
3230 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3231 current_cpu->branch (opval, npc, status);
3235 current_cpu->done_cti_insn (npc, status);
3240 // ********** bpl: bpl $soffset8
3243 thumb_sem_bpl (arm7f_cpu* current_cpu, thumb_scache* sem)
3245 #define FLD(f) abuf->fields.sfmt_beq.f
3246 sem_status status = SEM_STATUS_NORMAL;
3247 thumb_scache* abuf = sem;
3248 PCADDR pc = abuf->addr;
3249 PCADDR npc = pc + 2;
3251 if (NOTBI (current_cpu->hardware.h_nbit)) {
3253 USI opval = FLD (i_soffset8);
3254 if (UNLIKELY(current_cpu->trace_result_p))
3255 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3256 current_cpu->branch (opval, npc, status);
3260 current_cpu->done_cti_insn (npc, status);
3265 // ********** bvs: bvs $soffset8
3268 thumb_sem_bvs (arm7f_cpu* current_cpu, thumb_scache* sem)
3270 #define FLD(f) abuf->fields.sfmt_beq.f
3271 sem_status status = SEM_STATUS_NORMAL;
3272 thumb_scache* abuf = sem;
3273 PCADDR pc = abuf->addr;
3274 PCADDR npc = pc + 2;
3276 if (current_cpu->hardware.h_vbit) {
3278 USI opval = FLD (i_soffset8);
3279 if (UNLIKELY(current_cpu->trace_result_p))
3280 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3281 current_cpu->branch (opval, npc, status);
3285 current_cpu->done_cti_insn (npc, status);
3290 // ********** bvc: bvc $soffset8
3293 thumb_sem_bvc (arm7f_cpu* current_cpu, thumb_scache* sem)
3295 #define FLD(f) abuf->fields.sfmt_beq.f
3296 sem_status status = SEM_STATUS_NORMAL;
3297 thumb_scache* abuf = sem;
3298 PCADDR pc = abuf->addr;
3299 PCADDR npc = pc + 2;
3301 if (NOTBI (current_cpu->hardware.h_vbit)) {
3303 USI opval = FLD (i_soffset8);
3304 if (UNLIKELY(current_cpu->trace_result_p))
3305 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3306 current_cpu->branch (opval, npc, status);
3310 current_cpu->done_cti_insn (npc, status);
3315 // ********** bhi: bhi $soffset8
3318 thumb_sem_bhi (arm7f_cpu* current_cpu, thumb_scache* sem)
3320 #define FLD(f) abuf->fields.sfmt_beq.f
3321 sem_status status = SEM_STATUS_NORMAL;
3322 thumb_scache* abuf = sem;
3323 PCADDR pc = abuf->addr;
3324 PCADDR npc = pc + 2;
3326 if (ANDBI (current_cpu->hardware.h_cbit, NOTBI (current_cpu->hardware.h_zbit))) {
3328 USI opval = FLD (i_soffset8);
3329 if (UNLIKELY(current_cpu->trace_result_p))
3330 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3331 current_cpu->branch (opval, npc, status);
3335 current_cpu->done_cti_insn (npc, status);
3340 // ********** bls: bls $soffset8
3343 thumb_sem_bls (arm7f_cpu* current_cpu, thumb_scache* sem)
3345 #define FLD(f) abuf->fields.sfmt_beq.f
3346 sem_status status = SEM_STATUS_NORMAL;
3347 thumb_scache* abuf = sem;
3348 PCADDR pc = abuf->addr;
3349 PCADDR npc = pc + 2;
3351 if (ORBI (NOTBI (current_cpu->hardware.h_cbit), current_cpu->hardware.h_zbit)) {
3353 USI opval = FLD (i_soffset8);
3354 if (UNLIKELY(current_cpu->trace_result_p))
3355 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3356 current_cpu->branch (opval, npc, status);
3360 current_cpu->done_cti_insn (npc, status);
3365 // ********** bge: bge $soffset8
3368 thumb_sem_bge (arm7f_cpu* current_cpu, thumb_scache* sem)
3370 #define FLD(f) abuf->fields.sfmt_beq.f
3371 sem_status status = SEM_STATUS_NORMAL;
3372 thumb_scache* abuf = sem;
3373 PCADDR pc = abuf->addr;
3374 PCADDR npc = pc + 2;
3376 if (NOTBI (XORBI (current_cpu->hardware.h_nbit, current_cpu->hardware.h_vbit))) {
3378 USI opval = FLD (i_soffset8);
3379 if (UNLIKELY(current_cpu->trace_result_p))
3380 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3381 current_cpu->branch (opval, npc, status);
3385 current_cpu->done_cti_insn (npc, status);
3390 // ********** blt: blt $soffset8
3393 thumb_sem_blt (arm7f_cpu* current_cpu, thumb_scache* sem)
3395 #define FLD(f) abuf->fields.sfmt_beq.f
3396 sem_status status = SEM_STATUS_NORMAL;
3397 thumb_scache* abuf = sem;
3398 PCADDR pc = abuf->addr;
3399 PCADDR npc = pc + 2;
3401 if (XORBI (current_cpu->hardware.h_nbit, current_cpu->hardware.h_vbit)) {
3403 USI opval = FLD (i_soffset8);
3404 if (UNLIKELY(current_cpu->trace_result_p))
3405 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3406 current_cpu->branch (opval, npc, status);
3410 current_cpu->done_cti_insn (npc, status);
3415 // ********** bgt: bgt $soffset8
3418 thumb_sem_bgt (arm7f_cpu* current_cpu, thumb_scache* sem)
3420 #define FLD(f) abuf->fields.sfmt_beq.f
3421 sem_status status = SEM_STATUS_NORMAL;
3422 thumb_scache* abuf = sem;
3423 PCADDR pc = abuf->addr;
3424 PCADDR npc = pc + 2;
3426 if (NOTBI (ORBI (current_cpu->hardware.h_zbit, XORBI (current_cpu->hardware.h_nbit, current_cpu->hardware.h_vbit)))) {
3428 USI opval = FLD (i_soffset8);
3429 if (UNLIKELY(current_cpu->trace_result_p))
3430 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3431 current_cpu->branch (opval, npc, status);
3435 current_cpu->done_cti_insn (npc, status);
3440 // ********** ble: ble $soffset8
3443 thumb_sem_ble (arm7f_cpu* current_cpu, thumb_scache* sem)
3445 #define FLD(f) abuf->fields.sfmt_beq.f
3446 sem_status status = SEM_STATUS_NORMAL;
3447 thumb_scache* abuf = sem;
3448 PCADDR pc = abuf->addr;
3449 PCADDR npc = pc + 2;
3451 if (ORBI (current_cpu->hardware.h_zbit, XORBI (current_cpu->hardware.h_nbit, current_cpu->hardware.h_vbit))) {
3453 USI opval = FLD (i_soffset8);
3454 if (UNLIKELY(current_cpu->trace_result_p))
3455 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3456 current_cpu->branch (opval, npc, status);
3460 current_cpu->done_cti_insn (npc, status);
3465 // ********** swi: swi $value8
3468 thumb_sem_swi (arm7f_cpu* current_cpu, thumb_scache* sem)
3470 #define FLD(f) abuf->fields.sfmt_swi.f
3471 sem_status status = SEM_STATUS_NORMAL;
3472 thumb_scache* abuf = sem;
3473 PCADDR pc = abuf->addr;
3474 PCADDR npc = pc + 2;
3477 USI opval = current_cpu->thumb_swi (pc, FLD (f_value8));
3478 if (UNLIKELY(current_cpu->trace_result_p))
3479 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3480 current_cpu->branch (opval, npc, status);
3483 current_cpu->done_cti_insn (npc, status);
3488 // ********** b: b $offset11
3491 thumb_sem_b (arm7f_cpu* current_cpu, thumb_scache* sem)
3493 #define FLD(f) abuf->fields.sfmt_b.f
3494 sem_status status = SEM_STATUS_NORMAL;
3495 thumb_scache* abuf = sem;
3496 PCADDR pc = abuf->addr;
3497 PCADDR npc = pc + 2;
3500 USI opval = FLD (i_offset11);
3501 if (UNLIKELY(current_cpu->trace_result_p))
3502 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3503 current_cpu->branch (opval, npc, status);
3506 current_cpu->done_cti_insn (npc, status);
3511 // ********** bl-hi: bl-hi ${lbwl-hi}
3514 thumb_sem_bl_hi (arm7f_cpu* current_cpu, thumb_scache* sem)
3516 #define FLD(f) abuf->fields.sfmt_bl_hi.f
3517 sem_status status = SEM_STATUS_NORMAL;
3518 thumb_scache* abuf = sem;
3519 PCADDR pc = abuf->addr;
3520 PCADDR npc = pc + 2;
3523 SI opval = ADDSI (ADDSI (pc, 4), SLLSI (FLD (f_lbwl_hi), 12));
3524 if (UNLIKELY(current_cpu->trace_result_p))
3525 current_cpu->trace_stream << "lr-t" << ":=0x" << hex << opval << dec << " ";
3526 current_cpu->thumb_h_lr_t_set (opval);
3529 current_cpu->done_insn (npc, status);
3534 // ********** bl-lo: bl-lo ${lbwl-lo}
3537 thumb_sem_bl_lo (arm7f_cpu* current_cpu, thumb_scache* sem)
3539 #define FLD(f) abuf->fields.sfmt_bl_lo.f
3540 sem_status status = SEM_STATUS_NORMAL;
3541 thumb_scache* abuf = sem;
3542 PCADDR pc = abuf->addr;
3543 PCADDR npc = pc + 2;
3549 USI opval = ADDSI (current_cpu->thumb_h_lr_t_get (), SLLSI (FLD (f_lbwl_lo), 1));
3550 if (UNLIKELY(current_cpu->trace_result_p))
3551 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
3552 current_cpu->branch (opval, npc, status);
3555 SI opval = ORSI (ADDSI (tmp_cur_pc, 2), 1);
3556 if (UNLIKELY(current_cpu->trace_result_p))
3557 current_cpu->trace_stream << "lr-t" << ":=0x" << hex << opval << dec << " ";
3558 current_cpu->thumb_h_lr_t_set (opval);
3562 current_cpu->done_cti_insn (npc, status);