OSDN Git Service

* public snapshot of sid simulator
[pf3gnuchains/pf3gnuchains3x.git] / sid / component / cgen-cpu / arm7t / arm-sem.cxx
1 /* Simulator instruction semantics for arm.
2
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
4
5 Copyright (C) 2000 Red Hat, Inc.
6
7 This file is part of the Cygnus Simulators.
8
9
10 */
11
12
13 #include "arm7f.h"
14
15 using namespace arm7f; // FIXME: namespace organization still wip
16
17 #define GET_ATTR(name) GET_ATTR_##name ()
18
19
20 // ********** x-invalid: --invalid--
21
22 sem_status
23 arm_sem_x_invalid (arm7f_cpu* current_cpu, arm_scache* sem)
24 {
25 #define FLD(f) abuf->fields.fmt_empty.f
26   sem_status status = SEM_STATUS_NORMAL;
27   arm_scache* abuf = sem;
28   PCADDR pc = abuf->addr;
29   PCADDR npc = pc + 0;
30
31   {
32     current_cpu->invalid_insn (pc);
33     assert (0);
34     /* NOTREACHED */
35   }
36
37   current_cpu->done_insn (npc, status);
38   return status;
39 #undef FLD
40 }
41
42 // ********** b: b$cond $offset24
43
44 sem_status
45 arm_sem_b (arm7f_cpu* current_cpu, arm_scache* sem)
46 {
47 #define FLD(f) abuf->fields.sfmt_b.f
48   sem_status status = SEM_STATUS_NORMAL;
49   arm_scache* abuf = sem;
50   PCADDR pc = abuf->addr;
51   PCADDR npc = pc + 4;
52
53   {
54     USI opval = FLD (i_offset24);
55     current_cpu->branch (opval, npc, status);
56     if (current_cpu->trace_result_p)
57       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
58   }
59
60   current_cpu->done_cti_insn (npc, status);
61   return status;
62 #undef FLD
63 }
64
65 // ********** bl: bl$cond $offset24
66
67 sem_status
68 arm_sem_bl (arm7f_cpu* current_cpu, arm_scache* sem)
69 {
70 #define FLD(f) abuf->fields.sfmt_b.f
71   sem_status status = SEM_STATUS_NORMAL;
72   arm_scache* abuf = sem;
73   PCADDR pc = abuf->addr;
74   PCADDR npc = pc + 4;
75
76 {
77   {
78     SI opval = ANDSI (ADDSI (pc, 4), -4);
79     current_cpu->hardware.h_gr[((UINT) 14)] = opval;
80     if (current_cpu->trace_result_p)
81       current_cpu->trace_stream << "gr-14" << '[' << ((UINT) 14) << ']' << ":=0x" << hex << opval << dec << "  ";
82   }
83   {
84     USI opval = FLD (i_offset24);
85     current_cpu->branch (opval, npc, status);
86     if (current_cpu->trace_result_p)
87       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
88   }
89 }
90
91   current_cpu->done_cti_insn (npc, status);
92   return status;
93 #undef FLD
94 }
95
96 // ********** bx: bx$cond ${bx-rn}
97
98 sem_status
99 arm_sem_bx (arm7f_cpu* current_cpu, arm_scache* sem)
100 {
101 #define FLD(f) abuf->fields.sfmt_bx.f
102   sem_status status = SEM_STATUS_NORMAL;
103   arm_scache* abuf = sem;
104   PCADDR pc = abuf->addr;
105   PCADDR npc = pc + 4;
106
107 {
108   {
109     USI opval = ANDSI (* FLD (i_bx_rn), 0xfffffffe);
110     current_cpu->branch (opval, npc, status);
111     if (current_cpu->trace_result_p)
112       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
113   }
114 if (ANDSI (* FLD (i_bx_rn), 1)) {
115   {
116     BI opval = 1;
117     current_cpu->h_tbit_set (opval);
118     if (current_cpu->trace_result_p)
119       current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << "  ";
120   }
121 }
122 }
123
124   current_cpu->done_cti_insn (npc, status);
125   return status;
126 #undef FLD
127 }
128
129 // ********** ldr-post-dec-imm-offset: ldr${cond} $rd,???
130
131 sem_status
132 arm_sem_ldr_post_dec_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
133 {
134 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
135   sem_status status = SEM_STATUS_NORMAL;
136   arm_scache* abuf = sem;
137   PCADDR pc = abuf->addr;
138   PCADDR npc = pc + 4;
139
140 {
141   SI tmp_addr;
142   SI tmp_offset;
143   tmp_offset = FLD (f_uimm12);
144   tmp_addr = * FLD (i_rn);
145 if (EQSI (FLD (f_rd), 15)) {
146   {
147     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
148     current_cpu->branch (opval, npc, status);
149     if (current_cpu->trace_result_p)
150       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
151   }
152 } else {
153   {
154     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
155     * FLD (i_rd) = opval;
156     if (current_cpu->trace_result_p)
157       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
158   }
159 }
160   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
161   {
162     SI opval = tmp_addr;
163     * FLD (i_rn) = opval;
164     if (current_cpu->trace_result_p)
165       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
166   }
167 }
168
169   current_cpu->done_cti_insn (npc, status);
170   return status;
171 #undef FLD
172 }
173
174 // ********** ldr-post-dec-reg-offset: ldr${cond} $rd,???
175
176 sem_status
177 arm_sem_ldr_post_dec_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
178 {
179 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
180   sem_status status = SEM_STATUS_NORMAL;
181   arm_scache* abuf = sem;
182   PCADDR pc = abuf->addr;
183   PCADDR npc = pc + 4;
184
185 {
186   SI tmp_addr;
187   SI tmp_offset;
188   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
189   tmp_addr = * FLD (i_rn);
190 if (EQSI (FLD (f_rd), 15)) {
191   {
192     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
193     current_cpu->branch (opval, npc, status);
194     if (current_cpu->trace_result_p)
195       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
196   }
197 } else {
198   {
199     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
200     * FLD (i_rd) = opval;
201     if (current_cpu->trace_result_p)
202       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
203   }
204 }
205   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
206   {
207     SI opval = tmp_addr;
208     * FLD (i_rn) = opval;
209     if (current_cpu->trace_result_p)
210       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
211   }
212 }
213
214   current_cpu->done_cti_insn (npc, status);
215   return status;
216 #undef FLD
217 }
218
219 // ********** ldr-post-inc-imm-offset: ldr${cond} $rd,???
220
221 sem_status
222 arm_sem_ldr_post_inc_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
223 {
224 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
225   sem_status status = SEM_STATUS_NORMAL;
226   arm_scache* abuf = sem;
227   PCADDR pc = abuf->addr;
228   PCADDR npc = pc + 4;
229
230 {
231   SI tmp_addr;
232   SI tmp_offset;
233   tmp_offset = FLD (f_uimm12);
234   tmp_addr = * FLD (i_rn);
235 if (EQSI (FLD (f_rd), 15)) {
236   {
237     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
238     current_cpu->branch (opval, npc, status);
239     if (current_cpu->trace_result_p)
240       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
241   }
242 } else {
243   {
244     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
245     * FLD (i_rd) = opval;
246     if (current_cpu->trace_result_p)
247       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
248   }
249 }
250   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
251   {
252     SI opval = tmp_addr;
253     * FLD (i_rn) = opval;
254     if (current_cpu->trace_result_p)
255       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
256   }
257 }
258
259   current_cpu->done_cti_insn (npc, status);
260   return status;
261 #undef FLD
262 }
263
264 // ********** ldr-post-inc-reg-offset: ldr${cond} $rd,???
265
266 sem_status
267 arm_sem_ldr_post_inc_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
268 {
269 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
270   sem_status status = SEM_STATUS_NORMAL;
271   arm_scache* abuf = sem;
272   PCADDR pc = abuf->addr;
273   PCADDR npc = pc + 4;
274
275 {
276   SI tmp_addr;
277   SI tmp_offset;
278   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
279   tmp_addr = * FLD (i_rn);
280 if (EQSI (FLD (f_rd), 15)) {
281   {
282     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
283     current_cpu->branch (opval, npc, status);
284     if (current_cpu->trace_result_p)
285       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
286   }
287 } else {
288   {
289     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
290     * FLD (i_rd) = opval;
291     if (current_cpu->trace_result_p)
292       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
293   }
294 }
295   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
296   {
297     SI opval = tmp_addr;
298     * FLD (i_rn) = opval;
299     if (current_cpu->trace_result_p)
300       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
301   }
302 }
303
304   current_cpu->done_cti_insn (npc, status);
305   return status;
306 #undef FLD
307 }
308
309 // ********** ldr-post-dec-nonpriv-imm-offset: ldr${cond}t $rd,???
310
311 sem_status
312 arm_sem_ldr_post_dec_nonpriv_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
313 {
314 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
315   sem_status status = SEM_STATUS_NORMAL;
316   arm_scache* abuf = sem;
317   PCADDR pc = abuf->addr;
318   PCADDR npc = pc + 4;
319
320 {
321   SI tmp_addr;
322   SI tmp_offset;
323   tmp_offset = FLD (f_uimm12);
324   tmp_addr = * FLD (i_rn);
325 if (EQSI (FLD (f_rd), 15)) {
326   {
327     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
328     current_cpu->branch (opval, npc, status);
329     if (current_cpu->trace_result_p)
330       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
331   }
332 } else {
333   {
334     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
335     * FLD (i_rd) = opval;
336     if (current_cpu->trace_result_p)
337       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
338   }
339 }
340   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
341   {
342     SI opval = tmp_addr;
343     * FLD (i_rn) = opval;
344     if (current_cpu->trace_result_p)
345       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
346   }
347 }
348
349   current_cpu->done_cti_insn (npc, status);
350   return status;
351 #undef FLD
352 }
353
354 // ********** ldr-post-dec-nonpriv-reg-offset: ldr${cond}t $rd,???
355
356 sem_status
357 arm_sem_ldr_post_dec_nonpriv_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
358 {
359 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
360   sem_status status = SEM_STATUS_NORMAL;
361   arm_scache* abuf = sem;
362   PCADDR pc = abuf->addr;
363   PCADDR npc = pc + 4;
364
365 {
366   SI tmp_addr;
367   SI tmp_offset;
368   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
369   tmp_addr = * FLD (i_rn);
370 if (EQSI (FLD (f_rd), 15)) {
371   {
372     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
373     current_cpu->branch (opval, npc, status);
374     if (current_cpu->trace_result_p)
375       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
376   }
377 } else {
378   {
379     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
380     * FLD (i_rd) = opval;
381     if (current_cpu->trace_result_p)
382       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
383   }
384 }
385   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
386   {
387     SI opval = tmp_addr;
388     * FLD (i_rn) = opval;
389     if (current_cpu->trace_result_p)
390       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
391   }
392 }
393
394   current_cpu->done_cti_insn (npc, status);
395   return status;
396 #undef FLD
397 }
398
399 // ********** ldr-post-inc-nonpriv-imm-offset: ldr${cond}t $rd,???
400
401 sem_status
402 arm_sem_ldr_post_inc_nonpriv_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
403 {
404 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
405   sem_status status = SEM_STATUS_NORMAL;
406   arm_scache* abuf = sem;
407   PCADDR pc = abuf->addr;
408   PCADDR npc = pc + 4;
409
410 {
411   SI tmp_addr;
412   SI tmp_offset;
413   tmp_offset = FLD (f_uimm12);
414   tmp_addr = * FLD (i_rn);
415 if (EQSI (FLD (f_rd), 15)) {
416   {
417     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
418     current_cpu->branch (opval, npc, status);
419     if (current_cpu->trace_result_p)
420       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
421   }
422 } else {
423   {
424     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
425     * FLD (i_rd) = opval;
426     if (current_cpu->trace_result_p)
427       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
428   }
429 }
430   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
431   {
432     SI opval = tmp_addr;
433     * FLD (i_rn) = opval;
434     if (current_cpu->trace_result_p)
435       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
436   }
437 }
438
439   current_cpu->done_cti_insn (npc, status);
440   return status;
441 #undef FLD
442 }
443
444 // ********** ldr-post-inc-nonpriv-reg-offset: ldr${cond}t $rd,???
445
446 sem_status
447 arm_sem_ldr_post_inc_nonpriv_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
448 {
449 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
450   sem_status status = SEM_STATUS_NORMAL;
451   arm_scache* abuf = sem;
452   PCADDR pc = abuf->addr;
453   PCADDR npc = pc + 4;
454
455 {
456   SI tmp_addr;
457   SI tmp_offset;
458   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
459   tmp_addr = * FLD (i_rn);
460 if (EQSI (FLD (f_rd), 15)) {
461   {
462     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
463     current_cpu->branch (opval, npc, status);
464     if (current_cpu->trace_result_p)
465       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
466   }
467 } else {
468   {
469     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
470     * FLD (i_rd) = opval;
471     if (current_cpu->trace_result_p)
472       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
473   }
474 }
475   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
476   {
477     SI opval = tmp_addr;
478     * FLD (i_rn) = opval;
479     if (current_cpu->trace_result_p)
480       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
481   }
482 }
483
484   current_cpu->done_cti_insn (npc, status);
485   return status;
486 #undef FLD
487 }
488
489 // ********** ldr-pre-dec-imm-offset: ldr${cond} $rd,???
490
491 sem_status
492 arm_sem_ldr_pre_dec_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
493 {
494 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
495   sem_status status = SEM_STATUS_NORMAL;
496   arm_scache* abuf = sem;
497   PCADDR pc = abuf->addr;
498   PCADDR npc = pc + 4;
499
500 {
501   SI tmp_addr;
502   SI tmp_offset;
503   tmp_offset = FLD (f_uimm12);
504   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
505 if (EQSI (FLD (f_rd), 15)) {
506   {
507     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
508     current_cpu->branch (opval, npc, status);
509     if (current_cpu->trace_result_p)
510       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
511   }
512 } else {
513   {
514     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
515     * FLD (i_rd) = opval;
516     if (current_cpu->trace_result_p)
517       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
518   }
519 }
520 ((void) 0); /*nop*/
521 ((void) 0); /*nop*/
522 }
523
524   current_cpu->done_cti_insn (npc, status);
525   return status;
526 #undef FLD
527 }
528
529 // ********** ldr-pre-dec-reg-offset: ldr${cond} $rd,???
530
531 sem_status
532 arm_sem_ldr_pre_dec_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
533 {
534 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
535   sem_status status = SEM_STATUS_NORMAL;
536   arm_scache* abuf = sem;
537   PCADDR pc = abuf->addr;
538   PCADDR npc = pc + 4;
539
540 {
541   SI tmp_addr;
542   SI tmp_offset;
543   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
544   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
545 if (EQSI (FLD (f_rd), 15)) {
546   {
547     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
548     current_cpu->branch (opval, npc, status);
549     if (current_cpu->trace_result_p)
550       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
551   }
552 } else {
553   {
554     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
555     * FLD (i_rd) = opval;
556     if (current_cpu->trace_result_p)
557       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
558   }
559 }
560 ((void) 0); /*nop*/
561 ((void) 0); /*nop*/
562 }
563
564   current_cpu->done_cti_insn (npc, status);
565   return status;
566 #undef FLD
567 }
568
569 // ********** ldr-pre-inc-imm-offset: ldr${cond} $rd,???
570
571 sem_status
572 arm_sem_ldr_pre_inc_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
573 {
574 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
575   sem_status status = SEM_STATUS_NORMAL;
576   arm_scache* abuf = sem;
577   PCADDR pc = abuf->addr;
578   PCADDR npc = pc + 4;
579
580 {
581   SI tmp_addr;
582   SI tmp_offset;
583   tmp_offset = FLD (f_uimm12);
584   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
585 if (EQSI (FLD (f_rd), 15)) {
586   {
587     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
588     current_cpu->branch (opval, npc, status);
589     if (current_cpu->trace_result_p)
590       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
591   }
592 } else {
593   {
594     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
595     * FLD (i_rd) = opval;
596     if (current_cpu->trace_result_p)
597       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
598   }
599 }
600 ((void) 0); /*nop*/
601 ((void) 0); /*nop*/
602 }
603
604   current_cpu->done_cti_insn (npc, status);
605   return status;
606 #undef FLD
607 }
608
609 // ********** ldr-pre-inc-reg-offset: ldr${cond} $rd,???
610
611 sem_status
612 arm_sem_ldr_pre_inc_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
613 {
614 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
615   sem_status status = SEM_STATUS_NORMAL;
616   arm_scache* abuf = sem;
617   PCADDR pc = abuf->addr;
618   PCADDR npc = pc + 4;
619
620 {
621   SI tmp_addr;
622   SI tmp_offset;
623   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
624   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
625 if (EQSI (FLD (f_rd), 15)) {
626   {
627     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
628     current_cpu->branch (opval, npc, status);
629     if (current_cpu->trace_result_p)
630       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
631   }
632 } else {
633   {
634     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
635     * FLD (i_rd) = opval;
636     if (current_cpu->trace_result_p)
637       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
638   }
639 }
640 ((void) 0); /*nop*/
641 ((void) 0); /*nop*/
642 }
643
644   current_cpu->done_cti_insn (npc, status);
645   return status;
646 #undef FLD
647 }
648
649 // ********** ldr-pre-dec-wb-imm-offset: ldr${cond} $rd,???
650
651 sem_status
652 arm_sem_ldr_pre_dec_wb_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
653 {
654 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
655   sem_status status = SEM_STATUS_NORMAL;
656   arm_scache* abuf = sem;
657   PCADDR pc = abuf->addr;
658   PCADDR npc = pc + 4;
659
660 {
661   SI tmp_addr;
662   SI tmp_offset;
663   tmp_offset = FLD (f_uimm12);
664   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
665 if (EQSI (FLD (f_rd), 15)) {
666   {
667     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
668     current_cpu->branch (opval, npc, status);
669     if (current_cpu->trace_result_p)
670       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
671   }
672 } else {
673   {
674     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
675     * FLD (i_rd) = opval;
676     if (current_cpu->trace_result_p)
677       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
678   }
679 }
680 ((void) 0); /*nop*/
681   {
682     SI opval = tmp_addr;
683     * FLD (i_rn) = opval;
684     if (current_cpu->trace_result_p)
685       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
686   }
687 }
688
689   current_cpu->done_cti_insn (npc, status);
690   return status;
691 #undef FLD
692 }
693
694 // ********** ldr-pre-dec-wb-reg-offset: ldr${cond} $rd,???
695
696 sem_status
697 arm_sem_ldr_pre_dec_wb_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
698 {
699 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
700   sem_status status = SEM_STATUS_NORMAL;
701   arm_scache* abuf = sem;
702   PCADDR pc = abuf->addr;
703   PCADDR npc = pc + 4;
704
705 {
706   SI tmp_addr;
707   SI tmp_offset;
708   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
709   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
710 if (EQSI (FLD (f_rd), 15)) {
711   {
712     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
713     current_cpu->branch (opval, npc, status);
714     if (current_cpu->trace_result_p)
715       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
716   }
717 } else {
718   {
719     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
720     * FLD (i_rd) = opval;
721     if (current_cpu->trace_result_p)
722       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
723   }
724 }
725 ((void) 0); /*nop*/
726   {
727     SI opval = tmp_addr;
728     * FLD (i_rn) = opval;
729     if (current_cpu->trace_result_p)
730       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
731   }
732 }
733
734   current_cpu->done_cti_insn (npc, status);
735   return status;
736 #undef FLD
737 }
738
739 // ********** ldr-pre-inc-wb-imm-offset: ldr${cond} $rd,???
740
741 sem_status
742 arm_sem_ldr_pre_inc_wb_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
743 {
744 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
745   sem_status status = SEM_STATUS_NORMAL;
746   arm_scache* abuf = sem;
747   PCADDR pc = abuf->addr;
748   PCADDR npc = pc + 4;
749
750 {
751   SI tmp_addr;
752   SI tmp_offset;
753   tmp_offset = FLD (f_uimm12);
754   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
755 if (EQSI (FLD (f_rd), 15)) {
756   {
757     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
758     current_cpu->branch (opval, npc, status);
759     if (current_cpu->trace_result_p)
760       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
761   }
762 } else {
763   {
764     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
765     * FLD (i_rd) = opval;
766     if (current_cpu->trace_result_p)
767       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
768   }
769 }
770 ((void) 0); /*nop*/
771   {
772     SI opval = tmp_addr;
773     * FLD (i_rn) = opval;
774     if (current_cpu->trace_result_p)
775       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
776   }
777 }
778
779   current_cpu->done_cti_insn (npc, status);
780   return status;
781 #undef FLD
782 }
783
784 // ********** ldr-pre-inc-wb-reg-offset: ldr${cond} $rd,???
785
786 sem_status
787 arm_sem_ldr_pre_inc_wb_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
788 {
789 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
790   sem_status status = SEM_STATUS_NORMAL;
791   arm_scache* abuf = sem;
792   PCADDR pc = abuf->addr;
793   PCADDR npc = pc + 4;
794
795 {
796   SI tmp_addr;
797   SI tmp_offset;
798   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
799   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
800 if (EQSI (FLD (f_rd), 15)) {
801   {
802     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
803     current_cpu->branch (opval, npc, status);
804     if (current_cpu->trace_result_p)
805       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
806   }
807 } else {
808   {
809     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
810     * FLD (i_rd) = opval;
811     if (current_cpu->trace_result_p)
812       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
813   }
814 }
815 ((void) 0); /*nop*/
816   {
817     SI opval = tmp_addr;
818     * FLD (i_rn) = opval;
819     if (current_cpu->trace_result_p)
820       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
821   }
822 }
823
824   current_cpu->done_cti_insn (npc, status);
825   return status;
826 #undef FLD
827 }
828
829 // ********** ldrb-post-dec-imm-offset: ldr${cond}b $rd,???
830
831 sem_status
832 arm_sem_ldrb_post_dec_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
833 {
834 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
835   sem_status status = SEM_STATUS_NORMAL;
836   arm_scache* abuf = sem;
837   PCADDR pc = abuf->addr;
838   PCADDR npc = pc + 4;
839
840 {
841   SI tmp_addr;
842   SI tmp_offset;
843   tmp_offset = FLD (f_uimm12);
844   tmp_addr = * FLD (i_rn);
845 if (EQSI (FLD (f_rd), 15)) {
846   {
847     USI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
848     current_cpu->branch (opval, npc, status);
849     if (current_cpu->trace_result_p)
850       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
851   }
852 } else {
853   {
854     SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
855     * FLD (i_rd) = opval;
856     if (current_cpu->trace_result_p)
857       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
858   }
859 }
860   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
861   {
862     SI opval = tmp_addr;
863     * FLD (i_rn) = opval;
864     if (current_cpu->trace_result_p)
865       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
866   }
867 }
868
869   current_cpu->done_cti_insn (npc, status);
870   return status;
871 #undef FLD
872 }
873
874 // ********** ldrb-post-dec-reg-offset: ldr${cond}b $rd,???
875
876 sem_status
877 arm_sem_ldrb_post_dec_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
878 {
879 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
880   sem_status status = SEM_STATUS_NORMAL;
881   arm_scache* abuf = sem;
882   PCADDR pc = abuf->addr;
883   PCADDR npc = pc + 4;
884
885 {
886   SI tmp_addr;
887   SI tmp_offset;
888   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
889   tmp_addr = * FLD (i_rn);
890 if (EQSI (FLD (f_rd), 15)) {
891   {
892     USI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
893     current_cpu->branch (opval, npc, status);
894     if (current_cpu->trace_result_p)
895       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
896   }
897 } else {
898   {
899     SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
900     * FLD (i_rd) = opval;
901     if (current_cpu->trace_result_p)
902       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
903   }
904 }
905   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
906   {
907     SI opval = tmp_addr;
908     * FLD (i_rn) = opval;
909     if (current_cpu->trace_result_p)
910       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
911   }
912 }
913
914   current_cpu->done_cti_insn (npc, status);
915   return status;
916 #undef FLD
917 }
918
919 // ********** ldrb-post-inc-imm-offset: ldr${cond}b $rd,???
920
921 sem_status
922 arm_sem_ldrb_post_inc_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
923 {
924 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
925   sem_status status = SEM_STATUS_NORMAL;
926   arm_scache* abuf = sem;
927   PCADDR pc = abuf->addr;
928   PCADDR npc = pc + 4;
929
930 {
931   SI tmp_addr;
932   SI tmp_offset;
933   tmp_offset = FLD (f_uimm12);
934   tmp_addr = * FLD (i_rn);
935 if (EQSI (FLD (f_rd), 15)) {
936   {
937     USI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
938     current_cpu->branch (opval, npc, status);
939     if (current_cpu->trace_result_p)
940       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
941   }
942 } else {
943   {
944     SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
945     * FLD (i_rd) = opval;
946     if (current_cpu->trace_result_p)
947       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
948   }
949 }
950   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
951   {
952     SI opval = tmp_addr;
953     * FLD (i_rn) = opval;
954     if (current_cpu->trace_result_p)
955       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
956   }
957 }
958
959   current_cpu->done_cti_insn (npc, status);
960   return status;
961 #undef FLD
962 }
963
964 // ********** ldrb-post-inc-reg-offset: ldr${cond}b $rd,???
965
966 sem_status
967 arm_sem_ldrb_post_inc_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
968 {
969 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
970   sem_status status = SEM_STATUS_NORMAL;
971   arm_scache* abuf = sem;
972   PCADDR pc = abuf->addr;
973   PCADDR npc = pc + 4;
974
975 {
976   SI tmp_addr;
977   SI tmp_offset;
978   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
979   tmp_addr = * FLD (i_rn);
980 if (EQSI (FLD (f_rd), 15)) {
981   {
982     USI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
983     current_cpu->branch (opval, npc, status);
984     if (current_cpu->trace_result_p)
985       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
986   }
987 } else {
988   {
989     SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
990     * FLD (i_rd) = opval;
991     if (current_cpu->trace_result_p)
992       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
993   }
994 }
995   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
996   {
997     SI opval = tmp_addr;
998     * FLD (i_rn) = opval;
999     if (current_cpu->trace_result_p)
1000       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1001   }
1002 }
1003
1004   current_cpu->done_cti_insn (npc, status);
1005   return status;
1006 #undef FLD
1007 }
1008
1009 // ********** ldrb-post-dec-nonpriv-imm-offset: ldr${cond}bt $rd,???
1010
1011 sem_status
1012 arm_sem_ldrb_post_dec_nonpriv_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1013 {
1014 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
1015   sem_status status = SEM_STATUS_NORMAL;
1016   arm_scache* abuf = sem;
1017   PCADDR pc = abuf->addr;
1018   PCADDR npc = pc + 4;
1019
1020 {
1021   SI tmp_addr;
1022   SI tmp_offset;
1023   tmp_offset = FLD (f_uimm12);
1024   tmp_addr = * FLD (i_rn);
1025 if (EQSI (FLD (f_rd), 15)) {
1026   {
1027     USI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1028     current_cpu->branch (opval, npc, status);
1029     if (current_cpu->trace_result_p)
1030       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
1031   }
1032 } else {
1033   {
1034     SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1035     * FLD (i_rd) = opval;
1036     if (current_cpu->trace_result_p)
1037       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
1038   }
1039 }
1040   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
1041   {
1042     SI opval = tmp_addr;
1043     * FLD (i_rn) = opval;
1044     if (current_cpu->trace_result_p)
1045       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1046   }
1047 }
1048
1049   current_cpu->done_cti_insn (npc, status);
1050   return status;
1051 #undef FLD
1052 }
1053
1054 // ********** ldrb-post-dec-nonpriv-reg-offset: ldr${cond}bt $rd,???
1055
1056 sem_status
1057 arm_sem_ldrb_post_dec_nonpriv_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1058 {
1059 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
1060   sem_status status = SEM_STATUS_NORMAL;
1061   arm_scache* abuf = sem;
1062   PCADDR pc = abuf->addr;
1063   PCADDR npc = pc + 4;
1064
1065 {
1066   SI tmp_addr;
1067   SI tmp_offset;
1068   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
1069   tmp_addr = * FLD (i_rn);
1070 if (EQSI (FLD (f_rd), 15)) {
1071   {
1072     USI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1073     current_cpu->branch (opval, npc, status);
1074     if (current_cpu->trace_result_p)
1075       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
1076   }
1077 } else {
1078   {
1079     SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1080     * FLD (i_rd) = opval;
1081     if (current_cpu->trace_result_p)
1082       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
1083   }
1084 }
1085   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
1086   {
1087     SI opval = tmp_addr;
1088     * FLD (i_rn) = opval;
1089     if (current_cpu->trace_result_p)
1090       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1091   }
1092 }
1093
1094   current_cpu->done_cti_insn (npc, status);
1095   return status;
1096 #undef FLD
1097 }
1098
1099 // ********** ldrb-post-inc-nonpriv-imm-offset: ldr${cond}bt $rd,???
1100
1101 sem_status
1102 arm_sem_ldrb_post_inc_nonpriv_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1103 {
1104 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
1105   sem_status status = SEM_STATUS_NORMAL;
1106   arm_scache* abuf = sem;
1107   PCADDR pc = abuf->addr;
1108   PCADDR npc = pc + 4;
1109
1110 {
1111   SI tmp_addr;
1112   SI tmp_offset;
1113   tmp_offset = FLD (f_uimm12);
1114   tmp_addr = * FLD (i_rn);
1115 if (EQSI (FLD (f_rd), 15)) {
1116   {
1117     USI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1118     current_cpu->branch (opval, npc, status);
1119     if (current_cpu->trace_result_p)
1120       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
1121   }
1122 } else {
1123   {
1124     SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1125     * FLD (i_rd) = opval;
1126     if (current_cpu->trace_result_p)
1127       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
1128   }
1129 }
1130   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
1131   {
1132     SI opval = tmp_addr;
1133     * FLD (i_rn) = opval;
1134     if (current_cpu->trace_result_p)
1135       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1136   }
1137 }
1138
1139   current_cpu->done_cti_insn (npc, status);
1140   return status;
1141 #undef FLD
1142 }
1143
1144 // ********** ldrb-post-inc-nonpriv-reg-offset: ldr${cond}bt $rd,???
1145
1146 sem_status
1147 arm_sem_ldrb_post_inc_nonpriv_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1148 {
1149 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
1150   sem_status status = SEM_STATUS_NORMAL;
1151   arm_scache* abuf = sem;
1152   PCADDR pc = abuf->addr;
1153   PCADDR npc = pc + 4;
1154
1155 {
1156   SI tmp_addr;
1157   SI tmp_offset;
1158   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
1159   tmp_addr = * FLD (i_rn);
1160 if (EQSI (FLD (f_rd), 15)) {
1161   {
1162     USI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1163     current_cpu->branch (opval, npc, status);
1164     if (current_cpu->trace_result_p)
1165       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
1166   }
1167 } else {
1168   {
1169     SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1170     * FLD (i_rd) = opval;
1171     if (current_cpu->trace_result_p)
1172       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
1173   }
1174 }
1175   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
1176   {
1177     SI opval = tmp_addr;
1178     * FLD (i_rn) = opval;
1179     if (current_cpu->trace_result_p)
1180       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1181   }
1182 }
1183
1184   current_cpu->done_cti_insn (npc, status);
1185   return status;
1186 #undef FLD
1187 }
1188
1189 // ********** ldrb-pre-dec-imm-offset: ldr${cond}b $rd,???
1190
1191 sem_status
1192 arm_sem_ldrb_pre_dec_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1193 {
1194 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
1195   sem_status status = SEM_STATUS_NORMAL;
1196   arm_scache* abuf = sem;
1197   PCADDR pc = abuf->addr;
1198   PCADDR npc = pc + 4;
1199
1200 {
1201   SI tmp_addr;
1202   SI tmp_offset;
1203   tmp_offset = FLD (f_uimm12);
1204   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
1205 if (EQSI (FLD (f_rd), 15)) {
1206   {
1207     USI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1208     current_cpu->branch (opval, npc, status);
1209     if (current_cpu->trace_result_p)
1210       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
1211   }
1212 } else {
1213   {
1214     SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1215     * FLD (i_rd) = opval;
1216     if (current_cpu->trace_result_p)
1217       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
1218   }
1219 }
1220 ((void) 0); /*nop*/
1221 ((void) 0); /*nop*/
1222 }
1223
1224   current_cpu->done_cti_insn (npc, status);
1225   return status;
1226 #undef FLD
1227 }
1228
1229 // ********** ldrb-pre-dec-reg-offset: ldr${cond}b $rd,???
1230
1231 sem_status
1232 arm_sem_ldrb_pre_dec_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1233 {
1234 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
1235   sem_status status = SEM_STATUS_NORMAL;
1236   arm_scache* abuf = sem;
1237   PCADDR pc = abuf->addr;
1238   PCADDR npc = pc + 4;
1239
1240 {
1241   SI tmp_addr;
1242   SI tmp_offset;
1243   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
1244   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
1245 if (EQSI (FLD (f_rd), 15)) {
1246   {
1247     USI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1248     current_cpu->branch (opval, npc, status);
1249     if (current_cpu->trace_result_p)
1250       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
1251   }
1252 } else {
1253   {
1254     SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1255     * FLD (i_rd) = opval;
1256     if (current_cpu->trace_result_p)
1257       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
1258   }
1259 }
1260 ((void) 0); /*nop*/
1261 ((void) 0); /*nop*/
1262 }
1263
1264   current_cpu->done_cti_insn (npc, status);
1265   return status;
1266 #undef FLD
1267 }
1268
1269 // ********** ldrb-pre-inc-imm-offset: ldr${cond}b $rd,???
1270
1271 sem_status
1272 arm_sem_ldrb_pre_inc_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1273 {
1274 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
1275   sem_status status = SEM_STATUS_NORMAL;
1276   arm_scache* abuf = sem;
1277   PCADDR pc = abuf->addr;
1278   PCADDR npc = pc + 4;
1279
1280 {
1281   SI tmp_addr;
1282   SI tmp_offset;
1283   tmp_offset = FLD (f_uimm12);
1284   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
1285 if (EQSI (FLD (f_rd), 15)) {
1286   {
1287     USI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1288     current_cpu->branch (opval, npc, status);
1289     if (current_cpu->trace_result_p)
1290       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
1291   }
1292 } else {
1293   {
1294     SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1295     * FLD (i_rd) = opval;
1296     if (current_cpu->trace_result_p)
1297       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
1298   }
1299 }
1300 ((void) 0); /*nop*/
1301 ((void) 0); /*nop*/
1302 }
1303
1304   current_cpu->done_cti_insn (npc, status);
1305   return status;
1306 #undef FLD
1307 }
1308
1309 // ********** ldrb-pre-inc-reg-offset: ldr${cond}b $rd,???
1310
1311 sem_status
1312 arm_sem_ldrb_pre_inc_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1313 {
1314 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
1315   sem_status status = SEM_STATUS_NORMAL;
1316   arm_scache* abuf = sem;
1317   PCADDR pc = abuf->addr;
1318   PCADDR npc = pc + 4;
1319
1320 {
1321   SI tmp_addr;
1322   SI tmp_offset;
1323   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
1324   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
1325 if (EQSI (FLD (f_rd), 15)) {
1326   {
1327     USI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1328     current_cpu->branch (opval, npc, status);
1329     if (current_cpu->trace_result_p)
1330       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
1331   }
1332 } else {
1333   {
1334     SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1335     * FLD (i_rd) = opval;
1336     if (current_cpu->trace_result_p)
1337       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
1338   }
1339 }
1340 ((void) 0); /*nop*/
1341 ((void) 0); /*nop*/
1342 }
1343
1344   current_cpu->done_cti_insn (npc, status);
1345   return status;
1346 #undef FLD
1347 }
1348
1349 // ********** ldrb-pre-dec-wb-imm-offset: ldr${cond}b $rd,???
1350
1351 sem_status
1352 arm_sem_ldrb_pre_dec_wb_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1353 {
1354 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
1355   sem_status status = SEM_STATUS_NORMAL;
1356   arm_scache* abuf = sem;
1357   PCADDR pc = abuf->addr;
1358   PCADDR npc = pc + 4;
1359
1360 {
1361   SI tmp_addr;
1362   SI tmp_offset;
1363   tmp_offset = FLD (f_uimm12);
1364   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
1365 if (EQSI (FLD (f_rd), 15)) {
1366   {
1367     USI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1368     current_cpu->branch (opval, npc, status);
1369     if (current_cpu->trace_result_p)
1370       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
1371   }
1372 } else {
1373   {
1374     SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1375     * FLD (i_rd) = opval;
1376     if (current_cpu->trace_result_p)
1377       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
1378   }
1379 }
1380 ((void) 0); /*nop*/
1381   {
1382     SI opval = tmp_addr;
1383     * FLD (i_rn) = opval;
1384     if (current_cpu->trace_result_p)
1385       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1386   }
1387 }
1388
1389   current_cpu->done_cti_insn (npc, status);
1390   return status;
1391 #undef FLD
1392 }
1393
1394 // ********** ldrb-pre-dec-wb-reg-offset: ldr${cond}b $rd,???
1395
1396 sem_status
1397 arm_sem_ldrb_pre_dec_wb_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1398 {
1399 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
1400   sem_status status = SEM_STATUS_NORMAL;
1401   arm_scache* abuf = sem;
1402   PCADDR pc = abuf->addr;
1403   PCADDR npc = pc + 4;
1404
1405 {
1406   SI tmp_addr;
1407   SI tmp_offset;
1408   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
1409   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
1410 if (EQSI (FLD (f_rd), 15)) {
1411   {
1412     USI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1413     current_cpu->branch (opval, npc, status);
1414     if (current_cpu->trace_result_p)
1415       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
1416   }
1417 } else {
1418   {
1419     SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1420     * FLD (i_rd) = opval;
1421     if (current_cpu->trace_result_p)
1422       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
1423   }
1424 }
1425 ((void) 0); /*nop*/
1426   {
1427     SI opval = tmp_addr;
1428     * FLD (i_rn) = opval;
1429     if (current_cpu->trace_result_p)
1430       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1431   }
1432 }
1433
1434   current_cpu->done_cti_insn (npc, status);
1435   return status;
1436 #undef FLD
1437 }
1438
1439 // ********** ldrb-pre-inc-wb-imm-offset: ldr${cond}b $rd,???
1440
1441 sem_status
1442 arm_sem_ldrb_pre_inc_wb_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1443 {
1444 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
1445   sem_status status = SEM_STATUS_NORMAL;
1446   arm_scache* abuf = sem;
1447   PCADDR pc = abuf->addr;
1448   PCADDR npc = pc + 4;
1449
1450 {
1451   SI tmp_addr;
1452   SI tmp_offset;
1453   tmp_offset = FLD (f_uimm12);
1454   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
1455 if (EQSI (FLD (f_rd), 15)) {
1456   {
1457     USI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1458     current_cpu->branch (opval, npc, status);
1459     if (current_cpu->trace_result_p)
1460       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
1461   }
1462 } else {
1463   {
1464     SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1465     * FLD (i_rd) = opval;
1466     if (current_cpu->trace_result_p)
1467       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
1468   }
1469 }
1470 ((void) 0); /*nop*/
1471   {
1472     SI opval = tmp_addr;
1473     * FLD (i_rn) = opval;
1474     if (current_cpu->trace_result_p)
1475       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1476   }
1477 }
1478
1479   current_cpu->done_cti_insn (npc, status);
1480   return status;
1481 #undef FLD
1482 }
1483
1484 // ********** ldrb-pre-inc-wb-reg-offset: ldr${cond}b $rd,???
1485
1486 sem_status
1487 arm_sem_ldrb_pre_inc_wb_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1488 {
1489 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
1490   sem_status status = SEM_STATUS_NORMAL;
1491   arm_scache* abuf = sem;
1492   PCADDR pc = abuf->addr;
1493   PCADDR npc = pc + 4;
1494
1495 {
1496   SI tmp_addr;
1497   SI tmp_offset;
1498   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
1499   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
1500 if (EQSI (FLD (f_rd), 15)) {
1501   {
1502     USI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1503     current_cpu->branch (opval, npc, status);
1504     if (current_cpu->trace_result_p)
1505       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
1506   }
1507 } else {
1508   {
1509     SI opval = ZEXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
1510     * FLD (i_rd) = opval;
1511     if (current_cpu->trace_result_p)
1512       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
1513   }
1514 }
1515 ((void) 0); /*nop*/
1516   {
1517     SI opval = tmp_addr;
1518     * FLD (i_rn) = opval;
1519     if (current_cpu->trace_result_p)
1520       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1521   }
1522 }
1523
1524   current_cpu->done_cti_insn (npc, status);
1525   return status;
1526 #undef FLD
1527 }
1528
1529 // ********** str-post-dec-imm-offset: ldr${cond} $rd,???
1530
1531 sem_status
1532 arm_sem_str_post_dec_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1533 {
1534 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
1535   sem_status status = SEM_STATUS_NORMAL;
1536   arm_scache* abuf = sem;
1537   PCADDR pc = abuf->addr;
1538   PCADDR npc = pc + 4;
1539
1540 {
1541   SI tmp_addr;
1542   SI tmp_offset;
1543   tmp_offset = FLD (f_uimm12);
1544   tmp_addr = * FLD (i_rn);
1545   {
1546     SI opval = * FLD (i_rd);
1547     current_cpu->SETMEMSI (pc, tmp_addr, opval);
1548     if (current_cpu->trace_result_p)
1549       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
1550   }
1551   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
1552   {
1553     SI opval = tmp_addr;
1554     * FLD (i_rn) = opval;
1555     if (current_cpu->trace_result_p)
1556       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1557   }
1558 }
1559
1560   current_cpu->done_insn (npc, status);
1561   return status;
1562 #undef FLD
1563 }
1564
1565 // ********** str-post-dec-reg-offset: str${cond} $rd,???
1566
1567 sem_status
1568 arm_sem_str_post_dec_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1569 {
1570 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
1571   sem_status status = SEM_STATUS_NORMAL;
1572   arm_scache* abuf = sem;
1573   PCADDR pc = abuf->addr;
1574   PCADDR npc = pc + 4;
1575
1576 {
1577   SI tmp_addr;
1578   SI tmp_offset;
1579   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
1580   tmp_addr = * FLD (i_rn);
1581   {
1582     SI opval = * FLD (i_rd);
1583     current_cpu->SETMEMSI (pc, tmp_addr, opval);
1584     if (current_cpu->trace_result_p)
1585       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
1586   }
1587   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
1588   {
1589     SI opval = tmp_addr;
1590     * FLD (i_rn) = opval;
1591     if (current_cpu->trace_result_p)
1592       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1593   }
1594 }
1595
1596   current_cpu->done_insn (npc, status);
1597   return status;
1598 #undef FLD
1599 }
1600
1601 // ********** str-post-inc-imm-offset: ldr${cond} $rd,???
1602
1603 sem_status
1604 arm_sem_str_post_inc_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1605 {
1606 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
1607   sem_status status = SEM_STATUS_NORMAL;
1608   arm_scache* abuf = sem;
1609   PCADDR pc = abuf->addr;
1610   PCADDR npc = pc + 4;
1611
1612 {
1613   SI tmp_addr;
1614   SI tmp_offset;
1615   tmp_offset = FLD (f_uimm12);
1616   tmp_addr = * FLD (i_rn);
1617   {
1618     SI opval = * FLD (i_rd);
1619     current_cpu->SETMEMSI (pc, tmp_addr, opval);
1620     if (current_cpu->trace_result_p)
1621       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
1622   }
1623   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
1624   {
1625     SI opval = tmp_addr;
1626     * FLD (i_rn) = opval;
1627     if (current_cpu->trace_result_p)
1628       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1629   }
1630 }
1631
1632   current_cpu->done_insn (npc, status);
1633   return status;
1634 #undef FLD
1635 }
1636
1637 // ********** str-post-inc-reg-offset: str${cond} $rd,???
1638
1639 sem_status
1640 arm_sem_str_post_inc_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1641 {
1642 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
1643   sem_status status = SEM_STATUS_NORMAL;
1644   arm_scache* abuf = sem;
1645   PCADDR pc = abuf->addr;
1646   PCADDR npc = pc + 4;
1647
1648 {
1649   SI tmp_addr;
1650   SI tmp_offset;
1651   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
1652   tmp_addr = * FLD (i_rn);
1653   {
1654     SI opval = * FLD (i_rd);
1655     current_cpu->SETMEMSI (pc, tmp_addr, opval);
1656     if (current_cpu->trace_result_p)
1657       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
1658   }
1659   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
1660   {
1661     SI opval = tmp_addr;
1662     * FLD (i_rn) = opval;
1663     if (current_cpu->trace_result_p)
1664       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1665   }
1666 }
1667
1668   current_cpu->done_insn (npc, status);
1669   return status;
1670 #undef FLD
1671 }
1672
1673 // ********** str-post-dec-nonpriv-imm-offset: ldr${cond}t $rd,???
1674
1675 sem_status
1676 arm_sem_str_post_dec_nonpriv_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1677 {
1678 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
1679   sem_status status = SEM_STATUS_NORMAL;
1680   arm_scache* abuf = sem;
1681   PCADDR pc = abuf->addr;
1682   PCADDR npc = pc + 4;
1683
1684 {
1685   SI tmp_addr;
1686   SI tmp_offset;
1687   tmp_offset = FLD (f_uimm12);
1688   tmp_addr = * FLD (i_rn);
1689   {
1690     SI opval = * FLD (i_rd);
1691     current_cpu->SETMEMSI (pc, tmp_addr, opval);
1692     if (current_cpu->trace_result_p)
1693       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
1694   }
1695   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
1696   {
1697     SI opval = tmp_addr;
1698     * FLD (i_rn) = opval;
1699     if (current_cpu->trace_result_p)
1700       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1701   }
1702 }
1703
1704   current_cpu->done_insn (npc, status);
1705   return status;
1706 #undef FLD
1707 }
1708
1709 // ********** str-post-dec-nonpriv-reg-offset: str${cond}t $rd,???
1710
1711 sem_status
1712 arm_sem_str_post_dec_nonpriv_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1713 {
1714 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
1715   sem_status status = SEM_STATUS_NORMAL;
1716   arm_scache* abuf = sem;
1717   PCADDR pc = abuf->addr;
1718   PCADDR npc = pc + 4;
1719
1720 {
1721   SI tmp_addr;
1722   SI tmp_offset;
1723   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
1724   tmp_addr = * FLD (i_rn);
1725   {
1726     SI opval = * FLD (i_rd);
1727     current_cpu->SETMEMSI (pc, tmp_addr, opval);
1728     if (current_cpu->trace_result_p)
1729       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
1730   }
1731   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
1732   {
1733     SI opval = tmp_addr;
1734     * FLD (i_rn) = opval;
1735     if (current_cpu->trace_result_p)
1736       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1737   }
1738 }
1739
1740   current_cpu->done_insn (npc, status);
1741   return status;
1742 #undef FLD
1743 }
1744
1745 // ********** str-post-inc-nonpriv-imm-offset: ldr${cond}t $rd,???
1746
1747 sem_status
1748 arm_sem_str_post_inc_nonpriv_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1749 {
1750 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
1751   sem_status status = SEM_STATUS_NORMAL;
1752   arm_scache* abuf = sem;
1753   PCADDR pc = abuf->addr;
1754   PCADDR npc = pc + 4;
1755
1756 {
1757   SI tmp_addr;
1758   SI tmp_offset;
1759   tmp_offset = FLD (f_uimm12);
1760   tmp_addr = * FLD (i_rn);
1761   {
1762     SI opval = * FLD (i_rd);
1763     current_cpu->SETMEMSI (pc, tmp_addr, opval);
1764     if (current_cpu->trace_result_p)
1765       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
1766   }
1767   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
1768   {
1769     SI opval = tmp_addr;
1770     * FLD (i_rn) = opval;
1771     if (current_cpu->trace_result_p)
1772       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1773   }
1774 }
1775
1776   current_cpu->done_insn (npc, status);
1777   return status;
1778 #undef FLD
1779 }
1780
1781 // ********** str-post-inc-nonpriv-reg-offset: str${cond}t $rd,???
1782
1783 sem_status
1784 arm_sem_str_post_inc_nonpriv_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1785 {
1786 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
1787   sem_status status = SEM_STATUS_NORMAL;
1788   arm_scache* abuf = sem;
1789   PCADDR pc = abuf->addr;
1790   PCADDR npc = pc + 4;
1791
1792 {
1793   SI tmp_addr;
1794   SI tmp_offset;
1795   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
1796   tmp_addr = * FLD (i_rn);
1797   {
1798     SI opval = * FLD (i_rd);
1799     current_cpu->SETMEMSI (pc, tmp_addr, opval);
1800     if (current_cpu->trace_result_p)
1801       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
1802   }
1803   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
1804   {
1805     SI opval = tmp_addr;
1806     * FLD (i_rn) = opval;
1807     if (current_cpu->trace_result_p)
1808       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1809   }
1810 }
1811
1812   current_cpu->done_insn (npc, status);
1813   return status;
1814 #undef FLD
1815 }
1816
1817 // ********** str-pre-dec-imm-offset: ldr${cond} $rd,???
1818
1819 sem_status
1820 arm_sem_str_pre_dec_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1821 {
1822 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
1823   sem_status status = SEM_STATUS_NORMAL;
1824   arm_scache* abuf = sem;
1825   PCADDR pc = abuf->addr;
1826   PCADDR npc = pc + 4;
1827
1828 {
1829   SI tmp_addr;
1830   SI tmp_offset;
1831   tmp_offset = FLD (f_uimm12);
1832   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
1833   {
1834     SI opval = * FLD (i_rd);
1835     current_cpu->SETMEMSI (pc, tmp_addr, opval);
1836     if (current_cpu->trace_result_p)
1837       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
1838   }
1839 ((void) 0); /*nop*/
1840 ((void) 0); /*nop*/
1841 }
1842
1843   current_cpu->done_insn (npc, status);
1844   return status;
1845 #undef FLD
1846 }
1847
1848 // ********** str-pre-dec-reg-offset: str${cond} $rd,???
1849
1850 sem_status
1851 arm_sem_str_pre_dec_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1852 {
1853 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
1854   sem_status status = SEM_STATUS_NORMAL;
1855   arm_scache* abuf = sem;
1856   PCADDR pc = abuf->addr;
1857   PCADDR npc = pc + 4;
1858
1859 {
1860   SI tmp_addr;
1861   SI tmp_offset;
1862   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
1863   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
1864   {
1865     SI opval = * FLD (i_rd);
1866     current_cpu->SETMEMSI (pc, tmp_addr, opval);
1867     if (current_cpu->trace_result_p)
1868       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
1869   }
1870 ((void) 0); /*nop*/
1871 ((void) 0); /*nop*/
1872 }
1873
1874   current_cpu->done_insn (npc, status);
1875   return status;
1876 #undef FLD
1877 }
1878
1879 // ********** str-pre-inc-imm-offset: ldr${cond} $rd,???
1880
1881 sem_status
1882 arm_sem_str_pre_inc_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1883 {
1884 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
1885   sem_status status = SEM_STATUS_NORMAL;
1886   arm_scache* abuf = sem;
1887   PCADDR pc = abuf->addr;
1888   PCADDR npc = pc + 4;
1889
1890 {
1891   SI tmp_addr;
1892   SI tmp_offset;
1893   tmp_offset = FLD (f_uimm12);
1894   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
1895   {
1896     SI opval = * FLD (i_rd);
1897     current_cpu->SETMEMSI (pc, tmp_addr, opval);
1898     if (current_cpu->trace_result_p)
1899       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
1900   }
1901 ((void) 0); /*nop*/
1902 ((void) 0); /*nop*/
1903 }
1904
1905   current_cpu->done_insn (npc, status);
1906   return status;
1907 #undef FLD
1908 }
1909
1910 // ********** str-pre-inc-reg-offset: str${cond} $rd,???
1911
1912 sem_status
1913 arm_sem_str_pre_inc_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1914 {
1915 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
1916   sem_status status = SEM_STATUS_NORMAL;
1917   arm_scache* abuf = sem;
1918   PCADDR pc = abuf->addr;
1919   PCADDR npc = pc + 4;
1920
1921 {
1922   SI tmp_addr;
1923   SI tmp_offset;
1924   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
1925   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
1926   {
1927     SI opval = * FLD (i_rd);
1928     current_cpu->SETMEMSI (pc, tmp_addr, opval);
1929     if (current_cpu->trace_result_p)
1930       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
1931   }
1932 ((void) 0); /*nop*/
1933 ((void) 0); /*nop*/
1934 }
1935
1936   current_cpu->done_insn (npc, status);
1937   return status;
1938 #undef FLD
1939 }
1940
1941 // ********** str-pre-dec-wb-imm-offset: ldr${cond} $rd,???
1942
1943 sem_status
1944 arm_sem_str_pre_dec_wb_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1945 {
1946 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
1947   sem_status status = SEM_STATUS_NORMAL;
1948   arm_scache* abuf = sem;
1949   PCADDR pc = abuf->addr;
1950   PCADDR npc = pc + 4;
1951
1952 {
1953   SI tmp_addr;
1954   SI tmp_offset;
1955   tmp_offset = FLD (f_uimm12);
1956   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
1957   {
1958     SI opval = * FLD (i_rd);
1959     current_cpu->SETMEMSI (pc, tmp_addr, opval);
1960     if (current_cpu->trace_result_p)
1961       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
1962   }
1963 ((void) 0); /*nop*/
1964   {
1965     SI opval = tmp_addr;
1966     * FLD (i_rn) = opval;
1967     if (current_cpu->trace_result_p)
1968       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
1969   }
1970 }
1971
1972   current_cpu->done_insn (npc, status);
1973   return status;
1974 #undef FLD
1975 }
1976
1977 // ********** str-pre-dec-wb-reg-offset: str${cond} $rd,???
1978
1979 sem_status
1980 arm_sem_str_pre_dec_wb_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
1981 {
1982 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
1983   sem_status status = SEM_STATUS_NORMAL;
1984   arm_scache* abuf = sem;
1985   PCADDR pc = abuf->addr;
1986   PCADDR npc = pc + 4;
1987
1988 {
1989   SI tmp_addr;
1990   SI tmp_offset;
1991   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
1992   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
1993   {
1994     SI opval = * FLD (i_rd);
1995     current_cpu->SETMEMSI (pc, tmp_addr, opval);
1996     if (current_cpu->trace_result_p)
1997       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
1998   }
1999 ((void) 0); /*nop*/
2000   {
2001     SI opval = tmp_addr;
2002     * FLD (i_rn) = opval;
2003     if (current_cpu->trace_result_p)
2004       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2005   }
2006 }
2007
2008   current_cpu->done_insn (npc, status);
2009   return status;
2010 #undef FLD
2011 }
2012
2013 // ********** str-pre-inc-wb-imm-offset: ldr${cond} $rd,???
2014
2015 sem_status
2016 arm_sem_str_pre_inc_wb_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2017 {
2018 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
2019   sem_status status = SEM_STATUS_NORMAL;
2020   arm_scache* abuf = sem;
2021   PCADDR pc = abuf->addr;
2022   PCADDR npc = pc + 4;
2023
2024 {
2025   SI tmp_addr;
2026   SI tmp_offset;
2027   tmp_offset = FLD (f_uimm12);
2028   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
2029   {
2030     SI opval = * FLD (i_rd);
2031     current_cpu->SETMEMSI (pc, tmp_addr, opval);
2032     if (current_cpu->trace_result_p)
2033       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
2034   }
2035 ((void) 0); /*nop*/
2036   {
2037     SI opval = tmp_addr;
2038     * FLD (i_rn) = opval;
2039     if (current_cpu->trace_result_p)
2040       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2041   }
2042 }
2043
2044   current_cpu->done_insn (npc, status);
2045   return status;
2046 #undef FLD
2047 }
2048
2049 // ********** str-pre-inc-wb-reg-offset: str${cond} $rd,???
2050
2051 sem_status
2052 arm_sem_str_pre_inc_wb_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2053 {
2054 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
2055   sem_status status = SEM_STATUS_NORMAL;
2056   arm_scache* abuf = sem;
2057   PCADDR pc = abuf->addr;
2058   PCADDR npc = pc + 4;
2059
2060 {
2061   SI tmp_addr;
2062   SI tmp_offset;
2063   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
2064   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
2065   {
2066     SI opval = * FLD (i_rd);
2067     current_cpu->SETMEMSI (pc, tmp_addr, opval);
2068     if (current_cpu->trace_result_p)
2069       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
2070   }
2071 ((void) 0); /*nop*/
2072   {
2073     SI opval = tmp_addr;
2074     * FLD (i_rn) = opval;
2075     if (current_cpu->trace_result_p)
2076       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2077   }
2078 }
2079
2080   current_cpu->done_insn (npc, status);
2081   return status;
2082 #undef FLD
2083 }
2084
2085 // ********** strb-post-dec-imm-offset: ldr${cond}b $rd,???
2086
2087 sem_status
2088 arm_sem_strb_post_dec_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2089 {
2090 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
2091   sem_status status = SEM_STATUS_NORMAL;
2092   arm_scache* abuf = sem;
2093   PCADDR pc = abuf->addr;
2094   PCADDR npc = pc + 4;
2095
2096 {
2097   SI tmp_addr;
2098   SI tmp_offset;
2099   tmp_offset = FLD (f_uimm12);
2100   tmp_addr = * FLD (i_rn);
2101   {
2102     QI opval = TRUNCSIQI (* FLD (i_rd));
2103     current_cpu->SETMEMQI (pc, tmp_addr, opval);
2104     if (current_cpu->trace_result_p)
2105       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
2106   }
2107   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
2108   {
2109     SI opval = tmp_addr;
2110     * FLD (i_rn) = opval;
2111     if (current_cpu->trace_result_p)
2112       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2113   }
2114 }
2115
2116   current_cpu->done_insn (npc, status);
2117   return status;
2118 #undef FLD
2119 }
2120
2121 // ********** strb-post-dec-reg-offset: str${cond}b $rd,???
2122
2123 sem_status
2124 arm_sem_strb_post_dec_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2125 {
2126 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
2127   sem_status status = SEM_STATUS_NORMAL;
2128   arm_scache* abuf = sem;
2129   PCADDR pc = abuf->addr;
2130   PCADDR npc = pc + 4;
2131
2132 {
2133   SI tmp_addr;
2134   SI tmp_offset;
2135   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
2136   tmp_addr = * FLD (i_rn);
2137   {
2138     QI opval = TRUNCSIQI (* FLD (i_rd));
2139     current_cpu->SETMEMQI (pc, tmp_addr, opval);
2140     if (current_cpu->trace_result_p)
2141       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
2142   }
2143   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
2144   {
2145     SI opval = tmp_addr;
2146     * FLD (i_rn) = opval;
2147     if (current_cpu->trace_result_p)
2148       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2149   }
2150 }
2151
2152   current_cpu->done_insn (npc, status);
2153   return status;
2154 #undef FLD
2155 }
2156
2157 // ********** strb-post-inc-imm-offset: ldr${cond} $rd,???
2158
2159 sem_status
2160 arm_sem_strb_post_inc_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2161 {
2162 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
2163   sem_status status = SEM_STATUS_NORMAL;
2164   arm_scache* abuf = sem;
2165   PCADDR pc = abuf->addr;
2166   PCADDR npc = pc + 4;
2167
2168 {
2169   SI tmp_addr;
2170   SI tmp_offset;
2171   tmp_offset = FLD (f_uimm12);
2172   tmp_addr = * FLD (i_rn);
2173   {
2174     QI opval = TRUNCSIQI (* FLD (i_rd));
2175     current_cpu->SETMEMQI (pc, tmp_addr, opval);
2176     if (current_cpu->trace_result_p)
2177       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
2178   }
2179   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
2180   {
2181     SI opval = tmp_addr;
2182     * FLD (i_rn) = opval;
2183     if (current_cpu->trace_result_p)
2184       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2185   }
2186 }
2187
2188   current_cpu->done_insn (npc, status);
2189   return status;
2190 #undef FLD
2191 }
2192
2193 // ********** strb-post-inc-reg-offset: str${cond} $rd,???
2194
2195 sem_status
2196 arm_sem_strb_post_inc_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2197 {
2198 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
2199   sem_status status = SEM_STATUS_NORMAL;
2200   arm_scache* abuf = sem;
2201   PCADDR pc = abuf->addr;
2202   PCADDR npc = pc + 4;
2203
2204 {
2205   SI tmp_addr;
2206   SI tmp_offset;
2207   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
2208   tmp_addr = * FLD (i_rn);
2209   {
2210     QI opval = TRUNCSIQI (* FLD (i_rd));
2211     current_cpu->SETMEMQI (pc, tmp_addr, opval);
2212     if (current_cpu->trace_result_p)
2213       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
2214   }
2215   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
2216   {
2217     SI opval = tmp_addr;
2218     * FLD (i_rn) = opval;
2219     if (current_cpu->trace_result_p)
2220       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2221   }
2222 }
2223
2224   current_cpu->done_insn (npc, status);
2225   return status;
2226 #undef FLD
2227 }
2228
2229 // ********** strb-post-dec-nonpriv-imm-offset: ldr${cond}t $rd,???
2230
2231 sem_status
2232 arm_sem_strb_post_dec_nonpriv_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2233 {
2234 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
2235   sem_status status = SEM_STATUS_NORMAL;
2236   arm_scache* abuf = sem;
2237   PCADDR pc = abuf->addr;
2238   PCADDR npc = pc + 4;
2239
2240 {
2241   SI tmp_addr;
2242   SI tmp_offset;
2243   tmp_offset = FLD (f_uimm12);
2244   tmp_addr = * FLD (i_rn);
2245   {
2246     QI opval = TRUNCSIQI (* FLD (i_rd));
2247     current_cpu->SETMEMQI (pc, tmp_addr, opval);
2248     if (current_cpu->trace_result_p)
2249       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
2250   }
2251   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
2252   {
2253     SI opval = tmp_addr;
2254     * FLD (i_rn) = opval;
2255     if (current_cpu->trace_result_p)
2256       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2257   }
2258 }
2259
2260   current_cpu->done_insn (npc, status);
2261   return status;
2262 #undef FLD
2263 }
2264
2265 // ********** strb-post-dec-nonpriv-reg-offset: str${cond}t $rd,???
2266
2267 sem_status
2268 arm_sem_strb_post_dec_nonpriv_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2269 {
2270 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
2271   sem_status status = SEM_STATUS_NORMAL;
2272   arm_scache* abuf = sem;
2273   PCADDR pc = abuf->addr;
2274   PCADDR npc = pc + 4;
2275
2276 {
2277   SI tmp_addr;
2278   SI tmp_offset;
2279   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
2280   tmp_addr = * FLD (i_rn);
2281   {
2282     QI opval = TRUNCSIQI (* FLD (i_rd));
2283     current_cpu->SETMEMQI (pc, tmp_addr, opval);
2284     if (current_cpu->trace_result_p)
2285       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
2286   }
2287   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
2288   {
2289     SI opval = tmp_addr;
2290     * FLD (i_rn) = opval;
2291     if (current_cpu->trace_result_p)
2292       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2293   }
2294 }
2295
2296   current_cpu->done_insn (npc, status);
2297   return status;
2298 #undef FLD
2299 }
2300
2301 // ********** strb-post-inc-nonpriv-imm-offset: ldr${cond}t $rd,???
2302
2303 sem_status
2304 arm_sem_strb_post_inc_nonpriv_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2305 {
2306 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
2307   sem_status status = SEM_STATUS_NORMAL;
2308   arm_scache* abuf = sem;
2309   PCADDR pc = abuf->addr;
2310   PCADDR npc = pc + 4;
2311
2312 {
2313   SI tmp_addr;
2314   SI tmp_offset;
2315   tmp_offset = FLD (f_uimm12);
2316   tmp_addr = * FLD (i_rn);
2317   {
2318     QI opval = TRUNCSIQI (* FLD (i_rd));
2319     current_cpu->SETMEMQI (pc, tmp_addr, opval);
2320     if (current_cpu->trace_result_p)
2321       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
2322   }
2323   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
2324   {
2325     SI opval = tmp_addr;
2326     * FLD (i_rn) = opval;
2327     if (current_cpu->trace_result_p)
2328       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2329   }
2330 }
2331
2332   current_cpu->done_insn (npc, status);
2333   return status;
2334 #undef FLD
2335 }
2336
2337 // ********** strb-post-inc-nonpriv-reg-offset: str${cond}t $rd,???
2338
2339 sem_status
2340 arm_sem_strb_post_inc_nonpriv_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2341 {
2342 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
2343   sem_status status = SEM_STATUS_NORMAL;
2344   arm_scache* abuf = sem;
2345   PCADDR pc = abuf->addr;
2346   PCADDR npc = pc + 4;
2347
2348 {
2349   SI tmp_addr;
2350   SI tmp_offset;
2351   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
2352   tmp_addr = * FLD (i_rn);
2353   {
2354     QI opval = TRUNCSIQI (* FLD (i_rd));
2355     current_cpu->SETMEMQI (pc, tmp_addr, opval);
2356     if (current_cpu->trace_result_p)
2357       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
2358   }
2359   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
2360   {
2361     SI opval = tmp_addr;
2362     * FLD (i_rn) = opval;
2363     if (current_cpu->trace_result_p)
2364       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2365   }
2366 }
2367
2368   current_cpu->done_insn (npc, status);
2369   return status;
2370 #undef FLD
2371 }
2372
2373 // ********** strb-pre-dec-imm-offset: ldr${cond} $rd,???
2374
2375 sem_status
2376 arm_sem_strb_pre_dec_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2377 {
2378 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
2379   sem_status status = SEM_STATUS_NORMAL;
2380   arm_scache* abuf = sem;
2381   PCADDR pc = abuf->addr;
2382   PCADDR npc = pc + 4;
2383
2384 {
2385   SI tmp_addr;
2386   SI tmp_offset;
2387   tmp_offset = FLD (f_uimm12);
2388   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
2389   {
2390     QI opval = TRUNCSIQI (* FLD (i_rd));
2391     current_cpu->SETMEMQI (pc, tmp_addr, opval);
2392     if (current_cpu->trace_result_p)
2393       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
2394   }
2395 ((void) 0); /*nop*/
2396 ((void) 0); /*nop*/
2397 }
2398
2399   current_cpu->done_insn (npc, status);
2400   return status;
2401 #undef FLD
2402 }
2403
2404 // ********** strb-pre-dec-reg-offset: str${cond} $rd,???
2405
2406 sem_status
2407 arm_sem_strb_pre_dec_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2408 {
2409 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
2410   sem_status status = SEM_STATUS_NORMAL;
2411   arm_scache* abuf = sem;
2412   PCADDR pc = abuf->addr;
2413   PCADDR npc = pc + 4;
2414
2415 {
2416   SI tmp_addr;
2417   SI tmp_offset;
2418   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
2419   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
2420   {
2421     QI opval = TRUNCSIQI (* FLD (i_rd));
2422     current_cpu->SETMEMQI (pc, tmp_addr, opval);
2423     if (current_cpu->trace_result_p)
2424       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
2425   }
2426 ((void) 0); /*nop*/
2427 ((void) 0); /*nop*/
2428 }
2429
2430   current_cpu->done_insn (npc, status);
2431   return status;
2432 #undef FLD
2433 }
2434
2435 // ********** strb-pre-inc-imm-offset: ldr${cond} $rd,???
2436
2437 sem_status
2438 arm_sem_strb_pre_inc_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2439 {
2440 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
2441   sem_status status = SEM_STATUS_NORMAL;
2442   arm_scache* abuf = sem;
2443   PCADDR pc = abuf->addr;
2444   PCADDR npc = pc + 4;
2445
2446 {
2447   SI tmp_addr;
2448   SI tmp_offset;
2449   tmp_offset = FLD (f_uimm12);
2450   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
2451   {
2452     QI opval = TRUNCSIQI (* FLD (i_rd));
2453     current_cpu->SETMEMQI (pc, tmp_addr, opval);
2454     if (current_cpu->trace_result_p)
2455       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
2456   }
2457 ((void) 0); /*nop*/
2458 ((void) 0); /*nop*/
2459 }
2460
2461   current_cpu->done_insn (npc, status);
2462   return status;
2463 #undef FLD
2464 }
2465
2466 // ********** strb-pre-inc-reg-offset: str${cond} $rd,???
2467
2468 sem_status
2469 arm_sem_strb_pre_inc_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2470 {
2471 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
2472   sem_status status = SEM_STATUS_NORMAL;
2473   arm_scache* abuf = sem;
2474   PCADDR pc = abuf->addr;
2475   PCADDR npc = pc + 4;
2476
2477 {
2478   SI tmp_addr;
2479   SI tmp_offset;
2480   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
2481   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
2482   {
2483     QI opval = TRUNCSIQI (* FLD (i_rd));
2484     current_cpu->SETMEMQI (pc, tmp_addr, opval);
2485     if (current_cpu->trace_result_p)
2486       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
2487   }
2488 ((void) 0); /*nop*/
2489 ((void) 0); /*nop*/
2490 }
2491
2492   current_cpu->done_insn (npc, status);
2493   return status;
2494 #undef FLD
2495 }
2496
2497 // ********** strb-pre-dec-wb-imm-offset: ldr${cond} $rd,???
2498
2499 sem_status
2500 arm_sem_strb_pre_dec_wb_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2501 {
2502 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
2503   sem_status status = SEM_STATUS_NORMAL;
2504   arm_scache* abuf = sem;
2505   PCADDR pc = abuf->addr;
2506   PCADDR npc = pc + 4;
2507
2508 {
2509   SI tmp_addr;
2510   SI tmp_offset;
2511   tmp_offset = FLD (f_uimm12);
2512   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
2513   {
2514     QI opval = TRUNCSIQI (* FLD (i_rd));
2515     current_cpu->SETMEMQI (pc, tmp_addr, opval);
2516     if (current_cpu->trace_result_p)
2517       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
2518   }
2519 ((void) 0); /*nop*/
2520   {
2521     SI opval = tmp_addr;
2522     * FLD (i_rn) = opval;
2523     if (current_cpu->trace_result_p)
2524       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2525   }
2526 }
2527
2528   current_cpu->done_insn (npc, status);
2529   return status;
2530 #undef FLD
2531 }
2532
2533 // ********** strb-pre-dec-wb-reg-offset: str${cond} $rd,???
2534
2535 sem_status
2536 arm_sem_strb_pre_dec_wb_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2537 {
2538 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
2539   sem_status status = SEM_STATUS_NORMAL;
2540   arm_scache* abuf = sem;
2541   PCADDR pc = abuf->addr;
2542   PCADDR npc = pc + 4;
2543
2544 {
2545   SI tmp_addr;
2546   SI tmp_offset;
2547   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
2548   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
2549   {
2550     QI opval = TRUNCSIQI (* FLD (i_rd));
2551     current_cpu->SETMEMQI (pc, tmp_addr, opval);
2552     if (current_cpu->trace_result_p)
2553       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
2554   }
2555 ((void) 0); /*nop*/
2556   {
2557     SI opval = tmp_addr;
2558     * FLD (i_rn) = opval;
2559     if (current_cpu->trace_result_p)
2560       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2561   }
2562 }
2563
2564   current_cpu->done_insn (npc, status);
2565   return status;
2566 #undef FLD
2567 }
2568
2569 // ********** strb-pre-inc-wb-imm-offset: ldr${cond} $rd,???
2570
2571 sem_status
2572 arm_sem_strb_pre_inc_wb_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2573 {
2574 #define FLD(f) abuf->fields.sfmt_ldr_post_dec_imm_offset.f
2575   sem_status status = SEM_STATUS_NORMAL;
2576   arm_scache* abuf = sem;
2577   PCADDR pc = abuf->addr;
2578   PCADDR npc = pc + 4;
2579
2580 {
2581   SI tmp_addr;
2582   SI tmp_offset;
2583   tmp_offset = FLD (f_uimm12);
2584   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
2585   {
2586     QI opval = TRUNCSIQI (* FLD (i_rd));
2587     current_cpu->SETMEMQI (pc, tmp_addr, opval);
2588     if (current_cpu->trace_result_p)
2589       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
2590   }
2591 ((void) 0); /*nop*/
2592   {
2593     SI opval = tmp_addr;
2594     * FLD (i_rn) = opval;
2595     if (current_cpu->trace_result_p)
2596       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2597   }
2598 }
2599
2600   current_cpu->done_insn (npc, status);
2601   return status;
2602 #undef FLD
2603 }
2604
2605 // ********** strb-pre-inc-wb-reg-offset: str${cond} $rd,???
2606
2607 sem_status
2608 arm_sem_strb_pre_inc_wb_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2609 {
2610 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
2611   sem_status status = SEM_STATUS_NORMAL;
2612   arm_scache* abuf = sem;
2613   PCADDR pc = abuf->addr;
2614   PCADDR npc = pc + 4;
2615
2616 {
2617   SI tmp_addr;
2618   SI tmp_offset;
2619   tmp_offset = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
2620   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
2621   {
2622     QI opval = TRUNCSIQI (* FLD (i_rd));
2623     current_cpu->SETMEMQI (pc, tmp_addr, opval);
2624     if (current_cpu->trace_result_p)
2625       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
2626   }
2627 ((void) 0); /*nop*/
2628   {
2629     SI opval = tmp_addr;
2630     * FLD (i_rn) = opval;
2631     if (current_cpu->trace_result_p)
2632       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2633   }
2634 }
2635
2636   current_cpu->done_insn (npc, status);
2637   return status;
2638 #undef FLD
2639 }
2640
2641 // ********** strh-pre-dec-imm-offset: FIXME
2642
2643 sem_status
2644 arm_sem_strh_pre_dec_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2645 {
2646 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
2647   sem_status status = SEM_STATUS_NORMAL;
2648   arm_scache* abuf = sem;
2649   PCADDR pc = abuf->addr;
2650   PCADDR npc = pc + 4;
2651
2652 {
2653   SI tmp_addr;
2654   SI tmp_offset;
2655   tmp_offset = FLD (i_hdt_offset8);
2656   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
2657   {
2658     HI opval = TRUNCSIHI (* FLD (i_rd));
2659     current_cpu->SETMEMHI (pc, tmp_addr, opval);
2660     if (current_cpu->trace_result_p)
2661       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
2662   }
2663 ((void) 0); /*nop*/
2664 ((void) 0); /*nop*/
2665 }
2666
2667   current_cpu->done_insn (npc, status);
2668   return status;
2669 #undef FLD
2670 }
2671
2672 // ********** strh-pre-dec-reg-offset: FIXME
2673
2674 sem_status
2675 arm_sem_strh_pre_dec_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2676 {
2677 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
2678   sem_status status = SEM_STATUS_NORMAL;
2679   arm_scache* abuf = sem;
2680   PCADDR pc = abuf->addr;
2681   PCADDR npc = pc + 4;
2682
2683 {
2684   SI tmp_addr;
2685   SI tmp_offset;
2686   tmp_offset = * FLD (i_rm);
2687   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
2688   {
2689     HI opval = TRUNCSIHI (* FLD (i_rd));
2690     current_cpu->SETMEMHI (pc, tmp_addr, opval);
2691     if (current_cpu->trace_result_p)
2692       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
2693   }
2694 ((void) 0); /*nop*/
2695 ((void) 0); /*nop*/
2696 }
2697
2698   current_cpu->done_insn (npc, status);
2699   return status;
2700 #undef FLD
2701 }
2702
2703 // ********** strh-pre-inc-imm-offset: FIXME
2704
2705 sem_status
2706 arm_sem_strh_pre_inc_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2707 {
2708 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
2709   sem_status status = SEM_STATUS_NORMAL;
2710   arm_scache* abuf = sem;
2711   PCADDR pc = abuf->addr;
2712   PCADDR npc = pc + 4;
2713
2714 {
2715   SI tmp_addr;
2716   SI tmp_offset;
2717   tmp_offset = FLD (i_hdt_offset8);
2718   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
2719   {
2720     HI opval = TRUNCSIHI (* FLD (i_rd));
2721     current_cpu->SETMEMHI (pc, tmp_addr, opval);
2722     if (current_cpu->trace_result_p)
2723       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
2724   }
2725 ((void) 0); /*nop*/
2726 ((void) 0); /*nop*/
2727 }
2728
2729   current_cpu->done_insn (npc, status);
2730   return status;
2731 #undef FLD
2732 }
2733
2734 // ********** strh-pre-inc-reg-offset: FIXME
2735
2736 sem_status
2737 arm_sem_strh_pre_inc_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2738 {
2739 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
2740   sem_status status = SEM_STATUS_NORMAL;
2741   arm_scache* abuf = sem;
2742   PCADDR pc = abuf->addr;
2743   PCADDR npc = pc + 4;
2744
2745 {
2746   SI tmp_addr;
2747   SI tmp_offset;
2748   tmp_offset = * FLD (i_rm);
2749   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
2750   {
2751     HI opval = TRUNCSIHI (* FLD (i_rd));
2752     current_cpu->SETMEMHI (pc, tmp_addr, opval);
2753     if (current_cpu->trace_result_p)
2754       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
2755   }
2756 ((void) 0); /*nop*/
2757 ((void) 0); /*nop*/
2758 }
2759
2760   current_cpu->done_insn (npc, status);
2761   return status;
2762 #undef FLD
2763 }
2764
2765 // ********** strh-pre-dec-wb-imm-offset: FIXME
2766
2767 sem_status
2768 arm_sem_strh_pre_dec_wb_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2769 {
2770 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
2771   sem_status status = SEM_STATUS_NORMAL;
2772   arm_scache* abuf = sem;
2773   PCADDR pc = abuf->addr;
2774   PCADDR npc = pc + 4;
2775
2776 {
2777   SI tmp_addr;
2778   SI tmp_offset;
2779   tmp_offset = FLD (i_hdt_offset8);
2780   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
2781   {
2782     HI opval = TRUNCSIHI (* FLD (i_rd));
2783     current_cpu->SETMEMHI (pc, tmp_addr, opval);
2784     if (current_cpu->trace_result_p)
2785       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
2786   }
2787 ((void) 0); /*nop*/
2788   {
2789     SI opval = tmp_addr;
2790     * FLD (i_rn) = opval;
2791     if (current_cpu->trace_result_p)
2792       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2793   }
2794 }
2795
2796   current_cpu->done_insn (npc, status);
2797   return status;
2798 #undef FLD
2799 }
2800
2801 // ********** strh-pre-dec-wb-reg-offset: FIXME
2802
2803 sem_status
2804 arm_sem_strh_pre_dec_wb_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2805 {
2806 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
2807   sem_status status = SEM_STATUS_NORMAL;
2808   arm_scache* abuf = sem;
2809   PCADDR pc = abuf->addr;
2810   PCADDR npc = pc + 4;
2811
2812 {
2813   SI tmp_addr;
2814   SI tmp_offset;
2815   tmp_offset = * FLD (i_rm);
2816   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
2817   {
2818     HI opval = TRUNCSIHI (* FLD (i_rd));
2819     current_cpu->SETMEMHI (pc, tmp_addr, opval);
2820     if (current_cpu->trace_result_p)
2821       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
2822   }
2823 ((void) 0); /*nop*/
2824   {
2825     SI opval = tmp_addr;
2826     * FLD (i_rn) = opval;
2827     if (current_cpu->trace_result_p)
2828       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2829   }
2830 }
2831
2832   current_cpu->done_insn (npc, status);
2833   return status;
2834 #undef FLD
2835 }
2836
2837 // ********** strh-pre-inc-wb-imm-offset: FIXME
2838
2839 sem_status
2840 arm_sem_strh_pre_inc_wb_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2841 {
2842 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
2843   sem_status status = SEM_STATUS_NORMAL;
2844   arm_scache* abuf = sem;
2845   PCADDR pc = abuf->addr;
2846   PCADDR npc = pc + 4;
2847
2848 {
2849   SI tmp_addr;
2850   SI tmp_offset;
2851   tmp_offset = FLD (i_hdt_offset8);
2852   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
2853   {
2854     HI opval = TRUNCSIHI (* FLD (i_rd));
2855     current_cpu->SETMEMHI (pc, tmp_addr, opval);
2856     if (current_cpu->trace_result_p)
2857       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
2858   }
2859 ((void) 0); /*nop*/
2860   {
2861     SI opval = tmp_addr;
2862     * FLD (i_rn) = opval;
2863     if (current_cpu->trace_result_p)
2864       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2865   }
2866 }
2867
2868   current_cpu->done_insn (npc, status);
2869   return status;
2870 #undef FLD
2871 }
2872
2873 // ********** strh-pre-inc-wb-reg-offset: FIXME
2874
2875 sem_status
2876 arm_sem_strh_pre_inc_wb_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2877 {
2878 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
2879   sem_status status = SEM_STATUS_NORMAL;
2880   arm_scache* abuf = sem;
2881   PCADDR pc = abuf->addr;
2882   PCADDR npc = pc + 4;
2883
2884 {
2885   SI tmp_addr;
2886   SI tmp_offset;
2887   tmp_offset = * FLD (i_rm);
2888   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
2889   {
2890     HI opval = TRUNCSIHI (* FLD (i_rd));
2891     current_cpu->SETMEMHI (pc, tmp_addr, opval);
2892     if (current_cpu->trace_result_p)
2893       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
2894   }
2895 ((void) 0); /*nop*/
2896   {
2897     SI opval = tmp_addr;
2898     * FLD (i_rn) = opval;
2899     if (current_cpu->trace_result_p)
2900       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2901   }
2902 }
2903
2904   current_cpu->done_insn (npc, status);
2905   return status;
2906 #undef FLD
2907 }
2908
2909 // ********** strh-post-dec-imm-offset: FIXME
2910
2911 sem_status
2912 arm_sem_strh_post_dec_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2913 {
2914 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
2915   sem_status status = SEM_STATUS_NORMAL;
2916   arm_scache* abuf = sem;
2917   PCADDR pc = abuf->addr;
2918   PCADDR npc = pc + 4;
2919
2920 {
2921   SI tmp_addr;
2922   SI tmp_offset;
2923   tmp_offset = FLD (i_hdt_offset8);
2924   tmp_addr = * FLD (i_rn);
2925   {
2926     HI opval = TRUNCSIHI (* FLD (i_rd));
2927     current_cpu->SETMEMHI (pc, tmp_addr, opval);
2928     if (current_cpu->trace_result_p)
2929       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
2930   }
2931   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
2932   {
2933     SI opval = tmp_addr;
2934     * FLD (i_rn) = opval;
2935     if (current_cpu->trace_result_p)
2936       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2937   }
2938 }
2939
2940   current_cpu->done_insn (npc, status);
2941   return status;
2942 #undef FLD
2943 }
2944
2945 // ********** strh-post-dec-reg-offset: FIXME
2946
2947 sem_status
2948 arm_sem_strh_post_dec_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2949 {
2950 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
2951   sem_status status = SEM_STATUS_NORMAL;
2952   arm_scache* abuf = sem;
2953   PCADDR pc = abuf->addr;
2954   PCADDR npc = pc + 4;
2955
2956 {
2957   SI tmp_addr;
2958   SI tmp_offset;
2959   tmp_offset = * FLD (i_rm);
2960   tmp_addr = * FLD (i_rn);
2961   {
2962     HI opval = TRUNCSIHI (* FLD (i_rd));
2963     current_cpu->SETMEMHI (pc, tmp_addr, opval);
2964     if (current_cpu->trace_result_p)
2965       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
2966   }
2967   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
2968   {
2969     SI opval = tmp_addr;
2970     * FLD (i_rn) = opval;
2971     if (current_cpu->trace_result_p)
2972       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
2973   }
2974 }
2975
2976   current_cpu->done_insn (npc, status);
2977   return status;
2978 #undef FLD
2979 }
2980
2981 // ********** strh-post-inc-imm-offset: FIXME
2982
2983 sem_status
2984 arm_sem_strh_post_inc_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
2985 {
2986 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
2987   sem_status status = SEM_STATUS_NORMAL;
2988   arm_scache* abuf = sem;
2989   PCADDR pc = abuf->addr;
2990   PCADDR npc = pc + 4;
2991
2992 {
2993   SI tmp_addr;
2994   SI tmp_offset;
2995   tmp_offset = FLD (i_hdt_offset8);
2996   tmp_addr = * FLD (i_rn);
2997   {
2998     HI opval = TRUNCSIHI (* FLD (i_rd));
2999     current_cpu->SETMEMHI (pc, tmp_addr, opval);
3000     if (current_cpu->trace_result_p)
3001       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
3002   }
3003   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
3004   {
3005     SI opval = tmp_addr;
3006     * FLD (i_rn) = opval;
3007     if (current_cpu->trace_result_p)
3008       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
3009   }
3010 }
3011
3012   current_cpu->done_insn (npc, status);
3013   return status;
3014 #undef FLD
3015 }
3016
3017 // ********** strh-post-inc-reg-offset: FIXME
3018
3019 sem_status
3020 arm_sem_strh_post_inc_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3021 {
3022 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
3023   sem_status status = SEM_STATUS_NORMAL;
3024   arm_scache* abuf = sem;
3025   PCADDR pc = abuf->addr;
3026   PCADDR npc = pc + 4;
3027
3028 {
3029   SI tmp_addr;
3030   SI tmp_offset;
3031   tmp_offset = * FLD (i_rm);
3032   tmp_addr = * FLD (i_rn);
3033   {
3034     HI opval = TRUNCSIHI (* FLD (i_rd));
3035     current_cpu->SETMEMHI (pc, tmp_addr, opval);
3036     if (current_cpu->trace_result_p)
3037       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
3038   }
3039   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
3040   {
3041     SI opval = tmp_addr;
3042     * FLD (i_rn) = opval;
3043     if (current_cpu->trace_result_p)
3044       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
3045   }
3046 }
3047
3048   current_cpu->done_insn (npc, status);
3049   return status;
3050 #undef FLD
3051 }
3052
3053 // ********** ldrsb-pre-dec-imm-offset: FIXME
3054
3055 sem_status
3056 arm_sem_ldrsb_pre_dec_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3057 {
3058 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
3059   sem_status status = SEM_STATUS_NORMAL;
3060   arm_scache* abuf = sem;
3061   PCADDR pc = abuf->addr;
3062   PCADDR npc = pc + 4;
3063
3064 {
3065   SI tmp_addr;
3066   SI tmp_offset;
3067   tmp_offset = FLD (i_hdt_offset8);
3068   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
3069 if (EQSI (FLD (f_rd), 15)) {
3070   {
3071     USI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3072     current_cpu->branch (opval, npc, status);
3073     if (current_cpu->trace_result_p)
3074       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3075   }
3076 } else {
3077   {
3078     SI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3079     * FLD (i_rd) = opval;
3080     if (current_cpu->trace_result_p)
3081       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3082   }
3083 }
3084 ((void) 0); /*nop*/
3085 ((void) 0); /*nop*/
3086 }
3087
3088   current_cpu->done_cti_insn (npc, status);
3089   return status;
3090 #undef FLD
3091 }
3092
3093 // ********** ldrsb-pre-dec-reg-offset: FIXME
3094
3095 sem_status
3096 arm_sem_ldrsb_pre_dec_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3097 {
3098 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
3099   sem_status status = SEM_STATUS_NORMAL;
3100   arm_scache* abuf = sem;
3101   PCADDR pc = abuf->addr;
3102   PCADDR npc = pc + 4;
3103
3104 {
3105   SI tmp_addr;
3106   SI tmp_offset;
3107   tmp_offset = * FLD (i_rm);
3108   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
3109 if (EQSI (FLD (f_rd), 15)) {
3110   {
3111     USI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3112     current_cpu->branch (opval, npc, status);
3113     if (current_cpu->trace_result_p)
3114       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3115   }
3116 } else {
3117   {
3118     SI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3119     * FLD (i_rd) = opval;
3120     if (current_cpu->trace_result_p)
3121       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3122   }
3123 }
3124 ((void) 0); /*nop*/
3125 ((void) 0); /*nop*/
3126 }
3127
3128   current_cpu->done_cti_insn (npc, status);
3129   return status;
3130 #undef FLD
3131 }
3132
3133 // ********** ldrsb-pre-inc-imm-offset: FIXME
3134
3135 sem_status
3136 arm_sem_ldrsb_pre_inc_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3137 {
3138 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
3139   sem_status status = SEM_STATUS_NORMAL;
3140   arm_scache* abuf = sem;
3141   PCADDR pc = abuf->addr;
3142   PCADDR npc = pc + 4;
3143
3144 {
3145   SI tmp_addr;
3146   SI tmp_offset;
3147   tmp_offset = FLD (i_hdt_offset8);
3148   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
3149 if (EQSI (FLD (f_rd), 15)) {
3150   {
3151     USI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3152     current_cpu->branch (opval, npc, status);
3153     if (current_cpu->trace_result_p)
3154       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3155   }
3156 } else {
3157   {
3158     SI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3159     * FLD (i_rd) = opval;
3160     if (current_cpu->trace_result_p)
3161       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3162   }
3163 }
3164 ((void) 0); /*nop*/
3165 ((void) 0); /*nop*/
3166 }
3167
3168   current_cpu->done_cti_insn (npc, status);
3169   return status;
3170 #undef FLD
3171 }
3172
3173 // ********** ldrsb-pre-inc-reg-offset: FIXME
3174
3175 sem_status
3176 arm_sem_ldrsb_pre_inc_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3177 {
3178 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
3179   sem_status status = SEM_STATUS_NORMAL;
3180   arm_scache* abuf = sem;
3181   PCADDR pc = abuf->addr;
3182   PCADDR npc = pc + 4;
3183
3184 {
3185   SI tmp_addr;
3186   SI tmp_offset;
3187   tmp_offset = * FLD (i_rm);
3188   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
3189 if (EQSI (FLD (f_rd), 15)) {
3190   {
3191     USI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3192     current_cpu->branch (opval, npc, status);
3193     if (current_cpu->trace_result_p)
3194       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3195   }
3196 } else {
3197   {
3198     SI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3199     * FLD (i_rd) = opval;
3200     if (current_cpu->trace_result_p)
3201       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3202   }
3203 }
3204 ((void) 0); /*nop*/
3205 ((void) 0); /*nop*/
3206 }
3207
3208   current_cpu->done_cti_insn (npc, status);
3209   return status;
3210 #undef FLD
3211 }
3212
3213 // ********** ldrsb-pre-dec-wb-imm-offset: FIXME
3214
3215 sem_status
3216 arm_sem_ldrsb_pre_dec_wb_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3217 {
3218 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
3219   sem_status status = SEM_STATUS_NORMAL;
3220   arm_scache* abuf = sem;
3221   PCADDR pc = abuf->addr;
3222   PCADDR npc = pc + 4;
3223
3224 {
3225   SI tmp_addr;
3226   SI tmp_offset;
3227   tmp_offset = FLD (i_hdt_offset8);
3228   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
3229 if (EQSI (FLD (f_rd), 15)) {
3230   {
3231     USI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3232     current_cpu->branch (opval, npc, status);
3233     if (current_cpu->trace_result_p)
3234       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3235   }
3236 } else {
3237   {
3238     SI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3239     * FLD (i_rd) = opval;
3240     if (current_cpu->trace_result_p)
3241       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3242   }
3243 }
3244 ((void) 0); /*nop*/
3245   {
3246     SI opval = tmp_addr;
3247     * FLD (i_rn) = opval;
3248     if (current_cpu->trace_result_p)
3249       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
3250   }
3251 }
3252
3253   current_cpu->done_cti_insn (npc, status);
3254   return status;
3255 #undef FLD
3256 }
3257
3258 // ********** ldrsb-pre-dec-wb-reg-offset: FIXME
3259
3260 sem_status
3261 arm_sem_ldrsb_pre_dec_wb_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3262 {
3263 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
3264   sem_status status = SEM_STATUS_NORMAL;
3265   arm_scache* abuf = sem;
3266   PCADDR pc = abuf->addr;
3267   PCADDR npc = pc + 4;
3268
3269 {
3270   SI tmp_addr;
3271   SI tmp_offset;
3272   tmp_offset = * FLD (i_rm);
3273   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
3274 if (EQSI (FLD (f_rd), 15)) {
3275   {
3276     USI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3277     current_cpu->branch (opval, npc, status);
3278     if (current_cpu->trace_result_p)
3279       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3280   }
3281 } else {
3282   {
3283     SI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3284     * FLD (i_rd) = opval;
3285     if (current_cpu->trace_result_p)
3286       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3287   }
3288 }
3289 ((void) 0); /*nop*/
3290   {
3291     SI opval = tmp_addr;
3292     * FLD (i_rn) = opval;
3293     if (current_cpu->trace_result_p)
3294       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
3295   }
3296 }
3297
3298   current_cpu->done_cti_insn (npc, status);
3299   return status;
3300 #undef FLD
3301 }
3302
3303 // ********** ldrsb-pre-inc-wb-imm-offset: FIXME
3304
3305 sem_status
3306 arm_sem_ldrsb_pre_inc_wb_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3307 {
3308 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
3309   sem_status status = SEM_STATUS_NORMAL;
3310   arm_scache* abuf = sem;
3311   PCADDR pc = abuf->addr;
3312   PCADDR npc = pc + 4;
3313
3314 {
3315   SI tmp_addr;
3316   SI tmp_offset;
3317   tmp_offset = FLD (i_hdt_offset8);
3318   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
3319 if (EQSI (FLD (f_rd), 15)) {
3320   {
3321     USI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3322     current_cpu->branch (opval, npc, status);
3323     if (current_cpu->trace_result_p)
3324       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3325   }
3326 } else {
3327   {
3328     SI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3329     * FLD (i_rd) = opval;
3330     if (current_cpu->trace_result_p)
3331       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3332   }
3333 }
3334 ((void) 0); /*nop*/
3335   {
3336     SI opval = tmp_addr;
3337     * FLD (i_rn) = opval;
3338     if (current_cpu->trace_result_p)
3339       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
3340   }
3341 }
3342
3343   current_cpu->done_cti_insn (npc, status);
3344   return status;
3345 #undef FLD
3346 }
3347
3348 // ********** ldrsb-pre-inc-wb-reg-offset: FIXME
3349
3350 sem_status
3351 arm_sem_ldrsb_pre_inc_wb_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3352 {
3353 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
3354   sem_status status = SEM_STATUS_NORMAL;
3355   arm_scache* abuf = sem;
3356   PCADDR pc = abuf->addr;
3357   PCADDR npc = pc + 4;
3358
3359 {
3360   SI tmp_addr;
3361   SI tmp_offset;
3362   tmp_offset = * FLD (i_rm);
3363   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
3364 if (EQSI (FLD (f_rd), 15)) {
3365   {
3366     USI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3367     current_cpu->branch (opval, npc, status);
3368     if (current_cpu->trace_result_p)
3369       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3370   }
3371 } else {
3372   {
3373     SI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3374     * FLD (i_rd) = opval;
3375     if (current_cpu->trace_result_p)
3376       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3377   }
3378 }
3379 ((void) 0); /*nop*/
3380   {
3381     SI opval = tmp_addr;
3382     * FLD (i_rn) = opval;
3383     if (current_cpu->trace_result_p)
3384       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
3385   }
3386 }
3387
3388   current_cpu->done_cti_insn (npc, status);
3389   return status;
3390 #undef FLD
3391 }
3392
3393 // ********** ldrsb-post-dec-imm-offset: FIXME
3394
3395 sem_status
3396 arm_sem_ldrsb_post_dec_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3397 {
3398 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
3399   sem_status status = SEM_STATUS_NORMAL;
3400   arm_scache* abuf = sem;
3401   PCADDR pc = abuf->addr;
3402   PCADDR npc = pc + 4;
3403
3404 {
3405   SI tmp_addr;
3406   SI tmp_offset;
3407   tmp_offset = FLD (i_hdt_offset8);
3408   tmp_addr = * FLD (i_rn);
3409 if (EQSI (FLD (f_rd), 15)) {
3410   {
3411     USI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3412     current_cpu->branch (opval, npc, status);
3413     if (current_cpu->trace_result_p)
3414       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3415   }
3416 } else {
3417   {
3418     SI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3419     * FLD (i_rd) = opval;
3420     if (current_cpu->trace_result_p)
3421       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3422   }
3423 }
3424   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
3425   {
3426     SI opval = tmp_addr;
3427     * FLD (i_rn) = opval;
3428     if (current_cpu->trace_result_p)
3429       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
3430   }
3431 }
3432
3433   current_cpu->done_cti_insn (npc, status);
3434   return status;
3435 #undef FLD
3436 }
3437
3438 // ********** ldrsb-post-dec-reg-offset: FIXME
3439
3440 sem_status
3441 arm_sem_ldrsb_post_dec_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3442 {
3443 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
3444   sem_status status = SEM_STATUS_NORMAL;
3445   arm_scache* abuf = sem;
3446   PCADDR pc = abuf->addr;
3447   PCADDR npc = pc + 4;
3448
3449 {
3450   SI tmp_addr;
3451   SI tmp_offset;
3452   tmp_offset = * FLD (i_rm);
3453   tmp_addr = * FLD (i_rn);
3454 if (EQSI (FLD (f_rd), 15)) {
3455   {
3456     USI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3457     current_cpu->branch (opval, npc, status);
3458     if (current_cpu->trace_result_p)
3459       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3460   }
3461 } else {
3462   {
3463     SI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3464     * FLD (i_rd) = opval;
3465     if (current_cpu->trace_result_p)
3466       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3467   }
3468 }
3469   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
3470   {
3471     SI opval = tmp_addr;
3472     * FLD (i_rn) = opval;
3473     if (current_cpu->trace_result_p)
3474       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
3475   }
3476 }
3477
3478   current_cpu->done_cti_insn (npc, status);
3479   return status;
3480 #undef FLD
3481 }
3482
3483 // ********** ldrsb-post-inc-imm-offset: FIXME
3484
3485 sem_status
3486 arm_sem_ldrsb_post_inc_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3487 {
3488 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
3489   sem_status status = SEM_STATUS_NORMAL;
3490   arm_scache* abuf = sem;
3491   PCADDR pc = abuf->addr;
3492   PCADDR npc = pc + 4;
3493
3494 {
3495   SI tmp_addr;
3496   SI tmp_offset;
3497   tmp_offset = FLD (i_hdt_offset8);
3498   tmp_addr = * FLD (i_rn);
3499 if (EQSI (FLD (f_rd), 15)) {
3500   {
3501     USI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3502     current_cpu->branch (opval, npc, status);
3503     if (current_cpu->trace_result_p)
3504       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3505   }
3506 } else {
3507   {
3508     SI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3509     * FLD (i_rd) = opval;
3510     if (current_cpu->trace_result_p)
3511       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3512   }
3513 }
3514   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
3515   {
3516     SI opval = tmp_addr;
3517     * FLD (i_rn) = opval;
3518     if (current_cpu->trace_result_p)
3519       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
3520   }
3521 }
3522
3523   current_cpu->done_cti_insn (npc, status);
3524   return status;
3525 #undef FLD
3526 }
3527
3528 // ********** ldrsb-post-inc-reg-offset: FIXME
3529
3530 sem_status
3531 arm_sem_ldrsb_post_inc_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3532 {
3533 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
3534   sem_status status = SEM_STATUS_NORMAL;
3535   arm_scache* abuf = sem;
3536   PCADDR pc = abuf->addr;
3537   PCADDR npc = pc + 4;
3538
3539 {
3540   SI tmp_addr;
3541   SI tmp_offset;
3542   tmp_offset = * FLD (i_rm);
3543   tmp_addr = * FLD (i_rn);
3544 if (EQSI (FLD (f_rd), 15)) {
3545   {
3546     USI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3547     current_cpu->branch (opval, npc, status);
3548     if (current_cpu->trace_result_p)
3549       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3550   }
3551 } else {
3552   {
3553     SI opval = EXTQISI (current_cpu->GETMEMQI (pc, tmp_addr));
3554     * FLD (i_rd) = opval;
3555     if (current_cpu->trace_result_p)
3556       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3557   }
3558 }
3559   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
3560   {
3561     SI opval = tmp_addr;
3562     * FLD (i_rn) = opval;
3563     if (current_cpu->trace_result_p)
3564       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
3565   }
3566 }
3567
3568   current_cpu->done_cti_insn (npc, status);
3569   return status;
3570 #undef FLD
3571 }
3572
3573 // ********** ldrh-pre-dec-imm-offset: FIXME
3574
3575 sem_status
3576 arm_sem_ldrh_pre_dec_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3577 {
3578 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
3579   sem_status status = SEM_STATUS_NORMAL;
3580   arm_scache* abuf = sem;
3581   PCADDR pc = abuf->addr;
3582   PCADDR npc = pc + 4;
3583
3584 {
3585   SI tmp_addr;
3586   SI tmp_offset;
3587   tmp_offset = FLD (i_hdt_offset8);
3588   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
3589 if (EQSI (FLD (f_rd), 15)) {
3590   {
3591     USI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3592     current_cpu->branch (opval, npc, status);
3593     if (current_cpu->trace_result_p)
3594       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3595   }
3596 } else {
3597   {
3598     SI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3599     * FLD (i_rd) = opval;
3600     if (current_cpu->trace_result_p)
3601       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3602   }
3603 }
3604 ((void) 0); /*nop*/
3605 ((void) 0); /*nop*/
3606 }
3607
3608   current_cpu->done_cti_insn (npc, status);
3609   return status;
3610 #undef FLD
3611 }
3612
3613 // ********** ldrh-pre-dec-reg-offset: FIXME
3614
3615 sem_status
3616 arm_sem_ldrh_pre_dec_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3617 {
3618 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
3619   sem_status status = SEM_STATUS_NORMAL;
3620   arm_scache* abuf = sem;
3621   PCADDR pc = abuf->addr;
3622   PCADDR npc = pc + 4;
3623
3624 {
3625   SI tmp_addr;
3626   SI tmp_offset;
3627   tmp_offset = * FLD (i_rm);
3628   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
3629 if (EQSI (FLD (f_rd), 15)) {
3630   {
3631     USI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3632     current_cpu->branch (opval, npc, status);
3633     if (current_cpu->trace_result_p)
3634       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3635   }
3636 } else {
3637   {
3638     SI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3639     * FLD (i_rd) = opval;
3640     if (current_cpu->trace_result_p)
3641       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3642   }
3643 }
3644 ((void) 0); /*nop*/
3645 ((void) 0); /*nop*/
3646 }
3647
3648   current_cpu->done_cti_insn (npc, status);
3649   return status;
3650 #undef FLD
3651 }
3652
3653 // ********** ldrh-pre-inc-imm-offset: FIXME
3654
3655 sem_status
3656 arm_sem_ldrh_pre_inc_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3657 {
3658 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
3659   sem_status status = SEM_STATUS_NORMAL;
3660   arm_scache* abuf = sem;
3661   PCADDR pc = abuf->addr;
3662   PCADDR npc = pc + 4;
3663
3664 {
3665   SI tmp_addr;
3666   SI tmp_offset;
3667   tmp_offset = FLD (i_hdt_offset8);
3668   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
3669 if (EQSI (FLD (f_rd), 15)) {
3670   {
3671     USI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3672     current_cpu->branch (opval, npc, status);
3673     if (current_cpu->trace_result_p)
3674       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3675   }
3676 } else {
3677   {
3678     SI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3679     * FLD (i_rd) = opval;
3680     if (current_cpu->trace_result_p)
3681       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3682   }
3683 }
3684 ((void) 0); /*nop*/
3685 ((void) 0); /*nop*/
3686 }
3687
3688   current_cpu->done_cti_insn (npc, status);
3689   return status;
3690 #undef FLD
3691 }
3692
3693 // ********** ldrh-pre-inc-reg-offset: FIXME
3694
3695 sem_status
3696 arm_sem_ldrh_pre_inc_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3697 {
3698 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
3699   sem_status status = SEM_STATUS_NORMAL;
3700   arm_scache* abuf = sem;
3701   PCADDR pc = abuf->addr;
3702   PCADDR npc = pc + 4;
3703
3704 {
3705   SI tmp_addr;
3706   SI tmp_offset;
3707   tmp_offset = * FLD (i_rm);
3708   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
3709 if (EQSI (FLD (f_rd), 15)) {
3710   {
3711     USI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3712     current_cpu->branch (opval, npc, status);
3713     if (current_cpu->trace_result_p)
3714       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3715   }
3716 } else {
3717   {
3718     SI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3719     * FLD (i_rd) = opval;
3720     if (current_cpu->trace_result_p)
3721       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3722   }
3723 }
3724 ((void) 0); /*nop*/
3725 ((void) 0); /*nop*/
3726 }
3727
3728   current_cpu->done_cti_insn (npc, status);
3729   return status;
3730 #undef FLD
3731 }
3732
3733 // ********** ldrh-pre-dec-wb-imm-offset: FIXME
3734
3735 sem_status
3736 arm_sem_ldrh_pre_dec_wb_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3737 {
3738 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
3739   sem_status status = SEM_STATUS_NORMAL;
3740   arm_scache* abuf = sem;
3741   PCADDR pc = abuf->addr;
3742   PCADDR npc = pc + 4;
3743
3744 {
3745   SI tmp_addr;
3746   SI tmp_offset;
3747   tmp_offset = FLD (i_hdt_offset8);
3748   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
3749 if (EQSI (FLD (f_rd), 15)) {
3750   {
3751     USI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3752     current_cpu->branch (opval, npc, status);
3753     if (current_cpu->trace_result_p)
3754       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3755   }
3756 } else {
3757   {
3758     SI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3759     * FLD (i_rd) = opval;
3760     if (current_cpu->trace_result_p)
3761       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3762   }
3763 }
3764 ((void) 0); /*nop*/
3765   {
3766     SI opval = tmp_addr;
3767     * FLD (i_rn) = opval;
3768     if (current_cpu->trace_result_p)
3769       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
3770   }
3771 }
3772
3773   current_cpu->done_cti_insn (npc, status);
3774   return status;
3775 #undef FLD
3776 }
3777
3778 // ********** ldrh-pre-dec-wb-reg-offset: FIXME
3779
3780 sem_status
3781 arm_sem_ldrh_pre_dec_wb_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3782 {
3783 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
3784   sem_status status = SEM_STATUS_NORMAL;
3785   arm_scache* abuf = sem;
3786   PCADDR pc = abuf->addr;
3787   PCADDR npc = pc + 4;
3788
3789 {
3790   SI tmp_addr;
3791   SI tmp_offset;
3792   tmp_offset = * FLD (i_rm);
3793   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
3794 if (EQSI (FLD (f_rd), 15)) {
3795   {
3796     USI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3797     current_cpu->branch (opval, npc, status);
3798     if (current_cpu->trace_result_p)
3799       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3800   }
3801 } else {
3802   {
3803     SI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3804     * FLD (i_rd) = opval;
3805     if (current_cpu->trace_result_p)
3806       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3807   }
3808 }
3809 ((void) 0); /*nop*/
3810   {
3811     SI opval = tmp_addr;
3812     * FLD (i_rn) = opval;
3813     if (current_cpu->trace_result_p)
3814       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
3815   }
3816 }
3817
3818   current_cpu->done_cti_insn (npc, status);
3819   return status;
3820 #undef FLD
3821 }
3822
3823 // ********** ldrh-pre-inc-wb-imm-offset: FIXME
3824
3825 sem_status
3826 arm_sem_ldrh_pre_inc_wb_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3827 {
3828 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
3829   sem_status status = SEM_STATUS_NORMAL;
3830   arm_scache* abuf = sem;
3831   PCADDR pc = abuf->addr;
3832   PCADDR npc = pc + 4;
3833
3834 {
3835   SI tmp_addr;
3836   SI tmp_offset;
3837   tmp_offset = FLD (i_hdt_offset8);
3838   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
3839 if (EQSI (FLD (f_rd), 15)) {
3840   {
3841     USI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3842     current_cpu->branch (opval, npc, status);
3843     if (current_cpu->trace_result_p)
3844       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3845   }
3846 } else {
3847   {
3848     SI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3849     * FLD (i_rd) = opval;
3850     if (current_cpu->trace_result_p)
3851       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3852   }
3853 }
3854 ((void) 0); /*nop*/
3855   {
3856     SI opval = tmp_addr;
3857     * FLD (i_rn) = opval;
3858     if (current_cpu->trace_result_p)
3859       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
3860   }
3861 }
3862
3863   current_cpu->done_cti_insn (npc, status);
3864   return status;
3865 #undef FLD
3866 }
3867
3868 // ********** ldrh-pre-inc-wb-reg-offset: FIXME
3869
3870 sem_status
3871 arm_sem_ldrh_pre_inc_wb_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3872 {
3873 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
3874   sem_status status = SEM_STATUS_NORMAL;
3875   arm_scache* abuf = sem;
3876   PCADDR pc = abuf->addr;
3877   PCADDR npc = pc + 4;
3878
3879 {
3880   SI tmp_addr;
3881   SI tmp_offset;
3882   tmp_offset = * FLD (i_rm);
3883   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
3884 if (EQSI (FLD (f_rd), 15)) {
3885   {
3886     USI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3887     current_cpu->branch (opval, npc, status);
3888     if (current_cpu->trace_result_p)
3889       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3890   }
3891 } else {
3892   {
3893     SI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3894     * FLD (i_rd) = opval;
3895     if (current_cpu->trace_result_p)
3896       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3897   }
3898 }
3899 ((void) 0); /*nop*/
3900   {
3901     SI opval = tmp_addr;
3902     * FLD (i_rn) = opval;
3903     if (current_cpu->trace_result_p)
3904       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
3905   }
3906 }
3907
3908   current_cpu->done_cti_insn (npc, status);
3909   return status;
3910 #undef FLD
3911 }
3912
3913 // ********** ldrh-post-dec-imm-offset: FIXME
3914
3915 sem_status
3916 arm_sem_ldrh_post_dec_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3917 {
3918 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
3919   sem_status status = SEM_STATUS_NORMAL;
3920   arm_scache* abuf = sem;
3921   PCADDR pc = abuf->addr;
3922   PCADDR npc = pc + 4;
3923
3924 {
3925   SI tmp_addr;
3926   SI tmp_offset;
3927   tmp_offset = FLD (i_hdt_offset8);
3928   tmp_addr = * FLD (i_rn);
3929 if (EQSI (FLD (f_rd), 15)) {
3930   {
3931     USI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3932     current_cpu->branch (opval, npc, status);
3933     if (current_cpu->trace_result_p)
3934       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3935   }
3936 } else {
3937   {
3938     SI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3939     * FLD (i_rd) = opval;
3940     if (current_cpu->trace_result_p)
3941       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3942   }
3943 }
3944   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
3945   {
3946     SI opval = tmp_addr;
3947     * FLD (i_rn) = opval;
3948     if (current_cpu->trace_result_p)
3949       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
3950   }
3951 }
3952
3953   current_cpu->done_cti_insn (npc, status);
3954   return status;
3955 #undef FLD
3956 }
3957
3958 // ********** ldrh-post-dec-reg-offset: FIXME
3959
3960 sem_status
3961 arm_sem_ldrh_post_dec_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
3962 {
3963 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
3964   sem_status status = SEM_STATUS_NORMAL;
3965   arm_scache* abuf = sem;
3966   PCADDR pc = abuf->addr;
3967   PCADDR npc = pc + 4;
3968
3969 {
3970   SI tmp_addr;
3971   SI tmp_offset;
3972   tmp_offset = * FLD (i_rm);
3973   tmp_addr = * FLD (i_rn);
3974 if (EQSI (FLD (f_rd), 15)) {
3975   {
3976     USI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3977     current_cpu->branch (opval, npc, status);
3978     if (current_cpu->trace_result_p)
3979       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
3980   }
3981 } else {
3982   {
3983     SI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
3984     * FLD (i_rd) = opval;
3985     if (current_cpu->trace_result_p)
3986       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
3987   }
3988 }
3989   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
3990   {
3991     SI opval = tmp_addr;
3992     * FLD (i_rn) = opval;
3993     if (current_cpu->trace_result_p)
3994       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
3995   }
3996 }
3997
3998   current_cpu->done_cti_insn (npc, status);
3999   return status;
4000 #undef FLD
4001 }
4002
4003 // ********** ldrh-post-inc-imm-offset: FIXME
4004
4005 sem_status
4006 arm_sem_ldrh_post_inc_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
4007 {
4008 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
4009   sem_status status = SEM_STATUS_NORMAL;
4010   arm_scache* abuf = sem;
4011   PCADDR pc = abuf->addr;
4012   PCADDR npc = pc + 4;
4013
4014 {
4015   SI tmp_addr;
4016   SI tmp_offset;
4017   tmp_offset = FLD (i_hdt_offset8);
4018   tmp_addr = * FLD (i_rn);
4019 if (EQSI (FLD (f_rd), 15)) {
4020   {
4021     USI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4022     current_cpu->branch (opval, npc, status);
4023     if (current_cpu->trace_result_p)
4024       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
4025   }
4026 } else {
4027   {
4028     SI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4029     * FLD (i_rd) = opval;
4030     if (current_cpu->trace_result_p)
4031       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4032   }
4033 }
4034   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
4035   {
4036     SI opval = tmp_addr;
4037     * FLD (i_rn) = opval;
4038     if (current_cpu->trace_result_p)
4039       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
4040   }
4041 }
4042
4043   current_cpu->done_cti_insn (npc, status);
4044   return status;
4045 #undef FLD
4046 }
4047
4048 // ********** ldrh-post-inc-reg-offset: FIXME
4049
4050 sem_status
4051 arm_sem_ldrh_post_inc_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
4052 {
4053 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
4054   sem_status status = SEM_STATUS_NORMAL;
4055   arm_scache* abuf = sem;
4056   PCADDR pc = abuf->addr;
4057   PCADDR npc = pc + 4;
4058
4059 {
4060   SI tmp_addr;
4061   SI tmp_offset;
4062   tmp_offset = * FLD (i_rm);
4063   tmp_addr = * FLD (i_rn);
4064 if (EQSI (FLD (f_rd), 15)) {
4065   {
4066     USI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4067     current_cpu->branch (opval, npc, status);
4068     if (current_cpu->trace_result_p)
4069       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
4070   }
4071 } else {
4072   {
4073     SI opval = ZEXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4074     * FLD (i_rd) = opval;
4075     if (current_cpu->trace_result_p)
4076       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4077   }
4078 }
4079   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
4080   {
4081     SI opval = tmp_addr;
4082     * FLD (i_rn) = opval;
4083     if (current_cpu->trace_result_p)
4084       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
4085   }
4086 }
4087
4088   current_cpu->done_cti_insn (npc, status);
4089   return status;
4090 #undef FLD
4091 }
4092
4093 // ********** ldrsh-pre-dec-imm-offset: FIXME
4094
4095 sem_status
4096 arm_sem_ldrsh_pre_dec_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
4097 {
4098 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
4099   sem_status status = SEM_STATUS_NORMAL;
4100   arm_scache* abuf = sem;
4101   PCADDR pc = abuf->addr;
4102   PCADDR npc = pc + 4;
4103
4104 {
4105   SI tmp_addr;
4106   SI tmp_offset;
4107   tmp_offset = FLD (i_hdt_offset8);
4108   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
4109 if (EQSI (FLD (f_rd), 15)) {
4110   {
4111     USI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4112     current_cpu->branch (opval, npc, status);
4113     if (current_cpu->trace_result_p)
4114       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
4115   }
4116 } else {
4117   {
4118     SI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4119     * FLD (i_rd) = opval;
4120     if (current_cpu->trace_result_p)
4121       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4122   }
4123 }
4124 ((void) 0); /*nop*/
4125 ((void) 0); /*nop*/
4126 }
4127
4128   current_cpu->done_cti_insn (npc, status);
4129   return status;
4130 #undef FLD
4131 }
4132
4133 // ********** ldrsh-pre-dec-reg-offset: FIXME
4134
4135 sem_status
4136 arm_sem_ldrsh_pre_dec_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
4137 {
4138 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
4139   sem_status status = SEM_STATUS_NORMAL;
4140   arm_scache* abuf = sem;
4141   PCADDR pc = abuf->addr;
4142   PCADDR npc = pc + 4;
4143
4144 {
4145   SI tmp_addr;
4146   SI tmp_offset;
4147   tmp_offset = * FLD (i_rm);
4148   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
4149 if (EQSI (FLD (f_rd), 15)) {
4150   {
4151     USI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4152     current_cpu->branch (opval, npc, status);
4153     if (current_cpu->trace_result_p)
4154       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
4155   }
4156 } else {
4157   {
4158     SI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4159     * FLD (i_rd) = opval;
4160     if (current_cpu->trace_result_p)
4161       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4162   }
4163 }
4164 ((void) 0); /*nop*/
4165 ((void) 0); /*nop*/
4166 }
4167
4168   current_cpu->done_cti_insn (npc, status);
4169   return status;
4170 #undef FLD
4171 }
4172
4173 // ********** ldrsh-pre-inc-imm-offset: FIXME
4174
4175 sem_status
4176 arm_sem_ldrsh_pre_inc_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
4177 {
4178 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
4179   sem_status status = SEM_STATUS_NORMAL;
4180   arm_scache* abuf = sem;
4181   PCADDR pc = abuf->addr;
4182   PCADDR npc = pc + 4;
4183
4184 {
4185   SI tmp_addr;
4186   SI tmp_offset;
4187   tmp_offset = FLD (i_hdt_offset8);
4188   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
4189 if (EQSI (FLD (f_rd), 15)) {
4190   {
4191     USI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4192     current_cpu->branch (opval, npc, status);
4193     if (current_cpu->trace_result_p)
4194       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
4195   }
4196 } else {
4197   {
4198     SI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4199     * FLD (i_rd) = opval;
4200     if (current_cpu->trace_result_p)
4201       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4202   }
4203 }
4204 ((void) 0); /*nop*/
4205 ((void) 0); /*nop*/
4206 }
4207
4208   current_cpu->done_cti_insn (npc, status);
4209   return status;
4210 #undef FLD
4211 }
4212
4213 // ********** ldrsh-pre-inc-reg-offset: FIXME
4214
4215 sem_status
4216 arm_sem_ldrsh_pre_inc_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
4217 {
4218 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
4219   sem_status status = SEM_STATUS_NORMAL;
4220   arm_scache* abuf = sem;
4221   PCADDR pc = abuf->addr;
4222   PCADDR npc = pc + 4;
4223
4224 {
4225   SI tmp_addr;
4226   SI tmp_offset;
4227   tmp_offset = * FLD (i_rm);
4228   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
4229 if (EQSI (FLD (f_rd), 15)) {
4230   {
4231     USI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4232     current_cpu->branch (opval, npc, status);
4233     if (current_cpu->trace_result_p)
4234       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
4235   }
4236 } else {
4237   {
4238     SI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4239     * FLD (i_rd) = opval;
4240     if (current_cpu->trace_result_p)
4241       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4242   }
4243 }
4244 ((void) 0); /*nop*/
4245 ((void) 0); /*nop*/
4246 }
4247
4248   current_cpu->done_cti_insn (npc, status);
4249   return status;
4250 #undef FLD
4251 }
4252
4253 // ********** ldrsh-pre-dec-wb-imm-offset: FIXME
4254
4255 sem_status
4256 arm_sem_ldrsh_pre_dec_wb_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
4257 {
4258 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
4259   sem_status status = SEM_STATUS_NORMAL;
4260   arm_scache* abuf = sem;
4261   PCADDR pc = abuf->addr;
4262   PCADDR npc = pc + 4;
4263
4264 {
4265   SI tmp_addr;
4266   SI tmp_offset;
4267   tmp_offset = FLD (i_hdt_offset8);
4268   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
4269 if (EQSI (FLD (f_rd), 15)) {
4270   {
4271     USI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4272     current_cpu->branch (opval, npc, status);
4273     if (current_cpu->trace_result_p)
4274       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
4275   }
4276 } else {
4277   {
4278     SI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4279     * FLD (i_rd) = opval;
4280     if (current_cpu->trace_result_p)
4281       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4282   }
4283 }
4284 ((void) 0); /*nop*/
4285   {
4286     SI opval = tmp_addr;
4287     * FLD (i_rn) = opval;
4288     if (current_cpu->trace_result_p)
4289       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
4290   }
4291 }
4292
4293   current_cpu->done_cti_insn (npc, status);
4294   return status;
4295 #undef FLD
4296 }
4297
4298 // ********** ldrsh-pre-dec-wb-reg-offset: FIXME
4299
4300 sem_status
4301 arm_sem_ldrsh_pre_dec_wb_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
4302 {
4303 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
4304   sem_status status = SEM_STATUS_NORMAL;
4305   arm_scache* abuf = sem;
4306   PCADDR pc = abuf->addr;
4307   PCADDR npc = pc + 4;
4308
4309 {
4310   SI tmp_addr;
4311   SI tmp_offset;
4312   tmp_offset = * FLD (i_rm);
4313   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
4314 if (EQSI (FLD (f_rd), 15)) {
4315   {
4316     USI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4317     current_cpu->branch (opval, npc, status);
4318     if (current_cpu->trace_result_p)
4319       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
4320   }
4321 } else {
4322   {
4323     SI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4324     * FLD (i_rd) = opval;
4325     if (current_cpu->trace_result_p)
4326       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4327   }
4328 }
4329 ((void) 0); /*nop*/
4330   {
4331     SI opval = tmp_addr;
4332     * FLD (i_rn) = opval;
4333     if (current_cpu->trace_result_p)
4334       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
4335   }
4336 }
4337
4338   current_cpu->done_cti_insn (npc, status);
4339   return status;
4340 #undef FLD
4341 }
4342
4343 // ********** ldrsh-pre-inc-wb-imm-offset: FIXME
4344
4345 sem_status
4346 arm_sem_ldrsh_pre_inc_wb_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
4347 {
4348 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
4349   sem_status status = SEM_STATUS_NORMAL;
4350   arm_scache* abuf = sem;
4351   PCADDR pc = abuf->addr;
4352   PCADDR npc = pc + 4;
4353
4354 {
4355   SI tmp_addr;
4356   SI tmp_offset;
4357   tmp_offset = FLD (i_hdt_offset8);
4358   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
4359 if (EQSI (FLD (f_rd), 15)) {
4360   {
4361     USI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4362     current_cpu->branch (opval, npc, status);
4363     if (current_cpu->trace_result_p)
4364       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
4365   }
4366 } else {
4367   {
4368     SI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4369     * FLD (i_rd) = opval;
4370     if (current_cpu->trace_result_p)
4371       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4372   }
4373 }
4374 ((void) 0); /*nop*/
4375   {
4376     SI opval = tmp_addr;
4377     * FLD (i_rn) = opval;
4378     if (current_cpu->trace_result_p)
4379       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
4380   }
4381 }
4382
4383   current_cpu->done_cti_insn (npc, status);
4384   return status;
4385 #undef FLD
4386 }
4387
4388 // ********** ldrsh-pre-inc-wb-reg-offset: FIXME
4389
4390 sem_status
4391 arm_sem_ldrsh_pre_inc_wb_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
4392 {
4393 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
4394   sem_status status = SEM_STATUS_NORMAL;
4395   arm_scache* abuf = sem;
4396   PCADDR pc = abuf->addr;
4397   PCADDR npc = pc + 4;
4398
4399 {
4400   SI tmp_addr;
4401   SI tmp_offset;
4402   tmp_offset = * FLD (i_rm);
4403   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
4404 if (EQSI (FLD (f_rd), 15)) {
4405   {
4406     USI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4407     current_cpu->branch (opval, npc, status);
4408     if (current_cpu->trace_result_p)
4409       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
4410   }
4411 } else {
4412   {
4413     SI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4414     * FLD (i_rd) = opval;
4415     if (current_cpu->trace_result_p)
4416       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4417   }
4418 }
4419 ((void) 0); /*nop*/
4420   {
4421     SI opval = tmp_addr;
4422     * FLD (i_rn) = opval;
4423     if (current_cpu->trace_result_p)
4424       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
4425   }
4426 }
4427
4428   current_cpu->done_cti_insn (npc, status);
4429   return status;
4430 #undef FLD
4431 }
4432
4433 // ********** ldrsh-post-dec-imm-offset: FIXME
4434
4435 sem_status
4436 arm_sem_ldrsh_post_dec_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
4437 {
4438 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
4439   sem_status status = SEM_STATUS_NORMAL;
4440   arm_scache* abuf = sem;
4441   PCADDR pc = abuf->addr;
4442   PCADDR npc = pc + 4;
4443
4444 {
4445   SI tmp_addr;
4446   SI tmp_offset;
4447   tmp_offset = FLD (i_hdt_offset8);
4448   tmp_addr = * FLD (i_rn);
4449 if (EQSI (FLD (f_rd), 15)) {
4450   {
4451     USI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4452     current_cpu->branch (opval, npc, status);
4453     if (current_cpu->trace_result_p)
4454       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
4455   }
4456 } else {
4457   {
4458     SI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4459     * FLD (i_rd) = opval;
4460     if (current_cpu->trace_result_p)
4461       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4462   }
4463 }
4464   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
4465   {
4466     SI opval = tmp_addr;
4467     * FLD (i_rn) = opval;
4468     if (current_cpu->trace_result_p)
4469       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
4470   }
4471 }
4472
4473   current_cpu->done_cti_insn (npc, status);
4474   return status;
4475 #undef FLD
4476 }
4477
4478 // ********** ldrsh-post-dec-reg-offset: FIXME
4479
4480 sem_status
4481 arm_sem_ldrsh_post_dec_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
4482 {
4483 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
4484   sem_status status = SEM_STATUS_NORMAL;
4485   arm_scache* abuf = sem;
4486   PCADDR pc = abuf->addr;
4487   PCADDR npc = pc + 4;
4488
4489 {
4490   SI tmp_addr;
4491   SI tmp_offset;
4492   tmp_offset = * FLD (i_rm);
4493   tmp_addr = * FLD (i_rn);
4494 if (EQSI (FLD (f_rd), 15)) {
4495   {
4496     USI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4497     current_cpu->branch (opval, npc, status);
4498     if (current_cpu->trace_result_p)
4499       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
4500   }
4501 } else {
4502   {
4503     SI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4504     * FLD (i_rd) = opval;
4505     if (current_cpu->trace_result_p)
4506       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4507   }
4508 }
4509   tmp_addr = SUBSI (* FLD (i_rn), tmp_offset);
4510   {
4511     SI opval = tmp_addr;
4512     * FLD (i_rn) = opval;
4513     if (current_cpu->trace_result_p)
4514       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
4515   }
4516 }
4517
4518   current_cpu->done_cti_insn (npc, status);
4519   return status;
4520 #undef FLD
4521 }
4522
4523 // ********** ldrsh-post-inc-imm-offset: FIXME
4524
4525 sem_status
4526 arm_sem_ldrsh_post_inc_imm_offset (arm7f_cpu* current_cpu, arm_scache* sem)
4527 {
4528 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
4529   sem_status status = SEM_STATUS_NORMAL;
4530   arm_scache* abuf = sem;
4531   PCADDR pc = abuf->addr;
4532   PCADDR npc = pc + 4;
4533
4534 {
4535   SI tmp_addr;
4536   SI tmp_offset;
4537   tmp_offset = FLD (i_hdt_offset8);
4538   tmp_addr = * FLD (i_rn);
4539 if (EQSI (FLD (f_rd), 15)) {
4540   {
4541     USI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4542     current_cpu->branch (opval, npc, status);
4543     if (current_cpu->trace_result_p)
4544       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
4545   }
4546 } else {
4547   {
4548     SI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4549     * FLD (i_rd) = opval;
4550     if (current_cpu->trace_result_p)
4551       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4552   }
4553 }
4554   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
4555   {
4556     SI opval = tmp_addr;
4557     * FLD (i_rn) = opval;
4558     if (current_cpu->trace_result_p)
4559       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
4560   }
4561 }
4562
4563   current_cpu->done_cti_insn (npc, status);
4564   return status;
4565 #undef FLD
4566 }
4567
4568 // ********** ldrsh-post-inc-reg-offset: FIXME
4569
4570 sem_status
4571 arm_sem_ldrsh_post_inc_reg_offset (arm7f_cpu* current_cpu, arm_scache* sem)
4572 {
4573 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
4574   sem_status status = SEM_STATUS_NORMAL;
4575   arm_scache* abuf = sem;
4576   PCADDR pc = abuf->addr;
4577   PCADDR npc = pc + 4;
4578
4579 {
4580   SI tmp_addr;
4581   SI tmp_offset;
4582   tmp_offset = * FLD (i_rm);
4583   tmp_addr = * FLD (i_rn);
4584 if (EQSI (FLD (f_rd), 15)) {
4585   {
4586     USI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4587     current_cpu->branch (opval, npc, status);
4588     if (current_cpu->trace_result_p)
4589       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
4590   }
4591 } else {
4592   {
4593     SI opval = EXTHISI (current_cpu->GETMEMHI (pc, tmp_addr));
4594     * FLD (i_rd) = opval;
4595     if (current_cpu->trace_result_p)
4596       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4597   }
4598 }
4599   tmp_addr = ADDSI (* FLD (i_rn), tmp_offset);
4600   {
4601     SI opval = tmp_addr;
4602     * FLD (i_rn) = opval;
4603     if (current_cpu->trace_result_p)
4604       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
4605   }
4606 }
4607
4608   current_cpu->done_cti_insn (npc, status);
4609   return status;
4610 #undef FLD
4611 }
4612
4613 // ********** mul: mul$cond${set-cc?} ${mul-rd},$rm,$rs
4614
4615 sem_status
4616 arm_sem_mul (arm7f_cpu* current_cpu, arm_scache* sem)
4617 {
4618 #define FLD(f) abuf->fields.sfmt_mla.f
4619   sem_status status = SEM_STATUS_NORMAL;
4620   arm_scache* abuf = sem;
4621   PCADDR pc = abuf->addr;
4622   PCADDR npc = pc + 4;
4623
4624 {
4625   SI tmp_result;
4626   tmp_result = MULSI (* FLD (i_rm), * FLD (i_rs));
4627   {
4628     SI opval = tmp_result;
4629     * FLD (i_mul_rd) = opval;
4630     if (current_cpu->trace_result_p)
4631       current_cpu->trace_stream << "mul-rd" << '[' << FLD (f_mul_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4632   }
4633 if (FLD (f_set_cc_)) {
4634 {
4635   {
4636     BI opval = EQSI (tmp_result, 0);
4637     current_cpu->hardware.h_zbit = opval;
4638     if (current_cpu->trace_result_p)
4639       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
4640   }
4641   {
4642     BI opval = LTSI (tmp_result, 0);
4643     current_cpu->hardware.h_nbit = opval;
4644     if (current_cpu->trace_result_p)
4645       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
4646   }
4647 }
4648 }
4649 }
4650
4651   current_cpu->done_insn (npc, status);
4652   return status;
4653 #undef FLD
4654 }
4655
4656 // ********** mla: mla$cond${set-cc?} ${mul-rd},$rm,$rs,${mul-rn}
4657
4658 sem_status
4659 arm_sem_mla (arm7f_cpu* current_cpu, arm_scache* sem)
4660 {
4661 #define FLD(f) abuf->fields.sfmt_mla.f
4662   sem_status status = SEM_STATUS_NORMAL;
4663   arm_scache* abuf = sem;
4664   PCADDR pc = abuf->addr;
4665   PCADDR npc = pc + 4;
4666
4667 {
4668   SI tmp_result;
4669   {
4670     SI opval = ADDSI (MULSI (* FLD (i_rm), * FLD (i_rs)), * FLD (i_mul_rn));
4671     * FLD (i_mul_rd) = opval;
4672     if (current_cpu->trace_result_p)
4673       current_cpu->trace_stream << "mul-rd" << '[' << FLD (f_mul_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4674   }
4675 if (FLD (f_set_cc_)) {
4676 {
4677   {
4678     BI opval = EQSI (tmp_result, 0);
4679     current_cpu->hardware.h_zbit = opval;
4680     if (current_cpu->trace_result_p)
4681       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
4682   }
4683   {
4684     BI opval = LTSI (tmp_result, 0);
4685     current_cpu->hardware.h_nbit = opval;
4686     if (current_cpu->trace_result_p)
4687       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
4688   }
4689 }
4690 }
4691 }
4692
4693   current_cpu->done_insn (npc, status);
4694   return status;
4695 #undef FLD
4696 }
4697
4698 // ********** umull: umull$cond${set-cc?} $rdlo,$rdhi,$rm,$rs
4699
4700 sem_status
4701 arm_sem_umull (arm7f_cpu* current_cpu, arm_scache* sem)
4702 {
4703 #define FLD(f) abuf->fields.sfmt_umull.f
4704   sem_status status = SEM_STATUS_NORMAL;
4705   arm_scache* abuf = sem;
4706   PCADDR pc = abuf->addr;
4707   PCADDR npc = pc + 4;
4708
4709 {
4710   DI tmp_mul_result;
4711   SI tmp_hi;
4712   SI tmp_lo;
4713   tmp_mul_result = MULDI (ZEXTSIDI (* FLD (i_rs)), ZEXTSIDI (* FLD (i_rm)));
4714   {
4715     SI opval = SUBWORDDISI (tmp_mul_result, 0);
4716     * FLD (i_rdhi) = opval;
4717     if (current_cpu->trace_result_p)
4718       current_cpu->trace_stream << "rdhi" << '[' << FLD (f_rdhi) << ']' << ":=0x" << hex << opval << dec << "  ";
4719   }
4720   {
4721     SI opval = SUBWORDDISI (tmp_mul_result, 1);
4722     * FLD (i_rdlo) = opval;
4723     if (current_cpu->trace_result_p)
4724       current_cpu->trace_stream << "rdlo" << '[' << FLD (f_rdlo) << ']' << ":=0x" << hex << opval << dec << "  ";
4725   }
4726 if (FLD (f_set_cc_)) {
4727 {
4728   {
4729     BI opval = EQDI (tmp_mul_result, 0);
4730     current_cpu->hardware.h_zbit = opval;
4731     if (current_cpu->trace_result_p)
4732       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
4733   }
4734   {
4735     BI opval = LTDI (tmp_mul_result, 0);
4736     current_cpu->hardware.h_nbit = opval;
4737     if (current_cpu->trace_result_p)
4738       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
4739   }
4740 }
4741 }
4742 }
4743
4744   current_cpu->done_insn (npc, status);
4745   return status;
4746 #undef FLD
4747 }
4748
4749 // ********** umlal: umlal$cond${set-cc?} $rdlo,$rdhi,$rm,$rs
4750
4751 sem_status
4752 arm_sem_umlal (arm7f_cpu* current_cpu, arm_scache* sem)
4753 {
4754 #define FLD(f) abuf->fields.sfmt_umull.f
4755   sem_status status = SEM_STATUS_NORMAL;
4756   arm_scache* abuf = sem;
4757   PCADDR pc = abuf->addr;
4758   PCADDR npc = pc + 4;
4759
4760 {
4761   DI tmp_mul_result;
4762   SI tmp_hi;
4763   SI tmp_lo;
4764   tmp_mul_result = JOINSIDI (* FLD (i_rdhi), * FLD (i_rdlo));
4765   tmp_mul_result = ADDDI (MULDI (ZEXTSIDI (* FLD (i_rs)), ZEXTSIDI (* FLD (i_rm))), tmp_mul_result);
4766   {
4767     SI opval = SUBWORDDISI (tmp_mul_result, 0);
4768     * FLD (i_rdhi) = opval;
4769     if (current_cpu->trace_result_p)
4770       current_cpu->trace_stream << "rdhi" << '[' << FLD (f_rdhi) << ']' << ":=0x" << hex << opval << dec << "  ";
4771   }
4772   {
4773     SI opval = SUBWORDDISI (tmp_mul_result, 1);
4774     * FLD (i_rdlo) = opval;
4775     if (current_cpu->trace_result_p)
4776       current_cpu->trace_stream << "rdlo" << '[' << FLD (f_rdlo) << ']' << ":=0x" << hex << opval << dec << "  ";
4777   }
4778 if (FLD (f_set_cc_)) {
4779 {
4780   {
4781     BI opval = EQDI (tmp_mul_result, 0);
4782     current_cpu->hardware.h_zbit = opval;
4783     if (current_cpu->trace_result_p)
4784       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
4785   }
4786   {
4787     BI opval = LTDI (tmp_mul_result, 0);
4788     current_cpu->hardware.h_nbit = opval;
4789     if (current_cpu->trace_result_p)
4790       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
4791   }
4792 }
4793 }
4794 }
4795
4796   current_cpu->done_insn (npc, status);
4797   return status;
4798 #undef FLD
4799 }
4800
4801 // ********** smull: smull$cond${set-cc?} $rdlo,$rdhi,$rm,$rs
4802
4803 sem_status
4804 arm_sem_smull (arm7f_cpu* current_cpu, arm_scache* sem)
4805 {
4806 #define FLD(f) abuf->fields.sfmt_umull.f
4807   sem_status status = SEM_STATUS_NORMAL;
4808   arm_scache* abuf = sem;
4809   PCADDR pc = abuf->addr;
4810   PCADDR npc = pc + 4;
4811
4812 {
4813   DI tmp_mul_result;
4814   SI tmp_hi;
4815   SI tmp_lo;
4816   tmp_mul_result = MULDI (EXTSIDI (* FLD (i_rs)), EXTSIDI (* FLD (i_rm)));
4817   {
4818     SI opval = SUBWORDDISI (tmp_mul_result, 0);
4819     * FLD (i_rdhi) = opval;
4820     if (current_cpu->trace_result_p)
4821       current_cpu->trace_stream << "rdhi" << '[' << FLD (f_rdhi) << ']' << ":=0x" << hex << opval << dec << "  ";
4822   }
4823   {
4824     SI opval = SUBWORDDISI (tmp_mul_result, 1);
4825     * FLD (i_rdlo) = opval;
4826     if (current_cpu->trace_result_p)
4827       current_cpu->trace_stream << "rdlo" << '[' << FLD (f_rdlo) << ']' << ":=0x" << hex << opval << dec << "  ";
4828   }
4829 if (FLD (f_set_cc_)) {
4830 {
4831   {
4832     BI opval = EQDI (tmp_mul_result, 0);
4833     current_cpu->hardware.h_zbit = opval;
4834     if (current_cpu->trace_result_p)
4835       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
4836   }
4837   {
4838     BI opval = LTDI (tmp_mul_result, 0);
4839     current_cpu->hardware.h_nbit = opval;
4840     if (current_cpu->trace_result_p)
4841       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
4842   }
4843 }
4844 }
4845 }
4846
4847   current_cpu->done_insn (npc, status);
4848   return status;
4849 #undef FLD
4850 }
4851
4852 // ********** smlal: smlal$cond${set-cc?} $rdlo,$rdhi,$rm,$rs
4853
4854 sem_status
4855 arm_sem_smlal (arm7f_cpu* current_cpu, arm_scache* sem)
4856 {
4857 #define FLD(f) abuf->fields.sfmt_umull.f
4858   sem_status status = SEM_STATUS_NORMAL;
4859   arm_scache* abuf = sem;
4860   PCADDR pc = abuf->addr;
4861   PCADDR npc = pc + 4;
4862
4863 {
4864   DI tmp_mul_result;
4865   SI tmp_hi;
4866   SI tmp_lo;
4867   tmp_mul_result = JOINSIDI (* FLD (i_rdhi), * FLD (i_rdlo));
4868   tmp_mul_result = ADDDI (MULDI (EXTSIDI (* FLD (i_rs)), EXTSIDI (* FLD (i_rm))), tmp_mul_result);
4869   {
4870     SI opval = SUBWORDDISI (tmp_mul_result, 0);
4871     * FLD (i_rdhi) = opval;
4872     if (current_cpu->trace_result_p)
4873       current_cpu->trace_stream << "rdhi" << '[' << FLD (f_rdhi) << ']' << ":=0x" << hex << opval << dec << "  ";
4874   }
4875   {
4876     SI opval = SUBWORDDISI (tmp_mul_result, 1);
4877     * FLD (i_rdlo) = opval;
4878     if (current_cpu->trace_result_p)
4879       current_cpu->trace_stream << "rdlo" << '[' << FLD (f_rdlo) << ']' << ":=0x" << hex << opval << dec << "  ";
4880   }
4881 if (FLD (f_set_cc_)) {
4882 {
4883   {
4884     BI opval = EQDI (tmp_mul_result, 0);
4885     current_cpu->hardware.h_zbit = opval;
4886     if (current_cpu->trace_result_p)
4887       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
4888   }
4889   {
4890     BI opval = LTDI (tmp_mul_result, 0);
4891     current_cpu->hardware.h_nbit = opval;
4892     if (current_cpu->trace_result_p)
4893       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
4894   }
4895 }
4896 }
4897 }
4898
4899   current_cpu->done_insn (npc, status);
4900   return status;
4901 #undef FLD
4902 }
4903
4904 // ********** swp: swp$cond $rd,$rm,[$rn]
4905
4906 sem_status
4907 arm_sem_swp (arm7f_cpu* current_cpu, arm_scache* sem)
4908 {
4909 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
4910   sem_status status = SEM_STATUS_NORMAL;
4911   arm_scache* abuf = sem;
4912   PCADDR pc = abuf->addr;
4913   PCADDR npc = pc + 4;
4914
4915 {
4916   SI tmp_temp;
4917   tmp_temp = current_cpu->GETMEMSI (pc, * FLD (i_rn));
4918   {
4919     SI opval = * FLD (i_rm);
4920     current_cpu->SETMEMSI (pc, * FLD (i_rn), opval);
4921     if (current_cpu->trace_result_p)
4922       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) * FLD (i_rn) << dec << ']' << ":=0x" << hex << opval << dec << "  ";
4923   }
4924   {
4925     SI opval = tmp_temp;
4926     * FLD (i_rd) = opval;
4927     if (current_cpu->trace_result_p)
4928       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4929   }
4930 }
4931
4932   current_cpu->done_insn (npc, status);
4933   return status;
4934 #undef FLD
4935 }
4936
4937 // ********** swpb: swpb${cond}b $rd,$rm,[$rn]
4938
4939 sem_status
4940 arm_sem_swpb (arm7f_cpu* current_cpu, arm_scache* sem)
4941 {
4942 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
4943   sem_status status = SEM_STATUS_NORMAL;
4944   arm_scache* abuf = sem;
4945   PCADDR pc = abuf->addr;
4946   PCADDR npc = pc + 4;
4947
4948 {
4949   SI tmp_temp;
4950   tmp_temp = current_cpu->GETMEMQI (pc, * FLD (i_rn));
4951   {
4952     QI opval = * FLD (i_rm);
4953     current_cpu->SETMEMQI (pc, * FLD (i_rn), opval);
4954     if (current_cpu->trace_result_p)
4955       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) * FLD (i_rn) << dec << ']' << ":=0x" << hex << (SI) opval << dec << "  ";
4956   }
4957   {
4958     SI opval = tmp_temp;
4959     * FLD (i_rd) = opval;
4960     if (current_cpu->trace_result_p)
4961       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
4962   }
4963 }
4964
4965   current_cpu->done_insn (npc, status);
4966   return status;
4967 #undef FLD
4968 }
4969
4970 // ********** swi: swi$cond ${swi-comment}
4971
4972 sem_status
4973 arm_sem_swi (arm7f_cpu* current_cpu, arm_scache* sem)
4974 {
4975 #define FLD(f) abuf->fields.sfmt_swi.f
4976   sem_status status = SEM_STATUS_NORMAL;
4977   arm_scache* abuf = sem;
4978   PCADDR pc = abuf->addr;
4979   PCADDR npc = pc + 4;
4980
4981   {
4982     USI opval = current_cpu->arm_swi (pc, FLD (f_swi_comment));
4983     current_cpu->branch (opval, npc, status);
4984     if (current_cpu->trace_result_p)
4985       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
4986   }
4987
4988   current_cpu->done_cti_insn (npc, status);
4989   return status;
4990 #undef FLD
4991 }
4992
4993 // ********** and-reg/imm-shift: and$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftimm}
4994
4995 sem_status
4996 arm_sem_and_reg_imm_shift (arm7f_cpu* current_cpu, arm_scache* sem)
4997 {
4998 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
4999   sem_status status = SEM_STATUS_NORMAL;
5000   arm_scache* abuf = sem;
5001   PCADDR pc = abuf->addr;
5002   PCADDR npc = pc + 4;
5003
5004 {
5005   SI tmp_operand2;
5006   BI tmp_carry_out;
5007   SI tmp_result;
5008   tmp_operand2 = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
5009   tmp_carry_out = current_cpu->compute_carry_out_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm), current_cpu->hardware.h_cbit);
5010   tmp_result = ANDSI (* FLD (i_rn), tmp_operand2);
5011 if (EQSI (FLD (f_rd), 15)) {
5012 {
5013   {
5014     USI opval = tmp_result;
5015     current_cpu->branch (opval, npc, status);
5016     if (current_cpu->trace_result_p)
5017       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
5018   }
5019 if (FLD (f_set_cc_)) {
5020   {
5021     SI opval = current_cpu->h_spsr_get ();
5022     current_cpu->h_cpsr_set (opval);
5023     if (current_cpu->trace_result_p)
5024       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
5025   }
5026 }
5027 }
5028 } else {
5029 {
5030   {
5031     SI opval = tmp_result;
5032     * FLD (i_rd) = opval;
5033     if (current_cpu->trace_result_p)
5034       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
5035   }
5036 if (FLD (f_set_cc_)) {
5037 {
5038 {
5039   {
5040     BI opval = EQSI (tmp_result, 0);
5041     current_cpu->hardware.h_zbit = opval;
5042     if (current_cpu->trace_result_p)
5043       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
5044   }
5045   {
5046     BI opval = LTSI (tmp_result, 0);
5047     current_cpu->hardware.h_nbit = opval;
5048     if (current_cpu->trace_result_p)
5049       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
5050   }
5051 }
5052   {
5053     BI opval = tmp_carry_out;
5054     current_cpu->hardware.h_cbit = opval;
5055     if (current_cpu->trace_result_p)
5056       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
5057   }
5058 }
5059 }
5060 }
5061 }
5062 }
5063
5064   current_cpu->done_cti_insn (npc, status);
5065   return status;
5066 #undef FLD
5067 }
5068
5069 // ********** and-reg/reg-shift: and$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftreg}
5070
5071 sem_status
5072 arm_sem_and_reg_reg_shift (arm7f_cpu* current_cpu, arm_scache* sem)
5073 {
5074 #define FLD(f) abuf->fields.sfmt_and_reg_reg_shift.f
5075   sem_status status = SEM_STATUS_NORMAL;
5076   arm_scache* abuf = sem;
5077   PCADDR pc = abuf->addr;
5078   PCADDR npc = pc + 4;
5079
5080 {
5081   SI tmp_operand2;
5082   BI tmp_carry_out;
5083   SI tmp_result;
5084   tmp_operand2 = current_cpu->compute_operand2_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg));
5085   tmp_carry_out = current_cpu->compute_carry_out_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg), current_cpu->hardware.h_cbit);
5086   tmp_result = ANDSI (* FLD (i_rn), tmp_operand2);
5087 if (EQSI (FLD (f_rd), 15)) {
5088 {
5089   {
5090     USI opval = tmp_result;
5091     current_cpu->branch (opval, npc, status);
5092     if (current_cpu->trace_result_p)
5093       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
5094   }
5095 if (FLD (f_set_cc_)) {
5096   {
5097     SI opval = current_cpu->h_spsr_get ();
5098     current_cpu->h_cpsr_set (opval);
5099     if (current_cpu->trace_result_p)
5100       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
5101   }
5102 }
5103 }
5104 } else {
5105 {
5106   {
5107     SI opval = tmp_result;
5108     * FLD (i_rd) = opval;
5109     if (current_cpu->trace_result_p)
5110       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
5111   }
5112 if (FLD (f_set_cc_)) {
5113 {
5114 {
5115   {
5116     BI opval = EQSI (tmp_result, 0);
5117     current_cpu->hardware.h_zbit = opval;
5118     if (current_cpu->trace_result_p)
5119       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
5120   }
5121   {
5122     BI opval = LTSI (tmp_result, 0);
5123     current_cpu->hardware.h_nbit = opval;
5124     if (current_cpu->trace_result_p)
5125       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
5126   }
5127 }
5128   {
5129     BI opval = tmp_carry_out;
5130     current_cpu->hardware.h_cbit = opval;
5131     if (current_cpu->trace_result_p)
5132       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
5133   }
5134 }
5135 }
5136 }
5137 }
5138 }
5139
5140   current_cpu->done_cti_insn (npc, status);
5141   return status;
5142 #undef FLD
5143 }
5144
5145 // ********** and-imm: and$cond${set-cc?} $rd,$rn,$imm12
5146
5147 sem_status
5148 arm_sem_and_imm (arm7f_cpu* current_cpu, arm_scache* sem)
5149 {
5150 #define FLD(f) abuf->fields.sfmt_and_imm.f
5151   sem_status status = SEM_STATUS_NORMAL;
5152   arm_scache* abuf = sem;
5153   PCADDR pc = abuf->addr;
5154   PCADDR npc = pc + 4;
5155
5156 {
5157   SI tmp_result;
5158   tmp_result = ANDSI (* FLD (i_rn), FLD (f_imm12));
5159 if (EQSI (FLD (f_rd), 15)) {
5160 {
5161   {
5162     USI opval = tmp_result;
5163     current_cpu->branch (opval, npc, status);
5164     if (current_cpu->trace_result_p)
5165       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
5166   }
5167 if (FLD (f_set_cc_)) {
5168   {
5169     SI opval = current_cpu->h_spsr_get ();
5170     current_cpu->h_cpsr_set (opval);
5171     if (current_cpu->trace_result_p)
5172       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
5173   }
5174 }
5175 }
5176 } else {
5177 {
5178   {
5179     SI opval = tmp_result;
5180     * FLD (i_rd) = opval;
5181     if (current_cpu->trace_result_p)
5182       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
5183   }
5184 if (FLD (f_set_cc_)) {
5185 {
5186   {
5187     BI opval = EQSI (tmp_result, 0);
5188     current_cpu->hardware.h_zbit = opval;
5189     if (current_cpu->trace_result_p)
5190       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
5191   }
5192   {
5193     BI opval = LTSI (tmp_result, 0);
5194     current_cpu->hardware.h_nbit = opval;
5195     if (current_cpu->trace_result_p)
5196       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
5197   }
5198 }
5199 }
5200 }
5201 }
5202 }
5203
5204   current_cpu->done_cti_insn (npc, status);
5205   return status;
5206 #undef FLD
5207 }
5208
5209 // ********** orr-reg/imm-shift: orr$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftimm}
5210
5211 sem_status
5212 arm_sem_orr_reg_imm_shift (arm7f_cpu* current_cpu, arm_scache* sem)
5213 {
5214 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
5215   sem_status status = SEM_STATUS_NORMAL;
5216   arm_scache* abuf = sem;
5217   PCADDR pc = abuf->addr;
5218   PCADDR npc = pc + 4;
5219
5220 {
5221   SI tmp_operand2;
5222   BI tmp_carry_out;
5223   SI tmp_result;
5224   tmp_operand2 = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
5225   tmp_carry_out = current_cpu->compute_carry_out_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm), current_cpu->hardware.h_cbit);
5226   tmp_result = ORSI (* FLD (i_rn), tmp_operand2);
5227 if (EQSI (FLD (f_rd), 15)) {
5228 {
5229   {
5230     USI opval = tmp_result;
5231     current_cpu->branch (opval, npc, status);
5232     if (current_cpu->trace_result_p)
5233       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
5234   }
5235 if (FLD (f_set_cc_)) {
5236   {
5237     SI opval = current_cpu->h_spsr_get ();
5238     current_cpu->h_cpsr_set (opval);
5239     if (current_cpu->trace_result_p)
5240       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
5241   }
5242 }
5243 }
5244 } else {
5245 {
5246   {
5247     SI opval = tmp_result;
5248     * FLD (i_rd) = opval;
5249     if (current_cpu->trace_result_p)
5250       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
5251   }
5252 if (FLD (f_set_cc_)) {
5253 {
5254 {
5255   {
5256     BI opval = EQSI (tmp_result, 0);
5257     current_cpu->hardware.h_zbit = opval;
5258     if (current_cpu->trace_result_p)
5259       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
5260   }
5261   {
5262     BI opval = LTSI (tmp_result, 0);
5263     current_cpu->hardware.h_nbit = opval;
5264     if (current_cpu->trace_result_p)
5265       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
5266   }
5267 }
5268   {
5269     BI opval = tmp_carry_out;
5270     current_cpu->hardware.h_cbit = opval;
5271     if (current_cpu->trace_result_p)
5272       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
5273   }
5274 }
5275 }
5276 }
5277 }
5278 }
5279
5280   current_cpu->done_cti_insn (npc, status);
5281   return status;
5282 #undef FLD
5283 }
5284
5285 // ********** orr-reg/reg-shift: orr$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftreg}
5286
5287 sem_status
5288 arm_sem_orr_reg_reg_shift (arm7f_cpu* current_cpu, arm_scache* sem)
5289 {
5290 #define FLD(f) abuf->fields.sfmt_and_reg_reg_shift.f
5291   sem_status status = SEM_STATUS_NORMAL;
5292   arm_scache* abuf = sem;
5293   PCADDR pc = abuf->addr;
5294   PCADDR npc = pc + 4;
5295
5296 {
5297   SI tmp_operand2;
5298   BI tmp_carry_out;
5299   SI tmp_result;
5300   tmp_operand2 = current_cpu->compute_operand2_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg));
5301   tmp_carry_out = current_cpu->compute_carry_out_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg), current_cpu->hardware.h_cbit);
5302   tmp_result = ORSI (* FLD (i_rn), tmp_operand2);
5303 if (EQSI (FLD (f_rd), 15)) {
5304 {
5305   {
5306     USI opval = tmp_result;
5307     current_cpu->branch (opval, npc, status);
5308     if (current_cpu->trace_result_p)
5309       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
5310   }
5311 if (FLD (f_set_cc_)) {
5312   {
5313     SI opval = current_cpu->h_spsr_get ();
5314     current_cpu->h_cpsr_set (opval);
5315     if (current_cpu->trace_result_p)
5316       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
5317   }
5318 }
5319 }
5320 } else {
5321 {
5322   {
5323     SI opval = tmp_result;
5324     * FLD (i_rd) = opval;
5325     if (current_cpu->trace_result_p)
5326       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
5327   }
5328 if (FLD (f_set_cc_)) {
5329 {
5330 {
5331   {
5332     BI opval = EQSI (tmp_result, 0);
5333     current_cpu->hardware.h_zbit = opval;
5334     if (current_cpu->trace_result_p)
5335       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
5336   }
5337   {
5338     BI opval = LTSI (tmp_result, 0);
5339     current_cpu->hardware.h_nbit = opval;
5340     if (current_cpu->trace_result_p)
5341       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
5342   }
5343 }
5344   {
5345     BI opval = tmp_carry_out;
5346     current_cpu->hardware.h_cbit = opval;
5347     if (current_cpu->trace_result_p)
5348       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
5349   }
5350 }
5351 }
5352 }
5353 }
5354 }
5355
5356   current_cpu->done_cti_insn (npc, status);
5357   return status;
5358 #undef FLD
5359 }
5360
5361 // ********** orr-imm: orr$cond${set-cc?} $rd,$rn,$imm12
5362
5363 sem_status
5364 arm_sem_orr_imm (arm7f_cpu* current_cpu, arm_scache* sem)
5365 {
5366 #define FLD(f) abuf->fields.sfmt_and_imm.f
5367   sem_status status = SEM_STATUS_NORMAL;
5368   arm_scache* abuf = sem;
5369   PCADDR pc = abuf->addr;
5370   PCADDR npc = pc + 4;
5371
5372 {
5373   SI tmp_result;
5374   tmp_result = ORSI (* FLD (i_rn), FLD (f_imm12));
5375 if (EQSI (FLD (f_rd), 15)) {
5376 {
5377   {
5378     USI opval = tmp_result;
5379     current_cpu->branch (opval, npc, status);
5380     if (current_cpu->trace_result_p)
5381       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
5382   }
5383 if (FLD (f_set_cc_)) {
5384   {
5385     SI opval = current_cpu->h_spsr_get ();
5386     current_cpu->h_cpsr_set (opval);
5387     if (current_cpu->trace_result_p)
5388       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
5389   }
5390 }
5391 }
5392 } else {
5393 {
5394   {
5395     SI opval = tmp_result;
5396     * FLD (i_rd) = opval;
5397     if (current_cpu->trace_result_p)
5398       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
5399   }
5400 if (FLD (f_set_cc_)) {
5401 {
5402   {
5403     BI opval = EQSI (tmp_result, 0);
5404     current_cpu->hardware.h_zbit = opval;
5405     if (current_cpu->trace_result_p)
5406       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
5407   }
5408   {
5409     BI opval = LTSI (tmp_result, 0);
5410     current_cpu->hardware.h_nbit = opval;
5411     if (current_cpu->trace_result_p)
5412       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
5413   }
5414 }
5415 }
5416 }
5417 }
5418 }
5419
5420   current_cpu->done_cti_insn (npc, status);
5421   return status;
5422 #undef FLD
5423 }
5424
5425 // ********** eor-reg/imm-shift: eor$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftimm}
5426
5427 sem_status
5428 arm_sem_eor_reg_imm_shift (arm7f_cpu* current_cpu, arm_scache* sem)
5429 {
5430 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
5431   sem_status status = SEM_STATUS_NORMAL;
5432   arm_scache* abuf = sem;
5433   PCADDR pc = abuf->addr;
5434   PCADDR npc = pc + 4;
5435
5436 {
5437   SI tmp_operand2;
5438   BI tmp_carry_out;
5439   SI tmp_result;
5440   tmp_operand2 = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
5441   tmp_carry_out = current_cpu->compute_carry_out_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm), current_cpu->hardware.h_cbit);
5442   tmp_result = XORSI (* FLD (i_rn), tmp_operand2);
5443 if (EQSI (FLD (f_rd), 15)) {
5444 {
5445   {
5446     USI opval = tmp_result;
5447     current_cpu->branch (opval, npc, status);
5448     if (current_cpu->trace_result_p)
5449       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
5450   }
5451 if (FLD (f_set_cc_)) {
5452   {
5453     SI opval = current_cpu->h_spsr_get ();
5454     current_cpu->h_cpsr_set (opval);
5455     if (current_cpu->trace_result_p)
5456       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
5457   }
5458 }
5459 }
5460 } else {
5461 {
5462   {
5463     SI opval = tmp_result;
5464     * FLD (i_rd) = opval;
5465     if (current_cpu->trace_result_p)
5466       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
5467   }
5468 if (FLD (f_set_cc_)) {
5469 {
5470 {
5471   {
5472     BI opval = EQSI (tmp_result, 0);
5473     current_cpu->hardware.h_zbit = opval;
5474     if (current_cpu->trace_result_p)
5475       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
5476   }
5477   {
5478     BI opval = LTSI (tmp_result, 0);
5479     current_cpu->hardware.h_nbit = opval;
5480     if (current_cpu->trace_result_p)
5481       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
5482   }
5483 }
5484   {
5485     BI opval = tmp_carry_out;
5486     current_cpu->hardware.h_cbit = opval;
5487     if (current_cpu->trace_result_p)
5488       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
5489   }
5490 }
5491 }
5492 }
5493 }
5494 }
5495
5496   current_cpu->done_cti_insn (npc, status);
5497   return status;
5498 #undef FLD
5499 }
5500
5501 // ********** eor-reg/reg-shift: eor$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftreg}
5502
5503 sem_status
5504 arm_sem_eor_reg_reg_shift (arm7f_cpu* current_cpu, arm_scache* sem)
5505 {
5506 #define FLD(f) abuf->fields.sfmt_and_reg_reg_shift.f
5507   sem_status status = SEM_STATUS_NORMAL;
5508   arm_scache* abuf = sem;
5509   PCADDR pc = abuf->addr;
5510   PCADDR npc = pc + 4;
5511
5512 {
5513   SI tmp_operand2;
5514   BI tmp_carry_out;
5515   SI tmp_result;
5516   tmp_operand2 = current_cpu->compute_operand2_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg));
5517   tmp_carry_out = current_cpu->compute_carry_out_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg), current_cpu->hardware.h_cbit);
5518   tmp_result = XORSI (* FLD (i_rn), tmp_operand2);
5519 if (EQSI (FLD (f_rd), 15)) {
5520 {
5521   {
5522     USI opval = tmp_result;
5523     current_cpu->branch (opval, npc, status);
5524     if (current_cpu->trace_result_p)
5525       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
5526   }
5527 if (FLD (f_set_cc_)) {
5528   {
5529     SI opval = current_cpu->h_spsr_get ();
5530     current_cpu->h_cpsr_set (opval);
5531     if (current_cpu->trace_result_p)
5532       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
5533   }
5534 }
5535 }
5536 } else {
5537 {
5538   {
5539     SI opval = tmp_result;
5540     * FLD (i_rd) = opval;
5541     if (current_cpu->trace_result_p)
5542       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
5543   }
5544 if (FLD (f_set_cc_)) {
5545 {
5546 {
5547   {
5548     BI opval = EQSI (tmp_result, 0);
5549     current_cpu->hardware.h_zbit = opval;
5550     if (current_cpu->trace_result_p)
5551       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
5552   }
5553   {
5554     BI opval = LTSI (tmp_result, 0);
5555     current_cpu->hardware.h_nbit = opval;
5556     if (current_cpu->trace_result_p)
5557       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
5558   }
5559 }
5560   {
5561     BI opval = tmp_carry_out;
5562     current_cpu->hardware.h_cbit = opval;
5563     if (current_cpu->trace_result_p)
5564       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
5565   }
5566 }
5567 }
5568 }
5569 }
5570 }
5571
5572   current_cpu->done_cti_insn (npc, status);
5573   return status;
5574 #undef FLD
5575 }
5576
5577 // ********** eor-imm: eor$cond${set-cc?} $rd,$rn,$imm12
5578
5579 sem_status
5580 arm_sem_eor_imm (arm7f_cpu* current_cpu, arm_scache* sem)
5581 {
5582 #define FLD(f) abuf->fields.sfmt_and_imm.f
5583   sem_status status = SEM_STATUS_NORMAL;
5584   arm_scache* abuf = sem;
5585   PCADDR pc = abuf->addr;
5586   PCADDR npc = pc + 4;
5587
5588 {
5589   SI tmp_result;
5590   tmp_result = XORSI (* FLD (i_rn), FLD (f_imm12));
5591 if (EQSI (FLD (f_rd), 15)) {
5592 {
5593   {
5594     USI opval = tmp_result;
5595     current_cpu->branch (opval, npc, status);
5596     if (current_cpu->trace_result_p)
5597       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
5598   }
5599 if (FLD (f_set_cc_)) {
5600   {
5601     SI opval = current_cpu->h_spsr_get ();
5602     current_cpu->h_cpsr_set (opval);
5603     if (current_cpu->trace_result_p)
5604       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
5605   }
5606 }
5607 }
5608 } else {
5609 {
5610   {
5611     SI opval = tmp_result;
5612     * FLD (i_rd) = opval;
5613     if (current_cpu->trace_result_p)
5614       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
5615   }
5616 if (FLD (f_set_cc_)) {
5617 {
5618   {
5619     BI opval = EQSI (tmp_result, 0);
5620     current_cpu->hardware.h_zbit = opval;
5621     if (current_cpu->trace_result_p)
5622       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
5623   }
5624   {
5625     BI opval = LTSI (tmp_result, 0);
5626     current_cpu->hardware.h_nbit = opval;
5627     if (current_cpu->trace_result_p)
5628       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
5629   }
5630 }
5631 }
5632 }
5633 }
5634 }
5635
5636   current_cpu->done_cti_insn (npc, status);
5637   return status;
5638 #undef FLD
5639 }
5640
5641 // ********** mov-reg/imm-shift: mov$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftimm}
5642
5643 sem_status
5644 arm_sem_mov_reg_imm_shift (arm7f_cpu* current_cpu, arm_scache* sem)
5645 {
5646 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
5647   sem_status status = SEM_STATUS_NORMAL;
5648   arm_scache* abuf = sem;
5649   PCADDR pc = abuf->addr;
5650   PCADDR npc = pc + 4;
5651
5652 {
5653   SI tmp_operand2;
5654   BI tmp_carry_out;
5655   SI tmp_result;
5656   tmp_operand2 = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
5657   tmp_carry_out = current_cpu->compute_carry_out_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm), current_cpu->hardware.h_cbit);
5658   tmp_result = tmp_operand2;
5659 if (EQSI (FLD (f_rd), 15)) {
5660 {
5661   {
5662     USI opval = tmp_result;
5663     current_cpu->branch (opval, npc, status);
5664     if (current_cpu->trace_result_p)
5665       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
5666   }
5667 if (FLD (f_set_cc_)) {
5668   {
5669     SI opval = current_cpu->h_spsr_get ();
5670     current_cpu->h_cpsr_set (opval);
5671     if (current_cpu->trace_result_p)
5672       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
5673   }
5674 }
5675 }
5676 } else {
5677 {
5678   {
5679     SI opval = tmp_result;
5680     * FLD (i_rd) = opval;
5681     if (current_cpu->trace_result_p)
5682       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
5683   }
5684 if (FLD (f_set_cc_)) {
5685 {
5686 {
5687   {
5688     BI opval = EQSI (tmp_result, 0);
5689     current_cpu->hardware.h_zbit = opval;
5690     if (current_cpu->trace_result_p)
5691       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
5692   }
5693   {
5694     BI opval = LTSI (tmp_result, 0);
5695     current_cpu->hardware.h_nbit = opval;
5696     if (current_cpu->trace_result_p)
5697       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
5698   }
5699 }
5700   {
5701     BI opval = tmp_carry_out;
5702     current_cpu->hardware.h_cbit = opval;
5703     if (current_cpu->trace_result_p)
5704       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
5705   }
5706 }
5707 }
5708 }
5709 }
5710 }
5711
5712   current_cpu->done_cti_insn (npc, status);
5713   return status;
5714 #undef FLD
5715 }
5716
5717 // ********** mov-reg/reg-shift: mov$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftreg}
5718
5719 sem_status
5720 arm_sem_mov_reg_reg_shift (arm7f_cpu* current_cpu, arm_scache* sem)
5721 {
5722 #define FLD(f) abuf->fields.sfmt_and_reg_reg_shift.f
5723   sem_status status = SEM_STATUS_NORMAL;
5724   arm_scache* abuf = sem;
5725   PCADDR pc = abuf->addr;
5726   PCADDR npc = pc + 4;
5727
5728 {
5729   SI tmp_operand2;
5730   BI tmp_carry_out;
5731   SI tmp_result;
5732   tmp_operand2 = current_cpu->compute_operand2_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg));
5733   tmp_carry_out = current_cpu->compute_carry_out_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg), current_cpu->hardware.h_cbit);
5734   tmp_result = tmp_operand2;
5735 if (EQSI (FLD (f_rd), 15)) {
5736 {
5737   {
5738     USI opval = tmp_result;
5739     current_cpu->branch (opval, npc, status);
5740     if (current_cpu->trace_result_p)
5741       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
5742   }
5743 if (FLD (f_set_cc_)) {
5744   {
5745     SI opval = current_cpu->h_spsr_get ();
5746     current_cpu->h_cpsr_set (opval);
5747     if (current_cpu->trace_result_p)
5748       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
5749   }
5750 }
5751 }
5752 } else {
5753 {
5754   {
5755     SI opval = tmp_result;
5756     * FLD (i_rd) = opval;
5757     if (current_cpu->trace_result_p)
5758       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
5759   }
5760 if (FLD (f_set_cc_)) {
5761 {
5762 {
5763   {
5764     BI opval = EQSI (tmp_result, 0);
5765     current_cpu->hardware.h_zbit = opval;
5766     if (current_cpu->trace_result_p)
5767       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
5768   }
5769   {
5770     BI opval = LTSI (tmp_result, 0);
5771     current_cpu->hardware.h_nbit = opval;
5772     if (current_cpu->trace_result_p)
5773       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
5774   }
5775 }
5776   {
5777     BI opval = tmp_carry_out;
5778     current_cpu->hardware.h_cbit = opval;
5779     if (current_cpu->trace_result_p)
5780       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
5781   }
5782 }
5783 }
5784 }
5785 }
5786 }
5787
5788   current_cpu->done_cti_insn (npc, status);
5789   return status;
5790 #undef FLD
5791 }
5792
5793 // ********** mov-imm: mov$cond${set-cc?} $rd,$imm12
5794
5795 sem_status
5796 arm_sem_mov_imm (arm7f_cpu* current_cpu, arm_scache* sem)
5797 {
5798 #define FLD(f) abuf->fields.sfmt_and_imm.f
5799   sem_status status = SEM_STATUS_NORMAL;
5800   arm_scache* abuf = sem;
5801   PCADDR pc = abuf->addr;
5802   PCADDR npc = pc + 4;
5803
5804 {
5805   SI tmp_result;
5806   tmp_result = FLD (f_imm12);
5807 if (EQSI (FLD (f_rd), 15)) {
5808 {
5809   {
5810     USI opval = tmp_result;
5811     current_cpu->branch (opval, npc, status);
5812     if (current_cpu->trace_result_p)
5813       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
5814   }
5815 if (FLD (f_set_cc_)) {
5816   {
5817     SI opval = current_cpu->h_spsr_get ();
5818     current_cpu->h_cpsr_set (opval);
5819     if (current_cpu->trace_result_p)
5820       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
5821   }
5822 }
5823 }
5824 } else {
5825 {
5826   {
5827     SI opval = tmp_result;
5828     * FLD (i_rd) = opval;
5829     if (current_cpu->trace_result_p)
5830       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
5831   }
5832 if (FLD (f_set_cc_)) {
5833 {
5834   {
5835     BI opval = EQSI (tmp_result, 0);
5836     current_cpu->hardware.h_zbit = opval;
5837     if (current_cpu->trace_result_p)
5838       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
5839   }
5840   {
5841     BI opval = LTSI (tmp_result, 0);
5842     current_cpu->hardware.h_nbit = opval;
5843     if (current_cpu->trace_result_p)
5844       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
5845   }
5846 }
5847 }
5848 }
5849 }
5850 }
5851
5852   current_cpu->done_cti_insn (npc, status);
5853   return status;
5854 #undef FLD
5855 }
5856
5857 // ********** bic-reg/imm-shift: bic$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftimm}
5858
5859 sem_status
5860 arm_sem_bic_reg_imm_shift (arm7f_cpu* current_cpu, arm_scache* sem)
5861 {
5862 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
5863   sem_status status = SEM_STATUS_NORMAL;
5864   arm_scache* abuf = sem;
5865   PCADDR pc = abuf->addr;
5866   PCADDR npc = pc + 4;
5867
5868 {
5869   SI tmp_operand2;
5870   BI tmp_carry_out;
5871   SI tmp_result;
5872   tmp_operand2 = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
5873   tmp_carry_out = current_cpu->compute_carry_out_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm), current_cpu->hardware.h_cbit);
5874   tmp_result = ANDSI (* FLD (i_rn), INVSI (tmp_operand2));
5875 if (EQSI (FLD (f_rd), 15)) {
5876 {
5877   {
5878     USI opval = tmp_result;
5879     current_cpu->branch (opval, npc, status);
5880     if (current_cpu->trace_result_p)
5881       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
5882   }
5883 if (FLD (f_set_cc_)) {
5884   {
5885     SI opval = current_cpu->h_spsr_get ();
5886     current_cpu->h_cpsr_set (opval);
5887     if (current_cpu->trace_result_p)
5888       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
5889   }
5890 }
5891 }
5892 } else {
5893 {
5894   {
5895     SI opval = tmp_result;
5896     * FLD (i_rd) = opval;
5897     if (current_cpu->trace_result_p)
5898       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
5899   }
5900 if (FLD (f_set_cc_)) {
5901 {
5902 {
5903   {
5904     BI opval = EQSI (tmp_result, 0);
5905     current_cpu->hardware.h_zbit = opval;
5906     if (current_cpu->trace_result_p)
5907       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
5908   }
5909   {
5910     BI opval = LTSI (tmp_result, 0);
5911     current_cpu->hardware.h_nbit = opval;
5912     if (current_cpu->trace_result_p)
5913       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
5914   }
5915 }
5916   {
5917     BI opval = tmp_carry_out;
5918     current_cpu->hardware.h_cbit = opval;
5919     if (current_cpu->trace_result_p)
5920       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
5921   }
5922 }
5923 }
5924 }
5925 }
5926 }
5927
5928   current_cpu->done_cti_insn (npc, status);
5929   return status;
5930 #undef FLD
5931 }
5932
5933 // ********** bic-reg/reg-shift: bic$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftreg}
5934
5935 sem_status
5936 arm_sem_bic_reg_reg_shift (arm7f_cpu* current_cpu, arm_scache* sem)
5937 {
5938 #define FLD(f) abuf->fields.sfmt_and_reg_reg_shift.f
5939   sem_status status = SEM_STATUS_NORMAL;
5940   arm_scache* abuf = sem;
5941   PCADDR pc = abuf->addr;
5942   PCADDR npc = pc + 4;
5943
5944 {
5945   SI tmp_operand2;
5946   BI tmp_carry_out;
5947   SI tmp_result;
5948   tmp_operand2 = current_cpu->compute_operand2_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg));
5949   tmp_carry_out = current_cpu->compute_carry_out_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg), current_cpu->hardware.h_cbit);
5950   tmp_result = ANDSI (* FLD (i_rn), INVSI (tmp_operand2));
5951 if (EQSI (FLD (f_rd), 15)) {
5952 {
5953   {
5954     USI opval = tmp_result;
5955     current_cpu->branch (opval, npc, status);
5956     if (current_cpu->trace_result_p)
5957       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
5958   }
5959 if (FLD (f_set_cc_)) {
5960   {
5961     SI opval = current_cpu->h_spsr_get ();
5962     current_cpu->h_cpsr_set (opval);
5963     if (current_cpu->trace_result_p)
5964       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
5965   }
5966 }
5967 }
5968 } else {
5969 {
5970   {
5971     SI opval = tmp_result;
5972     * FLD (i_rd) = opval;
5973     if (current_cpu->trace_result_p)
5974       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
5975   }
5976 if (FLD (f_set_cc_)) {
5977 {
5978 {
5979   {
5980     BI opval = EQSI (tmp_result, 0);
5981     current_cpu->hardware.h_zbit = opval;
5982     if (current_cpu->trace_result_p)
5983       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
5984   }
5985   {
5986     BI opval = LTSI (tmp_result, 0);
5987     current_cpu->hardware.h_nbit = opval;
5988     if (current_cpu->trace_result_p)
5989       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
5990   }
5991 }
5992   {
5993     BI opval = tmp_carry_out;
5994     current_cpu->hardware.h_cbit = opval;
5995     if (current_cpu->trace_result_p)
5996       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
5997   }
5998 }
5999 }
6000 }
6001 }
6002 }
6003
6004   current_cpu->done_cti_insn (npc, status);
6005   return status;
6006 #undef FLD
6007 }
6008
6009 // ********** bic-imm: bic$cond${set-cc?} $rd,$rn,$imm12
6010
6011 sem_status
6012 arm_sem_bic_imm (arm7f_cpu* current_cpu, arm_scache* sem)
6013 {
6014 #define FLD(f) abuf->fields.sfmt_and_imm.f
6015   sem_status status = SEM_STATUS_NORMAL;
6016   arm_scache* abuf = sem;
6017   PCADDR pc = abuf->addr;
6018   PCADDR npc = pc + 4;
6019
6020 {
6021   SI tmp_result;
6022   tmp_result = ANDSI (* FLD (i_rn), INVSI (FLD (f_imm12)));
6023 if (EQSI (FLD (f_rd), 15)) {
6024 {
6025   {
6026     USI opval = tmp_result;
6027     current_cpu->branch (opval, npc, status);
6028     if (current_cpu->trace_result_p)
6029       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
6030   }
6031 if (FLD (f_set_cc_)) {
6032   {
6033     SI opval = current_cpu->h_spsr_get ();
6034     current_cpu->h_cpsr_set (opval);
6035     if (current_cpu->trace_result_p)
6036       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
6037   }
6038 }
6039 }
6040 } else {
6041 {
6042   {
6043     SI opval = tmp_result;
6044     * FLD (i_rd) = opval;
6045     if (current_cpu->trace_result_p)
6046       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
6047   }
6048 if (FLD (f_set_cc_)) {
6049 {
6050   {
6051     BI opval = EQSI (tmp_result, 0);
6052     current_cpu->hardware.h_zbit = opval;
6053     if (current_cpu->trace_result_p)
6054       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
6055   }
6056   {
6057     BI opval = LTSI (tmp_result, 0);
6058     current_cpu->hardware.h_nbit = opval;
6059     if (current_cpu->trace_result_p)
6060       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
6061   }
6062 }
6063 }
6064 }
6065 }
6066 }
6067
6068   current_cpu->done_cti_insn (npc, status);
6069   return status;
6070 #undef FLD
6071 }
6072
6073 // ********** mvn-reg/imm-shift: mvn$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftimm}
6074
6075 sem_status
6076 arm_sem_mvn_reg_imm_shift (arm7f_cpu* current_cpu, arm_scache* sem)
6077 {
6078 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
6079   sem_status status = SEM_STATUS_NORMAL;
6080   arm_scache* abuf = sem;
6081   PCADDR pc = abuf->addr;
6082   PCADDR npc = pc + 4;
6083
6084 {
6085   SI tmp_operand2;
6086   BI tmp_carry_out;
6087   SI tmp_result;
6088   tmp_operand2 = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
6089   tmp_carry_out = current_cpu->compute_carry_out_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm), current_cpu->hardware.h_cbit);
6090   tmp_result = INVSI (tmp_operand2);
6091 if (EQSI (FLD (f_rd), 15)) {
6092 {
6093   {
6094     USI opval = tmp_result;
6095     current_cpu->branch (opval, npc, status);
6096     if (current_cpu->trace_result_p)
6097       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
6098   }
6099 if (FLD (f_set_cc_)) {
6100   {
6101     SI opval = current_cpu->h_spsr_get ();
6102     current_cpu->h_cpsr_set (opval);
6103     if (current_cpu->trace_result_p)
6104       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
6105   }
6106 }
6107 }
6108 } else {
6109 {
6110   {
6111     SI opval = tmp_result;
6112     * FLD (i_rd) = opval;
6113     if (current_cpu->trace_result_p)
6114       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
6115   }
6116 if (FLD (f_set_cc_)) {
6117 {
6118 {
6119   {
6120     BI opval = EQSI (tmp_result, 0);
6121     current_cpu->hardware.h_zbit = opval;
6122     if (current_cpu->trace_result_p)
6123       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
6124   }
6125   {
6126     BI opval = LTSI (tmp_result, 0);
6127     current_cpu->hardware.h_nbit = opval;
6128     if (current_cpu->trace_result_p)
6129       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
6130   }
6131 }
6132   {
6133     BI opval = tmp_carry_out;
6134     current_cpu->hardware.h_cbit = opval;
6135     if (current_cpu->trace_result_p)
6136       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
6137   }
6138 }
6139 }
6140 }
6141 }
6142 }
6143
6144   current_cpu->done_cti_insn (npc, status);
6145   return status;
6146 #undef FLD
6147 }
6148
6149 // ********** mvn-reg/reg-shift: mvn$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftreg}
6150
6151 sem_status
6152 arm_sem_mvn_reg_reg_shift (arm7f_cpu* current_cpu, arm_scache* sem)
6153 {
6154 #define FLD(f) abuf->fields.sfmt_and_reg_reg_shift.f
6155   sem_status status = SEM_STATUS_NORMAL;
6156   arm_scache* abuf = sem;
6157   PCADDR pc = abuf->addr;
6158   PCADDR npc = pc + 4;
6159
6160 {
6161   SI tmp_operand2;
6162   BI tmp_carry_out;
6163   SI tmp_result;
6164   tmp_operand2 = current_cpu->compute_operand2_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg));
6165   tmp_carry_out = current_cpu->compute_carry_out_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg), current_cpu->hardware.h_cbit);
6166   tmp_result = INVSI (tmp_operand2);
6167 if (EQSI (FLD (f_rd), 15)) {
6168 {
6169   {
6170     USI opval = tmp_result;
6171     current_cpu->branch (opval, npc, status);
6172     if (current_cpu->trace_result_p)
6173       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
6174   }
6175 if (FLD (f_set_cc_)) {
6176   {
6177     SI opval = current_cpu->h_spsr_get ();
6178     current_cpu->h_cpsr_set (opval);
6179     if (current_cpu->trace_result_p)
6180       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
6181   }
6182 }
6183 }
6184 } else {
6185 {
6186   {
6187     SI opval = tmp_result;
6188     * FLD (i_rd) = opval;
6189     if (current_cpu->trace_result_p)
6190       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
6191   }
6192 if (FLD (f_set_cc_)) {
6193 {
6194 {
6195   {
6196     BI opval = EQSI (tmp_result, 0);
6197     current_cpu->hardware.h_zbit = opval;
6198     if (current_cpu->trace_result_p)
6199       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
6200   }
6201   {
6202     BI opval = LTSI (tmp_result, 0);
6203     current_cpu->hardware.h_nbit = opval;
6204     if (current_cpu->trace_result_p)
6205       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
6206   }
6207 }
6208   {
6209     BI opval = tmp_carry_out;
6210     current_cpu->hardware.h_cbit = opval;
6211     if (current_cpu->trace_result_p)
6212       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
6213   }
6214 }
6215 }
6216 }
6217 }
6218 }
6219
6220   current_cpu->done_cti_insn (npc, status);
6221   return status;
6222 #undef FLD
6223 }
6224
6225 // ********** mvn-imm: mvn$cond${set-cc?} $rd,$imm12
6226
6227 sem_status
6228 arm_sem_mvn_imm (arm7f_cpu* current_cpu, arm_scache* sem)
6229 {
6230 #define FLD(f) abuf->fields.sfmt_and_imm.f
6231   sem_status status = SEM_STATUS_NORMAL;
6232   arm_scache* abuf = sem;
6233   PCADDR pc = abuf->addr;
6234   PCADDR npc = pc + 4;
6235
6236 {
6237   SI tmp_result;
6238   tmp_result = INVSI (FLD (f_imm12));
6239 if (EQSI (FLD (f_rd), 15)) {
6240 {
6241   {
6242     USI opval = tmp_result;
6243     current_cpu->branch (opval, npc, status);
6244     if (current_cpu->trace_result_p)
6245       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
6246   }
6247 if (FLD (f_set_cc_)) {
6248   {
6249     SI opval = current_cpu->h_spsr_get ();
6250     current_cpu->h_cpsr_set (opval);
6251     if (current_cpu->trace_result_p)
6252       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
6253   }
6254 }
6255 }
6256 } else {
6257 {
6258   {
6259     SI opval = tmp_result;
6260     * FLD (i_rd) = opval;
6261     if (current_cpu->trace_result_p)
6262       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
6263   }
6264 if (FLD (f_set_cc_)) {
6265 {
6266   {
6267     BI opval = EQSI (tmp_result, 0);
6268     current_cpu->hardware.h_zbit = opval;
6269     if (current_cpu->trace_result_p)
6270       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
6271   }
6272   {
6273     BI opval = LTSI (tmp_result, 0);
6274     current_cpu->hardware.h_nbit = opval;
6275     if (current_cpu->trace_result_p)
6276       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
6277   }
6278 }
6279 }
6280 }
6281 }
6282 }
6283
6284   current_cpu->done_cti_insn (npc, status);
6285   return status;
6286 #undef FLD
6287 }
6288
6289 // ********** add-reg/imm-shift: add$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftimm}
6290
6291 sem_status
6292 arm_sem_add_reg_imm_shift (arm7f_cpu* current_cpu, arm_scache* sem)
6293 {
6294 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
6295   sem_status status = SEM_STATUS_NORMAL;
6296   arm_scache* abuf = sem;
6297   PCADDR pc = abuf->addr;
6298   PCADDR npc = pc + 4;
6299
6300 {
6301   SI tmp_operand2;
6302   SI tmp_result;
6303   SI tmp_temp_op1;
6304   SI tmp_temp_op2;
6305   tmp_operand2 = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
6306   tmp_temp_op1 = * FLD (i_rn);
6307   tmp_temp_op2 = tmp_operand2;
6308   tmp_result = ADDSI (* FLD (i_rn), tmp_operand2);
6309 if (EQSI (FLD (f_rd), 15)) {
6310 {
6311   {
6312     USI opval = tmp_result;
6313     current_cpu->branch (opval, npc, status);
6314     if (current_cpu->trace_result_p)
6315       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
6316   }
6317 if (FLD (f_set_cc_)) {
6318   {
6319     SI opval = current_cpu->h_spsr_get ();
6320     current_cpu->h_cpsr_set (opval);
6321     if (current_cpu->trace_result_p)
6322       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
6323   }
6324 }
6325 }
6326 } else {
6327 {
6328   {
6329     SI opval = tmp_result;
6330     * FLD (i_rd) = opval;
6331     if (current_cpu->trace_result_p)
6332       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
6333   }
6334 if (FLD (f_set_cc_)) {
6335 {
6336   SI tmp_result;
6337   tmp_result = ADDCSI (tmp_temp_op1, tmp_temp_op2, 0);
6338 {
6339   {
6340     BI opval = EQSI (tmp_result, 0);
6341     current_cpu->hardware.h_zbit = opval;
6342     if (current_cpu->trace_result_p)
6343       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
6344   }
6345   {
6346     BI opval = LTSI (tmp_result, 0);
6347     current_cpu->hardware.h_nbit = opval;
6348     if (current_cpu->trace_result_p)
6349       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
6350   }
6351 }
6352   {
6353     BI opval = ADDCFSI (tmp_temp_op1, tmp_temp_op2, 0);
6354     current_cpu->hardware.h_cbit = opval;
6355     if (current_cpu->trace_result_p)
6356       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
6357   }
6358   {
6359     BI opval = ADDOFSI (tmp_temp_op1, tmp_temp_op2, 0);
6360     current_cpu->hardware.h_vbit = opval;
6361     if (current_cpu->trace_result_p)
6362       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
6363   }
6364 }
6365 }
6366 }
6367 }
6368 }
6369
6370   current_cpu->done_cti_insn (npc, status);
6371   return status;
6372 #undef FLD
6373 }
6374
6375 // ********** add-reg/reg-shift: add$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftreg}
6376
6377 sem_status
6378 arm_sem_add_reg_reg_shift (arm7f_cpu* current_cpu, arm_scache* sem)
6379 {
6380 #define FLD(f) abuf->fields.sfmt_and_reg_reg_shift.f
6381   sem_status status = SEM_STATUS_NORMAL;
6382   arm_scache* abuf = sem;
6383   PCADDR pc = abuf->addr;
6384   PCADDR npc = pc + 4;
6385
6386 {
6387   SI tmp_operand2;
6388   SI tmp_result;
6389   SI tmp_temp_op1;
6390   SI tmp_temp_op2;
6391   tmp_operand2 = current_cpu->compute_operand2_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg));
6392   tmp_temp_op1 = * FLD (i_rn);
6393   tmp_temp_op2 = tmp_operand2;
6394   tmp_result = ADDSI (* FLD (i_rn), tmp_operand2);
6395 if (EQSI (FLD (f_rd), 15)) {
6396 {
6397   {
6398     USI opval = tmp_result;
6399     current_cpu->branch (opval, npc, status);
6400     if (current_cpu->trace_result_p)
6401       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
6402   }
6403 if (FLD (f_set_cc_)) {
6404   {
6405     SI opval = current_cpu->h_spsr_get ();
6406     current_cpu->h_cpsr_set (opval);
6407     if (current_cpu->trace_result_p)
6408       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
6409   }
6410 }
6411 }
6412 } else {
6413 {
6414   {
6415     SI opval = tmp_result;
6416     * FLD (i_rd) = opval;
6417     if (current_cpu->trace_result_p)
6418       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
6419   }
6420 if (FLD (f_set_cc_)) {
6421 {
6422   SI tmp_result;
6423   tmp_result = ADDCSI (tmp_temp_op1, tmp_temp_op2, 0);
6424 {
6425   {
6426     BI opval = EQSI (tmp_result, 0);
6427     current_cpu->hardware.h_zbit = opval;
6428     if (current_cpu->trace_result_p)
6429       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
6430   }
6431   {
6432     BI opval = LTSI (tmp_result, 0);
6433     current_cpu->hardware.h_nbit = opval;
6434     if (current_cpu->trace_result_p)
6435       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
6436   }
6437 }
6438   {
6439     BI opval = ADDCFSI (tmp_temp_op1, tmp_temp_op2, 0);
6440     current_cpu->hardware.h_cbit = opval;
6441     if (current_cpu->trace_result_p)
6442       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
6443   }
6444   {
6445     BI opval = ADDOFSI (tmp_temp_op1, tmp_temp_op2, 0);
6446     current_cpu->hardware.h_vbit = opval;
6447     if (current_cpu->trace_result_p)
6448       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
6449   }
6450 }
6451 }
6452 }
6453 }
6454 }
6455
6456   current_cpu->done_cti_insn (npc, status);
6457   return status;
6458 #undef FLD
6459 }
6460
6461 // ********** add-imm: add$cond${set-cc?} $rd,$rn,$imm12
6462
6463 sem_status
6464 arm_sem_add_imm (arm7f_cpu* current_cpu, arm_scache* sem)
6465 {
6466 #define FLD(f) abuf->fields.sfmt_and_imm.f
6467   sem_status status = SEM_STATUS_NORMAL;
6468   arm_scache* abuf = sem;
6469   PCADDR pc = abuf->addr;
6470   PCADDR npc = pc + 4;
6471
6472 {
6473   SI tmp_result;
6474   tmp_result = ADDSI (* FLD (i_rn), FLD (f_imm12));
6475 if (EQSI (FLD (f_rd), 15)) {
6476 {
6477 if (FLD (f_set_cc_)) {
6478   {
6479     SI opval = current_cpu->h_spsr_get ();
6480     current_cpu->h_cpsr_set (opval);
6481     if (current_cpu->trace_result_p)
6482       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
6483   }
6484 }
6485   {
6486     USI opval = tmp_result;
6487     current_cpu->branch (opval, npc, status);
6488     if (current_cpu->trace_result_p)
6489       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
6490   }
6491 }
6492 } else {
6493 {
6494 if (FLD (f_set_cc_)) {
6495 {
6496   SI tmp_result;
6497   tmp_result = ADDCSI (* FLD (i_rn), FLD (f_imm12), 0);
6498 {
6499   {
6500     BI opval = EQSI (tmp_result, 0);
6501     current_cpu->hardware.h_zbit = opval;
6502     if (current_cpu->trace_result_p)
6503       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
6504   }
6505   {
6506     BI opval = LTSI (tmp_result, 0);
6507     current_cpu->hardware.h_nbit = opval;
6508     if (current_cpu->trace_result_p)
6509       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
6510   }
6511 }
6512   {
6513     BI opval = ADDCFSI (* FLD (i_rn), FLD (f_imm12), 0);
6514     current_cpu->hardware.h_cbit = opval;
6515     if (current_cpu->trace_result_p)
6516       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
6517   }
6518   {
6519     BI opval = ADDOFSI (* FLD (i_rn), FLD (f_imm12), 0);
6520     current_cpu->hardware.h_vbit = opval;
6521     if (current_cpu->trace_result_p)
6522       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
6523   }
6524 }
6525 }
6526   {
6527     SI opval = tmp_result;
6528     * FLD (i_rd) = opval;
6529     if (current_cpu->trace_result_p)
6530       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
6531   }
6532 }
6533 }
6534 }
6535
6536   current_cpu->done_cti_insn (npc, status);
6537   return status;
6538 #undef FLD
6539 }
6540
6541 // ********** adc-reg/imm-shift: adc$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftimm}
6542
6543 sem_status
6544 arm_sem_adc_reg_imm_shift (arm7f_cpu* current_cpu, arm_scache* sem)
6545 {
6546 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
6547   sem_status status = SEM_STATUS_NORMAL;
6548   arm_scache* abuf = sem;
6549   PCADDR pc = abuf->addr;
6550   PCADDR npc = pc + 4;
6551
6552 {
6553   SI tmp_operand2;
6554   SI tmp_result;
6555   SI tmp_temp_op1;
6556   SI tmp_temp_op2;
6557   tmp_operand2 = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
6558   tmp_temp_op1 = * FLD (i_rn);
6559   tmp_temp_op2 = tmp_operand2;
6560   tmp_result = ADDCSI (* FLD (i_rn), tmp_operand2, current_cpu->hardware.h_cbit);
6561 if (EQSI (FLD (f_rd), 15)) {
6562 {
6563   {
6564     USI opval = tmp_result;
6565     current_cpu->branch (opval, npc, status);
6566     if (current_cpu->trace_result_p)
6567       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
6568   }
6569 if (FLD (f_set_cc_)) {
6570   {
6571     SI opval = current_cpu->h_spsr_get ();
6572     current_cpu->h_cpsr_set (opval);
6573     if (current_cpu->trace_result_p)
6574       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
6575   }
6576 }
6577 }
6578 } else {
6579 {
6580   {
6581     SI opval = tmp_result;
6582     * FLD (i_rd) = opval;
6583     if (current_cpu->trace_result_p)
6584       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
6585   }
6586 if (FLD (f_set_cc_)) {
6587 {
6588   SI tmp_result;
6589   tmp_result = ADDCSI (tmp_temp_op1, tmp_temp_op2, current_cpu->hardware.h_cbit);
6590 {
6591   {
6592     BI opval = EQSI (tmp_result, 0);
6593     current_cpu->hardware.h_zbit = opval;
6594     if (current_cpu->trace_result_p)
6595       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
6596   }
6597   {
6598     BI opval = LTSI (tmp_result, 0);
6599     current_cpu->hardware.h_nbit = opval;
6600     if (current_cpu->trace_result_p)
6601       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
6602   }
6603 }
6604   {
6605     BI opval = ADDCFSI (tmp_temp_op1, tmp_temp_op2, current_cpu->hardware.h_cbit);
6606     current_cpu->hardware.h_cbit = opval;
6607     if (current_cpu->trace_result_p)
6608       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
6609   }
6610   {
6611     BI opval = ADDOFSI (tmp_temp_op1, tmp_temp_op2, current_cpu->hardware.h_cbit);
6612     current_cpu->hardware.h_vbit = opval;
6613     if (current_cpu->trace_result_p)
6614       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
6615   }
6616 }
6617 }
6618 }
6619 }
6620 }
6621
6622   current_cpu->done_cti_insn (npc, status);
6623   return status;
6624 #undef FLD
6625 }
6626
6627 // ********** adc-reg/reg-shift: adc$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftreg}
6628
6629 sem_status
6630 arm_sem_adc_reg_reg_shift (arm7f_cpu* current_cpu, arm_scache* sem)
6631 {
6632 #define FLD(f) abuf->fields.sfmt_and_reg_reg_shift.f
6633   sem_status status = SEM_STATUS_NORMAL;
6634   arm_scache* abuf = sem;
6635   PCADDR pc = abuf->addr;
6636   PCADDR npc = pc + 4;
6637
6638 {
6639   SI tmp_operand2;
6640   SI tmp_result;
6641   SI tmp_temp_op1;
6642   SI tmp_temp_op2;
6643   tmp_operand2 = current_cpu->compute_operand2_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg));
6644   tmp_temp_op1 = * FLD (i_rn);
6645   tmp_temp_op2 = tmp_operand2;
6646   tmp_result = ADDCSI (* FLD (i_rn), tmp_operand2, current_cpu->hardware.h_cbit);
6647 if (EQSI (FLD (f_rd), 15)) {
6648 {
6649   {
6650     USI opval = tmp_result;
6651     current_cpu->branch (opval, npc, status);
6652     if (current_cpu->trace_result_p)
6653       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
6654   }
6655 if (FLD (f_set_cc_)) {
6656   {
6657     SI opval = current_cpu->h_spsr_get ();
6658     current_cpu->h_cpsr_set (opval);
6659     if (current_cpu->trace_result_p)
6660       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
6661   }
6662 }
6663 }
6664 } else {
6665 {
6666   {
6667     SI opval = tmp_result;
6668     * FLD (i_rd) = opval;
6669     if (current_cpu->trace_result_p)
6670       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
6671   }
6672 if (FLD (f_set_cc_)) {
6673 {
6674   SI tmp_result;
6675   tmp_result = ADDCSI (tmp_temp_op1, tmp_temp_op2, current_cpu->hardware.h_cbit);
6676 {
6677   {
6678     BI opval = EQSI (tmp_result, 0);
6679     current_cpu->hardware.h_zbit = opval;
6680     if (current_cpu->trace_result_p)
6681       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
6682   }
6683   {
6684     BI opval = LTSI (tmp_result, 0);
6685     current_cpu->hardware.h_nbit = opval;
6686     if (current_cpu->trace_result_p)
6687       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
6688   }
6689 }
6690   {
6691     BI opval = ADDCFSI (tmp_temp_op1, tmp_temp_op2, current_cpu->hardware.h_cbit);
6692     current_cpu->hardware.h_cbit = opval;
6693     if (current_cpu->trace_result_p)
6694       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
6695   }
6696   {
6697     BI opval = ADDOFSI (tmp_temp_op1, tmp_temp_op2, current_cpu->hardware.h_cbit);
6698     current_cpu->hardware.h_vbit = opval;
6699     if (current_cpu->trace_result_p)
6700       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
6701   }
6702 }
6703 }
6704 }
6705 }
6706 }
6707
6708   current_cpu->done_cti_insn (npc, status);
6709   return status;
6710 #undef FLD
6711 }
6712
6713 // ********** adc-imm: adc$cond${set-cc?} $rd,$rn,$imm12
6714
6715 sem_status
6716 arm_sem_adc_imm (arm7f_cpu* current_cpu, arm_scache* sem)
6717 {
6718 #define FLD(f) abuf->fields.sfmt_and_imm.f
6719   sem_status status = SEM_STATUS_NORMAL;
6720   arm_scache* abuf = sem;
6721   PCADDR pc = abuf->addr;
6722   PCADDR npc = pc + 4;
6723
6724 {
6725   SI tmp_result;
6726   tmp_result = ADDCSI (* FLD (i_rn), FLD (f_imm12), current_cpu->hardware.h_cbit);
6727 if (EQSI (FLD (f_rd), 15)) {
6728 {
6729 if (FLD (f_set_cc_)) {
6730   {
6731     SI opval = current_cpu->h_spsr_get ();
6732     current_cpu->h_cpsr_set (opval);
6733     if (current_cpu->trace_result_p)
6734       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
6735   }
6736 }
6737   {
6738     USI opval = tmp_result;
6739     current_cpu->branch (opval, npc, status);
6740     if (current_cpu->trace_result_p)
6741       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
6742   }
6743 }
6744 } else {
6745 {
6746 if (FLD (f_set_cc_)) {
6747 {
6748   SI tmp_result;
6749   tmp_result = ADDCSI (* FLD (i_rn), FLD (f_imm12), current_cpu->hardware.h_cbit);
6750 {
6751   {
6752     BI opval = EQSI (tmp_result, 0);
6753     current_cpu->hardware.h_zbit = opval;
6754     if (current_cpu->trace_result_p)
6755       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
6756   }
6757   {
6758     BI opval = LTSI (tmp_result, 0);
6759     current_cpu->hardware.h_nbit = opval;
6760     if (current_cpu->trace_result_p)
6761       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
6762   }
6763 }
6764   {
6765     BI opval = ADDCFSI (* FLD (i_rn), FLD (f_imm12), current_cpu->hardware.h_cbit);
6766     current_cpu->hardware.h_cbit = opval;
6767     if (current_cpu->trace_result_p)
6768       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
6769   }
6770   {
6771     BI opval = ADDOFSI (* FLD (i_rn), FLD (f_imm12), current_cpu->hardware.h_cbit);
6772     current_cpu->hardware.h_vbit = opval;
6773     if (current_cpu->trace_result_p)
6774       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
6775   }
6776 }
6777 }
6778   {
6779     SI opval = tmp_result;
6780     * FLD (i_rd) = opval;
6781     if (current_cpu->trace_result_p)
6782       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
6783   }
6784 }
6785 }
6786 }
6787
6788   current_cpu->done_cti_insn (npc, status);
6789   return status;
6790 #undef FLD
6791 }
6792
6793 // ********** sub-reg/imm-shift: sub$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftimm}
6794
6795 sem_status
6796 arm_sem_sub_reg_imm_shift (arm7f_cpu* current_cpu, arm_scache* sem)
6797 {
6798 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
6799   sem_status status = SEM_STATUS_NORMAL;
6800   arm_scache* abuf = sem;
6801   PCADDR pc = abuf->addr;
6802   PCADDR npc = pc + 4;
6803
6804 {
6805   SI tmp_operand2;
6806   SI tmp_result;
6807   SI tmp_temp_op1;
6808   SI tmp_temp_op2;
6809   tmp_operand2 = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
6810   tmp_temp_op1 = * FLD (i_rn);
6811   tmp_temp_op2 = tmp_operand2;
6812   tmp_result = SUBSI (* FLD (i_rn), tmp_operand2);
6813 if (EQSI (FLD (f_rd), 15)) {
6814 {
6815   {
6816     USI opval = tmp_result;
6817     current_cpu->branch (opval, npc, status);
6818     if (current_cpu->trace_result_p)
6819       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
6820   }
6821 if (FLD (f_set_cc_)) {
6822   {
6823     SI opval = current_cpu->h_spsr_get ();
6824     current_cpu->h_cpsr_set (opval);
6825     if (current_cpu->trace_result_p)
6826       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
6827   }
6828 }
6829 }
6830 } else {
6831 {
6832   {
6833     SI opval = tmp_result;
6834     * FLD (i_rd) = opval;
6835     if (current_cpu->trace_result_p)
6836       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
6837   }
6838 if (FLD (f_set_cc_)) {
6839 {
6840   SI tmp_result;
6841   tmp_result = SUBCSI (tmp_temp_op1, tmp_temp_op2, 0);
6842 {
6843   {
6844     BI opval = EQSI (tmp_result, 0);
6845     current_cpu->hardware.h_zbit = opval;
6846     if (current_cpu->trace_result_p)
6847       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
6848   }
6849   {
6850     BI opval = LTSI (tmp_result, 0);
6851     current_cpu->hardware.h_nbit = opval;
6852     if (current_cpu->trace_result_p)
6853       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
6854   }
6855 }
6856   {
6857     BI opval = NOTSI (SUBCFSI (tmp_temp_op1, tmp_temp_op2, 0));
6858     current_cpu->hardware.h_cbit = opval;
6859     if (current_cpu->trace_result_p)
6860       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
6861   }
6862   {
6863     BI opval = SUBOFSI (tmp_temp_op1, tmp_temp_op2, 0);
6864     current_cpu->hardware.h_vbit = opval;
6865     if (current_cpu->trace_result_p)
6866       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
6867   }
6868 }
6869 }
6870 }
6871 }
6872 }
6873
6874   current_cpu->done_cti_insn (npc, status);
6875   return status;
6876 #undef FLD
6877 }
6878
6879 // ********** sub-reg/reg-shift: sub$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftreg}
6880
6881 sem_status
6882 arm_sem_sub_reg_reg_shift (arm7f_cpu* current_cpu, arm_scache* sem)
6883 {
6884 #define FLD(f) abuf->fields.sfmt_and_reg_reg_shift.f
6885   sem_status status = SEM_STATUS_NORMAL;
6886   arm_scache* abuf = sem;
6887   PCADDR pc = abuf->addr;
6888   PCADDR npc = pc + 4;
6889
6890 {
6891   SI tmp_operand2;
6892   SI tmp_result;
6893   SI tmp_temp_op1;
6894   SI tmp_temp_op2;
6895   tmp_operand2 = current_cpu->compute_operand2_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg));
6896   tmp_temp_op1 = * FLD (i_rn);
6897   tmp_temp_op2 = tmp_operand2;
6898   tmp_result = SUBSI (* FLD (i_rn), tmp_operand2);
6899 if (EQSI (FLD (f_rd), 15)) {
6900 {
6901   {
6902     USI opval = tmp_result;
6903     current_cpu->branch (opval, npc, status);
6904     if (current_cpu->trace_result_p)
6905       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
6906   }
6907 if (FLD (f_set_cc_)) {
6908   {
6909     SI opval = current_cpu->h_spsr_get ();
6910     current_cpu->h_cpsr_set (opval);
6911     if (current_cpu->trace_result_p)
6912       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
6913   }
6914 }
6915 }
6916 } else {
6917 {
6918   {
6919     SI opval = tmp_result;
6920     * FLD (i_rd) = opval;
6921     if (current_cpu->trace_result_p)
6922       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
6923   }
6924 if (FLD (f_set_cc_)) {
6925 {
6926   SI tmp_result;
6927   tmp_result = SUBCSI (tmp_temp_op1, tmp_temp_op2, 0);
6928 {
6929   {
6930     BI opval = EQSI (tmp_result, 0);
6931     current_cpu->hardware.h_zbit = opval;
6932     if (current_cpu->trace_result_p)
6933       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
6934   }
6935   {
6936     BI opval = LTSI (tmp_result, 0);
6937     current_cpu->hardware.h_nbit = opval;
6938     if (current_cpu->trace_result_p)
6939       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
6940   }
6941 }
6942   {
6943     BI opval = NOTSI (SUBCFSI (tmp_temp_op1, tmp_temp_op2, 0));
6944     current_cpu->hardware.h_cbit = opval;
6945     if (current_cpu->trace_result_p)
6946       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
6947   }
6948   {
6949     BI opval = SUBOFSI (tmp_temp_op1, tmp_temp_op2, 0);
6950     current_cpu->hardware.h_vbit = opval;
6951     if (current_cpu->trace_result_p)
6952       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
6953   }
6954 }
6955 }
6956 }
6957 }
6958 }
6959
6960   current_cpu->done_cti_insn (npc, status);
6961   return status;
6962 #undef FLD
6963 }
6964
6965 // ********** sub-imm: sub$cond${set-cc?} $rd,$rn,$imm12
6966
6967 sem_status
6968 arm_sem_sub_imm (arm7f_cpu* current_cpu, arm_scache* sem)
6969 {
6970 #define FLD(f) abuf->fields.sfmt_and_imm.f
6971   sem_status status = SEM_STATUS_NORMAL;
6972   arm_scache* abuf = sem;
6973   PCADDR pc = abuf->addr;
6974   PCADDR npc = pc + 4;
6975
6976 {
6977   SI tmp_result;
6978   tmp_result = SUBSI (* FLD (i_rn), FLD (f_imm12));
6979 if (EQSI (FLD (f_rd), 15)) {
6980 {
6981 if (FLD (f_set_cc_)) {
6982   {
6983     SI opval = current_cpu->h_spsr_get ();
6984     current_cpu->h_cpsr_set (opval);
6985     if (current_cpu->trace_result_p)
6986       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
6987   }
6988 }
6989   {
6990     USI opval = tmp_result;
6991     current_cpu->branch (opval, npc, status);
6992     if (current_cpu->trace_result_p)
6993       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
6994   }
6995 }
6996 } else {
6997 {
6998 if (FLD (f_set_cc_)) {
6999 {
7000   SI tmp_result;
7001   tmp_result = SUBCSI (* FLD (i_rn), FLD (f_imm12), 0);
7002 {
7003   {
7004     BI opval = EQSI (tmp_result, 0);
7005     current_cpu->hardware.h_zbit = opval;
7006     if (current_cpu->trace_result_p)
7007       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
7008   }
7009   {
7010     BI opval = LTSI (tmp_result, 0);
7011     current_cpu->hardware.h_nbit = opval;
7012     if (current_cpu->trace_result_p)
7013       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
7014   }
7015 }
7016   {
7017     BI opval = NOTSI (SUBCFSI (* FLD (i_rn), FLD (f_imm12), 0));
7018     current_cpu->hardware.h_cbit = opval;
7019     if (current_cpu->trace_result_p)
7020       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
7021   }
7022   {
7023     BI opval = SUBOFSI (* FLD (i_rn), FLD (f_imm12), 0);
7024     current_cpu->hardware.h_vbit = opval;
7025     if (current_cpu->trace_result_p)
7026       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
7027   }
7028 }
7029 }
7030   {
7031     SI opval = tmp_result;
7032     * FLD (i_rd) = opval;
7033     if (current_cpu->trace_result_p)
7034       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
7035   }
7036 }
7037 }
7038 }
7039
7040   current_cpu->done_cti_insn (npc, status);
7041   return status;
7042 #undef FLD
7043 }
7044
7045 // ********** sbc-reg/imm-shift: sbc$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftimm}
7046
7047 sem_status
7048 arm_sem_sbc_reg_imm_shift (arm7f_cpu* current_cpu, arm_scache* sem)
7049 {
7050 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
7051   sem_status status = SEM_STATUS_NORMAL;
7052   arm_scache* abuf = sem;
7053   PCADDR pc = abuf->addr;
7054   PCADDR npc = pc + 4;
7055
7056 {
7057   SI tmp_operand2;
7058   SI tmp_result;
7059   SI tmp_temp_op1;
7060   SI tmp_temp_op2;
7061   tmp_operand2 = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
7062   tmp_temp_op1 = * FLD (i_rn);
7063   tmp_temp_op2 = tmp_operand2;
7064   tmp_result = SUBCSI (* FLD (i_rn), tmp_operand2, NOTBI (current_cpu->hardware.h_cbit));
7065 if (EQSI (FLD (f_rd), 15)) {
7066 {
7067   {
7068     USI opval = tmp_result;
7069     current_cpu->branch (opval, npc, status);
7070     if (current_cpu->trace_result_p)
7071       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
7072   }
7073 if (FLD (f_set_cc_)) {
7074   {
7075     SI opval = current_cpu->h_spsr_get ();
7076     current_cpu->h_cpsr_set (opval);
7077     if (current_cpu->trace_result_p)
7078       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
7079   }
7080 }
7081 }
7082 } else {
7083 {
7084   {
7085     SI opval = tmp_result;
7086     * FLD (i_rd) = opval;
7087     if (current_cpu->trace_result_p)
7088       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
7089   }
7090 if (FLD (f_set_cc_)) {
7091 {
7092   SI tmp_result;
7093   tmp_result = SUBCSI (tmp_temp_op1, tmp_temp_op2, NOTBI (current_cpu->hardware.h_cbit));
7094 {
7095   {
7096     BI opval = EQSI (tmp_result, 0);
7097     current_cpu->hardware.h_zbit = opval;
7098     if (current_cpu->trace_result_p)
7099       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
7100   }
7101   {
7102     BI opval = LTSI (tmp_result, 0);
7103     current_cpu->hardware.h_nbit = opval;
7104     if (current_cpu->trace_result_p)
7105       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
7106   }
7107 }
7108   {
7109     BI opval = NOTSI (SUBCFSI (tmp_temp_op1, tmp_temp_op2, NOTBI (current_cpu->hardware.h_cbit)));
7110     current_cpu->hardware.h_cbit = opval;
7111     if (current_cpu->trace_result_p)
7112       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
7113   }
7114   {
7115     BI opval = SUBOFSI (tmp_temp_op1, tmp_temp_op2, NOTBI (current_cpu->hardware.h_cbit));
7116     current_cpu->hardware.h_vbit = opval;
7117     if (current_cpu->trace_result_p)
7118       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
7119   }
7120 }
7121 }
7122 }
7123 }
7124 }
7125
7126   current_cpu->done_cti_insn (npc, status);
7127   return status;
7128 #undef FLD
7129 }
7130
7131 // ********** sbc-reg/reg-shift: sbc$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftreg}
7132
7133 sem_status
7134 arm_sem_sbc_reg_reg_shift (arm7f_cpu* current_cpu, arm_scache* sem)
7135 {
7136 #define FLD(f) abuf->fields.sfmt_and_reg_reg_shift.f
7137   sem_status status = SEM_STATUS_NORMAL;
7138   arm_scache* abuf = sem;
7139   PCADDR pc = abuf->addr;
7140   PCADDR npc = pc + 4;
7141
7142 {
7143   SI tmp_operand2;
7144   SI tmp_result;
7145   SI tmp_temp_op1;
7146   SI tmp_temp_op2;
7147   tmp_operand2 = current_cpu->compute_operand2_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg));
7148   tmp_temp_op1 = * FLD (i_rn);
7149   tmp_temp_op2 = tmp_operand2;
7150   tmp_result = SUBCSI (* FLD (i_rn), tmp_operand2, NOTBI (current_cpu->hardware.h_cbit));
7151 if (EQSI (FLD (f_rd), 15)) {
7152 {
7153   {
7154     USI opval = tmp_result;
7155     current_cpu->branch (opval, npc, status);
7156     if (current_cpu->trace_result_p)
7157       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
7158   }
7159 if (FLD (f_set_cc_)) {
7160   {
7161     SI opval = current_cpu->h_spsr_get ();
7162     current_cpu->h_cpsr_set (opval);
7163     if (current_cpu->trace_result_p)
7164       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
7165   }
7166 }
7167 }
7168 } else {
7169 {
7170   {
7171     SI opval = tmp_result;
7172     * FLD (i_rd) = opval;
7173     if (current_cpu->trace_result_p)
7174       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
7175   }
7176 if (FLD (f_set_cc_)) {
7177 {
7178   SI tmp_result;
7179   tmp_result = SUBCSI (tmp_temp_op1, tmp_temp_op2, NOTBI (current_cpu->hardware.h_cbit));
7180 {
7181   {
7182     BI opval = EQSI (tmp_result, 0);
7183     current_cpu->hardware.h_zbit = opval;
7184     if (current_cpu->trace_result_p)
7185       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
7186   }
7187   {
7188     BI opval = LTSI (tmp_result, 0);
7189     current_cpu->hardware.h_nbit = opval;
7190     if (current_cpu->trace_result_p)
7191       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
7192   }
7193 }
7194   {
7195     BI opval = NOTSI (SUBCFSI (tmp_temp_op1, tmp_temp_op2, NOTBI (current_cpu->hardware.h_cbit)));
7196     current_cpu->hardware.h_cbit = opval;
7197     if (current_cpu->trace_result_p)
7198       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
7199   }
7200   {
7201     BI opval = SUBOFSI (tmp_temp_op1, tmp_temp_op2, NOTBI (current_cpu->hardware.h_cbit));
7202     current_cpu->hardware.h_vbit = opval;
7203     if (current_cpu->trace_result_p)
7204       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
7205   }
7206 }
7207 }
7208 }
7209 }
7210 }
7211
7212   current_cpu->done_cti_insn (npc, status);
7213   return status;
7214 #undef FLD
7215 }
7216
7217 // ********** sbc-imm: sbc$cond${set-cc?} $rd,$rn,$imm12
7218
7219 sem_status
7220 arm_sem_sbc_imm (arm7f_cpu* current_cpu, arm_scache* sem)
7221 {
7222 #define FLD(f) abuf->fields.sfmt_and_imm.f
7223   sem_status status = SEM_STATUS_NORMAL;
7224   arm_scache* abuf = sem;
7225   PCADDR pc = abuf->addr;
7226   PCADDR npc = pc + 4;
7227
7228 {
7229   SI tmp_result;
7230   tmp_result = SUBCSI (* FLD (i_rn), FLD (f_imm12), NOTBI (current_cpu->hardware.h_cbit));
7231 if (EQSI (FLD (f_rd), 15)) {
7232 {
7233 if (FLD (f_set_cc_)) {
7234   {
7235     SI opval = current_cpu->h_spsr_get ();
7236     current_cpu->h_cpsr_set (opval);
7237     if (current_cpu->trace_result_p)
7238       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
7239   }
7240 }
7241   {
7242     USI opval = tmp_result;
7243     current_cpu->branch (opval, npc, status);
7244     if (current_cpu->trace_result_p)
7245       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
7246   }
7247 }
7248 } else {
7249 {
7250 if (FLD (f_set_cc_)) {
7251 {
7252   SI tmp_result;
7253   tmp_result = SUBCSI (* FLD (i_rn), FLD (f_imm12), NOTBI (current_cpu->hardware.h_cbit));
7254 {
7255   {
7256     BI opval = EQSI (tmp_result, 0);
7257     current_cpu->hardware.h_zbit = opval;
7258     if (current_cpu->trace_result_p)
7259       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
7260   }
7261   {
7262     BI opval = LTSI (tmp_result, 0);
7263     current_cpu->hardware.h_nbit = opval;
7264     if (current_cpu->trace_result_p)
7265       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
7266   }
7267 }
7268   {
7269     BI opval = NOTSI (SUBCFSI (* FLD (i_rn), FLD (f_imm12), NOTBI (current_cpu->hardware.h_cbit)));
7270     current_cpu->hardware.h_cbit = opval;
7271     if (current_cpu->trace_result_p)
7272       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
7273   }
7274   {
7275     BI opval = SUBOFSI (* FLD (i_rn), FLD (f_imm12), NOTBI (current_cpu->hardware.h_cbit));
7276     current_cpu->hardware.h_vbit = opval;
7277     if (current_cpu->trace_result_p)
7278       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
7279   }
7280 }
7281 }
7282   {
7283     SI opval = tmp_result;
7284     * FLD (i_rd) = opval;
7285     if (current_cpu->trace_result_p)
7286       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
7287   }
7288 }
7289 }
7290 }
7291
7292   current_cpu->done_cti_insn (npc, status);
7293   return status;
7294 #undef FLD
7295 }
7296
7297 // ********** rsb-reg/imm-shift: rsb$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftimm}
7298
7299 sem_status
7300 arm_sem_rsb_reg_imm_shift (arm7f_cpu* current_cpu, arm_scache* sem)
7301 {
7302 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
7303   sem_status status = SEM_STATUS_NORMAL;
7304   arm_scache* abuf = sem;
7305   PCADDR pc = abuf->addr;
7306   PCADDR npc = pc + 4;
7307
7308 {
7309   SI tmp_operand2;
7310   SI tmp_result;
7311   SI tmp_temp_op1;
7312   SI tmp_temp_op2;
7313   tmp_operand2 = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
7314   tmp_temp_op1 = * FLD (i_rn);
7315   tmp_temp_op2 = tmp_operand2;
7316   tmp_result = SUBSI (tmp_operand2, * FLD (i_rn));
7317 if (EQSI (FLD (f_rd), 15)) {
7318 {
7319   {
7320     USI opval = tmp_result;
7321     current_cpu->branch (opval, npc, status);
7322     if (current_cpu->trace_result_p)
7323       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
7324   }
7325 if (FLD (f_set_cc_)) {
7326   {
7327     SI opval = current_cpu->h_spsr_get ();
7328     current_cpu->h_cpsr_set (opval);
7329     if (current_cpu->trace_result_p)
7330       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
7331   }
7332 }
7333 }
7334 } else {
7335 {
7336   {
7337     SI opval = tmp_result;
7338     * FLD (i_rd) = opval;
7339     if (current_cpu->trace_result_p)
7340       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
7341   }
7342 if (FLD (f_set_cc_)) {
7343 {
7344   SI tmp_result;
7345   tmp_result = SUBCSI (tmp_temp_op2, tmp_temp_op1, 0);
7346 {
7347   {
7348     BI opval = EQSI (tmp_result, 0);
7349     current_cpu->hardware.h_zbit = opval;
7350     if (current_cpu->trace_result_p)
7351       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
7352   }
7353   {
7354     BI opval = LTSI (tmp_result, 0);
7355     current_cpu->hardware.h_nbit = opval;
7356     if (current_cpu->trace_result_p)
7357       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
7358   }
7359 }
7360   {
7361     BI opval = NOTSI (SUBCFSI (tmp_temp_op2, tmp_temp_op1, 0));
7362     current_cpu->hardware.h_cbit = opval;
7363     if (current_cpu->trace_result_p)
7364       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
7365   }
7366   {
7367     BI opval = SUBOFSI (tmp_temp_op2, tmp_temp_op1, 0);
7368     current_cpu->hardware.h_vbit = opval;
7369     if (current_cpu->trace_result_p)
7370       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
7371   }
7372 }
7373 }
7374 }
7375 }
7376 }
7377
7378   current_cpu->done_cti_insn (npc, status);
7379   return status;
7380 #undef FLD
7381 }
7382
7383 // ********** rsb-reg/reg-shift: rsb$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftreg}
7384
7385 sem_status
7386 arm_sem_rsb_reg_reg_shift (arm7f_cpu* current_cpu, arm_scache* sem)
7387 {
7388 #define FLD(f) abuf->fields.sfmt_and_reg_reg_shift.f
7389   sem_status status = SEM_STATUS_NORMAL;
7390   arm_scache* abuf = sem;
7391   PCADDR pc = abuf->addr;
7392   PCADDR npc = pc + 4;
7393
7394 {
7395   SI tmp_operand2;
7396   SI tmp_result;
7397   SI tmp_temp_op1;
7398   SI tmp_temp_op2;
7399   tmp_operand2 = current_cpu->compute_operand2_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg));
7400   tmp_temp_op1 = * FLD (i_rn);
7401   tmp_temp_op2 = tmp_operand2;
7402   tmp_result = SUBSI (tmp_operand2, * FLD (i_rn));
7403 if (EQSI (FLD (f_rd), 15)) {
7404 {
7405   {
7406     USI opval = tmp_result;
7407     current_cpu->branch (opval, npc, status);
7408     if (current_cpu->trace_result_p)
7409       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
7410   }
7411 if (FLD (f_set_cc_)) {
7412   {
7413     SI opval = current_cpu->h_spsr_get ();
7414     current_cpu->h_cpsr_set (opval);
7415     if (current_cpu->trace_result_p)
7416       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
7417   }
7418 }
7419 }
7420 } else {
7421 {
7422   {
7423     SI opval = tmp_result;
7424     * FLD (i_rd) = opval;
7425     if (current_cpu->trace_result_p)
7426       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
7427   }
7428 if (FLD (f_set_cc_)) {
7429 {
7430   SI tmp_result;
7431   tmp_result = SUBCSI (tmp_temp_op2, tmp_temp_op1, 0);
7432 {
7433   {
7434     BI opval = EQSI (tmp_result, 0);
7435     current_cpu->hardware.h_zbit = opval;
7436     if (current_cpu->trace_result_p)
7437       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
7438   }
7439   {
7440     BI opval = LTSI (tmp_result, 0);
7441     current_cpu->hardware.h_nbit = opval;
7442     if (current_cpu->trace_result_p)
7443       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
7444   }
7445 }
7446   {
7447     BI opval = NOTSI (SUBCFSI (tmp_temp_op2, tmp_temp_op1, 0));
7448     current_cpu->hardware.h_cbit = opval;
7449     if (current_cpu->trace_result_p)
7450       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
7451   }
7452   {
7453     BI opval = SUBOFSI (tmp_temp_op2, tmp_temp_op1, 0);
7454     current_cpu->hardware.h_vbit = opval;
7455     if (current_cpu->trace_result_p)
7456       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
7457   }
7458 }
7459 }
7460 }
7461 }
7462 }
7463
7464   current_cpu->done_cti_insn (npc, status);
7465   return status;
7466 #undef FLD
7467 }
7468
7469 // ********** rsb-imm: rsb$cond${set-cc?} $rd,$rn,$imm12
7470
7471 sem_status
7472 arm_sem_rsb_imm (arm7f_cpu* current_cpu, arm_scache* sem)
7473 {
7474 #define FLD(f) abuf->fields.sfmt_and_imm.f
7475   sem_status status = SEM_STATUS_NORMAL;
7476   arm_scache* abuf = sem;
7477   PCADDR pc = abuf->addr;
7478   PCADDR npc = pc + 4;
7479
7480 {
7481   SI tmp_result;
7482   tmp_result = SUBSI (FLD (f_imm12), * FLD (i_rn));
7483 if (EQSI (FLD (f_rd), 15)) {
7484 {
7485 if (FLD (f_set_cc_)) {
7486   {
7487     SI opval = current_cpu->h_spsr_get ();
7488     current_cpu->h_cpsr_set (opval);
7489     if (current_cpu->trace_result_p)
7490       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
7491   }
7492 }
7493   {
7494     USI opval = tmp_result;
7495     current_cpu->branch (opval, npc, status);
7496     if (current_cpu->trace_result_p)
7497       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
7498   }
7499 }
7500 } else {
7501 {
7502 if (FLD (f_set_cc_)) {
7503 {
7504   SI tmp_result;
7505   tmp_result = SUBCSI (FLD (f_imm12), * FLD (i_rn), 0);
7506 {
7507   {
7508     BI opval = EQSI (tmp_result, 0);
7509     current_cpu->hardware.h_zbit = opval;
7510     if (current_cpu->trace_result_p)
7511       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
7512   }
7513   {
7514     BI opval = LTSI (tmp_result, 0);
7515     current_cpu->hardware.h_nbit = opval;
7516     if (current_cpu->trace_result_p)
7517       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
7518   }
7519 }
7520   {
7521     BI opval = NOTSI (SUBCFSI (FLD (f_imm12), * FLD (i_rn), 0));
7522     current_cpu->hardware.h_cbit = opval;
7523     if (current_cpu->trace_result_p)
7524       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
7525   }
7526   {
7527     BI opval = SUBOFSI (FLD (f_imm12), * FLD (i_rn), 0);
7528     current_cpu->hardware.h_vbit = opval;
7529     if (current_cpu->trace_result_p)
7530       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
7531   }
7532 }
7533 }
7534   {
7535     SI opval = tmp_result;
7536     * FLD (i_rd) = opval;
7537     if (current_cpu->trace_result_p)
7538       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
7539   }
7540 }
7541 }
7542 }
7543
7544   current_cpu->done_cti_insn (npc, status);
7545   return status;
7546 #undef FLD
7547 }
7548
7549 // ********** rsc-reg/imm-shift: rsc$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftimm}
7550
7551 sem_status
7552 arm_sem_rsc_reg_imm_shift (arm7f_cpu* current_cpu, arm_scache* sem)
7553 {
7554 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
7555   sem_status status = SEM_STATUS_NORMAL;
7556   arm_scache* abuf = sem;
7557   PCADDR pc = abuf->addr;
7558   PCADDR npc = pc + 4;
7559
7560 {
7561   SI tmp_operand2;
7562   SI tmp_result;
7563   SI tmp_temp_op1;
7564   SI tmp_temp_op2;
7565   tmp_operand2 = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
7566   tmp_temp_op1 = * FLD (i_rn);
7567   tmp_temp_op2 = tmp_operand2;
7568   tmp_result = SUBCSI (tmp_operand2, * FLD (i_rn), NOTBI (current_cpu->hardware.h_cbit));
7569 if (EQSI (FLD (f_rd), 15)) {
7570 {
7571   {
7572     USI opval = tmp_result;
7573     current_cpu->branch (opval, npc, status);
7574     if (current_cpu->trace_result_p)
7575       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
7576   }
7577 if (FLD (f_set_cc_)) {
7578   {
7579     SI opval = current_cpu->h_spsr_get ();
7580     current_cpu->h_cpsr_set (opval);
7581     if (current_cpu->trace_result_p)
7582       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
7583   }
7584 }
7585 }
7586 } else {
7587 {
7588   {
7589     SI opval = tmp_result;
7590     * FLD (i_rd) = opval;
7591     if (current_cpu->trace_result_p)
7592       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
7593   }
7594 if (FLD (f_set_cc_)) {
7595 {
7596   SI tmp_result;
7597   tmp_result = SUBCSI (tmp_temp_op2, tmp_temp_op1, NOTBI (current_cpu->hardware.h_cbit));
7598 {
7599   {
7600     BI opval = EQSI (tmp_result, 0);
7601     current_cpu->hardware.h_zbit = opval;
7602     if (current_cpu->trace_result_p)
7603       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
7604   }
7605   {
7606     BI opval = LTSI (tmp_result, 0);
7607     current_cpu->hardware.h_nbit = opval;
7608     if (current_cpu->trace_result_p)
7609       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
7610   }
7611 }
7612   {
7613     BI opval = NOTSI (SUBCFSI (tmp_temp_op2, tmp_temp_op1, NOTBI (current_cpu->hardware.h_cbit)));
7614     current_cpu->hardware.h_cbit = opval;
7615     if (current_cpu->trace_result_p)
7616       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
7617   }
7618   {
7619     BI opval = SUBOFSI (tmp_temp_op2, tmp_temp_op1, NOTBI (current_cpu->hardware.h_cbit));
7620     current_cpu->hardware.h_vbit = opval;
7621     if (current_cpu->trace_result_p)
7622       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
7623   }
7624 }
7625 }
7626 }
7627 }
7628 }
7629
7630   current_cpu->done_cti_insn (npc, status);
7631   return status;
7632 #undef FLD
7633 }
7634
7635 // ********** rsc-reg/reg-shift: rsc$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftreg}
7636
7637 sem_status
7638 arm_sem_rsc_reg_reg_shift (arm7f_cpu* current_cpu, arm_scache* sem)
7639 {
7640 #define FLD(f) abuf->fields.sfmt_and_reg_reg_shift.f
7641   sem_status status = SEM_STATUS_NORMAL;
7642   arm_scache* abuf = sem;
7643   PCADDR pc = abuf->addr;
7644   PCADDR npc = pc + 4;
7645
7646 {
7647   SI tmp_operand2;
7648   SI tmp_result;
7649   SI tmp_temp_op1;
7650   SI tmp_temp_op2;
7651   tmp_operand2 = current_cpu->compute_operand2_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg));
7652   tmp_temp_op1 = * FLD (i_rn);
7653   tmp_temp_op2 = tmp_operand2;
7654   tmp_result = SUBCSI (tmp_operand2, * FLD (i_rn), NOTBI (current_cpu->hardware.h_cbit));
7655 if (EQSI (FLD (f_rd), 15)) {
7656 {
7657   {
7658     USI opval = tmp_result;
7659     current_cpu->branch (opval, npc, status);
7660     if (current_cpu->trace_result_p)
7661       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
7662   }
7663 if (FLD (f_set_cc_)) {
7664   {
7665     SI opval = current_cpu->h_spsr_get ();
7666     current_cpu->h_cpsr_set (opval);
7667     if (current_cpu->trace_result_p)
7668       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
7669   }
7670 }
7671 }
7672 } else {
7673 {
7674   {
7675     SI opval = tmp_result;
7676     * FLD (i_rd) = opval;
7677     if (current_cpu->trace_result_p)
7678       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
7679   }
7680 if (FLD (f_set_cc_)) {
7681 {
7682   SI tmp_result;
7683   tmp_result = SUBCSI (tmp_temp_op2, tmp_temp_op1, NOTBI (current_cpu->hardware.h_cbit));
7684 {
7685   {
7686     BI opval = EQSI (tmp_result, 0);
7687     current_cpu->hardware.h_zbit = opval;
7688     if (current_cpu->trace_result_p)
7689       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
7690   }
7691   {
7692     BI opval = LTSI (tmp_result, 0);
7693     current_cpu->hardware.h_nbit = opval;
7694     if (current_cpu->trace_result_p)
7695       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
7696   }
7697 }
7698   {
7699     BI opval = NOTSI (SUBCFSI (tmp_temp_op2, tmp_temp_op1, NOTBI (current_cpu->hardware.h_cbit)));
7700     current_cpu->hardware.h_cbit = opval;
7701     if (current_cpu->trace_result_p)
7702       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
7703   }
7704   {
7705     BI opval = SUBOFSI (tmp_temp_op2, tmp_temp_op1, NOTBI (current_cpu->hardware.h_cbit));
7706     current_cpu->hardware.h_vbit = opval;
7707     if (current_cpu->trace_result_p)
7708       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
7709   }
7710 }
7711 }
7712 }
7713 }
7714 }
7715
7716   current_cpu->done_cti_insn (npc, status);
7717   return status;
7718 #undef FLD
7719 }
7720
7721 // ********** rsc-imm: rsc$cond${set-cc?} $rd,$rn,$imm12
7722
7723 sem_status
7724 arm_sem_rsc_imm (arm7f_cpu* current_cpu, arm_scache* sem)
7725 {
7726 #define FLD(f) abuf->fields.sfmt_and_imm.f
7727   sem_status status = SEM_STATUS_NORMAL;
7728   arm_scache* abuf = sem;
7729   PCADDR pc = abuf->addr;
7730   PCADDR npc = pc + 4;
7731
7732 {
7733   SI tmp_result;
7734   tmp_result = SUBCSI (FLD (f_imm12), * FLD (i_rn), NOTBI (current_cpu->hardware.h_cbit));
7735 if (EQSI (FLD (f_rd), 15)) {
7736 {
7737 if (FLD (f_set_cc_)) {
7738   {
7739     SI opval = current_cpu->h_spsr_get ();
7740     current_cpu->h_cpsr_set (opval);
7741     if (current_cpu->trace_result_p)
7742       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
7743   }
7744 }
7745   {
7746     USI opval = tmp_result;
7747     current_cpu->branch (opval, npc, status);
7748     if (current_cpu->trace_result_p)
7749       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
7750   }
7751 }
7752 } else {
7753 {
7754 if (FLD (f_set_cc_)) {
7755 {
7756   SI tmp_result;
7757   tmp_result = SUBCSI (FLD (f_imm12), * FLD (i_rn), NOTBI (current_cpu->hardware.h_cbit));
7758 {
7759   {
7760     BI opval = EQSI (tmp_result, 0);
7761     current_cpu->hardware.h_zbit = opval;
7762     if (current_cpu->trace_result_p)
7763       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
7764   }
7765   {
7766     BI opval = LTSI (tmp_result, 0);
7767     current_cpu->hardware.h_nbit = opval;
7768     if (current_cpu->trace_result_p)
7769       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
7770   }
7771 }
7772   {
7773     BI opval = NOTSI (SUBCFSI (FLD (f_imm12), * FLD (i_rn), NOTBI (current_cpu->hardware.h_cbit)));
7774     current_cpu->hardware.h_cbit = opval;
7775     if (current_cpu->trace_result_p)
7776       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
7777   }
7778   {
7779     BI opval = SUBOFSI (FLD (f_imm12), * FLD (i_rn), NOTBI (current_cpu->hardware.h_cbit));
7780     current_cpu->hardware.h_vbit = opval;
7781     if (current_cpu->trace_result_p)
7782       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
7783   }
7784 }
7785 }
7786   {
7787     SI opval = tmp_result;
7788     * FLD (i_rd) = opval;
7789     if (current_cpu->trace_result_p)
7790       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
7791   }
7792 }
7793 }
7794 }
7795
7796   current_cpu->done_cti_insn (npc, status);
7797   return status;
7798 #undef FLD
7799 }
7800
7801 // ********** tst-reg/imm-shift: tst$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftimm}
7802
7803 sem_status
7804 arm_sem_tst_reg_imm_shift (arm7f_cpu* current_cpu, arm_scache* sem)
7805 {
7806 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
7807   sem_status status = SEM_STATUS_NORMAL;
7808   arm_scache* abuf = sem;
7809   PCADDR pc = abuf->addr;
7810   PCADDR npc = pc + 4;
7811
7812 {
7813   SI tmp_operand2;
7814   BI tmp_carry_out;
7815   SI tmp_result;
7816   tmp_operand2 = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
7817   tmp_carry_out = current_cpu->compute_carry_out_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm), current_cpu->hardware.h_cbit);
7818   tmp_result = ANDSI (* FLD (i_rn), tmp_operand2);
7819 if (EQSI (FLD (f_rd), 15)) {
7820   {
7821     SI opval = current_cpu->h_spsr_get ();
7822     current_cpu->h_cpsr_set (opval);
7823     if (current_cpu->trace_result_p)
7824       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
7825   }
7826 } else {
7827 {
7828 {
7829   {
7830     BI opval = EQSI (tmp_result, 0);
7831     current_cpu->hardware.h_zbit = opval;
7832     if (current_cpu->trace_result_p)
7833       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
7834   }
7835   {
7836     BI opval = LTSI (tmp_result, 0);
7837     current_cpu->hardware.h_nbit = opval;
7838     if (current_cpu->trace_result_p)
7839       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
7840   }
7841 }
7842   {
7843     BI opval = tmp_carry_out;
7844     current_cpu->hardware.h_cbit = opval;
7845     if (current_cpu->trace_result_p)
7846       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
7847   }
7848 }
7849 }
7850 }
7851
7852   current_cpu->done_insn (npc, status);
7853   return status;
7854 #undef FLD
7855 }
7856
7857 // ********** tst-reg/reg-shift: tst$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftreg}
7858
7859 sem_status
7860 arm_sem_tst_reg_reg_shift (arm7f_cpu* current_cpu, arm_scache* sem)
7861 {
7862 #define FLD(f) abuf->fields.sfmt_and_reg_reg_shift.f
7863   sem_status status = SEM_STATUS_NORMAL;
7864   arm_scache* abuf = sem;
7865   PCADDR pc = abuf->addr;
7866   PCADDR npc = pc + 4;
7867
7868 {
7869   SI tmp_operand2;
7870   BI tmp_carry_out;
7871   SI tmp_result;
7872   tmp_operand2 = current_cpu->compute_operand2_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg));
7873   tmp_carry_out = current_cpu->compute_carry_out_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg), current_cpu->hardware.h_cbit);
7874   tmp_result = ANDSI (* FLD (i_rn), tmp_operand2);
7875 if (EQSI (FLD (f_rd), 15)) {
7876   {
7877     SI opval = current_cpu->h_spsr_get ();
7878     current_cpu->h_cpsr_set (opval);
7879     if (current_cpu->trace_result_p)
7880       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
7881   }
7882 } else {
7883 {
7884 {
7885   {
7886     BI opval = EQSI (tmp_result, 0);
7887     current_cpu->hardware.h_zbit = opval;
7888     if (current_cpu->trace_result_p)
7889       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
7890   }
7891   {
7892     BI opval = LTSI (tmp_result, 0);
7893     current_cpu->hardware.h_nbit = opval;
7894     if (current_cpu->trace_result_p)
7895       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
7896   }
7897 }
7898   {
7899     BI opval = tmp_carry_out;
7900     current_cpu->hardware.h_cbit = opval;
7901     if (current_cpu->trace_result_p)
7902       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
7903   }
7904 }
7905 }
7906 }
7907
7908   current_cpu->done_insn (npc, status);
7909   return status;
7910 #undef FLD
7911 }
7912
7913 // ********** tst-imm: tst${cond}${set-cc?} $rn,$imm12
7914
7915 sem_status
7916 arm_sem_tst_imm (arm7f_cpu* current_cpu, arm_scache* sem)
7917 {
7918 #define FLD(f) abuf->fields.sfmt_tst_imm.f
7919   sem_status status = SEM_STATUS_NORMAL;
7920   arm_scache* abuf = sem;
7921   PCADDR pc = abuf->addr;
7922   PCADDR npc = pc + 4;
7923
7924 {
7925   BI tmp_carry_out;
7926 if (EQSI (FLD (f_ror_imm8_rotate), 0)) {
7927   tmp_carry_out = current_cpu->hardware.h_cbit;
7928 } else {
7929   tmp_carry_out = LTBI (FLD (f_ror_imm8), 0);
7930 }
7931 {
7932 {
7933   {
7934     BI opval = EQSI (ANDSI (* FLD (i_rn), FLD (f_ror_imm8)), 0);
7935     current_cpu->hardware.h_zbit = opval;
7936     if (current_cpu->trace_result_p)
7937       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
7938   }
7939   {
7940     BI opval = LTSI (ANDSI (* FLD (i_rn), FLD (f_ror_imm8)), 0);
7941     current_cpu->hardware.h_nbit = opval;
7942     if (current_cpu->trace_result_p)
7943       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
7944   }
7945 }
7946   {
7947     BI opval = tmp_carry_out;
7948     current_cpu->hardware.h_cbit = opval;
7949     if (current_cpu->trace_result_p)
7950       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
7951   }
7952 }
7953 }
7954
7955   current_cpu->done_insn (npc, status);
7956   return status;
7957 #undef FLD
7958 }
7959
7960 // ********** teq-reg/imm-shift: teq$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftimm}
7961
7962 sem_status
7963 arm_sem_teq_reg_imm_shift (arm7f_cpu* current_cpu, arm_scache* sem)
7964 {
7965 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
7966   sem_status status = SEM_STATUS_NORMAL;
7967   arm_scache* abuf = sem;
7968   PCADDR pc = abuf->addr;
7969   PCADDR npc = pc + 4;
7970
7971 {
7972   SI tmp_operand2;
7973   BI tmp_carry_out;
7974   SI tmp_result;
7975   tmp_operand2 = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
7976   tmp_carry_out = current_cpu->compute_carry_out_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm), current_cpu->hardware.h_cbit);
7977   tmp_result = XORSI (* FLD (i_rn), tmp_operand2);
7978 if (EQSI (FLD (f_rd), 15)) {
7979   {
7980     SI opval = current_cpu->h_spsr_get ();
7981     current_cpu->h_cpsr_set (opval);
7982     if (current_cpu->trace_result_p)
7983       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
7984   }
7985 } else {
7986 {
7987 {
7988   {
7989     BI opval = EQSI (tmp_result, 0);
7990     current_cpu->hardware.h_zbit = opval;
7991     if (current_cpu->trace_result_p)
7992       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
7993   }
7994   {
7995     BI opval = LTSI (tmp_result, 0);
7996     current_cpu->hardware.h_nbit = opval;
7997     if (current_cpu->trace_result_p)
7998       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
7999   }
8000 }
8001   {
8002     BI opval = tmp_carry_out;
8003     current_cpu->hardware.h_cbit = opval;
8004     if (current_cpu->trace_result_p)
8005       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
8006   }
8007 }
8008 }
8009 }
8010
8011   current_cpu->done_insn (npc, status);
8012   return status;
8013 #undef FLD
8014 }
8015
8016 // ********** teq-reg/reg-shift: teq$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftreg}
8017
8018 sem_status
8019 arm_sem_teq_reg_reg_shift (arm7f_cpu* current_cpu, arm_scache* sem)
8020 {
8021 #define FLD(f) abuf->fields.sfmt_and_reg_reg_shift.f
8022   sem_status status = SEM_STATUS_NORMAL;
8023   arm_scache* abuf = sem;
8024   PCADDR pc = abuf->addr;
8025   PCADDR npc = pc + 4;
8026
8027 {
8028   SI tmp_operand2;
8029   BI tmp_carry_out;
8030   SI tmp_result;
8031   tmp_operand2 = current_cpu->compute_operand2_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg));
8032   tmp_carry_out = current_cpu->compute_carry_out_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg), current_cpu->hardware.h_cbit);
8033   tmp_result = XORSI (* FLD (i_rn), tmp_operand2);
8034 if (EQSI (FLD (f_rd), 15)) {
8035   {
8036     SI opval = current_cpu->h_spsr_get ();
8037     current_cpu->h_cpsr_set (opval);
8038     if (current_cpu->trace_result_p)
8039       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
8040   }
8041 } else {
8042 {
8043 {
8044   {
8045     BI opval = EQSI (tmp_result, 0);
8046     current_cpu->hardware.h_zbit = opval;
8047     if (current_cpu->trace_result_p)
8048       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
8049   }
8050   {
8051     BI opval = LTSI (tmp_result, 0);
8052     current_cpu->hardware.h_nbit = opval;
8053     if (current_cpu->trace_result_p)
8054       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
8055   }
8056 }
8057   {
8058     BI opval = tmp_carry_out;
8059     current_cpu->hardware.h_cbit = opval;
8060     if (current_cpu->trace_result_p)
8061       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
8062   }
8063 }
8064 }
8065 }
8066
8067   current_cpu->done_insn (npc, status);
8068   return status;
8069 #undef FLD
8070 }
8071
8072 // ********** teq-imm: teq${cond}${set-cc?} $rn,$imm12
8073
8074 sem_status
8075 arm_sem_teq_imm (arm7f_cpu* current_cpu, arm_scache* sem)
8076 {
8077 #define FLD(f) abuf->fields.sfmt_tst_imm.f
8078   sem_status status = SEM_STATUS_NORMAL;
8079   arm_scache* abuf = sem;
8080   PCADDR pc = abuf->addr;
8081   PCADDR npc = pc + 4;
8082
8083 {
8084   BI tmp_carry_out;
8085 if (EQSI (FLD (f_ror_imm8_rotate), 0)) {
8086   tmp_carry_out = current_cpu->hardware.h_cbit;
8087 } else {
8088   tmp_carry_out = LTBI (FLD (f_ror_imm8), 0);
8089 }
8090 {
8091 {
8092   {
8093     BI opval = EQSI (XORSI (* FLD (i_rn), FLD (f_ror_imm8)), 0);
8094     current_cpu->hardware.h_zbit = opval;
8095     if (current_cpu->trace_result_p)
8096       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
8097   }
8098   {
8099     BI opval = LTSI (XORSI (* FLD (i_rn), FLD (f_ror_imm8)), 0);
8100     current_cpu->hardware.h_nbit = opval;
8101     if (current_cpu->trace_result_p)
8102       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
8103   }
8104 }
8105   {
8106     BI opval = tmp_carry_out;
8107     current_cpu->hardware.h_cbit = opval;
8108     if (current_cpu->trace_result_p)
8109       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
8110   }
8111 }
8112 }
8113
8114   current_cpu->done_insn (npc, status);
8115   return status;
8116 #undef FLD
8117 }
8118
8119 // ********** cmp-reg/imm-shift: cmp$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftimm}
8120
8121 sem_status
8122 arm_sem_cmp_reg_imm_shift (arm7f_cpu* current_cpu, arm_scache* sem)
8123 {
8124 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
8125   sem_status status = SEM_STATUS_NORMAL;
8126   arm_scache* abuf = sem;
8127   PCADDR pc = abuf->addr;
8128   PCADDR npc = pc + 4;
8129
8130 {
8131   SI tmp_operand2;
8132   tmp_operand2 = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
8133 if (EQSI (FLD (f_rd), 15)) {
8134   {
8135     SI opval = current_cpu->h_spsr_get ();
8136     current_cpu->h_cpsr_set (opval);
8137     if (current_cpu->trace_result_p)
8138       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
8139   }
8140 } else {
8141 {
8142   SI tmp_result;
8143   tmp_result = SUBCSI (* FLD (i_rn), tmp_operand2, 0);
8144 {
8145   {
8146     BI opval = EQSI (tmp_result, 0);
8147     current_cpu->hardware.h_zbit = opval;
8148     if (current_cpu->trace_result_p)
8149       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
8150   }
8151   {
8152     BI opval = LTSI (tmp_result, 0);
8153     current_cpu->hardware.h_nbit = opval;
8154     if (current_cpu->trace_result_p)
8155       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
8156   }
8157 }
8158   {
8159     BI opval = NOTSI (SUBCFSI (* FLD (i_rn), tmp_operand2, 0));
8160     current_cpu->hardware.h_cbit = opval;
8161     if (current_cpu->trace_result_p)
8162       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
8163   }
8164   {
8165     BI opval = SUBOFSI (* FLD (i_rn), tmp_operand2, 0);
8166     current_cpu->hardware.h_vbit = opval;
8167     if (current_cpu->trace_result_p)
8168       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
8169   }
8170 }
8171 }
8172 }
8173
8174   current_cpu->done_insn (npc, status);
8175   return status;
8176 #undef FLD
8177 }
8178
8179 // ********** cmp-reg/reg-shift: cmp$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftreg}
8180
8181 sem_status
8182 arm_sem_cmp_reg_reg_shift (arm7f_cpu* current_cpu, arm_scache* sem)
8183 {
8184 #define FLD(f) abuf->fields.sfmt_and_reg_reg_shift.f
8185   sem_status status = SEM_STATUS_NORMAL;
8186   arm_scache* abuf = sem;
8187   PCADDR pc = abuf->addr;
8188   PCADDR npc = pc + 4;
8189
8190 {
8191   SI tmp_operand2;
8192   tmp_operand2 = current_cpu->compute_operand2_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg));
8193 if (EQSI (FLD (f_rd), 15)) {
8194   {
8195     SI opval = current_cpu->h_spsr_get ();
8196     current_cpu->h_cpsr_set (opval);
8197     if (current_cpu->trace_result_p)
8198       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
8199   }
8200 } else {
8201 {
8202   SI tmp_result;
8203   tmp_result = SUBCSI (* FLD (i_rn), tmp_operand2, 0);
8204 {
8205   {
8206     BI opval = EQSI (tmp_result, 0);
8207     current_cpu->hardware.h_zbit = opval;
8208     if (current_cpu->trace_result_p)
8209       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
8210   }
8211   {
8212     BI opval = LTSI (tmp_result, 0);
8213     current_cpu->hardware.h_nbit = opval;
8214     if (current_cpu->trace_result_p)
8215       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
8216   }
8217 }
8218   {
8219     BI opval = NOTSI (SUBCFSI (* FLD (i_rn), tmp_operand2, 0));
8220     current_cpu->hardware.h_cbit = opval;
8221     if (current_cpu->trace_result_p)
8222       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
8223   }
8224   {
8225     BI opval = SUBOFSI (* FLD (i_rn), tmp_operand2, 0);
8226     current_cpu->hardware.h_vbit = opval;
8227     if (current_cpu->trace_result_p)
8228       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
8229   }
8230 }
8231 }
8232 }
8233
8234   current_cpu->done_insn (npc, status);
8235   return status;
8236 #undef FLD
8237 }
8238
8239 // ********** cmp-imm: cmp${cond}${set-cc?} $rn,$imm12
8240
8241 sem_status
8242 arm_sem_cmp_imm (arm7f_cpu* current_cpu, arm_scache* sem)
8243 {
8244 #define FLD(f) abuf->fields.sfmt_and_imm.f
8245   sem_status status = SEM_STATUS_NORMAL;
8246   arm_scache* abuf = sem;
8247   PCADDR pc = abuf->addr;
8248   PCADDR npc = pc + 4;
8249
8250 {
8251   SI tmp_result;
8252   tmp_result = SUBCSI (* FLD (i_rn), FLD (f_imm12), 0);
8253 {
8254   {
8255     BI opval = EQSI (tmp_result, 0);
8256     current_cpu->hardware.h_zbit = opval;
8257     if (current_cpu->trace_result_p)
8258       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
8259   }
8260   {
8261     BI opval = LTSI (tmp_result, 0);
8262     current_cpu->hardware.h_nbit = opval;
8263     if (current_cpu->trace_result_p)
8264       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
8265   }
8266 }
8267   {
8268     BI opval = NOTSI (SUBCFSI (* FLD (i_rn), FLD (f_imm12), 0));
8269     current_cpu->hardware.h_cbit = opval;
8270     if (current_cpu->trace_result_p)
8271       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
8272   }
8273   {
8274     BI opval = SUBOFSI (* FLD (i_rn), FLD (f_imm12), 0);
8275     current_cpu->hardware.h_vbit = opval;
8276     if (current_cpu->trace_result_p)
8277       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
8278   }
8279 }
8280
8281   current_cpu->done_insn (npc, status);
8282   return status;
8283 #undef FLD
8284 }
8285
8286 // ********** cmn-reg/imm-shift: cmn$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftimm}
8287
8288 sem_status
8289 arm_sem_cmn_reg_imm_shift (arm7f_cpu* current_cpu, arm_scache* sem)
8290 {
8291 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
8292   sem_status status = SEM_STATUS_NORMAL;
8293   arm_scache* abuf = sem;
8294   PCADDR pc = abuf->addr;
8295   PCADDR npc = pc + 4;
8296
8297 {
8298   SI tmp_operand2;
8299   tmp_operand2 = current_cpu->compute_operand2_immshift (* FLD (i_rm), FLD (f_operand2_shifttype), FLD (f_operand2_shiftimm));
8300 if (EQSI (FLD (f_rd), 15)) {
8301   {
8302     SI opval = current_cpu->h_spsr_get ();
8303     current_cpu->h_cpsr_set (opval);
8304     if (current_cpu->trace_result_p)
8305       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
8306   }
8307 } else {
8308 {
8309   SI tmp_result;
8310   tmp_result = ADDCSI (* FLD (i_rn), tmp_operand2, 0);
8311 {
8312   {
8313     BI opval = EQSI (tmp_result, 0);
8314     current_cpu->hardware.h_zbit = opval;
8315     if (current_cpu->trace_result_p)
8316       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
8317   }
8318   {
8319     BI opval = LTSI (tmp_result, 0);
8320     current_cpu->hardware.h_nbit = opval;
8321     if (current_cpu->trace_result_p)
8322       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
8323   }
8324 }
8325   {
8326     BI opval = ADDCFSI (* FLD (i_rn), tmp_operand2, 0);
8327     current_cpu->hardware.h_cbit = opval;
8328     if (current_cpu->trace_result_p)
8329       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
8330   }
8331   {
8332     BI opval = ADDOFSI (* FLD (i_rn), tmp_operand2, 0);
8333     current_cpu->hardware.h_vbit = opval;
8334     if (current_cpu->trace_result_p)
8335       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
8336   }
8337 }
8338 }
8339 }
8340
8341   current_cpu->done_insn (npc, status);
8342   return status;
8343 #undef FLD
8344 }
8345
8346 // ********** cmn-reg/reg-shift: cmn$cond${set-cc?} $rd,$rn,$rm,${operand2-shifttype} ${operand2-shiftreg}
8347
8348 sem_status
8349 arm_sem_cmn_reg_reg_shift (arm7f_cpu* current_cpu, arm_scache* sem)
8350 {
8351 #define FLD(f) abuf->fields.sfmt_and_reg_reg_shift.f
8352   sem_status status = SEM_STATUS_NORMAL;
8353   arm_scache* abuf = sem;
8354   PCADDR pc = abuf->addr;
8355   PCADDR npc = pc + 4;
8356
8357 {
8358   SI tmp_operand2;
8359   tmp_operand2 = current_cpu->compute_operand2_regshift (* FLD (i_rm), FLD (f_operand2_shifttype), * FLD (i_operand2_shiftreg));
8360 if (EQSI (FLD (f_rd), 15)) {
8361   {
8362     SI opval = current_cpu->h_spsr_get ();
8363     current_cpu->h_cpsr_set (opval);
8364     if (current_cpu->trace_result_p)
8365       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
8366   }
8367 } else {
8368 {
8369   SI tmp_result;
8370   tmp_result = ADDCSI (* FLD (i_rn), tmp_operand2, 0);
8371 {
8372   {
8373     BI opval = EQSI (tmp_result, 0);
8374     current_cpu->hardware.h_zbit = opval;
8375     if (current_cpu->trace_result_p)
8376       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
8377   }
8378   {
8379     BI opval = LTSI (tmp_result, 0);
8380     current_cpu->hardware.h_nbit = opval;
8381     if (current_cpu->trace_result_p)
8382       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
8383   }
8384 }
8385   {
8386     BI opval = ADDCFSI (* FLD (i_rn), tmp_operand2, 0);
8387     current_cpu->hardware.h_cbit = opval;
8388     if (current_cpu->trace_result_p)
8389       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
8390   }
8391   {
8392     BI opval = ADDOFSI (* FLD (i_rn), tmp_operand2, 0);
8393     current_cpu->hardware.h_vbit = opval;
8394     if (current_cpu->trace_result_p)
8395       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
8396   }
8397 }
8398 }
8399 }
8400
8401   current_cpu->done_insn (npc, status);
8402   return status;
8403 #undef FLD
8404 }
8405
8406 // ********** cmn-imm: cmn${cond}${set-cc?} $rn,$imm12
8407
8408 sem_status
8409 arm_sem_cmn_imm (arm7f_cpu* current_cpu, arm_scache* sem)
8410 {
8411 #define FLD(f) abuf->fields.sfmt_and_imm.f
8412   sem_status status = SEM_STATUS_NORMAL;
8413   arm_scache* abuf = sem;
8414   PCADDR pc = abuf->addr;
8415   PCADDR npc = pc + 4;
8416
8417 {
8418   SI tmp_result;
8419   tmp_result = ADDCSI (* FLD (i_rn), FLD (f_imm12), 0);
8420 {
8421   {
8422     BI opval = EQSI (tmp_result, 0);
8423     current_cpu->hardware.h_zbit = opval;
8424     if (current_cpu->trace_result_p)
8425       current_cpu->trace_stream << "zbit" << ":=0x" << hex << opval << dec << "  ";
8426   }
8427   {
8428     BI opval = LTSI (tmp_result, 0);
8429     current_cpu->hardware.h_nbit = opval;
8430     if (current_cpu->trace_result_p)
8431       current_cpu->trace_stream << "nbit" << ":=0x" << hex << opval << dec << "  ";
8432   }
8433 }
8434   {
8435     BI opval = ADDCFSI (* FLD (i_rn), FLD (f_imm12), 0);
8436     current_cpu->hardware.h_cbit = opval;
8437     if (current_cpu->trace_result_p)
8438       current_cpu->trace_stream << "cbit" << ":=0x" << hex << opval << dec << "  ";
8439   }
8440   {
8441     BI opval = ADDOFSI (* FLD (i_rn), FLD (f_imm12), 0);
8442     current_cpu->hardware.h_vbit = opval;
8443     if (current_cpu->trace_result_p)
8444       current_cpu->trace_stream << "vbit" << ":=0x" << hex << opval << dec << "  ";
8445   }
8446 }
8447
8448   current_cpu->done_insn (npc, status);
8449   return status;
8450 #undef FLD
8451 }
8452
8453 // ********** ldmda: FIXME
8454
8455 sem_status
8456 arm_sem_ldmda (arm7f_cpu* current_cpu, arm_scache* sem)
8457 {
8458 #define FLD(f) abuf->fields.sfmt_ldmda.f
8459   sem_status status = SEM_STATUS_NORMAL;
8460   arm_scache* abuf = sem;
8461   PCADDR pc = abuf->addr;
8462   PCADDR npc = pc + 4;
8463
8464 {
8465   SI tmp_addr;
8466   tmp_addr = * FLD (i_rn);
8467 if (ANDSI (FLD (f_reg_list), SLLSI (1, 15))) {
8468 {
8469   {
8470     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8471     current_cpu->branch (opval, npc, status);
8472     if (current_cpu->trace_result_p)
8473       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
8474   }
8475   tmp_addr = SUBSI (tmp_addr, 4);
8476 }
8477 }
8478 if (ANDSI (FLD (f_reg_list), SLLSI (1, 14))) {
8479 {
8480   {
8481     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8482     current_cpu->hardware.h_gr[((UINT) 14)] = opval;
8483     if (current_cpu->trace_result_p)
8484       current_cpu->trace_stream << "gr-14" << '[' << ((UINT) 14) << ']' << ":=0x" << hex << opval << dec << "  ";
8485   }
8486   tmp_addr = SUBSI (tmp_addr, 4);
8487 }
8488 }
8489 if (ANDSI (FLD (f_reg_list), SLLSI (1, 13))) {
8490 {
8491   {
8492     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8493     current_cpu->hardware.h_gr[((UINT) 13)] = opval;
8494     if (current_cpu->trace_result_p)
8495       current_cpu->trace_stream << "gr-13" << '[' << ((UINT) 13) << ']' << ":=0x" << hex << opval << dec << "  ";
8496   }
8497   tmp_addr = SUBSI (tmp_addr, 4);
8498 }
8499 }
8500 if (ANDSI (FLD (f_reg_list), SLLSI (1, 12))) {
8501 {
8502   {
8503     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8504     current_cpu->hardware.h_gr[((UINT) 12)] = opval;
8505     if (current_cpu->trace_result_p)
8506       current_cpu->trace_stream << "gr-12" << '[' << ((UINT) 12) << ']' << ":=0x" << hex << opval << dec << "  ";
8507   }
8508   tmp_addr = SUBSI (tmp_addr, 4);
8509 }
8510 }
8511 if (ANDSI (FLD (f_reg_list), SLLSI (1, 11))) {
8512 {
8513   {
8514     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8515     current_cpu->hardware.h_gr[((UINT) 11)] = opval;
8516     if (current_cpu->trace_result_p)
8517       current_cpu->trace_stream << "gr-11" << '[' << ((UINT) 11) << ']' << ":=0x" << hex << opval << dec << "  ";
8518   }
8519   tmp_addr = SUBSI (tmp_addr, 4);
8520 }
8521 }
8522 if (ANDSI (FLD (f_reg_list), SLLSI (1, 10))) {
8523 {
8524   {
8525     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8526     current_cpu->hardware.h_gr[((UINT) 10)] = opval;
8527     if (current_cpu->trace_result_p)
8528       current_cpu->trace_stream << "gr-10" << '[' << ((UINT) 10) << ']' << ":=0x" << hex << opval << dec << "  ";
8529   }
8530   tmp_addr = SUBSI (tmp_addr, 4);
8531 }
8532 }
8533 if (ANDSI (FLD (f_reg_list), SLLSI (1, 9))) {
8534 {
8535   {
8536     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8537     current_cpu->hardware.h_gr[((UINT) 9)] = opval;
8538     if (current_cpu->trace_result_p)
8539       current_cpu->trace_stream << "gr-9" << '[' << ((UINT) 9) << ']' << ":=0x" << hex << opval << dec << "  ";
8540   }
8541   tmp_addr = SUBSI (tmp_addr, 4);
8542 }
8543 }
8544 if (ANDSI (FLD (f_reg_list), SLLSI (1, 8))) {
8545 {
8546   {
8547     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8548     current_cpu->hardware.h_gr[((UINT) 8)] = opval;
8549     if (current_cpu->trace_result_p)
8550       current_cpu->trace_stream << "gr-8" << '[' << ((UINT) 8) << ']' << ":=0x" << hex << opval << dec << "  ";
8551   }
8552   tmp_addr = SUBSI (tmp_addr, 4);
8553 }
8554 }
8555 if (ANDSI (FLD (f_reg_list), SLLSI (1, 7))) {
8556 {
8557   {
8558     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8559     current_cpu->hardware.h_gr[((UINT) 7)] = opval;
8560     if (current_cpu->trace_result_p)
8561       current_cpu->trace_stream << "gr-7" << '[' << ((UINT) 7) << ']' << ":=0x" << hex << opval << dec << "  ";
8562   }
8563   tmp_addr = SUBSI (tmp_addr, 4);
8564 }
8565 }
8566 if (ANDSI (FLD (f_reg_list), SLLSI (1, 6))) {
8567 {
8568   {
8569     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8570     current_cpu->hardware.h_gr[((UINT) 6)] = opval;
8571     if (current_cpu->trace_result_p)
8572       current_cpu->trace_stream << "gr-6" << '[' << ((UINT) 6) << ']' << ":=0x" << hex << opval << dec << "  ";
8573   }
8574   tmp_addr = SUBSI (tmp_addr, 4);
8575 }
8576 }
8577 if (ANDSI (FLD (f_reg_list), SLLSI (1, 5))) {
8578 {
8579   {
8580     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8581     current_cpu->hardware.h_gr[((UINT) 5)] = opval;
8582     if (current_cpu->trace_result_p)
8583       current_cpu->trace_stream << "gr-5" << '[' << ((UINT) 5) << ']' << ":=0x" << hex << opval << dec << "  ";
8584   }
8585   tmp_addr = SUBSI (tmp_addr, 4);
8586 }
8587 }
8588 if (ANDSI (FLD (f_reg_list), SLLSI (1, 4))) {
8589 {
8590   {
8591     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8592     current_cpu->hardware.h_gr[((UINT) 4)] = opval;
8593     if (current_cpu->trace_result_p)
8594       current_cpu->trace_stream << "gr-4" << '[' << ((UINT) 4) << ']' << ":=0x" << hex << opval << dec << "  ";
8595   }
8596   tmp_addr = SUBSI (tmp_addr, 4);
8597 }
8598 }
8599 if (ANDSI (FLD (f_reg_list), SLLSI (1, 3))) {
8600 {
8601   {
8602     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8603     current_cpu->hardware.h_gr[((UINT) 3)] = opval;
8604     if (current_cpu->trace_result_p)
8605       current_cpu->trace_stream << "gr-3" << '[' << ((UINT) 3) << ']' << ":=0x" << hex << opval << dec << "  ";
8606   }
8607   tmp_addr = SUBSI (tmp_addr, 4);
8608 }
8609 }
8610 if (ANDSI (FLD (f_reg_list), SLLSI (1, 2))) {
8611 {
8612   {
8613     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8614     current_cpu->hardware.h_gr[((UINT) 2)] = opval;
8615     if (current_cpu->trace_result_p)
8616       current_cpu->trace_stream << "gr-2" << '[' << ((UINT) 2) << ']' << ":=0x" << hex << opval << dec << "  ";
8617   }
8618   tmp_addr = SUBSI (tmp_addr, 4);
8619 }
8620 }
8621 if (ANDSI (FLD (f_reg_list), SLLSI (1, 1))) {
8622 {
8623   {
8624     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8625     current_cpu->hardware.h_gr[((UINT) 1)] = opval;
8626     if (current_cpu->trace_result_p)
8627       current_cpu->trace_stream << "gr-1" << '[' << ((UINT) 1) << ']' << ":=0x" << hex << opval << dec << "  ";
8628   }
8629   tmp_addr = SUBSI (tmp_addr, 4);
8630 }
8631 }
8632 if (ANDSI (FLD (f_reg_list), SLLSI (1, 0))) {
8633 {
8634   {
8635     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8636     current_cpu->hardware.h_gr[((UINT) 0)] = opval;
8637     if (current_cpu->trace_result_p)
8638       current_cpu->trace_stream << "gr-0" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << "  ";
8639   }
8640   tmp_addr = SUBSI (tmp_addr, 4);
8641 }
8642 }
8643 }
8644
8645   current_cpu->done_cti_insn (npc, status);
8646   return status;
8647 #undef FLD
8648 }
8649
8650 // ********** ldmda-wb: FIXME
8651
8652 sem_status
8653 arm_sem_ldmda_wb (arm7f_cpu* current_cpu, arm_scache* sem)
8654 {
8655 #define FLD(f) abuf->fields.sfmt_ldmda.f
8656   sem_status status = SEM_STATUS_NORMAL;
8657   arm_scache* abuf = sem;
8658   PCADDR pc = abuf->addr;
8659   PCADDR npc = pc + 4;
8660
8661 {
8662   SI tmp_addr;
8663   tmp_addr = * FLD (i_rn);
8664 if (ANDSI (FLD (f_reg_list), SLLSI (1, 15))) {
8665 {
8666   {
8667     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8668     current_cpu->branch (opval, npc, status);
8669     if (current_cpu->trace_result_p)
8670       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
8671   }
8672   tmp_addr = SUBSI (tmp_addr, 4);
8673 }
8674 }
8675 if (ANDSI (FLD (f_reg_list), SLLSI (1, 14))) {
8676 {
8677   {
8678     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8679     current_cpu->hardware.h_gr[((UINT) 14)] = opval;
8680     if (current_cpu->trace_result_p)
8681       current_cpu->trace_stream << "gr-14" << '[' << ((UINT) 14) << ']' << ":=0x" << hex << opval << dec << "  ";
8682   }
8683   tmp_addr = SUBSI (tmp_addr, 4);
8684 }
8685 }
8686 if (ANDSI (FLD (f_reg_list), SLLSI (1, 13))) {
8687 {
8688   {
8689     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8690     current_cpu->hardware.h_gr[((UINT) 13)] = opval;
8691     if (current_cpu->trace_result_p)
8692       current_cpu->trace_stream << "gr-13" << '[' << ((UINT) 13) << ']' << ":=0x" << hex << opval << dec << "  ";
8693   }
8694   tmp_addr = SUBSI (tmp_addr, 4);
8695 }
8696 }
8697 if (ANDSI (FLD (f_reg_list), SLLSI (1, 12))) {
8698 {
8699   {
8700     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8701     current_cpu->hardware.h_gr[((UINT) 12)] = opval;
8702     if (current_cpu->trace_result_p)
8703       current_cpu->trace_stream << "gr-12" << '[' << ((UINT) 12) << ']' << ":=0x" << hex << opval << dec << "  ";
8704   }
8705   tmp_addr = SUBSI (tmp_addr, 4);
8706 }
8707 }
8708 if (ANDSI (FLD (f_reg_list), SLLSI (1, 11))) {
8709 {
8710   {
8711     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8712     current_cpu->hardware.h_gr[((UINT) 11)] = opval;
8713     if (current_cpu->trace_result_p)
8714       current_cpu->trace_stream << "gr-11" << '[' << ((UINT) 11) << ']' << ":=0x" << hex << opval << dec << "  ";
8715   }
8716   tmp_addr = SUBSI (tmp_addr, 4);
8717 }
8718 }
8719 if (ANDSI (FLD (f_reg_list), SLLSI (1, 10))) {
8720 {
8721   {
8722     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8723     current_cpu->hardware.h_gr[((UINT) 10)] = opval;
8724     if (current_cpu->trace_result_p)
8725       current_cpu->trace_stream << "gr-10" << '[' << ((UINT) 10) << ']' << ":=0x" << hex << opval << dec << "  ";
8726   }
8727   tmp_addr = SUBSI (tmp_addr, 4);
8728 }
8729 }
8730 if (ANDSI (FLD (f_reg_list), SLLSI (1, 9))) {
8731 {
8732   {
8733     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8734     current_cpu->hardware.h_gr[((UINT) 9)] = opval;
8735     if (current_cpu->trace_result_p)
8736       current_cpu->trace_stream << "gr-9" << '[' << ((UINT) 9) << ']' << ":=0x" << hex << opval << dec << "  ";
8737   }
8738   tmp_addr = SUBSI (tmp_addr, 4);
8739 }
8740 }
8741 if (ANDSI (FLD (f_reg_list), SLLSI (1, 8))) {
8742 {
8743   {
8744     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8745     current_cpu->hardware.h_gr[((UINT) 8)] = opval;
8746     if (current_cpu->trace_result_p)
8747       current_cpu->trace_stream << "gr-8" << '[' << ((UINT) 8) << ']' << ":=0x" << hex << opval << dec << "  ";
8748   }
8749   tmp_addr = SUBSI (tmp_addr, 4);
8750 }
8751 }
8752 if (ANDSI (FLD (f_reg_list), SLLSI (1, 7))) {
8753 {
8754   {
8755     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8756     current_cpu->hardware.h_gr[((UINT) 7)] = opval;
8757     if (current_cpu->trace_result_p)
8758       current_cpu->trace_stream << "gr-7" << '[' << ((UINT) 7) << ']' << ":=0x" << hex << opval << dec << "  ";
8759   }
8760   tmp_addr = SUBSI (tmp_addr, 4);
8761 }
8762 }
8763 if (ANDSI (FLD (f_reg_list), SLLSI (1, 6))) {
8764 {
8765   {
8766     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8767     current_cpu->hardware.h_gr[((UINT) 6)] = opval;
8768     if (current_cpu->trace_result_p)
8769       current_cpu->trace_stream << "gr-6" << '[' << ((UINT) 6) << ']' << ":=0x" << hex << opval << dec << "  ";
8770   }
8771   tmp_addr = SUBSI (tmp_addr, 4);
8772 }
8773 }
8774 if (ANDSI (FLD (f_reg_list), SLLSI (1, 5))) {
8775 {
8776   {
8777     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8778     current_cpu->hardware.h_gr[((UINT) 5)] = opval;
8779     if (current_cpu->trace_result_p)
8780       current_cpu->trace_stream << "gr-5" << '[' << ((UINT) 5) << ']' << ":=0x" << hex << opval << dec << "  ";
8781   }
8782   tmp_addr = SUBSI (tmp_addr, 4);
8783 }
8784 }
8785 if (ANDSI (FLD (f_reg_list), SLLSI (1, 4))) {
8786 {
8787   {
8788     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8789     current_cpu->hardware.h_gr[((UINT) 4)] = opval;
8790     if (current_cpu->trace_result_p)
8791       current_cpu->trace_stream << "gr-4" << '[' << ((UINT) 4) << ']' << ":=0x" << hex << opval << dec << "  ";
8792   }
8793   tmp_addr = SUBSI (tmp_addr, 4);
8794 }
8795 }
8796 if (ANDSI (FLD (f_reg_list), SLLSI (1, 3))) {
8797 {
8798   {
8799     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8800     current_cpu->hardware.h_gr[((UINT) 3)] = opval;
8801     if (current_cpu->trace_result_p)
8802       current_cpu->trace_stream << "gr-3" << '[' << ((UINT) 3) << ']' << ":=0x" << hex << opval << dec << "  ";
8803   }
8804   tmp_addr = SUBSI (tmp_addr, 4);
8805 }
8806 }
8807 if (ANDSI (FLD (f_reg_list), SLLSI (1, 2))) {
8808 {
8809   {
8810     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8811     current_cpu->hardware.h_gr[((UINT) 2)] = opval;
8812     if (current_cpu->trace_result_p)
8813       current_cpu->trace_stream << "gr-2" << '[' << ((UINT) 2) << ']' << ":=0x" << hex << opval << dec << "  ";
8814   }
8815   tmp_addr = SUBSI (tmp_addr, 4);
8816 }
8817 }
8818 if (ANDSI (FLD (f_reg_list), SLLSI (1, 1))) {
8819 {
8820   {
8821     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8822     current_cpu->hardware.h_gr[((UINT) 1)] = opval;
8823     if (current_cpu->trace_result_p)
8824       current_cpu->trace_stream << "gr-1" << '[' << ((UINT) 1) << ']' << ":=0x" << hex << opval << dec << "  ";
8825   }
8826   tmp_addr = SUBSI (tmp_addr, 4);
8827 }
8828 }
8829 if (ANDSI (FLD (f_reg_list), SLLSI (1, 0))) {
8830 {
8831   {
8832     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8833     current_cpu->hardware.h_gr[((UINT) 0)] = opval;
8834     if (current_cpu->trace_result_p)
8835       current_cpu->trace_stream << "gr-0" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << "  ";
8836   }
8837   tmp_addr = SUBSI (tmp_addr, 4);
8838 }
8839 }
8840   {
8841     SI opval = tmp_addr;
8842     * FLD (i_rn) = opval;
8843     if (current_cpu->trace_result_p)
8844       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
8845   }
8846 }
8847
8848   current_cpu->done_cti_insn (npc, status);
8849   return status;
8850 #undef FLD
8851 }
8852
8853 // ********** ldmib: FIXME
8854
8855 sem_status
8856 arm_sem_ldmib (arm7f_cpu* current_cpu, arm_scache* sem)
8857 {
8858 #define FLD(f) abuf->fields.sfmt_ldmda.f
8859   sem_status status = SEM_STATUS_NORMAL;
8860   arm_scache* abuf = sem;
8861   PCADDR pc = abuf->addr;
8862   PCADDR npc = pc + 4;
8863
8864 {
8865   SI tmp_addr;
8866   tmp_addr = * FLD (i_rn);
8867 if (ANDSI (FLD (f_reg_list), SLLSI (1, 0))) {
8868 {
8869   tmp_addr = ADDSI (tmp_addr, 4);
8870   {
8871     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8872     current_cpu->hardware.h_gr[((UINT) 0)] = opval;
8873     if (current_cpu->trace_result_p)
8874       current_cpu->trace_stream << "gr-0" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << "  ";
8875   }
8876 }
8877 }
8878 if (ANDSI (FLD (f_reg_list), SLLSI (1, 1))) {
8879 {
8880   tmp_addr = ADDSI (tmp_addr, 4);
8881   {
8882     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8883     current_cpu->hardware.h_gr[((UINT) 1)] = opval;
8884     if (current_cpu->trace_result_p)
8885       current_cpu->trace_stream << "gr-1" << '[' << ((UINT) 1) << ']' << ":=0x" << hex << opval << dec << "  ";
8886   }
8887 }
8888 }
8889 if (ANDSI (FLD (f_reg_list), SLLSI (1, 2))) {
8890 {
8891   tmp_addr = ADDSI (tmp_addr, 4);
8892   {
8893     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8894     current_cpu->hardware.h_gr[((UINT) 2)] = opval;
8895     if (current_cpu->trace_result_p)
8896       current_cpu->trace_stream << "gr-2" << '[' << ((UINT) 2) << ']' << ":=0x" << hex << opval << dec << "  ";
8897   }
8898 }
8899 }
8900 if (ANDSI (FLD (f_reg_list), SLLSI (1, 3))) {
8901 {
8902   tmp_addr = ADDSI (tmp_addr, 4);
8903   {
8904     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8905     current_cpu->hardware.h_gr[((UINT) 3)] = opval;
8906     if (current_cpu->trace_result_p)
8907       current_cpu->trace_stream << "gr-3" << '[' << ((UINT) 3) << ']' << ":=0x" << hex << opval << dec << "  ";
8908   }
8909 }
8910 }
8911 if (ANDSI (FLD (f_reg_list), SLLSI (1, 4))) {
8912 {
8913   tmp_addr = ADDSI (tmp_addr, 4);
8914   {
8915     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8916     current_cpu->hardware.h_gr[((UINT) 4)] = opval;
8917     if (current_cpu->trace_result_p)
8918       current_cpu->trace_stream << "gr-4" << '[' << ((UINT) 4) << ']' << ":=0x" << hex << opval << dec << "  ";
8919   }
8920 }
8921 }
8922 if (ANDSI (FLD (f_reg_list), SLLSI (1, 5))) {
8923 {
8924   tmp_addr = ADDSI (tmp_addr, 4);
8925   {
8926     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8927     current_cpu->hardware.h_gr[((UINT) 5)] = opval;
8928     if (current_cpu->trace_result_p)
8929       current_cpu->trace_stream << "gr-5" << '[' << ((UINT) 5) << ']' << ":=0x" << hex << opval << dec << "  ";
8930   }
8931 }
8932 }
8933 if (ANDSI (FLD (f_reg_list), SLLSI (1, 6))) {
8934 {
8935   tmp_addr = ADDSI (tmp_addr, 4);
8936   {
8937     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8938     current_cpu->hardware.h_gr[((UINT) 6)] = opval;
8939     if (current_cpu->trace_result_p)
8940       current_cpu->trace_stream << "gr-6" << '[' << ((UINT) 6) << ']' << ":=0x" << hex << opval << dec << "  ";
8941   }
8942 }
8943 }
8944 if (ANDSI (FLD (f_reg_list), SLLSI (1, 7))) {
8945 {
8946   tmp_addr = ADDSI (tmp_addr, 4);
8947   {
8948     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8949     current_cpu->hardware.h_gr[((UINT) 7)] = opval;
8950     if (current_cpu->trace_result_p)
8951       current_cpu->trace_stream << "gr-7" << '[' << ((UINT) 7) << ']' << ":=0x" << hex << opval << dec << "  ";
8952   }
8953 }
8954 }
8955 if (ANDSI (FLD (f_reg_list), SLLSI (1, 8))) {
8956 {
8957   tmp_addr = ADDSI (tmp_addr, 4);
8958   {
8959     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8960     current_cpu->hardware.h_gr[((UINT) 8)] = opval;
8961     if (current_cpu->trace_result_p)
8962       current_cpu->trace_stream << "gr-8" << '[' << ((UINT) 8) << ']' << ":=0x" << hex << opval << dec << "  ";
8963   }
8964 }
8965 }
8966 if (ANDSI (FLD (f_reg_list), SLLSI (1, 9))) {
8967 {
8968   tmp_addr = ADDSI (tmp_addr, 4);
8969   {
8970     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8971     current_cpu->hardware.h_gr[((UINT) 9)] = opval;
8972     if (current_cpu->trace_result_p)
8973       current_cpu->trace_stream << "gr-9" << '[' << ((UINT) 9) << ']' << ":=0x" << hex << opval << dec << "  ";
8974   }
8975 }
8976 }
8977 if (ANDSI (FLD (f_reg_list), SLLSI (1, 10))) {
8978 {
8979   tmp_addr = ADDSI (tmp_addr, 4);
8980   {
8981     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8982     current_cpu->hardware.h_gr[((UINT) 10)] = opval;
8983     if (current_cpu->trace_result_p)
8984       current_cpu->trace_stream << "gr-10" << '[' << ((UINT) 10) << ']' << ":=0x" << hex << opval << dec << "  ";
8985   }
8986 }
8987 }
8988 if (ANDSI (FLD (f_reg_list), SLLSI (1, 11))) {
8989 {
8990   tmp_addr = ADDSI (tmp_addr, 4);
8991   {
8992     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
8993     current_cpu->hardware.h_gr[((UINT) 11)] = opval;
8994     if (current_cpu->trace_result_p)
8995       current_cpu->trace_stream << "gr-11" << '[' << ((UINT) 11) << ']' << ":=0x" << hex << opval << dec << "  ";
8996   }
8997 }
8998 }
8999 if (ANDSI (FLD (f_reg_list), SLLSI (1, 12))) {
9000 {
9001   tmp_addr = ADDSI (tmp_addr, 4);
9002   {
9003     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9004     current_cpu->hardware.h_gr[((UINT) 12)] = opval;
9005     if (current_cpu->trace_result_p)
9006       current_cpu->trace_stream << "gr-12" << '[' << ((UINT) 12) << ']' << ":=0x" << hex << opval << dec << "  ";
9007   }
9008 }
9009 }
9010 if (ANDSI (FLD (f_reg_list), SLLSI (1, 13))) {
9011 {
9012   tmp_addr = ADDSI (tmp_addr, 4);
9013   {
9014     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9015     current_cpu->hardware.h_gr[((UINT) 13)] = opval;
9016     if (current_cpu->trace_result_p)
9017       current_cpu->trace_stream << "gr-13" << '[' << ((UINT) 13) << ']' << ":=0x" << hex << opval << dec << "  ";
9018   }
9019 }
9020 }
9021 if (ANDSI (FLD (f_reg_list), SLLSI (1, 14))) {
9022 {
9023   tmp_addr = ADDSI (tmp_addr, 4);
9024   {
9025     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9026     current_cpu->hardware.h_gr[((UINT) 14)] = opval;
9027     if (current_cpu->trace_result_p)
9028       current_cpu->trace_stream << "gr-14" << '[' << ((UINT) 14) << ']' << ":=0x" << hex << opval << dec << "  ";
9029   }
9030 }
9031 }
9032 if (ANDSI (FLD (f_reg_list), SLLSI (1, 15))) {
9033 {
9034   tmp_addr = ADDSI (tmp_addr, 4);
9035   {
9036     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9037     current_cpu->branch (opval, npc, status);
9038     if (current_cpu->trace_result_p)
9039       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
9040   }
9041 }
9042 }
9043 }
9044
9045   current_cpu->done_cti_insn (npc, status);
9046   return status;
9047 #undef FLD
9048 }
9049
9050 // ********** ldmib-wb: FIXME
9051
9052 sem_status
9053 arm_sem_ldmib_wb (arm7f_cpu* current_cpu, arm_scache* sem)
9054 {
9055 #define FLD(f) abuf->fields.sfmt_ldmda.f
9056   sem_status status = SEM_STATUS_NORMAL;
9057   arm_scache* abuf = sem;
9058   PCADDR pc = abuf->addr;
9059   PCADDR npc = pc + 4;
9060
9061 {
9062   SI tmp_addr;
9063   tmp_addr = * FLD (i_rn);
9064 if (ANDSI (FLD (f_reg_list), SLLSI (1, 0))) {
9065 {
9066   tmp_addr = ADDSI (tmp_addr, 4);
9067   {
9068     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9069     current_cpu->hardware.h_gr[((UINT) 0)] = opval;
9070     if (current_cpu->trace_result_p)
9071       current_cpu->trace_stream << "gr-0" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << "  ";
9072   }
9073 }
9074 }
9075 if (ANDSI (FLD (f_reg_list), SLLSI (1, 1))) {
9076 {
9077   tmp_addr = ADDSI (tmp_addr, 4);
9078   {
9079     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9080     current_cpu->hardware.h_gr[((UINT) 1)] = opval;
9081     if (current_cpu->trace_result_p)
9082       current_cpu->trace_stream << "gr-1" << '[' << ((UINT) 1) << ']' << ":=0x" << hex << opval << dec << "  ";
9083   }
9084 }
9085 }
9086 if (ANDSI (FLD (f_reg_list), SLLSI (1, 2))) {
9087 {
9088   tmp_addr = ADDSI (tmp_addr, 4);
9089   {
9090     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9091     current_cpu->hardware.h_gr[((UINT) 2)] = opval;
9092     if (current_cpu->trace_result_p)
9093       current_cpu->trace_stream << "gr-2" << '[' << ((UINT) 2) << ']' << ":=0x" << hex << opval << dec << "  ";
9094   }
9095 }
9096 }
9097 if (ANDSI (FLD (f_reg_list), SLLSI (1, 3))) {
9098 {
9099   tmp_addr = ADDSI (tmp_addr, 4);
9100   {
9101     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9102     current_cpu->hardware.h_gr[((UINT) 3)] = opval;
9103     if (current_cpu->trace_result_p)
9104       current_cpu->trace_stream << "gr-3" << '[' << ((UINT) 3) << ']' << ":=0x" << hex << opval << dec << "  ";
9105   }
9106 }
9107 }
9108 if (ANDSI (FLD (f_reg_list), SLLSI (1, 4))) {
9109 {
9110   tmp_addr = ADDSI (tmp_addr, 4);
9111   {
9112     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9113     current_cpu->hardware.h_gr[((UINT) 4)] = opval;
9114     if (current_cpu->trace_result_p)
9115       current_cpu->trace_stream << "gr-4" << '[' << ((UINT) 4) << ']' << ":=0x" << hex << opval << dec << "  ";
9116   }
9117 }
9118 }
9119 if (ANDSI (FLD (f_reg_list), SLLSI (1, 5))) {
9120 {
9121   tmp_addr = ADDSI (tmp_addr, 4);
9122   {
9123     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9124     current_cpu->hardware.h_gr[((UINT) 5)] = opval;
9125     if (current_cpu->trace_result_p)
9126       current_cpu->trace_stream << "gr-5" << '[' << ((UINT) 5) << ']' << ":=0x" << hex << opval << dec << "  ";
9127   }
9128 }
9129 }
9130 if (ANDSI (FLD (f_reg_list), SLLSI (1, 6))) {
9131 {
9132   tmp_addr = ADDSI (tmp_addr, 4);
9133   {
9134     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9135     current_cpu->hardware.h_gr[((UINT) 6)] = opval;
9136     if (current_cpu->trace_result_p)
9137       current_cpu->trace_stream << "gr-6" << '[' << ((UINT) 6) << ']' << ":=0x" << hex << opval << dec << "  ";
9138   }
9139 }
9140 }
9141 if (ANDSI (FLD (f_reg_list), SLLSI (1, 7))) {
9142 {
9143   tmp_addr = ADDSI (tmp_addr, 4);
9144   {
9145     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9146     current_cpu->hardware.h_gr[((UINT) 7)] = opval;
9147     if (current_cpu->trace_result_p)
9148       current_cpu->trace_stream << "gr-7" << '[' << ((UINT) 7) << ']' << ":=0x" << hex << opval << dec << "  ";
9149   }
9150 }
9151 }
9152 if (ANDSI (FLD (f_reg_list), SLLSI (1, 8))) {
9153 {
9154   tmp_addr = ADDSI (tmp_addr, 4);
9155   {
9156     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9157     current_cpu->hardware.h_gr[((UINT) 8)] = opval;
9158     if (current_cpu->trace_result_p)
9159       current_cpu->trace_stream << "gr-8" << '[' << ((UINT) 8) << ']' << ":=0x" << hex << opval << dec << "  ";
9160   }
9161 }
9162 }
9163 if (ANDSI (FLD (f_reg_list), SLLSI (1, 9))) {
9164 {
9165   tmp_addr = ADDSI (tmp_addr, 4);
9166   {
9167     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9168     current_cpu->hardware.h_gr[((UINT) 9)] = opval;
9169     if (current_cpu->trace_result_p)
9170       current_cpu->trace_stream << "gr-9" << '[' << ((UINT) 9) << ']' << ":=0x" << hex << opval << dec << "  ";
9171   }
9172 }
9173 }
9174 if (ANDSI (FLD (f_reg_list), SLLSI (1, 10))) {
9175 {
9176   tmp_addr = ADDSI (tmp_addr, 4);
9177   {
9178     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9179     current_cpu->hardware.h_gr[((UINT) 10)] = opval;
9180     if (current_cpu->trace_result_p)
9181       current_cpu->trace_stream << "gr-10" << '[' << ((UINT) 10) << ']' << ":=0x" << hex << opval << dec << "  ";
9182   }
9183 }
9184 }
9185 if (ANDSI (FLD (f_reg_list), SLLSI (1, 11))) {
9186 {
9187   tmp_addr = ADDSI (tmp_addr, 4);
9188   {
9189     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9190     current_cpu->hardware.h_gr[((UINT) 11)] = opval;
9191     if (current_cpu->trace_result_p)
9192       current_cpu->trace_stream << "gr-11" << '[' << ((UINT) 11) << ']' << ":=0x" << hex << opval << dec << "  ";
9193   }
9194 }
9195 }
9196 if (ANDSI (FLD (f_reg_list), SLLSI (1, 12))) {
9197 {
9198   tmp_addr = ADDSI (tmp_addr, 4);
9199   {
9200     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9201     current_cpu->hardware.h_gr[((UINT) 12)] = opval;
9202     if (current_cpu->trace_result_p)
9203       current_cpu->trace_stream << "gr-12" << '[' << ((UINT) 12) << ']' << ":=0x" << hex << opval << dec << "  ";
9204   }
9205 }
9206 }
9207 if (ANDSI (FLD (f_reg_list), SLLSI (1, 13))) {
9208 {
9209   tmp_addr = ADDSI (tmp_addr, 4);
9210   {
9211     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9212     current_cpu->hardware.h_gr[((UINT) 13)] = opval;
9213     if (current_cpu->trace_result_p)
9214       current_cpu->trace_stream << "gr-13" << '[' << ((UINT) 13) << ']' << ":=0x" << hex << opval << dec << "  ";
9215   }
9216 }
9217 }
9218 if (ANDSI (FLD (f_reg_list), SLLSI (1, 14))) {
9219 {
9220   tmp_addr = ADDSI (tmp_addr, 4);
9221   {
9222     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9223     current_cpu->hardware.h_gr[((UINT) 14)] = opval;
9224     if (current_cpu->trace_result_p)
9225       current_cpu->trace_stream << "gr-14" << '[' << ((UINT) 14) << ']' << ":=0x" << hex << opval << dec << "  ";
9226   }
9227 }
9228 }
9229 if (ANDSI (FLD (f_reg_list), SLLSI (1, 15))) {
9230 {
9231   tmp_addr = ADDSI (tmp_addr, 4);
9232   {
9233     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9234     current_cpu->branch (opval, npc, status);
9235     if (current_cpu->trace_result_p)
9236       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
9237   }
9238 }
9239 }
9240   {
9241     SI opval = tmp_addr;
9242     * FLD (i_rn) = opval;
9243     if (current_cpu->trace_result_p)
9244       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
9245   }
9246 }
9247
9248   current_cpu->done_cti_insn (npc, status);
9249   return status;
9250 #undef FLD
9251 }
9252
9253 // ********** ldmia: FIXME
9254
9255 sem_status
9256 arm_sem_ldmia (arm7f_cpu* current_cpu, arm_scache* sem)
9257 {
9258 #define FLD(f) abuf->fields.sfmt_ldmda.f
9259   sem_status status = SEM_STATUS_NORMAL;
9260   arm_scache* abuf = sem;
9261   PCADDR pc = abuf->addr;
9262   PCADDR npc = pc + 4;
9263
9264 {
9265   SI tmp_addr;
9266   tmp_addr = * FLD (i_rn);
9267 if (ANDSI (FLD (f_reg_list), SLLSI (1, 0))) {
9268 {
9269   {
9270     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9271     current_cpu->hardware.h_gr[((UINT) 0)] = opval;
9272     if (current_cpu->trace_result_p)
9273       current_cpu->trace_stream << "gr-0" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << "  ";
9274   }
9275   tmp_addr = ADDSI (tmp_addr, 4);
9276 }
9277 }
9278 if (ANDSI (FLD (f_reg_list), SLLSI (1, 1))) {
9279 {
9280   {
9281     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9282     current_cpu->hardware.h_gr[((UINT) 1)] = opval;
9283     if (current_cpu->trace_result_p)
9284       current_cpu->trace_stream << "gr-1" << '[' << ((UINT) 1) << ']' << ":=0x" << hex << opval << dec << "  ";
9285   }
9286   tmp_addr = ADDSI (tmp_addr, 4);
9287 }
9288 }
9289 if (ANDSI (FLD (f_reg_list), SLLSI (1, 2))) {
9290 {
9291   {
9292     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9293     current_cpu->hardware.h_gr[((UINT) 2)] = opval;
9294     if (current_cpu->trace_result_p)
9295       current_cpu->trace_stream << "gr-2" << '[' << ((UINT) 2) << ']' << ":=0x" << hex << opval << dec << "  ";
9296   }
9297   tmp_addr = ADDSI (tmp_addr, 4);
9298 }
9299 }
9300 if (ANDSI (FLD (f_reg_list), SLLSI (1, 3))) {
9301 {
9302   {
9303     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9304     current_cpu->hardware.h_gr[((UINT) 3)] = opval;
9305     if (current_cpu->trace_result_p)
9306       current_cpu->trace_stream << "gr-3" << '[' << ((UINT) 3) << ']' << ":=0x" << hex << opval << dec << "  ";
9307   }
9308   tmp_addr = ADDSI (tmp_addr, 4);
9309 }
9310 }
9311 if (ANDSI (FLD (f_reg_list), SLLSI (1, 4))) {
9312 {
9313   {
9314     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9315     current_cpu->hardware.h_gr[((UINT) 4)] = opval;
9316     if (current_cpu->trace_result_p)
9317       current_cpu->trace_stream << "gr-4" << '[' << ((UINT) 4) << ']' << ":=0x" << hex << opval << dec << "  ";
9318   }
9319   tmp_addr = ADDSI (tmp_addr, 4);
9320 }
9321 }
9322 if (ANDSI (FLD (f_reg_list), SLLSI (1, 5))) {
9323 {
9324   {
9325     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9326     current_cpu->hardware.h_gr[((UINT) 5)] = opval;
9327     if (current_cpu->trace_result_p)
9328       current_cpu->trace_stream << "gr-5" << '[' << ((UINT) 5) << ']' << ":=0x" << hex << opval << dec << "  ";
9329   }
9330   tmp_addr = ADDSI (tmp_addr, 4);
9331 }
9332 }
9333 if (ANDSI (FLD (f_reg_list), SLLSI (1, 6))) {
9334 {
9335   {
9336     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9337     current_cpu->hardware.h_gr[((UINT) 6)] = opval;
9338     if (current_cpu->trace_result_p)
9339       current_cpu->trace_stream << "gr-6" << '[' << ((UINT) 6) << ']' << ":=0x" << hex << opval << dec << "  ";
9340   }
9341   tmp_addr = ADDSI (tmp_addr, 4);
9342 }
9343 }
9344 if (ANDSI (FLD (f_reg_list), SLLSI (1, 7))) {
9345 {
9346   {
9347     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9348     current_cpu->hardware.h_gr[((UINT) 7)] = opval;
9349     if (current_cpu->trace_result_p)
9350       current_cpu->trace_stream << "gr-7" << '[' << ((UINT) 7) << ']' << ":=0x" << hex << opval << dec << "  ";
9351   }
9352   tmp_addr = ADDSI (tmp_addr, 4);
9353 }
9354 }
9355 if (ANDSI (FLD (f_reg_list), SLLSI (1, 8))) {
9356 {
9357   {
9358     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9359     current_cpu->hardware.h_gr[((UINT) 8)] = opval;
9360     if (current_cpu->trace_result_p)
9361       current_cpu->trace_stream << "gr-8" << '[' << ((UINT) 8) << ']' << ":=0x" << hex << opval << dec << "  ";
9362   }
9363   tmp_addr = ADDSI (tmp_addr, 4);
9364 }
9365 }
9366 if (ANDSI (FLD (f_reg_list), SLLSI (1, 9))) {
9367 {
9368   {
9369     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9370     current_cpu->hardware.h_gr[((UINT) 9)] = opval;
9371     if (current_cpu->trace_result_p)
9372       current_cpu->trace_stream << "gr-9" << '[' << ((UINT) 9) << ']' << ":=0x" << hex << opval << dec << "  ";
9373   }
9374   tmp_addr = ADDSI (tmp_addr, 4);
9375 }
9376 }
9377 if (ANDSI (FLD (f_reg_list), SLLSI (1, 10))) {
9378 {
9379   {
9380     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9381     current_cpu->hardware.h_gr[((UINT) 10)] = opval;
9382     if (current_cpu->trace_result_p)
9383       current_cpu->trace_stream << "gr-10" << '[' << ((UINT) 10) << ']' << ":=0x" << hex << opval << dec << "  ";
9384   }
9385   tmp_addr = ADDSI (tmp_addr, 4);
9386 }
9387 }
9388 if (ANDSI (FLD (f_reg_list), SLLSI (1, 11))) {
9389 {
9390   {
9391     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9392     current_cpu->hardware.h_gr[((UINT) 11)] = opval;
9393     if (current_cpu->trace_result_p)
9394       current_cpu->trace_stream << "gr-11" << '[' << ((UINT) 11) << ']' << ":=0x" << hex << opval << dec << "  ";
9395   }
9396   tmp_addr = ADDSI (tmp_addr, 4);
9397 }
9398 }
9399 if (ANDSI (FLD (f_reg_list), SLLSI (1, 12))) {
9400 {
9401   {
9402     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9403     current_cpu->hardware.h_gr[((UINT) 12)] = opval;
9404     if (current_cpu->trace_result_p)
9405       current_cpu->trace_stream << "gr-12" << '[' << ((UINT) 12) << ']' << ":=0x" << hex << opval << dec << "  ";
9406   }
9407   tmp_addr = ADDSI (tmp_addr, 4);
9408 }
9409 }
9410 if (ANDSI (FLD (f_reg_list), SLLSI (1, 13))) {
9411 {
9412   {
9413     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9414     current_cpu->hardware.h_gr[((UINT) 13)] = opval;
9415     if (current_cpu->trace_result_p)
9416       current_cpu->trace_stream << "gr-13" << '[' << ((UINT) 13) << ']' << ":=0x" << hex << opval << dec << "  ";
9417   }
9418   tmp_addr = ADDSI (tmp_addr, 4);
9419 }
9420 }
9421 if (ANDSI (FLD (f_reg_list), SLLSI (1, 14))) {
9422 {
9423   {
9424     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9425     current_cpu->hardware.h_gr[((UINT) 14)] = opval;
9426     if (current_cpu->trace_result_p)
9427       current_cpu->trace_stream << "gr-14" << '[' << ((UINT) 14) << ']' << ":=0x" << hex << opval << dec << "  ";
9428   }
9429   tmp_addr = ADDSI (tmp_addr, 4);
9430 }
9431 }
9432 if (ANDSI (FLD (f_reg_list), SLLSI (1, 15))) {
9433 {
9434   {
9435     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9436     current_cpu->branch (opval, npc, status);
9437     if (current_cpu->trace_result_p)
9438       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
9439   }
9440   tmp_addr = ADDSI (tmp_addr, 4);
9441 }
9442 }
9443 }
9444
9445   current_cpu->done_cti_insn (npc, status);
9446   return status;
9447 #undef FLD
9448 }
9449
9450 // ********** ldmia-wb: FIXME
9451
9452 sem_status
9453 arm_sem_ldmia_wb (arm7f_cpu* current_cpu, arm_scache* sem)
9454 {
9455 #define FLD(f) abuf->fields.sfmt_ldmda.f
9456   sem_status status = SEM_STATUS_NORMAL;
9457   arm_scache* abuf = sem;
9458   PCADDR pc = abuf->addr;
9459   PCADDR npc = pc + 4;
9460
9461 {
9462   SI tmp_addr;
9463   tmp_addr = * FLD (i_rn);
9464 if (ANDSI (FLD (f_reg_list), SLLSI (1, 0))) {
9465 {
9466   {
9467     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9468     current_cpu->hardware.h_gr[((UINT) 0)] = opval;
9469     if (current_cpu->trace_result_p)
9470       current_cpu->trace_stream << "gr-0" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << "  ";
9471   }
9472   tmp_addr = ADDSI (tmp_addr, 4);
9473 }
9474 }
9475 if (ANDSI (FLD (f_reg_list), SLLSI (1, 1))) {
9476 {
9477   {
9478     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9479     current_cpu->hardware.h_gr[((UINT) 1)] = opval;
9480     if (current_cpu->trace_result_p)
9481       current_cpu->trace_stream << "gr-1" << '[' << ((UINT) 1) << ']' << ":=0x" << hex << opval << dec << "  ";
9482   }
9483   tmp_addr = ADDSI (tmp_addr, 4);
9484 }
9485 }
9486 if (ANDSI (FLD (f_reg_list), SLLSI (1, 2))) {
9487 {
9488   {
9489     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9490     current_cpu->hardware.h_gr[((UINT) 2)] = opval;
9491     if (current_cpu->trace_result_p)
9492       current_cpu->trace_stream << "gr-2" << '[' << ((UINT) 2) << ']' << ":=0x" << hex << opval << dec << "  ";
9493   }
9494   tmp_addr = ADDSI (tmp_addr, 4);
9495 }
9496 }
9497 if (ANDSI (FLD (f_reg_list), SLLSI (1, 3))) {
9498 {
9499   {
9500     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9501     current_cpu->hardware.h_gr[((UINT) 3)] = opval;
9502     if (current_cpu->trace_result_p)
9503       current_cpu->trace_stream << "gr-3" << '[' << ((UINT) 3) << ']' << ":=0x" << hex << opval << dec << "  ";
9504   }
9505   tmp_addr = ADDSI (tmp_addr, 4);
9506 }
9507 }
9508 if (ANDSI (FLD (f_reg_list), SLLSI (1, 4))) {
9509 {
9510   {
9511     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9512     current_cpu->hardware.h_gr[((UINT) 4)] = opval;
9513     if (current_cpu->trace_result_p)
9514       current_cpu->trace_stream << "gr-4" << '[' << ((UINT) 4) << ']' << ":=0x" << hex << opval << dec << "  ";
9515   }
9516   tmp_addr = ADDSI (tmp_addr, 4);
9517 }
9518 }
9519 if (ANDSI (FLD (f_reg_list), SLLSI (1, 5))) {
9520 {
9521   {
9522     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9523     current_cpu->hardware.h_gr[((UINT) 5)] = opval;
9524     if (current_cpu->trace_result_p)
9525       current_cpu->trace_stream << "gr-5" << '[' << ((UINT) 5) << ']' << ":=0x" << hex << opval << dec << "  ";
9526   }
9527   tmp_addr = ADDSI (tmp_addr, 4);
9528 }
9529 }
9530 if (ANDSI (FLD (f_reg_list), SLLSI (1, 6))) {
9531 {
9532   {
9533     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9534     current_cpu->hardware.h_gr[((UINT) 6)] = opval;
9535     if (current_cpu->trace_result_p)
9536       current_cpu->trace_stream << "gr-6" << '[' << ((UINT) 6) << ']' << ":=0x" << hex << opval << dec << "  ";
9537   }
9538   tmp_addr = ADDSI (tmp_addr, 4);
9539 }
9540 }
9541 if (ANDSI (FLD (f_reg_list), SLLSI (1, 7))) {
9542 {
9543   {
9544     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9545     current_cpu->hardware.h_gr[((UINT) 7)] = opval;
9546     if (current_cpu->trace_result_p)
9547       current_cpu->trace_stream << "gr-7" << '[' << ((UINT) 7) << ']' << ":=0x" << hex << opval << dec << "  ";
9548   }
9549   tmp_addr = ADDSI (tmp_addr, 4);
9550 }
9551 }
9552 if (ANDSI (FLD (f_reg_list), SLLSI (1, 8))) {
9553 {
9554   {
9555     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9556     current_cpu->hardware.h_gr[((UINT) 8)] = opval;
9557     if (current_cpu->trace_result_p)
9558       current_cpu->trace_stream << "gr-8" << '[' << ((UINT) 8) << ']' << ":=0x" << hex << opval << dec << "  ";
9559   }
9560   tmp_addr = ADDSI (tmp_addr, 4);
9561 }
9562 }
9563 if (ANDSI (FLD (f_reg_list), SLLSI (1, 9))) {
9564 {
9565   {
9566     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9567     current_cpu->hardware.h_gr[((UINT) 9)] = opval;
9568     if (current_cpu->trace_result_p)
9569       current_cpu->trace_stream << "gr-9" << '[' << ((UINT) 9) << ']' << ":=0x" << hex << opval << dec << "  ";
9570   }
9571   tmp_addr = ADDSI (tmp_addr, 4);
9572 }
9573 }
9574 if (ANDSI (FLD (f_reg_list), SLLSI (1, 10))) {
9575 {
9576   {
9577     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9578     current_cpu->hardware.h_gr[((UINT) 10)] = opval;
9579     if (current_cpu->trace_result_p)
9580       current_cpu->trace_stream << "gr-10" << '[' << ((UINT) 10) << ']' << ":=0x" << hex << opval << dec << "  ";
9581   }
9582   tmp_addr = ADDSI (tmp_addr, 4);
9583 }
9584 }
9585 if (ANDSI (FLD (f_reg_list), SLLSI (1, 11))) {
9586 {
9587   {
9588     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9589     current_cpu->hardware.h_gr[((UINT) 11)] = opval;
9590     if (current_cpu->trace_result_p)
9591       current_cpu->trace_stream << "gr-11" << '[' << ((UINT) 11) << ']' << ":=0x" << hex << opval << dec << "  ";
9592   }
9593   tmp_addr = ADDSI (tmp_addr, 4);
9594 }
9595 }
9596 if (ANDSI (FLD (f_reg_list), SLLSI (1, 12))) {
9597 {
9598   {
9599     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9600     current_cpu->hardware.h_gr[((UINT) 12)] = opval;
9601     if (current_cpu->trace_result_p)
9602       current_cpu->trace_stream << "gr-12" << '[' << ((UINT) 12) << ']' << ":=0x" << hex << opval << dec << "  ";
9603   }
9604   tmp_addr = ADDSI (tmp_addr, 4);
9605 }
9606 }
9607 if (ANDSI (FLD (f_reg_list), SLLSI (1, 13))) {
9608 {
9609   {
9610     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9611     current_cpu->hardware.h_gr[((UINT) 13)] = opval;
9612     if (current_cpu->trace_result_p)
9613       current_cpu->trace_stream << "gr-13" << '[' << ((UINT) 13) << ']' << ":=0x" << hex << opval << dec << "  ";
9614   }
9615   tmp_addr = ADDSI (tmp_addr, 4);
9616 }
9617 }
9618 if (ANDSI (FLD (f_reg_list), SLLSI (1, 14))) {
9619 {
9620   {
9621     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9622     current_cpu->hardware.h_gr[((UINT) 14)] = opval;
9623     if (current_cpu->trace_result_p)
9624       current_cpu->trace_stream << "gr-14" << '[' << ((UINT) 14) << ']' << ":=0x" << hex << opval << dec << "  ";
9625   }
9626   tmp_addr = ADDSI (tmp_addr, 4);
9627 }
9628 }
9629 if (ANDSI (FLD (f_reg_list), SLLSI (1, 15))) {
9630 {
9631   {
9632     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9633     current_cpu->branch (opval, npc, status);
9634     if (current_cpu->trace_result_p)
9635       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
9636   }
9637   tmp_addr = ADDSI (tmp_addr, 4);
9638 }
9639 }
9640   {
9641     SI opval = tmp_addr;
9642     * FLD (i_rn) = opval;
9643     if (current_cpu->trace_result_p)
9644       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
9645   }
9646 }
9647
9648   current_cpu->done_cti_insn (npc, status);
9649   return status;
9650 #undef FLD
9651 }
9652
9653 // ********** ldmdb: ldm$cond ..
9654
9655 sem_status
9656 arm_sem_ldmdb (arm7f_cpu* current_cpu, arm_scache* sem)
9657 {
9658 #define FLD(f) abuf->fields.sfmt_ldmda.f
9659   sem_status status = SEM_STATUS_NORMAL;
9660   arm_scache* abuf = sem;
9661   PCADDR pc = abuf->addr;
9662   PCADDR npc = pc + 4;
9663
9664 {
9665   SI tmp_addr;
9666   tmp_addr = * FLD (i_rn);
9667 if (ANDSI (FLD (f_reg_list), SLLSI (1, 15))) {
9668 {
9669   tmp_addr = SUBSI (tmp_addr, 4);
9670   {
9671     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9672     current_cpu->branch (opval, npc, status);
9673     if (current_cpu->trace_result_p)
9674       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
9675   }
9676 }
9677 }
9678 if (ANDSI (FLD (f_reg_list), SLLSI (1, 14))) {
9679 {
9680   tmp_addr = SUBSI (tmp_addr, 4);
9681   {
9682     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9683     current_cpu->hardware.h_gr[((UINT) 14)] = opval;
9684     if (current_cpu->trace_result_p)
9685       current_cpu->trace_stream << "gr-14" << '[' << ((UINT) 14) << ']' << ":=0x" << hex << opval << dec << "  ";
9686   }
9687 }
9688 }
9689 if (ANDSI (FLD (f_reg_list), SLLSI (1, 13))) {
9690 {
9691   tmp_addr = SUBSI (tmp_addr, 4);
9692   {
9693     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9694     current_cpu->hardware.h_gr[((UINT) 13)] = opval;
9695     if (current_cpu->trace_result_p)
9696       current_cpu->trace_stream << "gr-13" << '[' << ((UINT) 13) << ']' << ":=0x" << hex << opval << dec << "  ";
9697   }
9698 }
9699 }
9700 if (ANDSI (FLD (f_reg_list), SLLSI (1, 12))) {
9701 {
9702   tmp_addr = SUBSI (tmp_addr, 4);
9703   {
9704     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9705     current_cpu->hardware.h_gr[((UINT) 12)] = opval;
9706     if (current_cpu->trace_result_p)
9707       current_cpu->trace_stream << "gr-12" << '[' << ((UINT) 12) << ']' << ":=0x" << hex << opval << dec << "  ";
9708   }
9709 }
9710 }
9711 if (ANDSI (FLD (f_reg_list), SLLSI (1, 11))) {
9712 {
9713   tmp_addr = SUBSI (tmp_addr, 4);
9714   {
9715     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9716     current_cpu->hardware.h_gr[((UINT) 11)] = opval;
9717     if (current_cpu->trace_result_p)
9718       current_cpu->trace_stream << "gr-11" << '[' << ((UINT) 11) << ']' << ":=0x" << hex << opval << dec << "  ";
9719   }
9720 }
9721 }
9722 if (ANDSI (FLD (f_reg_list), SLLSI (1, 10))) {
9723 {
9724   tmp_addr = SUBSI (tmp_addr, 4);
9725   {
9726     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9727     current_cpu->hardware.h_gr[((UINT) 10)] = opval;
9728     if (current_cpu->trace_result_p)
9729       current_cpu->trace_stream << "gr-10" << '[' << ((UINT) 10) << ']' << ":=0x" << hex << opval << dec << "  ";
9730   }
9731 }
9732 }
9733 if (ANDSI (FLD (f_reg_list), SLLSI (1, 9))) {
9734 {
9735   tmp_addr = SUBSI (tmp_addr, 4);
9736   {
9737     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9738     current_cpu->hardware.h_gr[((UINT) 9)] = opval;
9739     if (current_cpu->trace_result_p)
9740       current_cpu->trace_stream << "gr-9" << '[' << ((UINT) 9) << ']' << ":=0x" << hex << opval << dec << "  ";
9741   }
9742 }
9743 }
9744 if (ANDSI (FLD (f_reg_list), SLLSI (1, 8))) {
9745 {
9746   tmp_addr = SUBSI (tmp_addr, 4);
9747   {
9748     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9749     current_cpu->hardware.h_gr[((UINT) 8)] = opval;
9750     if (current_cpu->trace_result_p)
9751       current_cpu->trace_stream << "gr-8" << '[' << ((UINT) 8) << ']' << ":=0x" << hex << opval << dec << "  ";
9752   }
9753 }
9754 }
9755 if (ANDSI (FLD (f_reg_list), SLLSI (1, 7))) {
9756 {
9757   tmp_addr = SUBSI (tmp_addr, 4);
9758   {
9759     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9760     current_cpu->hardware.h_gr[((UINT) 7)] = opval;
9761     if (current_cpu->trace_result_p)
9762       current_cpu->trace_stream << "gr-7" << '[' << ((UINT) 7) << ']' << ":=0x" << hex << opval << dec << "  ";
9763   }
9764 }
9765 }
9766 if (ANDSI (FLD (f_reg_list), SLLSI (1, 6))) {
9767 {
9768   tmp_addr = SUBSI (tmp_addr, 4);
9769   {
9770     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9771     current_cpu->hardware.h_gr[((UINT) 6)] = opval;
9772     if (current_cpu->trace_result_p)
9773       current_cpu->trace_stream << "gr-6" << '[' << ((UINT) 6) << ']' << ":=0x" << hex << opval << dec << "  ";
9774   }
9775 }
9776 }
9777 if (ANDSI (FLD (f_reg_list), SLLSI (1, 5))) {
9778 {
9779   tmp_addr = SUBSI (tmp_addr, 4);
9780   {
9781     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9782     current_cpu->hardware.h_gr[((UINT) 5)] = opval;
9783     if (current_cpu->trace_result_p)
9784       current_cpu->trace_stream << "gr-5" << '[' << ((UINT) 5) << ']' << ":=0x" << hex << opval << dec << "  ";
9785   }
9786 }
9787 }
9788 if (ANDSI (FLD (f_reg_list), SLLSI (1, 4))) {
9789 {
9790   tmp_addr = SUBSI (tmp_addr, 4);
9791   {
9792     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9793     current_cpu->hardware.h_gr[((UINT) 4)] = opval;
9794     if (current_cpu->trace_result_p)
9795       current_cpu->trace_stream << "gr-4" << '[' << ((UINT) 4) << ']' << ":=0x" << hex << opval << dec << "  ";
9796   }
9797 }
9798 }
9799 if (ANDSI (FLD (f_reg_list), SLLSI (1, 3))) {
9800 {
9801   tmp_addr = SUBSI (tmp_addr, 4);
9802   {
9803     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9804     current_cpu->hardware.h_gr[((UINT) 3)] = opval;
9805     if (current_cpu->trace_result_p)
9806       current_cpu->trace_stream << "gr-3" << '[' << ((UINT) 3) << ']' << ":=0x" << hex << opval << dec << "  ";
9807   }
9808 }
9809 }
9810 if (ANDSI (FLD (f_reg_list), SLLSI (1, 2))) {
9811 {
9812   tmp_addr = SUBSI (tmp_addr, 4);
9813   {
9814     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9815     current_cpu->hardware.h_gr[((UINT) 2)] = opval;
9816     if (current_cpu->trace_result_p)
9817       current_cpu->trace_stream << "gr-2" << '[' << ((UINT) 2) << ']' << ":=0x" << hex << opval << dec << "  ";
9818   }
9819 }
9820 }
9821 if (ANDSI (FLD (f_reg_list), SLLSI (1, 1))) {
9822 {
9823   tmp_addr = SUBSI (tmp_addr, 4);
9824   {
9825     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9826     current_cpu->hardware.h_gr[((UINT) 1)] = opval;
9827     if (current_cpu->trace_result_p)
9828       current_cpu->trace_stream << "gr-1" << '[' << ((UINT) 1) << ']' << ":=0x" << hex << opval << dec << "  ";
9829   }
9830 }
9831 }
9832 if (ANDSI (FLD (f_reg_list), SLLSI (1, 0))) {
9833 {
9834   tmp_addr = SUBSI (tmp_addr, 4);
9835   {
9836     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9837     current_cpu->hardware.h_gr[((UINT) 0)] = opval;
9838     if (current_cpu->trace_result_p)
9839       current_cpu->trace_stream << "gr-0" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << "  ";
9840   }
9841 }
9842 }
9843 }
9844
9845   current_cpu->done_cti_insn (npc, status);
9846   return status;
9847 #undef FLD
9848 }
9849
9850 // ********** ldmdb-wb: FIXME
9851
9852 sem_status
9853 arm_sem_ldmdb_wb (arm7f_cpu* current_cpu, arm_scache* sem)
9854 {
9855 #define FLD(f) abuf->fields.sfmt_ldmda.f
9856   sem_status status = SEM_STATUS_NORMAL;
9857   arm_scache* abuf = sem;
9858   PCADDR pc = abuf->addr;
9859   PCADDR npc = pc + 4;
9860
9861 {
9862   SI tmp_addr;
9863   tmp_addr = * FLD (i_rn);
9864 if (ANDSI (FLD (f_reg_list), SLLSI (1, 15))) {
9865 {
9866   tmp_addr = SUBSI (tmp_addr, 4);
9867   {
9868     USI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9869     current_cpu->branch (opval, npc, status);
9870     if (current_cpu->trace_result_p)
9871       current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << "  ";
9872   }
9873 }
9874 }
9875 if (ANDSI (FLD (f_reg_list), SLLSI (1, 14))) {
9876 {
9877   tmp_addr = SUBSI (tmp_addr, 4);
9878   {
9879     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9880     current_cpu->hardware.h_gr[((UINT) 14)] = opval;
9881     if (current_cpu->trace_result_p)
9882       current_cpu->trace_stream << "gr-14" << '[' << ((UINT) 14) << ']' << ":=0x" << hex << opval << dec << "  ";
9883   }
9884 }
9885 }
9886 if (ANDSI (FLD (f_reg_list), SLLSI (1, 13))) {
9887 {
9888   tmp_addr = SUBSI (tmp_addr, 4);
9889   {
9890     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9891     current_cpu->hardware.h_gr[((UINT) 13)] = opval;
9892     if (current_cpu->trace_result_p)
9893       current_cpu->trace_stream << "gr-13" << '[' << ((UINT) 13) << ']' << ":=0x" << hex << opval << dec << "  ";
9894   }
9895 }
9896 }
9897 if (ANDSI (FLD (f_reg_list), SLLSI (1, 12))) {
9898 {
9899   tmp_addr = SUBSI (tmp_addr, 4);
9900   {
9901     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9902     current_cpu->hardware.h_gr[((UINT) 12)] = opval;
9903     if (current_cpu->trace_result_p)
9904       current_cpu->trace_stream << "gr-12" << '[' << ((UINT) 12) << ']' << ":=0x" << hex << opval << dec << "  ";
9905   }
9906 }
9907 }
9908 if (ANDSI (FLD (f_reg_list), SLLSI (1, 11))) {
9909 {
9910   tmp_addr = SUBSI (tmp_addr, 4);
9911   {
9912     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9913     current_cpu->hardware.h_gr[((UINT) 11)] = opval;
9914     if (current_cpu->trace_result_p)
9915       current_cpu->trace_stream << "gr-11" << '[' << ((UINT) 11) << ']' << ":=0x" << hex << opval << dec << "  ";
9916   }
9917 }
9918 }
9919 if (ANDSI (FLD (f_reg_list), SLLSI (1, 10))) {
9920 {
9921   tmp_addr = SUBSI (tmp_addr, 4);
9922   {
9923     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9924     current_cpu->hardware.h_gr[((UINT) 10)] = opval;
9925     if (current_cpu->trace_result_p)
9926       current_cpu->trace_stream << "gr-10" << '[' << ((UINT) 10) << ']' << ":=0x" << hex << opval << dec << "  ";
9927   }
9928 }
9929 }
9930 if (ANDSI (FLD (f_reg_list), SLLSI (1, 9))) {
9931 {
9932   tmp_addr = SUBSI (tmp_addr, 4);
9933   {
9934     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9935     current_cpu->hardware.h_gr[((UINT) 9)] = opval;
9936     if (current_cpu->trace_result_p)
9937       current_cpu->trace_stream << "gr-9" << '[' << ((UINT) 9) << ']' << ":=0x" << hex << opval << dec << "  ";
9938   }
9939 }
9940 }
9941 if (ANDSI (FLD (f_reg_list), SLLSI (1, 8))) {
9942 {
9943   tmp_addr = SUBSI (tmp_addr, 4);
9944   {
9945     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9946     current_cpu->hardware.h_gr[((UINT) 8)] = opval;
9947     if (current_cpu->trace_result_p)
9948       current_cpu->trace_stream << "gr-8" << '[' << ((UINT) 8) << ']' << ":=0x" << hex << opval << dec << "  ";
9949   }
9950 }
9951 }
9952 if (ANDSI (FLD (f_reg_list), SLLSI (1, 7))) {
9953 {
9954   tmp_addr = SUBSI (tmp_addr, 4);
9955   {
9956     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9957     current_cpu->hardware.h_gr[((UINT) 7)] = opval;
9958     if (current_cpu->trace_result_p)
9959       current_cpu->trace_stream << "gr-7" << '[' << ((UINT) 7) << ']' << ":=0x" << hex << opval << dec << "  ";
9960   }
9961 }
9962 }
9963 if (ANDSI (FLD (f_reg_list), SLLSI (1, 6))) {
9964 {
9965   tmp_addr = SUBSI (tmp_addr, 4);
9966   {
9967     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9968     current_cpu->hardware.h_gr[((UINT) 6)] = opval;
9969     if (current_cpu->trace_result_p)
9970       current_cpu->trace_stream << "gr-6" << '[' << ((UINT) 6) << ']' << ":=0x" << hex << opval << dec << "  ";
9971   }
9972 }
9973 }
9974 if (ANDSI (FLD (f_reg_list), SLLSI (1, 5))) {
9975 {
9976   tmp_addr = SUBSI (tmp_addr, 4);
9977   {
9978     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9979     current_cpu->hardware.h_gr[((UINT) 5)] = opval;
9980     if (current_cpu->trace_result_p)
9981       current_cpu->trace_stream << "gr-5" << '[' << ((UINT) 5) << ']' << ":=0x" << hex << opval << dec << "  ";
9982   }
9983 }
9984 }
9985 if (ANDSI (FLD (f_reg_list), SLLSI (1, 4))) {
9986 {
9987   tmp_addr = SUBSI (tmp_addr, 4);
9988   {
9989     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
9990     current_cpu->hardware.h_gr[((UINT) 4)] = opval;
9991     if (current_cpu->trace_result_p)
9992       current_cpu->trace_stream << "gr-4" << '[' << ((UINT) 4) << ']' << ":=0x" << hex << opval << dec << "  ";
9993   }
9994 }
9995 }
9996 if (ANDSI (FLD (f_reg_list), SLLSI (1, 3))) {
9997 {
9998   tmp_addr = SUBSI (tmp_addr, 4);
9999   {
10000     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
10001     current_cpu->hardware.h_gr[((UINT) 3)] = opval;
10002     if (current_cpu->trace_result_p)
10003       current_cpu->trace_stream << "gr-3" << '[' << ((UINT) 3) << ']' << ":=0x" << hex << opval << dec << "  ";
10004   }
10005 }
10006 }
10007 if (ANDSI (FLD (f_reg_list), SLLSI (1, 2))) {
10008 {
10009   tmp_addr = SUBSI (tmp_addr, 4);
10010   {
10011     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
10012     current_cpu->hardware.h_gr[((UINT) 2)] = opval;
10013     if (current_cpu->trace_result_p)
10014       current_cpu->trace_stream << "gr-2" << '[' << ((UINT) 2) << ']' << ":=0x" << hex << opval << dec << "  ";
10015   }
10016 }
10017 }
10018 if (ANDSI (FLD (f_reg_list), SLLSI (1, 1))) {
10019 {
10020   tmp_addr = SUBSI (tmp_addr, 4);
10021   {
10022     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
10023     current_cpu->hardware.h_gr[((UINT) 1)] = opval;
10024     if (current_cpu->trace_result_p)
10025       current_cpu->trace_stream << "gr-1" << '[' << ((UINT) 1) << ']' << ":=0x" << hex << opval << dec << "  ";
10026   }
10027 }
10028 }
10029 if (ANDSI (FLD (f_reg_list), SLLSI (1, 0))) {
10030 {
10031   tmp_addr = SUBSI (tmp_addr, 4);
10032   {
10033     SI opval = current_cpu->GETMEMSI (pc, tmp_addr);
10034     current_cpu->hardware.h_gr[((UINT) 0)] = opval;
10035     if (current_cpu->trace_result_p)
10036       current_cpu->trace_stream << "gr-0" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << "  ";
10037   }
10038 }
10039 }
10040   {
10041     SI opval = tmp_addr;
10042     * FLD (i_rn) = opval;
10043     if (current_cpu->trace_result_p)
10044       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
10045   }
10046 }
10047
10048   current_cpu->done_cti_insn (npc, status);
10049   return status;
10050 #undef FLD
10051 }
10052
10053 // ********** stmdb: FIXME
10054
10055 sem_status
10056 arm_sem_stmdb (arm7f_cpu* current_cpu, arm_scache* sem)
10057 {
10058 #define FLD(f) abuf->fields.sfmt_ldmda.f
10059   sem_status status = SEM_STATUS_NORMAL;
10060   arm_scache* abuf = sem;
10061   PCADDR pc = abuf->addr;
10062   PCADDR npc = pc + 4;
10063
10064 {
10065   SI tmp_addr;
10066   tmp_addr = * FLD (i_rn);
10067 if (ANDSI (FLD (f_reg_list), SLLSI (1, 15))) {
10068 {
10069   tmp_addr = SUBSI (tmp_addr, 4);
10070   {
10071     SI opval = ADDSI (current_cpu->hardware.h_gr[((UINT) 15)], 4);
10072     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10073     if (current_cpu->trace_result_p)
10074       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10075   }
10076 }
10077 }
10078 if (ANDSI (FLD (f_reg_list), SLLSI (1, 14))) {
10079 {
10080   tmp_addr = SUBSI (tmp_addr, 4);
10081   {
10082     SI opval = current_cpu->hardware.h_gr[((UINT) 14)];
10083     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10084     if (current_cpu->trace_result_p)
10085       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10086   }
10087 }
10088 }
10089 if (ANDSI (FLD (f_reg_list), SLLSI (1, 13))) {
10090 {
10091   tmp_addr = SUBSI (tmp_addr, 4);
10092   {
10093     SI opval = current_cpu->hardware.h_gr[((UINT) 13)];
10094     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10095     if (current_cpu->trace_result_p)
10096       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10097   }
10098 }
10099 }
10100 if (ANDSI (FLD (f_reg_list), SLLSI (1, 12))) {
10101 {
10102   tmp_addr = SUBSI (tmp_addr, 4);
10103   {
10104     SI opval = current_cpu->hardware.h_gr[((UINT) 12)];
10105     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10106     if (current_cpu->trace_result_p)
10107       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10108   }
10109 }
10110 }
10111 if (ANDSI (FLD (f_reg_list), SLLSI (1, 11))) {
10112 {
10113   tmp_addr = SUBSI (tmp_addr, 4);
10114   {
10115     SI opval = current_cpu->hardware.h_gr[((UINT) 11)];
10116     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10117     if (current_cpu->trace_result_p)
10118       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10119   }
10120 }
10121 }
10122 if (ANDSI (FLD (f_reg_list), SLLSI (1, 10))) {
10123 {
10124   tmp_addr = SUBSI (tmp_addr, 4);
10125   {
10126     SI opval = current_cpu->hardware.h_gr[((UINT) 10)];
10127     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10128     if (current_cpu->trace_result_p)
10129       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10130   }
10131 }
10132 }
10133 if (ANDSI (FLD (f_reg_list), SLLSI (1, 9))) {
10134 {
10135   tmp_addr = SUBSI (tmp_addr, 4);
10136   {
10137     SI opval = current_cpu->hardware.h_gr[((UINT) 9)];
10138     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10139     if (current_cpu->trace_result_p)
10140       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10141   }
10142 }
10143 }
10144 if (ANDSI (FLD (f_reg_list), SLLSI (1, 8))) {
10145 {
10146   tmp_addr = SUBSI (tmp_addr, 4);
10147   {
10148     SI opval = current_cpu->hardware.h_gr[((UINT) 8)];
10149     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10150     if (current_cpu->trace_result_p)
10151       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10152   }
10153 }
10154 }
10155 if (ANDSI (FLD (f_reg_list), SLLSI (1, 7))) {
10156 {
10157   tmp_addr = SUBSI (tmp_addr, 4);
10158   {
10159     SI opval = current_cpu->hardware.h_gr[((UINT) 7)];
10160     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10161     if (current_cpu->trace_result_p)
10162       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10163   }
10164 }
10165 }
10166 if (ANDSI (FLD (f_reg_list), SLLSI (1, 6))) {
10167 {
10168   tmp_addr = SUBSI (tmp_addr, 4);
10169   {
10170     SI opval = current_cpu->hardware.h_gr[((UINT) 6)];
10171     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10172     if (current_cpu->trace_result_p)
10173       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10174   }
10175 }
10176 }
10177 if (ANDSI (FLD (f_reg_list), SLLSI (1, 5))) {
10178 {
10179   tmp_addr = SUBSI (tmp_addr, 4);
10180   {
10181     SI opval = current_cpu->hardware.h_gr[((UINT) 5)];
10182     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10183     if (current_cpu->trace_result_p)
10184       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10185   }
10186 }
10187 }
10188 if (ANDSI (FLD (f_reg_list), SLLSI (1, 4))) {
10189 {
10190   tmp_addr = SUBSI (tmp_addr, 4);
10191   {
10192     SI opval = current_cpu->hardware.h_gr[((UINT) 4)];
10193     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10194     if (current_cpu->trace_result_p)
10195       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10196   }
10197 }
10198 }
10199 if (ANDSI (FLD (f_reg_list), SLLSI (1, 3))) {
10200 {
10201   tmp_addr = SUBSI (tmp_addr, 4);
10202   {
10203     SI opval = current_cpu->hardware.h_gr[((UINT) 3)];
10204     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10205     if (current_cpu->trace_result_p)
10206       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10207   }
10208 }
10209 }
10210 if (ANDSI (FLD (f_reg_list), SLLSI (1, 2))) {
10211 {
10212   tmp_addr = SUBSI (tmp_addr, 4);
10213   {
10214     SI opval = current_cpu->hardware.h_gr[((UINT) 2)];
10215     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10216     if (current_cpu->trace_result_p)
10217       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10218   }
10219 }
10220 }
10221 if (ANDSI (FLD (f_reg_list), SLLSI (1, 1))) {
10222 {
10223   tmp_addr = SUBSI (tmp_addr, 4);
10224   {
10225     SI opval = current_cpu->hardware.h_gr[((UINT) 1)];
10226     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10227     if (current_cpu->trace_result_p)
10228       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10229   }
10230 }
10231 }
10232 if (ANDSI (FLD (f_reg_list), SLLSI (1, 0))) {
10233 {
10234   tmp_addr = SUBSI (tmp_addr, 4);
10235   {
10236     SI opval = current_cpu->hardware.h_gr[((UINT) 0)];
10237     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10238     if (current_cpu->trace_result_p)
10239       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10240   }
10241 }
10242 }
10243 }
10244
10245   current_cpu->done_insn (npc, status);
10246   return status;
10247 #undef FLD
10248 }
10249
10250 // ********** stmdb-wb: FIXME
10251
10252 sem_status
10253 arm_sem_stmdb_wb (arm7f_cpu* current_cpu, arm_scache* sem)
10254 {
10255 #define FLD(f) abuf->fields.sfmt_ldmda.f
10256   sem_status status = SEM_STATUS_NORMAL;
10257   arm_scache* abuf = sem;
10258   PCADDR pc = abuf->addr;
10259   PCADDR npc = pc + 4;
10260
10261 {
10262   SI tmp_addr;
10263   tmp_addr = * FLD (i_rn);
10264 if (ANDSI (FLD (f_reg_list), SLLSI (1, 15))) {
10265 {
10266   tmp_addr = SUBSI (tmp_addr, 4);
10267   {
10268     SI opval = ADDSI (current_cpu->hardware.h_gr[((UINT) 15)], 4);
10269     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10270     if (current_cpu->trace_result_p)
10271       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10272   }
10273 }
10274 }
10275 if (ANDSI (FLD (f_reg_list), SLLSI (1, 14))) {
10276 {
10277   tmp_addr = SUBSI (tmp_addr, 4);
10278   {
10279     SI opval = current_cpu->hardware.h_gr[((UINT) 14)];
10280     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10281     if (current_cpu->trace_result_p)
10282       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10283   }
10284 }
10285 }
10286 if (ANDSI (FLD (f_reg_list), SLLSI (1, 13))) {
10287 {
10288   tmp_addr = SUBSI (tmp_addr, 4);
10289   {
10290     SI opval = current_cpu->hardware.h_gr[((UINT) 13)];
10291     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10292     if (current_cpu->trace_result_p)
10293       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10294   }
10295 }
10296 }
10297 if (ANDSI (FLD (f_reg_list), SLLSI (1, 12))) {
10298 {
10299   tmp_addr = SUBSI (tmp_addr, 4);
10300   {
10301     SI opval = current_cpu->hardware.h_gr[((UINT) 12)];
10302     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10303     if (current_cpu->trace_result_p)
10304       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10305   }
10306 }
10307 }
10308 if (ANDSI (FLD (f_reg_list), SLLSI (1, 11))) {
10309 {
10310   tmp_addr = SUBSI (tmp_addr, 4);
10311   {
10312     SI opval = current_cpu->hardware.h_gr[((UINT) 11)];
10313     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10314     if (current_cpu->trace_result_p)
10315       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10316   }
10317 }
10318 }
10319 if (ANDSI (FLD (f_reg_list), SLLSI (1, 10))) {
10320 {
10321   tmp_addr = SUBSI (tmp_addr, 4);
10322   {
10323     SI opval = current_cpu->hardware.h_gr[((UINT) 10)];
10324     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10325     if (current_cpu->trace_result_p)
10326       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10327   }
10328 }
10329 }
10330 if (ANDSI (FLD (f_reg_list), SLLSI (1, 9))) {
10331 {
10332   tmp_addr = SUBSI (tmp_addr, 4);
10333   {
10334     SI opval = current_cpu->hardware.h_gr[((UINT) 9)];
10335     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10336     if (current_cpu->trace_result_p)
10337       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10338   }
10339 }
10340 }
10341 if (ANDSI (FLD (f_reg_list), SLLSI (1, 8))) {
10342 {
10343   tmp_addr = SUBSI (tmp_addr, 4);
10344   {
10345     SI opval = current_cpu->hardware.h_gr[((UINT) 8)];
10346     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10347     if (current_cpu->trace_result_p)
10348       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10349   }
10350 }
10351 }
10352 if (ANDSI (FLD (f_reg_list), SLLSI (1, 7))) {
10353 {
10354   tmp_addr = SUBSI (tmp_addr, 4);
10355   {
10356     SI opval = current_cpu->hardware.h_gr[((UINT) 7)];
10357     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10358     if (current_cpu->trace_result_p)
10359       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10360   }
10361 }
10362 }
10363 if (ANDSI (FLD (f_reg_list), SLLSI (1, 6))) {
10364 {
10365   tmp_addr = SUBSI (tmp_addr, 4);
10366   {
10367     SI opval = current_cpu->hardware.h_gr[((UINT) 6)];
10368     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10369     if (current_cpu->trace_result_p)
10370       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10371   }
10372 }
10373 }
10374 if (ANDSI (FLD (f_reg_list), SLLSI (1, 5))) {
10375 {
10376   tmp_addr = SUBSI (tmp_addr, 4);
10377   {
10378     SI opval = current_cpu->hardware.h_gr[((UINT) 5)];
10379     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10380     if (current_cpu->trace_result_p)
10381       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10382   }
10383 }
10384 }
10385 if (ANDSI (FLD (f_reg_list), SLLSI (1, 4))) {
10386 {
10387   tmp_addr = SUBSI (tmp_addr, 4);
10388   {
10389     SI opval = current_cpu->hardware.h_gr[((UINT) 4)];
10390     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10391     if (current_cpu->trace_result_p)
10392       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10393   }
10394 }
10395 }
10396 if (ANDSI (FLD (f_reg_list), SLLSI (1, 3))) {
10397 {
10398   tmp_addr = SUBSI (tmp_addr, 4);
10399   {
10400     SI opval = current_cpu->hardware.h_gr[((UINT) 3)];
10401     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10402     if (current_cpu->trace_result_p)
10403       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10404   }
10405 }
10406 }
10407 if (ANDSI (FLD (f_reg_list), SLLSI (1, 2))) {
10408 {
10409   tmp_addr = SUBSI (tmp_addr, 4);
10410   {
10411     SI opval = current_cpu->hardware.h_gr[((UINT) 2)];
10412     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10413     if (current_cpu->trace_result_p)
10414       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10415   }
10416 }
10417 }
10418 if (ANDSI (FLD (f_reg_list), SLLSI (1, 1))) {
10419 {
10420   tmp_addr = SUBSI (tmp_addr, 4);
10421   {
10422     SI opval = current_cpu->hardware.h_gr[((UINT) 1)];
10423     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10424     if (current_cpu->trace_result_p)
10425       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10426   }
10427 }
10428 }
10429 if (ANDSI (FLD (f_reg_list), SLLSI (1, 0))) {
10430 {
10431   tmp_addr = SUBSI (tmp_addr, 4);
10432   {
10433     SI opval = current_cpu->hardware.h_gr[((UINT) 0)];
10434     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10435     if (current_cpu->trace_result_p)
10436       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10437   }
10438 }
10439 }
10440   {
10441     SI opval = tmp_addr;
10442     * FLD (i_rn) = opval;
10443     if (current_cpu->trace_result_p)
10444       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
10445   }
10446 }
10447
10448   current_cpu->done_insn (npc, status);
10449   return status;
10450 #undef FLD
10451 }
10452
10453 // ********** stmib: FIXME
10454
10455 sem_status
10456 arm_sem_stmib (arm7f_cpu* current_cpu, arm_scache* sem)
10457 {
10458 #define FLD(f) abuf->fields.sfmt_ldmda.f
10459   sem_status status = SEM_STATUS_NORMAL;
10460   arm_scache* abuf = sem;
10461   PCADDR pc = abuf->addr;
10462   PCADDR npc = pc + 4;
10463
10464 {
10465   SI tmp_addr;
10466   tmp_addr = * FLD (i_rn);
10467 if (ANDSI (FLD (f_reg_list), SLLSI (1, 0))) {
10468 {
10469   tmp_addr = ADDSI (tmp_addr, 4);
10470   {
10471     SI opval = current_cpu->hardware.h_gr[((UINT) 0)];
10472     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10473     if (current_cpu->trace_result_p)
10474       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10475   }
10476 }
10477 }
10478 if (ANDSI (FLD (f_reg_list), SLLSI (1, 1))) {
10479 {
10480   tmp_addr = ADDSI (tmp_addr, 4);
10481   {
10482     SI opval = current_cpu->hardware.h_gr[((UINT) 1)];
10483     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10484     if (current_cpu->trace_result_p)
10485       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10486   }
10487 }
10488 }
10489 if (ANDSI (FLD (f_reg_list), SLLSI (1, 2))) {
10490 {
10491   tmp_addr = ADDSI (tmp_addr, 4);
10492   {
10493     SI opval = current_cpu->hardware.h_gr[((UINT) 2)];
10494     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10495     if (current_cpu->trace_result_p)
10496       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10497   }
10498 }
10499 }
10500 if (ANDSI (FLD (f_reg_list), SLLSI (1, 3))) {
10501 {
10502   tmp_addr = ADDSI (tmp_addr, 4);
10503   {
10504     SI opval = current_cpu->hardware.h_gr[((UINT) 3)];
10505     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10506     if (current_cpu->trace_result_p)
10507       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10508   }
10509 }
10510 }
10511 if (ANDSI (FLD (f_reg_list), SLLSI (1, 4))) {
10512 {
10513   tmp_addr = ADDSI (tmp_addr, 4);
10514   {
10515     SI opval = current_cpu->hardware.h_gr[((UINT) 4)];
10516     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10517     if (current_cpu->trace_result_p)
10518       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10519   }
10520 }
10521 }
10522 if (ANDSI (FLD (f_reg_list), SLLSI (1, 5))) {
10523 {
10524   tmp_addr = ADDSI (tmp_addr, 4);
10525   {
10526     SI opval = current_cpu->hardware.h_gr[((UINT) 5)];
10527     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10528     if (current_cpu->trace_result_p)
10529       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10530   }
10531 }
10532 }
10533 if (ANDSI (FLD (f_reg_list), SLLSI (1, 6))) {
10534 {
10535   tmp_addr = ADDSI (tmp_addr, 4);
10536   {
10537     SI opval = current_cpu->hardware.h_gr[((UINT) 6)];
10538     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10539     if (current_cpu->trace_result_p)
10540       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10541   }
10542 }
10543 }
10544 if (ANDSI (FLD (f_reg_list), SLLSI (1, 7))) {
10545 {
10546   tmp_addr = ADDSI (tmp_addr, 4);
10547   {
10548     SI opval = current_cpu->hardware.h_gr[((UINT) 7)];
10549     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10550     if (current_cpu->trace_result_p)
10551       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10552   }
10553 }
10554 }
10555 if (ANDSI (FLD (f_reg_list), SLLSI (1, 8))) {
10556 {
10557   tmp_addr = ADDSI (tmp_addr, 4);
10558   {
10559     SI opval = current_cpu->hardware.h_gr[((UINT) 8)];
10560     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10561     if (current_cpu->trace_result_p)
10562       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10563   }
10564 }
10565 }
10566 if (ANDSI (FLD (f_reg_list), SLLSI (1, 9))) {
10567 {
10568   tmp_addr = ADDSI (tmp_addr, 4);
10569   {
10570     SI opval = current_cpu->hardware.h_gr[((UINT) 9)];
10571     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10572     if (current_cpu->trace_result_p)
10573       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10574   }
10575 }
10576 }
10577 if (ANDSI (FLD (f_reg_list), SLLSI (1, 10))) {
10578 {
10579   tmp_addr = ADDSI (tmp_addr, 4);
10580   {
10581     SI opval = current_cpu->hardware.h_gr[((UINT) 10)];
10582     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10583     if (current_cpu->trace_result_p)
10584       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10585   }
10586 }
10587 }
10588 if (ANDSI (FLD (f_reg_list), SLLSI (1, 11))) {
10589 {
10590   tmp_addr = ADDSI (tmp_addr, 4);
10591   {
10592     SI opval = current_cpu->hardware.h_gr[((UINT) 11)];
10593     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10594     if (current_cpu->trace_result_p)
10595       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10596   }
10597 }
10598 }
10599 if (ANDSI (FLD (f_reg_list), SLLSI (1, 12))) {
10600 {
10601   tmp_addr = ADDSI (tmp_addr, 4);
10602   {
10603     SI opval = current_cpu->hardware.h_gr[((UINT) 12)];
10604     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10605     if (current_cpu->trace_result_p)
10606       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10607   }
10608 }
10609 }
10610 if (ANDSI (FLD (f_reg_list), SLLSI (1, 13))) {
10611 {
10612   tmp_addr = ADDSI (tmp_addr, 4);
10613   {
10614     SI opval = current_cpu->hardware.h_gr[((UINT) 13)];
10615     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10616     if (current_cpu->trace_result_p)
10617       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10618   }
10619 }
10620 }
10621 if (ANDSI (FLD (f_reg_list), SLLSI (1, 14))) {
10622 {
10623   tmp_addr = ADDSI (tmp_addr, 4);
10624   {
10625     SI opval = current_cpu->hardware.h_gr[((UINT) 14)];
10626     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10627     if (current_cpu->trace_result_p)
10628       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10629   }
10630 }
10631 }
10632 if (ANDSI (FLD (f_reg_list), SLLSI (1, 15))) {
10633 {
10634   tmp_addr = ADDSI (tmp_addr, 4);
10635   {
10636     SI opval = ADDSI (current_cpu->hardware.h_gr[((UINT) 15)], 4);
10637     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10638     if (current_cpu->trace_result_p)
10639       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10640   }
10641 }
10642 }
10643 }
10644
10645   current_cpu->done_insn (npc, status);
10646   return status;
10647 #undef FLD
10648 }
10649
10650 // ********** stmib-wb: FIXME
10651
10652 sem_status
10653 arm_sem_stmib_wb (arm7f_cpu* current_cpu, arm_scache* sem)
10654 {
10655 #define FLD(f) abuf->fields.sfmt_ldmda.f
10656   sem_status status = SEM_STATUS_NORMAL;
10657   arm_scache* abuf = sem;
10658   PCADDR pc = abuf->addr;
10659   PCADDR npc = pc + 4;
10660
10661 {
10662   SI tmp_addr;
10663   tmp_addr = * FLD (i_rn);
10664 if (ANDSI (FLD (f_reg_list), SLLSI (1, 0))) {
10665 {
10666   tmp_addr = ADDSI (tmp_addr, 4);
10667   {
10668     SI opval = current_cpu->hardware.h_gr[((UINT) 0)];
10669     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10670     if (current_cpu->trace_result_p)
10671       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10672   }
10673 }
10674 }
10675 if (ANDSI (FLD (f_reg_list), SLLSI (1, 1))) {
10676 {
10677   tmp_addr = ADDSI (tmp_addr, 4);
10678   {
10679     SI opval = current_cpu->hardware.h_gr[((UINT) 1)];
10680     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10681     if (current_cpu->trace_result_p)
10682       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10683   }
10684 }
10685 }
10686 if (ANDSI (FLD (f_reg_list), SLLSI (1, 2))) {
10687 {
10688   tmp_addr = ADDSI (tmp_addr, 4);
10689   {
10690     SI opval = current_cpu->hardware.h_gr[((UINT) 2)];
10691     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10692     if (current_cpu->trace_result_p)
10693       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10694   }
10695 }
10696 }
10697 if (ANDSI (FLD (f_reg_list), SLLSI (1, 3))) {
10698 {
10699   tmp_addr = ADDSI (tmp_addr, 4);
10700   {
10701     SI opval = current_cpu->hardware.h_gr[((UINT) 3)];
10702     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10703     if (current_cpu->trace_result_p)
10704       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10705   }
10706 }
10707 }
10708 if (ANDSI (FLD (f_reg_list), SLLSI (1, 4))) {
10709 {
10710   tmp_addr = ADDSI (tmp_addr, 4);
10711   {
10712     SI opval = current_cpu->hardware.h_gr[((UINT) 4)];
10713     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10714     if (current_cpu->trace_result_p)
10715       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10716   }
10717 }
10718 }
10719 if (ANDSI (FLD (f_reg_list), SLLSI (1, 5))) {
10720 {
10721   tmp_addr = ADDSI (tmp_addr, 4);
10722   {
10723     SI opval = current_cpu->hardware.h_gr[((UINT) 5)];
10724     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10725     if (current_cpu->trace_result_p)
10726       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10727   }
10728 }
10729 }
10730 if (ANDSI (FLD (f_reg_list), SLLSI (1, 6))) {
10731 {
10732   tmp_addr = ADDSI (tmp_addr, 4);
10733   {
10734     SI opval = current_cpu->hardware.h_gr[((UINT) 6)];
10735     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10736     if (current_cpu->trace_result_p)
10737       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10738   }
10739 }
10740 }
10741 if (ANDSI (FLD (f_reg_list), SLLSI (1, 7))) {
10742 {
10743   tmp_addr = ADDSI (tmp_addr, 4);
10744   {
10745     SI opval = current_cpu->hardware.h_gr[((UINT) 7)];
10746     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10747     if (current_cpu->trace_result_p)
10748       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10749   }
10750 }
10751 }
10752 if (ANDSI (FLD (f_reg_list), SLLSI (1, 8))) {
10753 {
10754   tmp_addr = ADDSI (tmp_addr, 4);
10755   {
10756     SI opval = current_cpu->hardware.h_gr[((UINT) 8)];
10757     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10758     if (current_cpu->trace_result_p)
10759       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10760   }
10761 }
10762 }
10763 if (ANDSI (FLD (f_reg_list), SLLSI (1, 9))) {
10764 {
10765   tmp_addr = ADDSI (tmp_addr, 4);
10766   {
10767     SI opval = current_cpu->hardware.h_gr[((UINT) 9)];
10768     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10769     if (current_cpu->trace_result_p)
10770       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10771   }
10772 }
10773 }
10774 if (ANDSI (FLD (f_reg_list), SLLSI (1, 10))) {
10775 {
10776   tmp_addr = ADDSI (tmp_addr, 4);
10777   {
10778     SI opval = current_cpu->hardware.h_gr[((UINT) 10)];
10779     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10780     if (current_cpu->trace_result_p)
10781       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10782   }
10783 }
10784 }
10785 if (ANDSI (FLD (f_reg_list), SLLSI (1, 11))) {
10786 {
10787   tmp_addr = ADDSI (tmp_addr, 4);
10788   {
10789     SI opval = current_cpu->hardware.h_gr[((UINT) 11)];
10790     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10791     if (current_cpu->trace_result_p)
10792       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10793   }
10794 }
10795 }
10796 if (ANDSI (FLD (f_reg_list), SLLSI (1, 12))) {
10797 {
10798   tmp_addr = ADDSI (tmp_addr, 4);
10799   {
10800     SI opval = current_cpu->hardware.h_gr[((UINT) 12)];
10801     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10802     if (current_cpu->trace_result_p)
10803       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10804   }
10805 }
10806 }
10807 if (ANDSI (FLD (f_reg_list), SLLSI (1, 13))) {
10808 {
10809   tmp_addr = ADDSI (tmp_addr, 4);
10810   {
10811     SI opval = current_cpu->hardware.h_gr[((UINT) 13)];
10812     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10813     if (current_cpu->trace_result_p)
10814       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10815   }
10816 }
10817 }
10818 if (ANDSI (FLD (f_reg_list), SLLSI (1, 14))) {
10819 {
10820   tmp_addr = ADDSI (tmp_addr, 4);
10821   {
10822     SI opval = current_cpu->hardware.h_gr[((UINT) 14)];
10823     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10824     if (current_cpu->trace_result_p)
10825       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10826   }
10827 }
10828 }
10829 if (ANDSI (FLD (f_reg_list), SLLSI (1, 15))) {
10830 {
10831   tmp_addr = ADDSI (tmp_addr, 4);
10832   {
10833     SI opval = ADDSI (current_cpu->hardware.h_gr[((UINT) 15)], 4);
10834     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10835     if (current_cpu->trace_result_p)
10836       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10837   }
10838 }
10839 }
10840   {
10841     SI opval = tmp_addr;
10842     * FLD (i_rn) = opval;
10843     if (current_cpu->trace_result_p)
10844       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
10845   }
10846 }
10847
10848   current_cpu->done_insn (npc, status);
10849   return status;
10850 #undef FLD
10851 }
10852
10853 // ********** stmia: FIXME
10854
10855 sem_status
10856 arm_sem_stmia (arm7f_cpu* current_cpu, arm_scache* sem)
10857 {
10858 #define FLD(f) abuf->fields.sfmt_ldmda.f
10859   sem_status status = SEM_STATUS_NORMAL;
10860   arm_scache* abuf = sem;
10861   PCADDR pc = abuf->addr;
10862   PCADDR npc = pc + 4;
10863
10864 {
10865   SI tmp_addr;
10866   tmp_addr = * FLD (i_rn);
10867 if (ANDSI (FLD (f_reg_list), SLLSI (1, 0))) {
10868 {
10869   {
10870     SI opval = current_cpu->hardware.h_gr[((UINT) 0)];
10871     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10872     if (current_cpu->trace_result_p)
10873       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10874   }
10875   tmp_addr = ADDSI (tmp_addr, 4);
10876 }
10877 }
10878 if (ANDSI (FLD (f_reg_list), SLLSI (1, 1))) {
10879 {
10880   {
10881     SI opval = current_cpu->hardware.h_gr[((UINT) 1)];
10882     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10883     if (current_cpu->trace_result_p)
10884       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10885   }
10886   tmp_addr = ADDSI (tmp_addr, 4);
10887 }
10888 }
10889 if (ANDSI (FLD (f_reg_list), SLLSI (1, 2))) {
10890 {
10891   {
10892     SI opval = current_cpu->hardware.h_gr[((UINT) 2)];
10893     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10894     if (current_cpu->trace_result_p)
10895       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10896   }
10897   tmp_addr = ADDSI (tmp_addr, 4);
10898 }
10899 }
10900 if (ANDSI (FLD (f_reg_list), SLLSI (1, 3))) {
10901 {
10902   {
10903     SI opval = current_cpu->hardware.h_gr[((UINT) 3)];
10904     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10905     if (current_cpu->trace_result_p)
10906       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10907   }
10908   tmp_addr = ADDSI (tmp_addr, 4);
10909 }
10910 }
10911 if (ANDSI (FLD (f_reg_list), SLLSI (1, 4))) {
10912 {
10913   {
10914     SI opval = current_cpu->hardware.h_gr[((UINT) 4)];
10915     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10916     if (current_cpu->trace_result_p)
10917       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10918   }
10919   tmp_addr = ADDSI (tmp_addr, 4);
10920 }
10921 }
10922 if (ANDSI (FLD (f_reg_list), SLLSI (1, 5))) {
10923 {
10924   {
10925     SI opval = current_cpu->hardware.h_gr[((UINT) 5)];
10926     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10927     if (current_cpu->trace_result_p)
10928       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10929   }
10930   tmp_addr = ADDSI (tmp_addr, 4);
10931 }
10932 }
10933 if (ANDSI (FLD (f_reg_list), SLLSI (1, 6))) {
10934 {
10935   {
10936     SI opval = current_cpu->hardware.h_gr[((UINT) 6)];
10937     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10938     if (current_cpu->trace_result_p)
10939       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10940   }
10941   tmp_addr = ADDSI (tmp_addr, 4);
10942 }
10943 }
10944 if (ANDSI (FLD (f_reg_list), SLLSI (1, 7))) {
10945 {
10946   {
10947     SI opval = current_cpu->hardware.h_gr[((UINT) 7)];
10948     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10949     if (current_cpu->trace_result_p)
10950       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10951   }
10952   tmp_addr = ADDSI (tmp_addr, 4);
10953 }
10954 }
10955 if (ANDSI (FLD (f_reg_list), SLLSI (1, 8))) {
10956 {
10957   {
10958     SI opval = current_cpu->hardware.h_gr[((UINT) 8)];
10959     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10960     if (current_cpu->trace_result_p)
10961       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10962   }
10963   tmp_addr = ADDSI (tmp_addr, 4);
10964 }
10965 }
10966 if (ANDSI (FLD (f_reg_list), SLLSI (1, 9))) {
10967 {
10968   {
10969     SI opval = current_cpu->hardware.h_gr[((UINT) 9)];
10970     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10971     if (current_cpu->trace_result_p)
10972       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10973   }
10974   tmp_addr = ADDSI (tmp_addr, 4);
10975 }
10976 }
10977 if (ANDSI (FLD (f_reg_list), SLLSI (1, 10))) {
10978 {
10979   {
10980     SI opval = current_cpu->hardware.h_gr[((UINT) 10)];
10981     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10982     if (current_cpu->trace_result_p)
10983       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10984   }
10985   tmp_addr = ADDSI (tmp_addr, 4);
10986 }
10987 }
10988 if (ANDSI (FLD (f_reg_list), SLLSI (1, 11))) {
10989 {
10990   {
10991     SI opval = current_cpu->hardware.h_gr[((UINT) 11)];
10992     current_cpu->SETMEMSI (pc, tmp_addr, opval);
10993     if (current_cpu->trace_result_p)
10994       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
10995   }
10996   tmp_addr = ADDSI (tmp_addr, 4);
10997 }
10998 }
10999 if (ANDSI (FLD (f_reg_list), SLLSI (1, 12))) {
11000 {
11001   {
11002     SI opval = current_cpu->hardware.h_gr[((UINT) 12)];
11003     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11004     if (current_cpu->trace_result_p)
11005       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11006   }
11007   tmp_addr = ADDSI (tmp_addr, 4);
11008 }
11009 }
11010 if (ANDSI (FLD (f_reg_list), SLLSI (1, 13))) {
11011 {
11012   {
11013     SI opval = current_cpu->hardware.h_gr[((UINT) 13)];
11014     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11015     if (current_cpu->trace_result_p)
11016       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11017   }
11018   tmp_addr = ADDSI (tmp_addr, 4);
11019 }
11020 }
11021 if (ANDSI (FLD (f_reg_list), SLLSI (1, 14))) {
11022 {
11023   {
11024     SI opval = current_cpu->hardware.h_gr[((UINT) 14)];
11025     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11026     if (current_cpu->trace_result_p)
11027       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11028   }
11029   tmp_addr = ADDSI (tmp_addr, 4);
11030 }
11031 }
11032 if (ANDSI (FLD (f_reg_list), SLLSI (1, 15))) {
11033 {
11034   {
11035     SI opval = ADDSI (current_cpu->hardware.h_gr[((UINT) 15)], 4);
11036     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11037     if (current_cpu->trace_result_p)
11038       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11039   }
11040   tmp_addr = ADDSI (tmp_addr, 4);
11041 }
11042 }
11043 }
11044
11045   current_cpu->done_insn (npc, status);
11046   return status;
11047 #undef FLD
11048 }
11049
11050 // ********** stmia-wb: FIXME
11051
11052 sem_status
11053 arm_sem_stmia_wb (arm7f_cpu* current_cpu, arm_scache* sem)
11054 {
11055 #define FLD(f) abuf->fields.sfmt_ldmda.f
11056   sem_status status = SEM_STATUS_NORMAL;
11057   arm_scache* abuf = sem;
11058   PCADDR pc = abuf->addr;
11059   PCADDR npc = pc + 4;
11060
11061 {
11062   SI tmp_addr;
11063   tmp_addr = * FLD (i_rn);
11064 if (ANDSI (FLD (f_reg_list), SLLSI (1, 0))) {
11065 {
11066   {
11067     SI opval = current_cpu->hardware.h_gr[((UINT) 0)];
11068     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11069     if (current_cpu->trace_result_p)
11070       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11071   }
11072   tmp_addr = ADDSI (tmp_addr, 4);
11073 }
11074 }
11075 if (ANDSI (FLD (f_reg_list), SLLSI (1, 1))) {
11076 {
11077   {
11078     SI opval = current_cpu->hardware.h_gr[((UINT) 1)];
11079     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11080     if (current_cpu->trace_result_p)
11081       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11082   }
11083   tmp_addr = ADDSI (tmp_addr, 4);
11084 }
11085 }
11086 if (ANDSI (FLD (f_reg_list), SLLSI (1, 2))) {
11087 {
11088   {
11089     SI opval = current_cpu->hardware.h_gr[((UINT) 2)];
11090     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11091     if (current_cpu->trace_result_p)
11092       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11093   }
11094   tmp_addr = ADDSI (tmp_addr, 4);
11095 }
11096 }
11097 if (ANDSI (FLD (f_reg_list), SLLSI (1, 3))) {
11098 {
11099   {
11100     SI opval = current_cpu->hardware.h_gr[((UINT) 3)];
11101     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11102     if (current_cpu->trace_result_p)
11103       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11104   }
11105   tmp_addr = ADDSI (tmp_addr, 4);
11106 }
11107 }
11108 if (ANDSI (FLD (f_reg_list), SLLSI (1, 4))) {
11109 {
11110   {
11111     SI opval = current_cpu->hardware.h_gr[((UINT) 4)];
11112     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11113     if (current_cpu->trace_result_p)
11114       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11115   }
11116   tmp_addr = ADDSI (tmp_addr, 4);
11117 }
11118 }
11119 if (ANDSI (FLD (f_reg_list), SLLSI (1, 5))) {
11120 {
11121   {
11122     SI opval = current_cpu->hardware.h_gr[((UINT) 5)];
11123     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11124     if (current_cpu->trace_result_p)
11125       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11126   }
11127   tmp_addr = ADDSI (tmp_addr, 4);
11128 }
11129 }
11130 if (ANDSI (FLD (f_reg_list), SLLSI (1, 6))) {
11131 {
11132   {
11133     SI opval = current_cpu->hardware.h_gr[((UINT) 6)];
11134     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11135     if (current_cpu->trace_result_p)
11136       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11137   }
11138   tmp_addr = ADDSI (tmp_addr, 4);
11139 }
11140 }
11141 if (ANDSI (FLD (f_reg_list), SLLSI (1, 7))) {
11142 {
11143   {
11144     SI opval = current_cpu->hardware.h_gr[((UINT) 7)];
11145     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11146     if (current_cpu->trace_result_p)
11147       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11148   }
11149   tmp_addr = ADDSI (tmp_addr, 4);
11150 }
11151 }
11152 if (ANDSI (FLD (f_reg_list), SLLSI (1, 8))) {
11153 {
11154   {
11155     SI opval = current_cpu->hardware.h_gr[((UINT) 8)];
11156     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11157     if (current_cpu->trace_result_p)
11158       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11159   }
11160   tmp_addr = ADDSI (tmp_addr, 4);
11161 }
11162 }
11163 if (ANDSI (FLD (f_reg_list), SLLSI (1, 9))) {
11164 {
11165   {
11166     SI opval = current_cpu->hardware.h_gr[((UINT) 9)];
11167     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11168     if (current_cpu->trace_result_p)
11169       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11170   }
11171   tmp_addr = ADDSI (tmp_addr, 4);
11172 }
11173 }
11174 if (ANDSI (FLD (f_reg_list), SLLSI (1, 10))) {
11175 {
11176   {
11177     SI opval = current_cpu->hardware.h_gr[((UINT) 10)];
11178     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11179     if (current_cpu->trace_result_p)
11180       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11181   }
11182   tmp_addr = ADDSI (tmp_addr, 4);
11183 }
11184 }
11185 if (ANDSI (FLD (f_reg_list), SLLSI (1, 11))) {
11186 {
11187   {
11188     SI opval = current_cpu->hardware.h_gr[((UINT) 11)];
11189     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11190     if (current_cpu->trace_result_p)
11191       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11192   }
11193   tmp_addr = ADDSI (tmp_addr, 4);
11194 }
11195 }
11196 if (ANDSI (FLD (f_reg_list), SLLSI (1, 12))) {
11197 {
11198   {
11199     SI opval = current_cpu->hardware.h_gr[((UINT) 12)];
11200     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11201     if (current_cpu->trace_result_p)
11202       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11203   }
11204   tmp_addr = ADDSI (tmp_addr, 4);
11205 }
11206 }
11207 if (ANDSI (FLD (f_reg_list), SLLSI (1, 13))) {
11208 {
11209   {
11210     SI opval = current_cpu->hardware.h_gr[((UINT) 13)];
11211     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11212     if (current_cpu->trace_result_p)
11213       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11214   }
11215   tmp_addr = ADDSI (tmp_addr, 4);
11216 }
11217 }
11218 if (ANDSI (FLD (f_reg_list), SLLSI (1, 14))) {
11219 {
11220   {
11221     SI opval = current_cpu->hardware.h_gr[((UINT) 14)];
11222     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11223     if (current_cpu->trace_result_p)
11224       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11225   }
11226   tmp_addr = ADDSI (tmp_addr, 4);
11227 }
11228 }
11229 if (ANDSI (FLD (f_reg_list), SLLSI (1, 15))) {
11230 {
11231   {
11232     SI opval = ADDSI (current_cpu->hardware.h_gr[((UINT) 15)], 4);
11233     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11234     if (current_cpu->trace_result_p)
11235       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11236   }
11237   tmp_addr = ADDSI (tmp_addr, 4);
11238 }
11239 }
11240   {
11241     SI opval = tmp_addr;
11242     * FLD (i_rn) = opval;
11243     if (current_cpu->trace_result_p)
11244       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
11245   }
11246 }
11247
11248   current_cpu->done_insn (npc, status);
11249   return status;
11250 #undef FLD
11251 }
11252
11253 // ********** stmda: FIXME
11254
11255 sem_status
11256 arm_sem_stmda (arm7f_cpu* current_cpu, arm_scache* sem)
11257 {
11258 #define FLD(f) abuf->fields.sfmt_ldmda.f
11259   sem_status status = SEM_STATUS_NORMAL;
11260   arm_scache* abuf = sem;
11261   PCADDR pc = abuf->addr;
11262   PCADDR npc = pc + 4;
11263
11264 {
11265   SI tmp_addr;
11266   tmp_addr = * FLD (i_rn);
11267 if (ANDSI (FLD (f_reg_list), SLLSI (1, 15))) {
11268 {
11269   {
11270     SI opval = ADDSI (current_cpu->hardware.h_gr[((UINT) 15)], 4);
11271     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11272     if (current_cpu->trace_result_p)
11273       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11274   }
11275   tmp_addr = SUBSI (tmp_addr, 4);
11276 }
11277 }
11278 if (ANDSI (FLD (f_reg_list), SLLSI (1, 14))) {
11279 {
11280   {
11281     SI opval = current_cpu->hardware.h_gr[((UINT) 14)];
11282     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11283     if (current_cpu->trace_result_p)
11284       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11285   }
11286   tmp_addr = SUBSI (tmp_addr, 4);
11287 }
11288 }
11289 if (ANDSI (FLD (f_reg_list), SLLSI (1, 13))) {
11290 {
11291   {
11292     SI opval = current_cpu->hardware.h_gr[((UINT) 13)];
11293     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11294     if (current_cpu->trace_result_p)
11295       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11296   }
11297   tmp_addr = SUBSI (tmp_addr, 4);
11298 }
11299 }
11300 if (ANDSI (FLD (f_reg_list), SLLSI (1, 12))) {
11301 {
11302   {
11303     SI opval = current_cpu->hardware.h_gr[((UINT) 12)];
11304     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11305     if (current_cpu->trace_result_p)
11306       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11307   }
11308   tmp_addr = SUBSI (tmp_addr, 4);
11309 }
11310 }
11311 if (ANDSI (FLD (f_reg_list), SLLSI (1, 11))) {
11312 {
11313   {
11314     SI opval = current_cpu->hardware.h_gr[((UINT) 11)];
11315     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11316     if (current_cpu->trace_result_p)
11317       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11318   }
11319   tmp_addr = SUBSI (tmp_addr, 4);
11320 }
11321 }
11322 if (ANDSI (FLD (f_reg_list), SLLSI (1, 10))) {
11323 {
11324   {
11325     SI opval = current_cpu->hardware.h_gr[((UINT) 10)];
11326     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11327     if (current_cpu->trace_result_p)
11328       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11329   }
11330   tmp_addr = SUBSI (tmp_addr, 4);
11331 }
11332 }
11333 if (ANDSI (FLD (f_reg_list), SLLSI (1, 9))) {
11334 {
11335   {
11336     SI opval = current_cpu->hardware.h_gr[((UINT) 9)];
11337     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11338     if (current_cpu->trace_result_p)
11339       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11340   }
11341   tmp_addr = SUBSI (tmp_addr, 4);
11342 }
11343 }
11344 if (ANDSI (FLD (f_reg_list), SLLSI (1, 8))) {
11345 {
11346   {
11347     SI opval = current_cpu->hardware.h_gr[((UINT) 8)];
11348     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11349     if (current_cpu->trace_result_p)
11350       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11351   }
11352   tmp_addr = SUBSI (tmp_addr, 4);
11353 }
11354 }
11355 if (ANDSI (FLD (f_reg_list), SLLSI (1, 7))) {
11356 {
11357   {
11358     SI opval = current_cpu->hardware.h_gr[((UINT) 7)];
11359     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11360     if (current_cpu->trace_result_p)
11361       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11362   }
11363   tmp_addr = SUBSI (tmp_addr, 4);
11364 }
11365 }
11366 if (ANDSI (FLD (f_reg_list), SLLSI (1, 6))) {
11367 {
11368   {
11369     SI opval = current_cpu->hardware.h_gr[((UINT) 6)];
11370     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11371     if (current_cpu->trace_result_p)
11372       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11373   }
11374   tmp_addr = SUBSI (tmp_addr, 4);
11375 }
11376 }
11377 if (ANDSI (FLD (f_reg_list), SLLSI (1, 5))) {
11378 {
11379   {
11380     SI opval = current_cpu->hardware.h_gr[((UINT) 5)];
11381     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11382     if (current_cpu->trace_result_p)
11383       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11384   }
11385   tmp_addr = SUBSI (tmp_addr, 4);
11386 }
11387 }
11388 if (ANDSI (FLD (f_reg_list), SLLSI (1, 4))) {
11389 {
11390   {
11391     SI opval = current_cpu->hardware.h_gr[((UINT) 4)];
11392     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11393     if (current_cpu->trace_result_p)
11394       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11395   }
11396   tmp_addr = SUBSI (tmp_addr, 4);
11397 }
11398 }
11399 if (ANDSI (FLD (f_reg_list), SLLSI (1, 3))) {
11400 {
11401   {
11402     SI opval = current_cpu->hardware.h_gr[((UINT) 3)];
11403     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11404     if (current_cpu->trace_result_p)
11405       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11406   }
11407   tmp_addr = SUBSI (tmp_addr, 4);
11408 }
11409 }
11410 if (ANDSI (FLD (f_reg_list), SLLSI (1, 2))) {
11411 {
11412   {
11413     SI opval = current_cpu->hardware.h_gr[((UINT) 2)];
11414     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11415     if (current_cpu->trace_result_p)
11416       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11417   }
11418   tmp_addr = SUBSI (tmp_addr, 4);
11419 }
11420 }
11421 if (ANDSI (FLD (f_reg_list), SLLSI (1, 1))) {
11422 {
11423   {
11424     SI opval = current_cpu->hardware.h_gr[((UINT) 1)];
11425     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11426     if (current_cpu->trace_result_p)
11427       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11428   }
11429   tmp_addr = SUBSI (tmp_addr, 4);
11430 }
11431 }
11432 if (ANDSI (FLD (f_reg_list), SLLSI (1, 0))) {
11433 {
11434   {
11435     SI opval = current_cpu->hardware.h_gr[((UINT) 0)];
11436     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11437     if (current_cpu->trace_result_p)
11438       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11439   }
11440   tmp_addr = SUBSI (tmp_addr, 4);
11441 }
11442 }
11443 }
11444
11445   current_cpu->done_insn (npc, status);
11446   return status;
11447 #undef FLD
11448 }
11449
11450 // ********** stmda-wb: FIXME
11451
11452 sem_status
11453 arm_sem_stmda_wb (arm7f_cpu* current_cpu, arm_scache* sem)
11454 {
11455 #define FLD(f) abuf->fields.sfmt_ldmda.f
11456   sem_status status = SEM_STATUS_NORMAL;
11457   arm_scache* abuf = sem;
11458   PCADDR pc = abuf->addr;
11459   PCADDR npc = pc + 4;
11460
11461 {
11462   SI tmp_addr;
11463   tmp_addr = * FLD (i_rn);
11464 if (ANDSI (FLD (f_reg_list), SLLSI (1, 15))) {
11465 {
11466   {
11467     SI opval = ADDSI (current_cpu->hardware.h_gr[((UINT) 15)], 4);
11468     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11469     if (current_cpu->trace_result_p)
11470       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11471   }
11472   tmp_addr = SUBSI (tmp_addr, 4);
11473 }
11474 }
11475 if (ANDSI (FLD (f_reg_list), SLLSI (1, 14))) {
11476 {
11477   {
11478     SI opval = current_cpu->hardware.h_gr[((UINT) 14)];
11479     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11480     if (current_cpu->trace_result_p)
11481       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11482   }
11483   tmp_addr = SUBSI (tmp_addr, 4);
11484 }
11485 }
11486 if (ANDSI (FLD (f_reg_list), SLLSI (1, 13))) {
11487 {
11488   {
11489     SI opval = current_cpu->hardware.h_gr[((UINT) 13)];
11490     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11491     if (current_cpu->trace_result_p)
11492       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11493   }
11494   tmp_addr = SUBSI (tmp_addr, 4);
11495 }
11496 }
11497 if (ANDSI (FLD (f_reg_list), SLLSI (1, 12))) {
11498 {
11499   {
11500     SI opval = current_cpu->hardware.h_gr[((UINT) 12)];
11501     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11502     if (current_cpu->trace_result_p)
11503       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11504   }
11505   tmp_addr = SUBSI (tmp_addr, 4);
11506 }
11507 }
11508 if (ANDSI (FLD (f_reg_list), SLLSI (1, 11))) {
11509 {
11510   {
11511     SI opval = current_cpu->hardware.h_gr[((UINT) 11)];
11512     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11513     if (current_cpu->trace_result_p)
11514       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11515   }
11516   tmp_addr = SUBSI (tmp_addr, 4);
11517 }
11518 }
11519 if (ANDSI (FLD (f_reg_list), SLLSI (1, 10))) {
11520 {
11521   {
11522     SI opval = current_cpu->hardware.h_gr[((UINT) 10)];
11523     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11524     if (current_cpu->trace_result_p)
11525       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11526   }
11527   tmp_addr = SUBSI (tmp_addr, 4);
11528 }
11529 }
11530 if (ANDSI (FLD (f_reg_list), SLLSI (1, 9))) {
11531 {
11532   {
11533     SI opval = current_cpu->hardware.h_gr[((UINT) 9)];
11534     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11535     if (current_cpu->trace_result_p)
11536       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11537   }
11538   tmp_addr = SUBSI (tmp_addr, 4);
11539 }
11540 }
11541 if (ANDSI (FLD (f_reg_list), SLLSI (1, 8))) {
11542 {
11543   {
11544     SI opval = current_cpu->hardware.h_gr[((UINT) 8)];
11545     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11546     if (current_cpu->trace_result_p)
11547       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11548   }
11549   tmp_addr = SUBSI (tmp_addr, 4);
11550 }
11551 }
11552 if (ANDSI (FLD (f_reg_list), SLLSI (1, 7))) {
11553 {
11554   {
11555     SI opval = current_cpu->hardware.h_gr[((UINT) 7)];
11556     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11557     if (current_cpu->trace_result_p)
11558       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11559   }
11560   tmp_addr = SUBSI (tmp_addr, 4);
11561 }
11562 }
11563 if (ANDSI (FLD (f_reg_list), SLLSI (1, 6))) {
11564 {
11565   {
11566     SI opval = current_cpu->hardware.h_gr[((UINT) 6)];
11567     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11568     if (current_cpu->trace_result_p)
11569       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11570   }
11571   tmp_addr = SUBSI (tmp_addr, 4);
11572 }
11573 }
11574 if (ANDSI (FLD (f_reg_list), SLLSI (1, 5))) {
11575 {
11576   {
11577     SI opval = current_cpu->hardware.h_gr[((UINT) 5)];
11578     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11579     if (current_cpu->trace_result_p)
11580       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11581   }
11582   tmp_addr = SUBSI (tmp_addr, 4);
11583 }
11584 }
11585 if (ANDSI (FLD (f_reg_list), SLLSI (1, 4))) {
11586 {
11587   {
11588     SI opval = current_cpu->hardware.h_gr[((UINT) 4)];
11589     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11590     if (current_cpu->trace_result_p)
11591       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11592   }
11593   tmp_addr = SUBSI (tmp_addr, 4);
11594 }
11595 }
11596 if (ANDSI (FLD (f_reg_list), SLLSI (1, 3))) {
11597 {
11598   {
11599     SI opval = current_cpu->hardware.h_gr[((UINT) 3)];
11600     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11601     if (current_cpu->trace_result_p)
11602       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11603   }
11604   tmp_addr = SUBSI (tmp_addr, 4);
11605 }
11606 }
11607 if (ANDSI (FLD (f_reg_list), SLLSI (1, 2))) {
11608 {
11609   {
11610     SI opval = current_cpu->hardware.h_gr[((UINT) 2)];
11611     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11612     if (current_cpu->trace_result_p)
11613       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11614   }
11615   tmp_addr = SUBSI (tmp_addr, 4);
11616 }
11617 }
11618 if (ANDSI (FLD (f_reg_list), SLLSI (1, 1))) {
11619 {
11620   {
11621     SI opval = current_cpu->hardware.h_gr[((UINT) 1)];
11622     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11623     if (current_cpu->trace_result_p)
11624       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11625   }
11626   tmp_addr = SUBSI (tmp_addr, 4);
11627 }
11628 }
11629 if (ANDSI (FLD (f_reg_list), SLLSI (1, 0))) {
11630 {
11631   {
11632     SI opval = current_cpu->hardware.h_gr[((UINT) 0)];
11633     current_cpu->SETMEMSI (pc, tmp_addr, opval);
11634     if (current_cpu->trace_result_p)
11635       current_cpu->trace_stream << "memory" << '[' <<  "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << "  ";
11636   }
11637   tmp_addr = SUBSI (tmp_addr, 4);
11638 }
11639 }
11640   {
11641     SI opval = tmp_addr;
11642     * FLD (i_rn) = opval;
11643     if (current_cpu->trace_result_p)
11644       current_cpu->trace_stream << "rn" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << "  ";
11645   }
11646 }
11647
11648   current_cpu->done_insn (npc, status);
11649   return status;
11650 #undef FLD
11651 }
11652
11653 // ********** mrs-c: mrs$cond $rd,cpsr
11654
11655 sem_status
11656 arm_sem_mrs_c (arm7f_cpu* current_cpu, arm_scache* sem)
11657 {
11658 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
11659   sem_status status = SEM_STATUS_NORMAL;
11660   arm_scache* abuf = sem;
11661   PCADDR pc = abuf->addr;
11662   PCADDR npc = pc + 4;
11663
11664   {
11665     SI opval = current_cpu->h_cpsr_get ();
11666     * FLD (i_rd) = opval;
11667     if (current_cpu->trace_result_p)
11668       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
11669   }
11670
11671   current_cpu->done_insn (npc, status);
11672   return status;
11673 #undef FLD
11674 }
11675
11676 // ********** mrs-s: mrs$cond $rd,spsr
11677
11678 sem_status
11679 arm_sem_mrs_s (arm7f_cpu* current_cpu, arm_scache* sem)
11680 {
11681 #define FLD(f) abuf->fields.sfmt_strh_pre_dec_imm_offset.f
11682   sem_status status = SEM_STATUS_NORMAL;
11683   arm_scache* abuf = sem;
11684   PCADDR pc = abuf->addr;
11685   PCADDR npc = pc + 4;
11686
11687   {
11688     SI opval = current_cpu->h_spsr_get ();
11689     * FLD (i_rd) = opval;
11690     if (current_cpu->trace_result_p)
11691       current_cpu->trace_stream << "rd" << '[' << FLD (f_rd) << ']' << ":=0x" << hex << opval << dec << "  ";
11692   }
11693
11694   current_cpu->done_insn (npc, status);
11695   return status;
11696 #undef FLD
11697 }
11698
11699 // ********** msr-c: msr$cond cpsr,$rm
11700
11701 sem_status
11702 arm_sem_msr_c (arm7f_cpu* current_cpu, arm_scache* sem)
11703 {
11704 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
11705   sem_status status = SEM_STATUS_NORMAL;
11706   arm_scache* abuf = sem;
11707   PCADDR pc = abuf->addr;
11708   PCADDR npc = pc + 4;
11709
11710   {
11711     SI opval = * FLD (i_rm);
11712     current_cpu->h_cpsr_set (opval);
11713     if (current_cpu->trace_result_p)
11714       current_cpu->trace_stream << "cpsr" << ":=0x" << hex << opval << dec << "  ";
11715   }
11716
11717   current_cpu->done_insn (npc, status);
11718   return status;
11719 #undef FLD
11720 }
11721
11722 // ********** msr-s: msr$cond spsr,$rm
11723
11724 sem_status
11725 arm_sem_msr_s (arm7f_cpu* current_cpu, arm_scache* sem)
11726 {
11727 #define FLD(f) abuf->fields.sfmt_and_reg_imm_shift.f
11728   sem_status status = SEM_STATUS_NORMAL;
11729   arm_scache* abuf = sem;
11730   PCADDR pc = abuf->addr;
11731   PCADDR npc = pc + 4;
11732
11733   {
11734     SI opval = * FLD (i_rm);
11735     current_cpu->h_spsr_set (opval);
11736     if (current_cpu->trace_result_p)
11737       current_cpu->trace_stream << "spsr" << ":=0x" << hex << opval << dec << "  ";
11738   }
11739
11740   current_cpu->done_insn (npc, status);
11741   return status;
11742 #undef FLD
11743 }
11744