]>
Commit | Line | Data |
---|---|---|
c906108c SS |
1 | /* Simulator instruction semantics for fr30bf. |
2 | ||
3 | THIS FILE IS MACHINE GENERATED WITH CGEN. | |
4 | ||
5 | Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. | |
6 | ||
7 | This file is part of the GNU Simulators. | |
8 | ||
9 | This program is free software; you can redistribute it and/or modify | |
10 | it under the terms of the GNU General Public License as published by | |
11 | the Free Software Foundation; either version 2, or (at your option) | |
12 | any later version. | |
13 | ||
14 | This program is distributed in the hope that it will be useful, | |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | GNU General Public License for more details. | |
18 | ||
19 | You should have received a copy of the GNU General Public License along | |
20 | with this program; if not, write to the Free Software Foundation, Inc., | |
21 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
22 | ||
23 | */ | |
24 | ||
25 | #define WANT_CPU fr30bf | |
26 | #define WANT_CPU_FR30BF | |
27 | ||
28 | #include "sim-main.h" | |
29 | #include "cgen-mem.h" | |
30 | #include "cgen-ops.h" | |
31 | ||
32 | #undef GET_ATTR | |
33 | #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr) | |
34 | ||
96baa820 JM |
35 | /* This is used so that we can compile two copies of the semantic code, |
36 | one with full feature support and one without that runs fast(er). | |
37 | FAST_P, when desired, is defined on the command line, -DFAST_P=1. */ | |
38 | #if FAST_P | |
39 | #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_semf_,fn) | |
40 | #undef TRACE_RESULT | |
41 | #define TRACE_RESULT(cpu, abuf, name, type, val) | |
42 | #else | |
43 | #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_sem_,fn) | |
44 | #endif | |
45 | ||
c906108c SS |
46 | /* x-invalid: --invalid-- */ |
47 | ||
96baa820 | 48 | static SEM_PC |
c906108c SS |
49 | SEM_FN_NAME (fr30bf,x_invalid) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
50 | { | |
51 | #define FLD(f) abuf->fields.fmt_empty.f | |
52 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); | |
53 | int UNUSED written = 0; | |
54 | IADDR UNUSED pc = abuf->addr; | |
55 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0); | |
56 | ||
57 | { | |
58 | #if WITH_SCACHE | |
59 | /* Update the recorded pc in the cpu state struct. */ | |
60 | SET_H_PC (pc); | |
61 | #endif | |
62 | sim_engine_invalid_insn (current_cpu, pc); | |
63 | sim_io_error (CPU_STATE (current_cpu), "invalid insn not handled\n"); | |
64 | /* NOTREACHED */ | |
65 | } | |
66 | ||
67 | return vpc; | |
68 | #undef FLD | |
69 | } | |
70 | ||
71 | /* x-after: --after-- */ | |
72 | ||
96baa820 | 73 | static SEM_PC |
c906108c SS |
74 | SEM_FN_NAME (fr30bf,x_after) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
75 | { | |
76 | #define FLD(f) abuf->fields.fmt_empty.f | |
77 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); | |
78 | int UNUSED written = 0; | |
79 | IADDR UNUSED pc = abuf->addr; | |
80 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0); | |
81 | ||
82 | { | |
83 | #if WITH_SCACHE_PBB_FR30BF | |
84 | fr30bf_pbb_after (current_cpu, sem_arg); | |
85 | #endif | |
86 | } | |
87 | ||
88 | return vpc; | |
89 | #undef FLD | |
90 | } | |
91 | ||
92 | /* x-before: --before-- */ | |
93 | ||
96baa820 | 94 | static SEM_PC |
c906108c SS |
95 | SEM_FN_NAME (fr30bf,x_before) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
96 | { | |
97 | #define FLD(f) abuf->fields.fmt_empty.f | |
98 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); | |
99 | int UNUSED written = 0; | |
100 | IADDR UNUSED pc = abuf->addr; | |
101 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0); | |
102 | ||
103 | { | |
104 | #if WITH_SCACHE_PBB_FR30BF | |
105 | fr30bf_pbb_before (current_cpu, sem_arg); | |
106 | #endif | |
107 | } | |
108 | ||
109 | return vpc; | |
110 | #undef FLD | |
111 | } | |
112 | ||
113 | /* x-cti-chain: --cti-chain-- */ | |
114 | ||
96baa820 | 115 | static SEM_PC |
c906108c SS |
116 | SEM_FN_NAME (fr30bf,x_cti_chain) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
117 | { | |
118 | #define FLD(f) abuf->fields.fmt_empty.f | |
119 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); | |
120 | int UNUSED written = 0; | |
121 | IADDR UNUSED pc = abuf->addr; | |
122 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0); | |
123 | ||
124 | { | |
125 | #if WITH_SCACHE_PBB_FR30BF | |
126 | #ifdef DEFINE_SWITCH | |
127 | vpc = fr30bf_pbb_cti_chain (current_cpu, sem_arg, | |
96baa820 | 128 | pbb_br_type, pbb_br_npc); |
c906108c SS |
129 | BREAK (sem); |
130 | #else | |
131 | /* FIXME: Allow provision of explicit ifmt spec in insn spec. */ | |
132 | vpc = fr30bf_pbb_cti_chain (current_cpu, sem_arg, | |
96baa820 | 133 | CPU_PBB_BR_TYPE (current_cpu), |
c906108c SS |
134 | CPU_PBB_BR_NPC (current_cpu)); |
135 | #endif | |
136 | #endif | |
137 | } | |
138 | ||
139 | return vpc; | |
140 | #undef FLD | |
141 | } | |
142 | ||
143 | /* x-chain: --chain-- */ | |
144 | ||
96baa820 | 145 | static SEM_PC |
c906108c SS |
146 | SEM_FN_NAME (fr30bf,x_chain) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
147 | { | |
148 | #define FLD(f) abuf->fields.fmt_empty.f | |
149 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); | |
150 | int UNUSED written = 0; | |
151 | IADDR UNUSED pc = abuf->addr; | |
152 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0); | |
153 | ||
154 | { | |
155 | #if WITH_SCACHE_PBB_FR30BF | |
156 | vpc = fr30bf_pbb_chain (current_cpu, sem_arg); | |
157 | #ifdef DEFINE_SWITCH | |
158 | BREAK (sem); | |
159 | #endif | |
160 | #endif | |
161 | } | |
162 | ||
163 | return vpc; | |
164 | #undef FLD | |
165 | } | |
166 | ||
167 | /* x-begin: --begin-- */ | |
168 | ||
96baa820 | 169 | static SEM_PC |
c906108c SS |
170 | SEM_FN_NAME (fr30bf,x_begin) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
171 | { | |
172 | #define FLD(f) abuf->fields.fmt_empty.f | |
173 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); | |
174 | int UNUSED written = 0; | |
175 | IADDR UNUSED pc = abuf->addr; | |
176 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0); | |
177 | ||
178 | { | |
179 | #if WITH_SCACHE_PBB_FR30BF | |
180 | #ifdef DEFINE_SWITCH | |
181 | /* In the switch case FAST_P is a constant, allowing several optimizations | |
182 | in any called inline functions. */ | |
183 | vpc = fr30bf_pbb_begin (current_cpu, FAST_P); | |
184 | #else | |
185 | vpc = fr30bf_pbb_begin (current_cpu, STATE_RUN_FAST_P (CPU_STATE (current_cpu))); | |
186 | #endif | |
187 | #endif | |
188 | } | |
189 | ||
190 | return vpc; | |
191 | #undef FLD | |
192 | } | |
193 | ||
194 | /* add: add $Rj,$Ri */ | |
195 | ||
96baa820 | 196 | static SEM_PC |
c906108c SS |
197 | SEM_FN_NAME (fr30bf,add) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
198 | { | |
96baa820 | 199 | #define FLD(f) abuf->fields.sfmt_add.f |
c906108c SS |
200 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
201 | int UNUSED written = 0; | |
202 | IADDR UNUSED pc = abuf->addr; | |
203 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
204 | ||
7a292a7a | 205 | { |
c906108c SS |
206 | { |
207 | BI opval = ADDOFSI (* FLD (i_Ri), * FLD (i_Rj), 0); | |
208 | CPU (h_vbit) = opval; | |
209 | TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval); | |
210 | } | |
211 | { | |
212 | BI opval = ADDCFSI (* FLD (i_Ri), * FLD (i_Rj), 0); | |
213 | CPU (h_cbit) = opval; | |
214 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
215 | } | |
216 | { | |
217 | SI opval = ADDSI (* FLD (i_Ri), * FLD (i_Rj)); | |
218 | * FLD (i_Ri) = opval; | |
219 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
220 | } | |
7a292a7a | 221 | { |
c906108c SS |
222 | { |
223 | BI opval = EQSI (* FLD (i_Ri), 0); | |
224 | CPU (h_zbit) = opval; | |
225 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
226 | } | |
227 | { | |
228 | BI opval = LTSI (* FLD (i_Ri), 0); | |
229 | CPU (h_nbit) = opval; | |
230 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
231 | } | |
7a292a7a SS |
232 | } |
233 | } | |
c906108c SS |
234 | |
235 | return vpc; | |
236 | #undef FLD | |
237 | } | |
238 | ||
239 | /* addi: add $u4,$Ri */ | |
240 | ||
96baa820 | 241 | static SEM_PC |
c906108c SS |
242 | SEM_FN_NAME (fr30bf,addi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
243 | { | |
96baa820 | 244 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
245 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
246 | int UNUSED written = 0; | |
247 | IADDR UNUSED pc = abuf->addr; | |
248 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
249 | ||
7a292a7a | 250 | { |
c906108c SS |
251 | { |
252 | BI opval = ADDOFSI (* FLD (i_Ri), FLD (f_u4), 0); | |
253 | CPU (h_vbit) = opval; | |
254 | TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval); | |
255 | } | |
256 | { | |
257 | BI opval = ADDCFSI (* FLD (i_Ri), FLD (f_u4), 0); | |
258 | CPU (h_cbit) = opval; | |
259 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
260 | } | |
261 | { | |
262 | SI opval = ADDSI (* FLD (i_Ri), FLD (f_u4)); | |
263 | * FLD (i_Ri) = opval; | |
264 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
265 | } | |
7a292a7a | 266 | { |
c906108c SS |
267 | { |
268 | BI opval = EQSI (* FLD (i_Ri), 0); | |
269 | CPU (h_zbit) = opval; | |
270 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
271 | } | |
272 | { | |
273 | BI opval = LTSI (* FLD (i_Ri), 0); | |
274 | CPU (h_nbit) = opval; | |
275 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
276 | } | |
7a292a7a SS |
277 | } |
278 | } | |
c906108c SS |
279 | |
280 | return vpc; | |
281 | #undef FLD | |
282 | } | |
283 | ||
284 | /* add2: add2 $m4,$Ri */ | |
285 | ||
96baa820 | 286 | static SEM_PC |
c906108c SS |
287 | SEM_FN_NAME (fr30bf,add2) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
288 | { | |
96baa820 | 289 | #define FLD(f) abuf->fields.sfmt_add2.f |
c906108c SS |
290 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
291 | int UNUSED written = 0; | |
292 | IADDR UNUSED pc = abuf->addr; | |
293 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
294 | ||
7a292a7a | 295 | { |
c906108c SS |
296 | { |
297 | BI opval = ADDOFSI (* FLD (i_Ri), FLD (f_m4), 0); | |
298 | CPU (h_vbit) = opval; | |
299 | TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval); | |
300 | } | |
301 | { | |
302 | BI opval = ADDCFSI (* FLD (i_Ri), FLD (f_m4), 0); | |
303 | CPU (h_cbit) = opval; | |
304 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
305 | } | |
306 | { | |
307 | SI opval = ADDSI (* FLD (i_Ri), FLD (f_m4)); | |
308 | * FLD (i_Ri) = opval; | |
309 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
310 | } | |
7a292a7a | 311 | { |
c906108c SS |
312 | { |
313 | BI opval = EQSI (* FLD (i_Ri), 0); | |
314 | CPU (h_zbit) = opval; | |
315 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
316 | } | |
317 | { | |
318 | BI opval = LTSI (* FLD (i_Ri), 0); | |
319 | CPU (h_nbit) = opval; | |
320 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
321 | } | |
7a292a7a SS |
322 | } |
323 | } | |
c906108c SS |
324 | |
325 | return vpc; | |
326 | #undef FLD | |
327 | } | |
328 | ||
329 | /* addc: addc $Rj,$Ri */ | |
330 | ||
96baa820 | 331 | static SEM_PC |
c906108c SS |
332 | SEM_FN_NAME (fr30bf,addc) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
333 | { | |
96baa820 | 334 | #define FLD(f) abuf->fields.sfmt_add.f |
c906108c SS |
335 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
336 | int UNUSED written = 0; | |
337 | IADDR UNUSED pc = abuf->addr; | |
338 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
339 | ||
7a292a7a | 340 | { |
c906108c SS |
341 | SI tmp_tmp; |
342 | tmp_tmp = ADDCSI (* FLD (i_Ri), * FLD (i_Rj), CPU (h_cbit)); | |
343 | { | |
344 | BI opval = ADDOFSI (* FLD (i_Ri), * FLD (i_Rj), CPU (h_cbit)); | |
345 | CPU (h_vbit) = opval; | |
346 | TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval); | |
347 | } | |
348 | { | |
349 | BI opval = ADDCFSI (* FLD (i_Ri), * FLD (i_Rj), CPU (h_cbit)); | |
350 | CPU (h_cbit) = opval; | |
351 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
352 | } | |
353 | { | |
354 | SI opval = tmp_tmp; | |
355 | * FLD (i_Ri) = opval; | |
356 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
357 | } | |
7a292a7a | 358 | { |
c906108c SS |
359 | { |
360 | BI opval = EQSI (* FLD (i_Ri), 0); | |
361 | CPU (h_zbit) = opval; | |
362 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
363 | } | |
364 | { | |
365 | BI opval = LTSI (* FLD (i_Ri), 0); | |
366 | CPU (h_nbit) = opval; | |
367 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
368 | } | |
7a292a7a SS |
369 | } |
370 | } | |
c906108c SS |
371 | |
372 | return vpc; | |
373 | #undef FLD | |
374 | } | |
375 | ||
376 | /* addn: addn $Rj,$Ri */ | |
377 | ||
96baa820 | 378 | static SEM_PC |
c906108c SS |
379 | SEM_FN_NAME (fr30bf,addn) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
380 | { | |
96baa820 | 381 | #define FLD(f) abuf->fields.sfmt_add.f |
c906108c SS |
382 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
383 | int UNUSED written = 0; | |
384 | IADDR UNUSED pc = abuf->addr; | |
385 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
386 | ||
387 | { | |
388 | SI opval = ADDSI (* FLD (i_Ri), * FLD (i_Rj)); | |
389 | * FLD (i_Ri) = opval; | |
390 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
391 | } | |
392 | ||
393 | return vpc; | |
394 | #undef FLD | |
395 | } | |
396 | ||
397 | /* addni: addn $u4,$Ri */ | |
398 | ||
96baa820 | 399 | static SEM_PC |
c906108c SS |
400 | SEM_FN_NAME (fr30bf,addni) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
401 | { | |
96baa820 | 402 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
403 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
404 | int UNUSED written = 0; | |
405 | IADDR UNUSED pc = abuf->addr; | |
406 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
407 | ||
408 | { | |
409 | SI opval = ADDSI (* FLD (i_Ri), FLD (f_u4)); | |
410 | * FLD (i_Ri) = opval; | |
411 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
412 | } | |
413 | ||
414 | return vpc; | |
415 | #undef FLD | |
416 | } | |
417 | ||
418 | /* addn2: addn2 $m4,$Ri */ | |
419 | ||
96baa820 | 420 | static SEM_PC |
c906108c SS |
421 | SEM_FN_NAME (fr30bf,addn2) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
422 | { | |
96baa820 | 423 | #define FLD(f) abuf->fields.sfmt_add2.f |
c906108c SS |
424 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
425 | int UNUSED written = 0; | |
426 | IADDR UNUSED pc = abuf->addr; | |
427 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
428 | ||
429 | { | |
430 | SI opval = ADDSI (* FLD (i_Ri), FLD (f_m4)); | |
431 | * FLD (i_Ri) = opval; | |
432 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
433 | } | |
434 | ||
435 | return vpc; | |
436 | #undef FLD | |
437 | } | |
438 | ||
439 | /* sub: sub $Rj,$Ri */ | |
440 | ||
96baa820 | 441 | static SEM_PC |
c906108c SS |
442 | SEM_FN_NAME (fr30bf,sub) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
443 | { | |
96baa820 | 444 | #define FLD(f) abuf->fields.sfmt_add.f |
c906108c SS |
445 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
446 | int UNUSED written = 0; | |
447 | IADDR UNUSED pc = abuf->addr; | |
448 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
449 | ||
7a292a7a | 450 | { |
c906108c SS |
451 | { |
452 | BI opval = SUBOFSI (* FLD (i_Ri), * FLD (i_Rj), 0); | |
453 | CPU (h_vbit) = opval; | |
454 | TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval); | |
455 | } | |
456 | { | |
457 | BI opval = SUBCFSI (* FLD (i_Ri), * FLD (i_Rj), 0); | |
458 | CPU (h_cbit) = opval; | |
459 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
460 | } | |
461 | { | |
462 | SI opval = SUBSI (* FLD (i_Ri), * FLD (i_Rj)); | |
463 | * FLD (i_Ri) = opval; | |
464 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
465 | } | |
7a292a7a | 466 | { |
c906108c SS |
467 | { |
468 | BI opval = EQSI (* FLD (i_Ri), 0); | |
469 | CPU (h_zbit) = opval; | |
470 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
471 | } | |
472 | { | |
473 | BI opval = LTSI (* FLD (i_Ri), 0); | |
474 | CPU (h_nbit) = opval; | |
475 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
476 | } | |
7a292a7a SS |
477 | } |
478 | } | |
c906108c SS |
479 | |
480 | return vpc; | |
481 | #undef FLD | |
482 | } | |
483 | ||
484 | /* subc: subc $Rj,$Ri */ | |
485 | ||
96baa820 | 486 | static SEM_PC |
c906108c SS |
487 | SEM_FN_NAME (fr30bf,subc) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
488 | { | |
96baa820 | 489 | #define FLD(f) abuf->fields.sfmt_add.f |
c906108c SS |
490 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
491 | int UNUSED written = 0; | |
492 | IADDR UNUSED pc = abuf->addr; | |
493 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
494 | ||
7a292a7a | 495 | { |
c906108c SS |
496 | SI tmp_tmp; |
497 | tmp_tmp = SUBCSI (* FLD (i_Ri), * FLD (i_Rj), CPU (h_cbit)); | |
498 | { | |
499 | BI opval = SUBOFSI (* FLD (i_Ri), * FLD (i_Rj), CPU (h_cbit)); | |
500 | CPU (h_vbit) = opval; | |
501 | TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval); | |
502 | } | |
503 | { | |
504 | BI opval = SUBCFSI (* FLD (i_Ri), * FLD (i_Rj), CPU (h_cbit)); | |
505 | CPU (h_cbit) = opval; | |
506 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
507 | } | |
508 | { | |
509 | SI opval = tmp_tmp; | |
510 | * FLD (i_Ri) = opval; | |
511 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
512 | } | |
7a292a7a | 513 | { |
c906108c SS |
514 | { |
515 | BI opval = EQSI (* FLD (i_Ri), 0); | |
516 | CPU (h_zbit) = opval; | |
517 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
518 | } | |
519 | { | |
520 | BI opval = LTSI (* FLD (i_Ri), 0); | |
521 | CPU (h_nbit) = opval; | |
522 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
523 | } | |
7a292a7a SS |
524 | } |
525 | } | |
c906108c SS |
526 | |
527 | return vpc; | |
528 | #undef FLD | |
529 | } | |
530 | ||
531 | /* subn: subn $Rj,$Ri */ | |
532 | ||
96baa820 | 533 | static SEM_PC |
c906108c SS |
534 | SEM_FN_NAME (fr30bf,subn) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
535 | { | |
96baa820 | 536 | #define FLD(f) abuf->fields.sfmt_add.f |
c906108c SS |
537 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
538 | int UNUSED written = 0; | |
539 | IADDR UNUSED pc = abuf->addr; | |
540 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
541 | ||
542 | { | |
543 | SI opval = SUBSI (* FLD (i_Ri), * FLD (i_Rj)); | |
544 | * FLD (i_Ri) = opval; | |
545 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
546 | } | |
547 | ||
548 | return vpc; | |
549 | #undef FLD | |
550 | } | |
551 | ||
552 | /* cmp: cmp $Rj,$Ri */ | |
553 | ||
96baa820 | 554 | static SEM_PC |
c906108c SS |
555 | SEM_FN_NAME (fr30bf,cmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
556 | { | |
96baa820 | 557 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
558 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
559 | int UNUSED written = 0; | |
560 | IADDR UNUSED pc = abuf->addr; | |
561 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
562 | ||
7a292a7a | 563 | { |
c906108c SS |
564 | SI tmp_tmp1; |
565 | { | |
566 | BI opval = SUBOFSI (* FLD (i_Ri), * FLD (i_Rj), 0); | |
567 | CPU (h_vbit) = opval; | |
568 | TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval); | |
569 | } | |
570 | { | |
571 | BI opval = SUBCFSI (* FLD (i_Ri), * FLD (i_Rj), 0); | |
572 | CPU (h_cbit) = opval; | |
573 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
574 | } | |
575 | tmp_tmp1 = SUBSI (* FLD (i_Ri), * FLD (i_Rj)); | |
7a292a7a | 576 | { |
c906108c SS |
577 | { |
578 | BI opval = EQSI (tmp_tmp1, 0); | |
579 | CPU (h_zbit) = opval; | |
580 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
581 | } | |
582 | { | |
583 | BI opval = LTSI (tmp_tmp1, 0); | |
584 | CPU (h_nbit) = opval; | |
585 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
586 | } | |
7a292a7a SS |
587 | } |
588 | } | |
c906108c SS |
589 | |
590 | return vpc; | |
591 | #undef FLD | |
592 | } | |
593 | ||
594 | /* cmpi: cmp $u4,$Ri */ | |
595 | ||
96baa820 | 596 | static SEM_PC |
c906108c SS |
597 | SEM_FN_NAME (fr30bf,cmpi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
598 | { | |
96baa820 | 599 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
600 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
601 | int UNUSED written = 0; | |
602 | IADDR UNUSED pc = abuf->addr; | |
603 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
604 | ||
7a292a7a | 605 | { |
c906108c SS |
606 | SI tmp_tmp1; |
607 | { | |
608 | BI opval = SUBOFSI (* FLD (i_Ri), FLD (f_u4), 0); | |
609 | CPU (h_vbit) = opval; | |
610 | TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval); | |
611 | } | |
612 | { | |
613 | BI opval = SUBCFSI (* FLD (i_Ri), FLD (f_u4), 0); | |
614 | CPU (h_cbit) = opval; | |
615 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
616 | } | |
617 | tmp_tmp1 = SUBSI (* FLD (i_Ri), FLD (f_u4)); | |
7a292a7a | 618 | { |
c906108c SS |
619 | { |
620 | BI opval = EQSI (tmp_tmp1, 0); | |
621 | CPU (h_zbit) = opval; | |
622 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
623 | } | |
624 | { | |
625 | BI opval = LTSI (tmp_tmp1, 0); | |
626 | CPU (h_nbit) = opval; | |
627 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
628 | } | |
7a292a7a SS |
629 | } |
630 | } | |
c906108c SS |
631 | |
632 | return vpc; | |
633 | #undef FLD | |
634 | } | |
635 | ||
636 | /* cmp2: cmp2 $m4,$Ri */ | |
637 | ||
96baa820 | 638 | static SEM_PC |
c906108c SS |
639 | SEM_FN_NAME (fr30bf,cmp2) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
640 | { | |
96baa820 | 641 | #define FLD(f) abuf->fields.sfmt_add2.f |
c906108c SS |
642 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
643 | int UNUSED written = 0; | |
644 | IADDR UNUSED pc = abuf->addr; | |
645 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
646 | ||
7a292a7a | 647 | { |
c906108c SS |
648 | SI tmp_tmp1; |
649 | { | |
650 | BI opval = SUBOFSI (* FLD (i_Ri), FLD (f_m4), 0); | |
651 | CPU (h_vbit) = opval; | |
652 | TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval); | |
653 | } | |
654 | { | |
655 | BI opval = SUBCFSI (* FLD (i_Ri), FLD (f_m4), 0); | |
656 | CPU (h_cbit) = opval; | |
657 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
658 | } | |
659 | tmp_tmp1 = SUBSI (* FLD (i_Ri), FLD (f_m4)); | |
7a292a7a | 660 | { |
c906108c SS |
661 | { |
662 | BI opval = EQSI (tmp_tmp1, 0); | |
663 | CPU (h_zbit) = opval; | |
664 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
665 | } | |
666 | { | |
667 | BI opval = LTSI (tmp_tmp1, 0); | |
668 | CPU (h_nbit) = opval; | |
669 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
670 | } | |
7a292a7a SS |
671 | } |
672 | } | |
c906108c SS |
673 | |
674 | return vpc; | |
675 | #undef FLD | |
676 | } | |
677 | ||
678 | /* and: and $Rj,$Ri */ | |
679 | ||
96baa820 | 680 | static SEM_PC |
c906108c SS |
681 | SEM_FN_NAME (fr30bf,and) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
682 | { | |
96baa820 | 683 | #define FLD(f) abuf->fields.sfmt_add.f |
c906108c SS |
684 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
685 | int UNUSED written = 0; | |
686 | IADDR UNUSED pc = abuf->addr; | |
687 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
688 | ||
7a292a7a | 689 | { |
c906108c SS |
690 | { |
691 | SI opval = ANDSI (* FLD (i_Ri), * FLD (i_Rj)); | |
692 | * FLD (i_Ri) = opval; | |
693 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
694 | } | |
7a292a7a | 695 | { |
c906108c SS |
696 | { |
697 | BI opval = EQSI (* FLD (i_Ri), 0); | |
698 | CPU (h_zbit) = opval; | |
699 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
700 | } | |
701 | { | |
702 | BI opval = LTSI (* FLD (i_Ri), 0); | |
703 | CPU (h_nbit) = opval; | |
704 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
705 | } | |
7a292a7a SS |
706 | } |
707 | } | |
c906108c SS |
708 | |
709 | return vpc; | |
710 | #undef FLD | |
711 | } | |
712 | ||
713 | /* or: or $Rj,$Ri */ | |
714 | ||
96baa820 | 715 | static SEM_PC |
c906108c SS |
716 | SEM_FN_NAME (fr30bf,or) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
717 | { | |
96baa820 | 718 | #define FLD(f) abuf->fields.sfmt_add.f |
c906108c SS |
719 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
720 | int UNUSED written = 0; | |
721 | IADDR UNUSED pc = abuf->addr; | |
722 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
723 | ||
7a292a7a | 724 | { |
c906108c SS |
725 | { |
726 | SI opval = ORSI (* FLD (i_Ri), * FLD (i_Rj)); | |
727 | * FLD (i_Ri) = opval; | |
728 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
729 | } | |
7a292a7a | 730 | { |
c906108c SS |
731 | { |
732 | BI opval = EQSI (* FLD (i_Ri), 0); | |
733 | CPU (h_zbit) = opval; | |
734 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
735 | } | |
736 | { | |
737 | BI opval = LTSI (* FLD (i_Ri), 0); | |
738 | CPU (h_nbit) = opval; | |
739 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
740 | } | |
7a292a7a SS |
741 | } |
742 | } | |
c906108c SS |
743 | |
744 | return vpc; | |
745 | #undef FLD | |
746 | } | |
747 | ||
748 | /* eor: eor $Rj,$Ri */ | |
749 | ||
96baa820 | 750 | static SEM_PC |
c906108c SS |
751 | SEM_FN_NAME (fr30bf,eor) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
752 | { | |
96baa820 | 753 | #define FLD(f) abuf->fields.sfmt_add.f |
c906108c SS |
754 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
755 | int UNUSED written = 0; | |
756 | IADDR UNUSED pc = abuf->addr; | |
757 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
758 | ||
7a292a7a | 759 | { |
c906108c SS |
760 | { |
761 | SI opval = XORSI (* FLD (i_Ri), * FLD (i_Rj)); | |
762 | * FLD (i_Ri) = opval; | |
763 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
764 | } | |
7a292a7a | 765 | { |
c906108c SS |
766 | { |
767 | BI opval = EQSI (* FLD (i_Ri), 0); | |
768 | CPU (h_zbit) = opval; | |
769 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
770 | } | |
771 | { | |
772 | BI opval = LTSI (* FLD (i_Ri), 0); | |
773 | CPU (h_nbit) = opval; | |
774 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
775 | } | |
7a292a7a SS |
776 | } |
777 | } | |
c906108c SS |
778 | |
779 | return vpc; | |
780 | #undef FLD | |
781 | } | |
782 | ||
783 | /* andm: and $Rj,@$Ri */ | |
784 | ||
96baa820 | 785 | static SEM_PC |
c906108c SS |
786 | SEM_FN_NAME (fr30bf,andm) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
787 | { | |
96baa820 | 788 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
789 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
790 | int UNUSED written = 0; | |
791 | IADDR UNUSED pc = abuf->addr; | |
792 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
793 | ||
7a292a7a | 794 | { |
c906108c SS |
795 | SI tmp_tmp; |
796 | tmp_tmp = ANDSI (GETMEMSI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj)); | |
7a292a7a | 797 | { |
c906108c SS |
798 | { |
799 | BI opval = EQSI (tmp_tmp, 0); | |
800 | CPU (h_zbit) = opval; | |
801 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
802 | } | |
803 | { | |
804 | BI opval = LTSI (tmp_tmp, 0); | |
805 | CPU (h_nbit) = opval; | |
806 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
807 | } | |
7a292a7a | 808 | } |
c906108c SS |
809 | { |
810 | SI opval = tmp_tmp; | |
811 | SETMEMSI (current_cpu, pc, * FLD (i_Ri), opval); | |
812 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
813 | } | |
7a292a7a | 814 | } |
c906108c SS |
815 | |
816 | return vpc; | |
817 | #undef FLD | |
818 | } | |
819 | ||
820 | /* andh: andh $Rj,@$Ri */ | |
821 | ||
96baa820 | 822 | static SEM_PC |
c906108c SS |
823 | SEM_FN_NAME (fr30bf,andh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
824 | { | |
96baa820 | 825 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
826 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
827 | int UNUSED written = 0; | |
828 | IADDR UNUSED pc = abuf->addr; | |
829 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
830 | ||
7a292a7a | 831 | { |
c906108c SS |
832 | HI tmp_tmp; |
833 | tmp_tmp = ANDHI (GETMEMHI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj)); | |
7a292a7a | 834 | { |
c906108c SS |
835 | { |
836 | BI opval = EQHI (tmp_tmp, 0); | |
837 | CPU (h_zbit) = opval; | |
838 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
839 | } | |
840 | { | |
841 | BI opval = LTHI (tmp_tmp, 0); | |
842 | CPU (h_nbit) = opval; | |
843 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
844 | } | |
7a292a7a | 845 | } |
c906108c SS |
846 | { |
847 | HI opval = tmp_tmp; | |
848 | SETMEMHI (current_cpu, pc, * FLD (i_Ri), opval); | |
849 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
850 | } | |
7a292a7a | 851 | } |
c906108c SS |
852 | |
853 | return vpc; | |
854 | #undef FLD | |
855 | } | |
856 | ||
857 | /* andb: andb $Rj,@$Ri */ | |
858 | ||
96baa820 | 859 | static SEM_PC |
c906108c SS |
860 | SEM_FN_NAME (fr30bf,andb) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
861 | { | |
96baa820 | 862 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
863 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
864 | int UNUSED written = 0; | |
865 | IADDR UNUSED pc = abuf->addr; | |
866 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
867 | ||
7a292a7a | 868 | { |
c906108c SS |
869 | QI tmp_tmp; |
870 | tmp_tmp = ANDQI (GETMEMQI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj)); | |
7a292a7a | 871 | { |
c906108c SS |
872 | { |
873 | BI opval = EQQI (tmp_tmp, 0); | |
874 | CPU (h_zbit) = opval; | |
875 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
876 | } | |
877 | { | |
878 | BI opval = LTQI (tmp_tmp, 0); | |
879 | CPU (h_nbit) = opval; | |
880 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
881 | } | |
7a292a7a | 882 | } |
c906108c SS |
883 | { |
884 | QI opval = tmp_tmp; | |
885 | SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval); | |
886 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
887 | } | |
7a292a7a | 888 | } |
c906108c SS |
889 | |
890 | return vpc; | |
891 | #undef FLD | |
892 | } | |
893 | ||
894 | /* orm: or $Rj,@$Ri */ | |
895 | ||
96baa820 | 896 | static SEM_PC |
c906108c SS |
897 | SEM_FN_NAME (fr30bf,orm) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
898 | { | |
96baa820 | 899 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
900 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
901 | int UNUSED written = 0; | |
902 | IADDR UNUSED pc = abuf->addr; | |
903 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
904 | ||
7a292a7a | 905 | { |
c906108c SS |
906 | SI tmp_tmp; |
907 | tmp_tmp = ORSI (GETMEMSI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj)); | |
7a292a7a | 908 | { |
c906108c SS |
909 | { |
910 | BI opval = EQSI (tmp_tmp, 0); | |
911 | CPU (h_zbit) = opval; | |
912 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
913 | } | |
914 | { | |
915 | BI opval = LTSI (tmp_tmp, 0); | |
916 | CPU (h_nbit) = opval; | |
917 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
918 | } | |
7a292a7a | 919 | } |
c906108c SS |
920 | { |
921 | SI opval = tmp_tmp; | |
922 | SETMEMSI (current_cpu, pc, * FLD (i_Ri), opval); | |
923 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
924 | } | |
7a292a7a | 925 | } |
c906108c SS |
926 | |
927 | return vpc; | |
928 | #undef FLD | |
929 | } | |
930 | ||
931 | /* orh: orh $Rj,@$Ri */ | |
932 | ||
96baa820 | 933 | static SEM_PC |
c906108c SS |
934 | SEM_FN_NAME (fr30bf,orh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
935 | { | |
96baa820 | 936 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
937 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
938 | int UNUSED written = 0; | |
939 | IADDR UNUSED pc = abuf->addr; | |
940 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
941 | ||
7a292a7a | 942 | { |
c906108c SS |
943 | HI tmp_tmp; |
944 | tmp_tmp = ORHI (GETMEMHI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj)); | |
7a292a7a | 945 | { |
c906108c SS |
946 | { |
947 | BI opval = EQHI (tmp_tmp, 0); | |
948 | CPU (h_zbit) = opval; | |
949 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
950 | } | |
951 | { | |
952 | BI opval = LTHI (tmp_tmp, 0); | |
953 | CPU (h_nbit) = opval; | |
954 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
955 | } | |
7a292a7a | 956 | } |
c906108c SS |
957 | { |
958 | HI opval = tmp_tmp; | |
959 | SETMEMHI (current_cpu, pc, * FLD (i_Ri), opval); | |
960 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
961 | } | |
7a292a7a | 962 | } |
c906108c SS |
963 | |
964 | return vpc; | |
965 | #undef FLD | |
966 | } | |
967 | ||
968 | /* orb: orb $Rj,@$Ri */ | |
969 | ||
96baa820 | 970 | static SEM_PC |
c906108c SS |
971 | SEM_FN_NAME (fr30bf,orb) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
972 | { | |
96baa820 | 973 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
974 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
975 | int UNUSED written = 0; | |
976 | IADDR UNUSED pc = abuf->addr; | |
977 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
978 | ||
7a292a7a | 979 | { |
c906108c SS |
980 | QI tmp_tmp; |
981 | tmp_tmp = ORQI (GETMEMQI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj)); | |
7a292a7a | 982 | { |
c906108c SS |
983 | { |
984 | BI opval = EQQI (tmp_tmp, 0); | |
985 | CPU (h_zbit) = opval; | |
986 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
987 | } | |
988 | { | |
989 | BI opval = LTQI (tmp_tmp, 0); | |
990 | CPU (h_nbit) = opval; | |
991 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
992 | } | |
7a292a7a | 993 | } |
c906108c SS |
994 | { |
995 | QI opval = tmp_tmp; | |
996 | SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval); | |
997 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
998 | } | |
7a292a7a | 999 | } |
c906108c SS |
1000 | |
1001 | return vpc; | |
1002 | #undef FLD | |
1003 | } | |
1004 | ||
1005 | /* eorm: eor $Rj,@$Ri */ | |
1006 | ||
96baa820 | 1007 | static SEM_PC |
c906108c SS |
1008 | SEM_FN_NAME (fr30bf,eorm) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1009 | { | |
96baa820 | 1010 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
1011 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1012 | int UNUSED written = 0; | |
1013 | IADDR UNUSED pc = abuf->addr; | |
1014 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1015 | ||
7a292a7a | 1016 | { |
c906108c SS |
1017 | SI tmp_tmp; |
1018 | tmp_tmp = XORSI (GETMEMSI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj)); | |
7a292a7a | 1019 | { |
c906108c SS |
1020 | { |
1021 | BI opval = EQSI (tmp_tmp, 0); | |
1022 | CPU (h_zbit) = opval; | |
1023 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1024 | } | |
1025 | { | |
1026 | BI opval = LTSI (tmp_tmp, 0); | |
1027 | CPU (h_nbit) = opval; | |
1028 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
1029 | } | |
7a292a7a | 1030 | } |
c906108c SS |
1031 | { |
1032 | SI opval = tmp_tmp; | |
1033 | SETMEMSI (current_cpu, pc, * FLD (i_Ri), opval); | |
1034 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
1035 | } | |
7a292a7a | 1036 | } |
c906108c SS |
1037 | |
1038 | return vpc; | |
1039 | #undef FLD | |
1040 | } | |
1041 | ||
1042 | /* eorh: eorh $Rj,@$Ri */ | |
1043 | ||
96baa820 | 1044 | static SEM_PC |
c906108c SS |
1045 | SEM_FN_NAME (fr30bf,eorh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1046 | { | |
96baa820 | 1047 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
1048 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1049 | int UNUSED written = 0; | |
1050 | IADDR UNUSED pc = abuf->addr; | |
1051 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1052 | ||
7a292a7a | 1053 | { |
c906108c SS |
1054 | HI tmp_tmp; |
1055 | tmp_tmp = XORHI (GETMEMHI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj)); | |
7a292a7a | 1056 | { |
c906108c SS |
1057 | { |
1058 | BI opval = EQHI (tmp_tmp, 0); | |
1059 | CPU (h_zbit) = opval; | |
1060 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1061 | } | |
1062 | { | |
1063 | BI opval = LTHI (tmp_tmp, 0); | |
1064 | CPU (h_nbit) = opval; | |
1065 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
1066 | } | |
7a292a7a | 1067 | } |
c906108c SS |
1068 | { |
1069 | HI opval = tmp_tmp; | |
1070 | SETMEMHI (current_cpu, pc, * FLD (i_Ri), opval); | |
1071 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
1072 | } | |
7a292a7a | 1073 | } |
c906108c SS |
1074 | |
1075 | return vpc; | |
1076 | #undef FLD | |
1077 | } | |
1078 | ||
1079 | /* eorb: eorb $Rj,@$Ri */ | |
1080 | ||
96baa820 | 1081 | static SEM_PC |
c906108c SS |
1082 | SEM_FN_NAME (fr30bf,eorb) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1083 | { | |
96baa820 | 1084 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
1085 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1086 | int UNUSED written = 0; | |
1087 | IADDR UNUSED pc = abuf->addr; | |
1088 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1089 | ||
7a292a7a | 1090 | { |
c906108c SS |
1091 | QI tmp_tmp; |
1092 | tmp_tmp = XORQI (GETMEMQI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj)); | |
7a292a7a | 1093 | { |
c906108c SS |
1094 | { |
1095 | BI opval = EQQI (tmp_tmp, 0); | |
1096 | CPU (h_zbit) = opval; | |
1097 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1098 | } | |
1099 | { | |
1100 | BI opval = LTQI (tmp_tmp, 0); | |
1101 | CPU (h_nbit) = opval; | |
1102 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
1103 | } | |
7a292a7a | 1104 | } |
c906108c SS |
1105 | { |
1106 | QI opval = tmp_tmp; | |
1107 | SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval); | |
1108 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
1109 | } | |
7a292a7a | 1110 | } |
c906108c SS |
1111 | |
1112 | return vpc; | |
1113 | #undef FLD | |
1114 | } | |
1115 | ||
1116 | /* bandl: bandl $u4,@$Ri */ | |
1117 | ||
96baa820 | 1118 | static SEM_PC |
c906108c SS |
1119 | SEM_FN_NAME (fr30bf,bandl) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1120 | { | |
96baa820 | 1121 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
1122 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1123 | int UNUSED written = 0; | |
1124 | IADDR UNUSED pc = abuf->addr; | |
1125 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1126 | ||
1127 | { | |
1128 | QI opval = ANDQI (ORQI (FLD (f_u4), 240), GETMEMQI (current_cpu, pc, * FLD (i_Ri))); | |
1129 | SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval); | |
1130 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
1131 | } | |
1132 | ||
1133 | return vpc; | |
1134 | #undef FLD | |
1135 | } | |
1136 | ||
1137 | /* borl: borl $u4,@$Ri */ | |
1138 | ||
96baa820 | 1139 | static SEM_PC |
c906108c SS |
1140 | SEM_FN_NAME (fr30bf,borl) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1141 | { | |
96baa820 | 1142 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
1143 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1144 | int UNUSED written = 0; | |
1145 | IADDR UNUSED pc = abuf->addr; | |
1146 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1147 | ||
1148 | { | |
1149 | QI opval = ORQI (FLD (f_u4), GETMEMQI (current_cpu, pc, * FLD (i_Ri))); | |
1150 | SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval); | |
1151 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
1152 | } | |
1153 | ||
1154 | return vpc; | |
1155 | #undef FLD | |
1156 | } | |
1157 | ||
1158 | /* beorl: beorl $u4,@$Ri */ | |
1159 | ||
96baa820 | 1160 | static SEM_PC |
c906108c SS |
1161 | SEM_FN_NAME (fr30bf,beorl) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1162 | { | |
96baa820 | 1163 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
1164 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1165 | int UNUSED written = 0; | |
1166 | IADDR UNUSED pc = abuf->addr; | |
1167 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1168 | ||
1169 | { | |
1170 | QI opval = XORQI (FLD (f_u4), GETMEMQI (current_cpu, pc, * FLD (i_Ri))); | |
1171 | SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval); | |
1172 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
1173 | } | |
1174 | ||
1175 | return vpc; | |
1176 | #undef FLD | |
1177 | } | |
1178 | ||
1179 | /* bandh: bandh $u4,@$Ri */ | |
1180 | ||
96baa820 | 1181 | static SEM_PC |
c906108c SS |
1182 | SEM_FN_NAME (fr30bf,bandh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1183 | { | |
96baa820 | 1184 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
1185 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1186 | int UNUSED written = 0; | |
1187 | IADDR UNUSED pc = abuf->addr; | |
1188 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1189 | ||
1190 | { | |
1191 | QI opval = ANDQI (ORQI (SLLQI (FLD (f_u4), 4), 15), GETMEMQI (current_cpu, pc, * FLD (i_Ri))); | |
1192 | SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval); | |
1193 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
1194 | } | |
1195 | ||
1196 | return vpc; | |
1197 | #undef FLD | |
1198 | } | |
1199 | ||
1200 | /* borh: borh $u4,@$Ri */ | |
1201 | ||
96baa820 | 1202 | static SEM_PC |
c906108c SS |
1203 | SEM_FN_NAME (fr30bf,borh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1204 | { | |
96baa820 | 1205 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
1206 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1207 | int UNUSED written = 0; | |
1208 | IADDR UNUSED pc = abuf->addr; | |
1209 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1210 | ||
1211 | { | |
1212 | QI opval = ORQI (SLLQI (FLD (f_u4), 4), GETMEMQI (current_cpu, pc, * FLD (i_Ri))); | |
1213 | SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval); | |
1214 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
1215 | } | |
1216 | ||
1217 | return vpc; | |
1218 | #undef FLD | |
1219 | } | |
1220 | ||
1221 | /* beorh: beorh $u4,@$Ri */ | |
1222 | ||
96baa820 | 1223 | static SEM_PC |
c906108c SS |
1224 | SEM_FN_NAME (fr30bf,beorh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1225 | { | |
96baa820 | 1226 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
1227 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1228 | int UNUSED written = 0; | |
1229 | IADDR UNUSED pc = abuf->addr; | |
1230 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1231 | ||
1232 | { | |
1233 | QI opval = XORQI (SLLQI (FLD (f_u4), 4), GETMEMQI (current_cpu, pc, * FLD (i_Ri))); | |
1234 | SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval); | |
1235 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
1236 | } | |
1237 | ||
1238 | return vpc; | |
1239 | #undef FLD | |
1240 | } | |
1241 | ||
1242 | /* btstl: btstl $u4,@$Ri */ | |
1243 | ||
96baa820 | 1244 | static SEM_PC |
c906108c SS |
1245 | SEM_FN_NAME (fr30bf,btstl) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1246 | { | |
96baa820 | 1247 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
1248 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1249 | int UNUSED written = 0; | |
1250 | IADDR UNUSED pc = abuf->addr; | |
1251 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1252 | ||
7a292a7a | 1253 | { |
c906108c SS |
1254 | QI tmp_tmp; |
1255 | tmp_tmp = ANDQI (FLD (f_u4), GETMEMQI (current_cpu, pc, * FLD (i_Ri))); | |
1256 | { | |
1257 | BI opval = EQQI (tmp_tmp, 0); | |
1258 | CPU (h_zbit) = opval; | |
1259 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1260 | } | |
1261 | { | |
1262 | BI opval = 0; | |
1263 | CPU (h_nbit) = opval; | |
1264 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
1265 | } | |
7a292a7a | 1266 | } |
c906108c SS |
1267 | |
1268 | return vpc; | |
1269 | #undef FLD | |
1270 | } | |
1271 | ||
1272 | /* btsth: btsth $u4,@$Ri */ | |
1273 | ||
96baa820 | 1274 | static SEM_PC |
c906108c SS |
1275 | SEM_FN_NAME (fr30bf,btsth) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1276 | { | |
96baa820 | 1277 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
1278 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1279 | int UNUSED written = 0; | |
1280 | IADDR UNUSED pc = abuf->addr; | |
1281 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1282 | ||
7a292a7a | 1283 | { |
c906108c SS |
1284 | QI tmp_tmp; |
1285 | tmp_tmp = ANDQI (SLLQI (FLD (f_u4), 4), GETMEMQI (current_cpu, pc, * FLD (i_Ri))); | |
1286 | { | |
1287 | BI opval = EQQI (tmp_tmp, 0); | |
1288 | CPU (h_zbit) = opval; | |
1289 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1290 | } | |
1291 | { | |
1292 | BI opval = LTQI (tmp_tmp, 0); | |
1293 | CPU (h_nbit) = opval; | |
1294 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
1295 | } | |
7a292a7a | 1296 | } |
c906108c SS |
1297 | |
1298 | return vpc; | |
1299 | #undef FLD | |
1300 | } | |
1301 | ||
1302 | /* mul: mul $Rj,$Ri */ | |
1303 | ||
96baa820 | 1304 | static SEM_PC |
c906108c SS |
1305 | SEM_FN_NAME (fr30bf,mul) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1306 | { | |
96baa820 | 1307 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
1308 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1309 | int UNUSED written = 0; | |
1310 | IADDR UNUSED pc = abuf->addr; | |
1311 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1312 | ||
7a292a7a | 1313 | { |
c906108c SS |
1314 | DI tmp_tmp; |
1315 | tmp_tmp = MULDI (EXTSIDI (* FLD (i_Rj)), EXTSIDI (* FLD (i_Ri))); | |
1316 | { | |
1317 | SI opval = TRUNCDISI (tmp_tmp); | |
1318 | SET_H_DR (((UINT) 5), opval); | |
1319 | TRACE_RESULT (current_cpu, abuf, "dr-5", 'x', opval); | |
1320 | } | |
1321 | { | |
1322 | SI opval = TRUNCDISI (SRLDI (tmp_tmp, 32)); | |
1323 | SET_H_DR (((UINT) 4), opval); | |
1324 | TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval); | |
1325 | } | |
1326 | { | |
1327 | BI opval = LTSI (GET_H_DR (((UINT) 5)), 0); | |
1328 | CPU (h_nbit) = opval; | |
1329 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
1330 | } | |
1331 | { | |
1332 | BI opval = EQDI (tmp_tmp, MAKEDI (0, 0)); | |
1333 | CPU (h_zbit) = opval; | |
1334 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1335 | } | |
1336 | { | |
1337 | BI opval = ORIF (GTDI (tmp_tmp, MAKEDI (0, 2147483647)), LTDI (tmp_tmp, NEGDI (MAKEDI (0, 0x80000000)))); | |
1338 | CPU (h_vbit) = opval; | |
1339 | TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval); | |
1340 | } | |
7a292a7a | 1341 | } |
c906108c SS |
1342 | |
1343 | return vpc; | |
1344 | #undef FLD | |
1345 | } | |
1346 | ||
1347 | /* mulu: mulu $Rj,$Ri */ | |
1348 | ||
96baa820 | 1349 | static SEM_PC |
c906108c SS |
1350 | SEM_FN_NAME (fr30bf,mulu) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1351 | { | |
96baa820 | 1352 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
1353 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1354 | int UNUSED written = 0; | |
1355 | IADDR UNUSED pc = abuf->addr; | |
1356 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1357 | ||
7a292a7a | 1358 | { |
c906108c SS |
1359 | DI tmp_tmp; |
1360 | tmp_tmp = MULDI (ZEXTSIDI (* FLD (i_Rj)), ZEXTSIDI (* FLD (i_Ri))); | |
1361 | { | |
1362 | SI opval = TRUNCDISI (tmp_tmp); | |
1363 | SET_H_DR (((UINT) 5), opval); | |
1364 | TRACE_RESULT (current_cpu, abuf, "dr-5", 'x', opval); | |
1365 | } | |
1366 | { | |
1367 | SI opval = TRUNCDISI (SRLDI (tmp_tmp, 32)); | |
1368 | SET_H_DR (((UINT) 4), opval); | |
1369 | TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval); | |
1370 | } | |
1371 | { | |
1372 | BI opval = LTSI (GET_H_DR (((UINT) 4)), 0); | |
1373 | CPU (h_nbit) = opval; | |
1374 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
1375 | } | |
1376 | { | |
1377 | BI opval = EQSI (GET_H_DR (((UINT) 5)), 0); | |
1378 | CPU (h_zbit) = opval; | |
1379 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1380 | } | |
1381 | { | |
1382 | BI opval = NESI (GET_H_DR (((UINT) 4)), 0); | |
1383 | CPU (h_vbit) = opval; | |
1384 | TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval); | |
1385 | } | |
7a292a7a | 1386 | } |
c906108c SS |
1387 | |
1388 | return vpc; | |
1389 | #undef FLD | |
1390 | } | |
1391 | ||
1392 | /* mulh: mulh $Rj,$Ri */ | |
1393 | ||
96baa820 | 1394 | static SEM_PC |
c906108c SS |
1395 | SEM_FN_NAME (fr30bf,mulh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1396 | { | |
96baa820 | 1397 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
1398 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1399 | int UNUSED written = 0; | |
1400 | IADDR UNUSED pc = abuf->addr; | |
1401 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1402 | ||
7a292a7a | 1403 | { |
c906108c SS |
1404 | { |
1405 | SI opval = MULHI (TRUNCSIHI (* FLD (i_Rj)), TRUNCSIHI (* FLD (i_Ri))); | |
1406 | SET_H_DR (((UINT) 5), opval); | |
1407 | TRACE_RESULT (current_cpu, abuf, "dr-5", 'x', opval); | |
1408 | } | |
1409 | { | |
1410 | BI opval = LTSI (GET_H_DR (((UINT) 5)), 0); | |
1411 | CPU (h_nbit) = opval; | |
1412 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
1413 | } | |
1414 | { | |
1415 | BI opval = GESI (GET_H_DR (((UINT) 5)), 0); | |
1416 | CPU (h_zbit) = opval; | |
1417 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1418 | } | |
7a292a7a | 1419 | } |
c906108c SS |
1420 | |
1421 | return vpc; | |
1422 | #undef FLD | |
1423 | } | |
1424 | ||
1425 | /* muluh: muluh $Rj,$Ri */ | |
1426 | ||
96baa820 | 1427 | static SEM_PC |
c906108c SS |
1428 | SEM_FN_NAME (fr30bf,muluh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1429 | { | |
96baa820 | 1430 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
1431 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1432 | int UNUSED written = 0; | |
1433 | IADDR UNUSED pc = abuf->addr; | |
1434 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1435 | ||
7a292a7a | 1436 | { |
c906108c SS |
1437 | { |
1438 | SI opval = MULSI (ANDSI (* FLD (i_Rj), 65535), ANDSI (* FLD (i_Ri), 65535)); | |
1439 | SET_H_DR (((UINT) 5), opval); | |
1440 | TRACE_RESULT (current_cpu, abuf, "dr-5", 'x', opval); | |
1441 | } | |
1442 | { | |
1443 | BI opval = LTSI (GET_H_DR (((UINT) 5)), 0); | |
1444 | CPU (h_nbit) = opval; | |
1445 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
1446 | } | |
1447 | { | |
1448 | BI opval = GESI (GET_H_DR (((UINT) 5)), 0); | |
1449 | CPU (h_zbit) = opval; | |
1450 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1451 | } | |
7a292a7a | 1452 | } |
c906108c SS |
1453 | |
1454 | return vpc; | |
1455 | #undef FLD | |
1456 | } | |
1457 | ||
1458 | /* div0s: div0s $Ri */ | |
1459 | ||
96baa820 | 1460 | static SEM_PC |
c906108c SS |
1461 | SEM_FN_NAME (fr30bf,div0s) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1462 | { | |
96baa820 | 1463 | #define FLD(f) abuf->fields.sfmt_mov2dr.f |
c906108c SS |
1464 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1465 | int UNUSED written = 0; | |
1466 | IADDR UNUSED pc = abuf->addr; | |
1467 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1468 | ||
7a292a7a | 1469 | { |
c906108c SS |
1470 | { |
1471 | BI opval = LTSI (GET_H_DR (((UINT) 5)), 0); | |
1472 | CPU (h_d0bit) = opval; | |
1473 | TRACE_RESULT (current_cpu, abuf, "d0bit", 'x', opval); | |
1474 | } | |
1475 | { | |
1476 | BI opval = XORBI (CPU (h_d0bit), LTSI (* FLD (i_Ri), 0)); | |
1477 | CPU (h_d1bit) = opval; | |
1478 | TRACE_RESULT (current_cpu, abuf, "d1bit", 'x', opval); | |
1479 | } | |
1480 | if (NEBI (CPU (h_d0bit), 0)) { | |
1481 | { | |
1482 | SI opval = 0xffffffff; | |
1483 | SET_H_DR (((UINT) 4), opval); | |
1484 | written |= (1 << 5); | |
1485 | TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval); | |
1486 | } | |
1487 | } else { | |
1488 | { | |
1489 | SI opval = 0; | |
1490 | SET_H_DR (((UINT) 4), opval); | |
1491 | written |= (1 << 5); | |
1492 | TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval); | |
1493 | } | |
1494 | } | |
7a292a7a | 1495 | } |
c906108c SS |
1496 | |
1497 | abuf->written = written; | |
1498 | return vpc; | |
1499 | #undef FLD | |
1500 | } | |
1501 | ||
1502 | /* div0u: div0u $Ri */ | |
1503 | ||
96baa820 | 1504 | static SEM_PC |
c906108c SS |
1505 | SEM_FN_NAME (fr30bf,div0u) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1506 | { | |
96baa820 | 1507 | #define FLD(f) abuf->fields.fmt_empty.f |
c906108c SS |
1508 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1509 | int UNUSED written = 0; | |
1510 | IADDR UNUSED pc = abuf->addr; | |
1511 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1512 | ||
7a292a7a | 1513 | { |
c906108c SS |
1514 | { |
1515 | BI opval = 0; | |
1516 | CPU (h_d0bit) = opval; | |
1517 | TRACE_RESULT (current_cpu, abuf, "d0bit", 'x', opval); | |
1518 | } | |
1519 | { | |
1520 | BI opval = 0; | |
1521 | CPU (h_d1bit) = opval; | |
1522 | TRACE_RESULT (current_cpu, abuf, "d1bit", 'x', opval); | |
1523 | } | |
1524 | { | |
1525 | SI opval = 0; | |
1526 | SET_H_DR (((UINT) 4), opval); | |
1527 | TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval); | |
1528 | } | |
7a292a7a | 1529 | } |
c906108c SS |
1530 | |
1531 | return vpc; | |
1532 | #undef FLD | |
1533 | } | |
1534 | ||
1535 | /* div1: div1 $Ri */ | |
1536 | ||
96baa820 | 1537 | static SEM_PC |
c906108c SS |
1538 | SEM_FN_NAME (fr30bf,div1) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1539 | { | |
96baa820 | 1540 | #define FLD(f) abuf->fields.sfmt_mov2dr.f |
c906108c SS |
1541 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1542 | int UNUSED written = 0; | |
1543 | IADDR UNUSED pc = abuf->addr; | |
1544 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1545 | ||
7a292a7a | 1546 | { |
c906108c SS |
1547 | SI tmp_tmp; |
1548 | { | |
1549 | SI opval = SLLSI (GET_H_DR (((UINT) 4)), 1); | |
1550 | SET_H_DR (((UINT) 4), opval); | |
1551 | TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval); | |
1552 | } | |
1553 | if (LTSI (GET_H_DR (((UINT) 5)), 0)) { | |
1554 | { | |
1555 | SI opval = ADDSI (GET_H_DR (((UINT) 4)), 1); | |
1556 | SET_H_DR (((UINT) 4), opval); | |
1557 | TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval); | |
1558 | } | |
1559 | } | |
1560 | { | |
1561 | SI opval = SLLSI (GET_H_DR (((UINT) 5)), 1); | |
1562 | SET_H_DR (((UINT) 5), opval); | |
1563 | TRACE_RESULT (current_cpu, abuf, "dr-5", 'x', opval); | |
1564 | } | |
1565 | if (EQBI (CPU (h_d1bit), 1)) { | |
7a292a7a | 1566 | { |
c906108c SS |
1567 | tmp_tmp = ADDSI (GET_H_DR (((UINT) 4)), * FLD (i_Ri)); |
1568 | { | |
1569 | BI opval = ADDCFSI (GET_H_DR (((UINT) 4)), * FLD (i_Ri), 0); | |
1570 | CPU (h_cbit) = opval; | |
1571 | written |= (1 << 6); | |
1572 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
1573 | } | |
7a292a7a | 1574 | } |
c906108c | 1575 | } else { |
7a292a7a | 1576 | { |
c906108c SS |
1577 | tmp_tmp = SUBSI (GET_H_DR (((UINT) 4)), * FLD (i_Ri)); |
1578 | { | |
1579 | BI opval = SUBCFSI (GET_H_DR (((UINT) 4)), * FLD (i_Ri), 0); | |
1580 | CPU (h_cbit) = opval; | |
1581 | written |= (1 << 6); | |
1582 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
1583 | } | |
7a292a7a | 1584 | } |
c906108c SS |
1585 | } |
1586 | if (NOTBI (XORBI (XORBI (CPU (h_d0bit), CPU (h_d1bit)), CPU (h_cbit)))) { | |
7a292a7a | 1587 | { |
c906108c SS |
1588 | { |
1589 | SI opval = tmp_tmp; | |
1590 | SET_H_DR (((UINT) 4), opval); | |
1591 | TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval); | |
1592 | } | |
1593 | { | |
1594 | SI opval = ORSI (GET_H_DR (((UINT) 5)), 1); | |
1595 | SET_H_DR (((UINT) 5), opval); | |
1596 | TRACE_RESULT (current_cpu, abuf, "dr-5", 'x', opval); | |
1597 | } | |
7a292a7a | 1598 | } |
c906108c SS |
1599 | } |
1600 | { | |
1601 | BI opval = EQSI (GET_H_DR (((UINT) 4)), 0); | |
1602 | CPU (h_zbit) = opval; | |
1603 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1604 | } | |
7a292a7a | 1605 | } |
c906108c SS |
1606 | |
1607 | abuf->written = written; | |
1608 | return vpc; | |
1609 | #undef FLD | |
1610 | } | |
1611 | ||
1612 | /* div2: div2 $Ri */ | |
1613 | ||
96baa820 | 1614 | static SEM_PC |
c906108c SS |
1615 | SEM_FN_NAME (fr30bf,div2) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1616 | { | |
96baa820 | 1617 | #define FLD(f) abuf->fields.sfmt_mov2dr.f |
c906108c SS |
1618 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1619 | int UNUSED written = 0; | |
1620 | IADDR UNUSED pc = abuf->addr; | |
1621 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1622 | ||
7a292a7a | 1623 | { |
c906108c SS |
1624 | SI tmp_tmp; |
1625 | if (EQBI (CPU (h_d1bit), 1)) { | |
7a292a7a | 1626 | { |
c906108c SS |
1627 | tmp_tmp = ADDSI (GET_H_DR (((UINT) 4)), * FLD (i_Ri)); |
1628 | { | |
1629 | BI opval = ADDCFSI (GET_H_DR (((UINT) 4)), * FLD (i_Ri), 0); | |
1630 | CPU (h_cbit) = opval; | |
1631 | written |= (1 << 3); | |
1632 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
1633 | } | |
7a292a7a | 1634 | } |
c906108c | 1635 | } else { |
7a292a7a | 1636 | { |
c906108c SS |
1637 | tmp_tmp = SUBSI (GET_H_DR (((UINT) 4)), * FLD (i_Ri)); |
1638 | { | |
1639 | BI opval = SUBCFSI (GET_H_DR (((UINT) 4)), * FLD (i_Ri), 0); | |
1640 | CPU (h_cbit) = opval; | |
1641 | written |= (1 << 3); | |
1642 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
1643 | } | |
7a292a7a | 1644 | } |
c906108c SS |
1645 | } |
1646 | if (EQSI (tmp_tmp, 0)) { | |
7a292a7a | 1647 | { |
c906108c SS |
1648 | { |
1649 | BI opval = 1; | |
1650 | CPU (h_zbit) = opval; | |
1651 | written |= (1 << 5); | |
1652 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1653 | } | |
1654 | { | |
1655 | SI opval = 0; | |
1656 | SET_H_DR (((UINT) 4), opval); | |
1657 | written |= (1 << 4); | |
1658 | TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval); | |
1659 | } | |
7a292a7a | 1660 | } |
c906108c SS |
1661 | } else { |
1662 | { | |
1663 | BI opval = 0; | |
1664 | CPU (h_zbit) = opval; | |
1665 | written |= (1 << 5); | |
1666 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1667 | } | |
1668 | } | |
7a292a7a | 1669 | } |
c906108c SS |
1670 | |
1671 | abuf->written = written; | |
1672 | return vpc; | |
1673 | #undef FLD | |
1674 | } | |
1675 | ||
1676 | /* div3: div3 */ | |
1677 | ||
96baa820 | 1678 | static SEM_PC |
c906108c SS |
1679 | SEM_FN_NAME (fr30bf,div3) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1680 | { | |
96baa820 | 1681 | #define FLD(f) abuf->fields.fmt_empty.f |
c906108c SS |
1682 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1683 | int UNUSED written = 0; | |
1684 | IADDR UNUSED pc = abuf->addr; | |
1685 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1686 | ||
1687 | if (EQBI (CPU (h_zbit), 1)) { | |
1688 | { | |
1689 | SI opval = ADDSI (GET_H_DR (((UINT) 5)), 1); | |
1690 | SET_H_DR (((UINT) 5), opval); | |
1691 | written |= (1 << 2); | |
1692 | TRACE_RESULT (current_cpu, abuf, "dr-5", 'x', opval); | |
1693 | } | |
1694 | } | |
1695 | ||
1696 | abuf->written = written; | |
1697 | return vpc; | |
1698 | #undef FLD | |
1699 | } | |
1700 | ||
1701 | /* div4s: div4s */ | |
1702 | ||
96baa820 | 1703 | static SEM_PC |
c906108c SS |
1704 | SEM_FN_NAME (fr30bf,div4s) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1705 | { | |
96baa820 | 1706 | #define FLD(f) abuf->fields.fmt_empty.f |
c906108c SS |
1707 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1708 | int UNUSED written = 0; | |
1709 | IADDR UNUSED pc = abuf->addr; | |
1710 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1711 | ||
1712 | if (EQBI (CPU (h_d1bit), 1)) { | |
1713 | { | |
1714 | SI opval = NEGSI (GET_H_DR (((UINT) 5))); | |
1715 | SET_H_DR (((UINT) 5), opval); | |
1716 | written |= (1 << 2); | |
1717 | TRACE_RESULT (current_cpu, abuf, "dr-5", 'x', opval); | |
1718 | } | |
1719 | } | |
1720 | ||
1721 | abuf->written = written; | |
1722 | return vpc; | |
1723 | #undef FLD | |
1724 | } | |
1725 | ||
1726 | /* lsl: lsl $Rj,$Ri */ | |
1727 | ||
96baa820 | 1728 | static SEM_PC |
c906108c SS |
1729 | SEM_FN_NAME (fr30bf,lsl) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1730 | { | |
96baa820 | 1731 | #define FLD(f) abuf->fields.sfmt_add.f |
c906108c SS |
1732 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1733 | int UNUSED written = 0; | |
1734 | IADDR UNUSED pc = abuf->addr; | |
1735 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1736 | ||
7a292a7a | 1737 | { |
c906108c SS |
1738 | SI tmp_shift; |
1739 | tmp_shift = ANDSI (* FLD (i_Rj), 31); | |
1740 | if (NESI (tmp_shift, 0)) { | |
7a292a7a | 1741 | { |
c906108c SS |
1742 | { |
1743 | BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (32, tmp_shift))), 0); | |
1744 | CPU (h_cbit) = opval; | |
1745 | written |= (1 << 3); | |
1746 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
1747 | } | |
1748 | { | |
1749 | SI opval = SLLSI (* FLD (i_Ri), tmp_shift); | |
1750 | * FLD (i_Ri) = opval; | |
1751 | written |= (1 << 2); | |
1752 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
1753 | } | |
7a292a7a | 1754 | } |
c906108c SS |
1755 | } else { |
1756 | { | |
1757 | BI opval = 0; | |
1758 | CPU (h_cbit) = opval; | |
1759 | written |= (1 << 3); | |
1760 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
1761 | } | |
1762 | } | |
1763 | { | |
1764 | BI opval = LTSI (* FLD (i_Ri), 0); | |
1765 | CPU (h_nbit) = opval; | |
1766 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
1767 | } | |
1768 | { | |
1769 | BI opval = EQSI (* FLD (i_Ri), 0); | |
1770 | CPU (h_zbit) = opval; | |
1771 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1772 | } | |
7a292a7a | 1773 | } |
c906108c SS |
1774 | |
1775 | abuf->written = written; | |
1776 | return vpc; | |
1777 | #undef FLD | |
1778 | } | |
1779 | ||
1780 | /* lsli: lsl $u4,$Ri */ | |
1781 | ||
96baa820 | 1782 | static SEM_PC |
c906108c SS |
1783 | SEM_FN_NAME (fr30bf,lsli) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1784 | { | |
96baa820 | 1785 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
1786 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1787 | int UNUSED written = 0; | |
1788 | IADDR UNUSED pc = abuf->addr; | |
1789 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1790 | ||
7a292a7a | 1791 | { |
c906108c SS |
1792 | SI tmp_shift; |
1793 | tmp_shift = FLD (f_u4); | |
1794 | if (NESI (tmp_shift, 0)) { | |
7a292a7a | 1795 | { |
c906108c SS |
1796 | { |
1797 | BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (32, tmp_shift))), 0); | |
1798 | CPU (h_cbit) = opval; | |
1799 | written |= (1 << 3); | |
1800 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
1801 | } | |
1802 | { | |
1803 | SI opval = SLLSI (* FLD (i_Ri), tmp_shift); | |
1804 | * FLD (i_Ri) = opval; | |
1805 | written |= (1 << 2); | |
1806 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
1807 | } | |
7a292a7a | 1808 | } |
c906108c SS |
1809 | } else { |
1810 | { | |
1811 | BI opval = 0; | |
1812 | CPU (h_cbit) = opval; | |
1813 | written |= (1 << 3); | |
1814 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
1815 | } | |
1816 | } | |
1817 | { | |
1818 | BI opval = LTSI (* FLD (i_Ri), 0); | |
1819 | CPU (h_nbit) = opval; | |
1820 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
1821 | } | |
1822 | { | |
1823 | BI opval = EQSI (* FLD (i_Ri), 0); | |
1824 | CPU (h_zbit) = opval; | |
1825 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1826 | } | |
7a292a7a | 1827 | } |
c906108c SS |
1828 | |
1829 | abuf->written = written; | |
1830 | return vpc; | |
1831 | #undef FLD | |
1832 | } | |
1833 | ||
1834 | /* lsl2: lsl2 $u4,$Ri */ | |
1835 | ||
96baa820 | 1836 | static SEM_PC |
c906108c SS |
1837 | SEM_FN_NAME (fr30bf,lsl2) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1838 | { | |
96baa820 | 1839 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
1840 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1841 | int UNUSED written = 0; | |
1842 | IADDR UNUSED pc = abuf->addr; | |
1843 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1844 | ||
7a292a7a | 1845 | { |
c906108c SS |
1846 | SI tmp_shift; |
1847 | tmp_shift = ADDSI (FLD (f_u4), 16); | |
1848 | if (NESI (tmp_shift, 0)) { | |
7a292a7a | 1849 | { |
c906108c SS |
1850 | { |
1851 | BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (32, tmp_shift))), 0); | |
1852 | CPU (h_cbit) = opval; | |
1853 | written |= (1 << 3); | |
1854 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
1855 | } | |
1856 | { | |
1857 | SI opval = SLLSI (* FLD (i_Ri), tmp_shift); | |
1858 | * FLD (i_Ri) = opval; | |
1859 | written |= (1 << 2); | |
1860 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
1861 | } | |
7a292a7a | 1862 | } |
c906108c SS |
1863 | } else { |
1864 | { | |
1865 | BI opval = 0; | |
1866 | CPU (h_cbit) = opval; | |
1867 | written |= (1 << 3); | |
1868 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
1869 | } | |
1870 | } | |
1871 | { | |
1872 | BI opval = LTSI (* FLD (i_Ri), 0); | |
1873 | CPU (h_nbit) = opval; | |
1874 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
1875 | } | |
1876 | { | |
1877 | BI opval = EQSI (* FLD (i_Ri), 0); | |
1878 | CPU (h_zbit) = opval; | |
1879 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1880 | } | |
7a292a7a | 1881 | } |
c906108c SS |
1882 | |
1883 | abuf->written = written; | |
1884 | return vpc; | |
1885 | #undef FLD | |
1886 | } | |
1887 | ||
1888 | /* lsr: lsr $Rj,$Ri */ | |
1889 | ||
96baa820 | 1890 | static SEM_PC |
c906108c SS |
1891 | SEM_FN_NAME (fr30bf,lsr) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1892 | { | |
96baa820 | 1893 | #define FLD(f) abuf->fields.sfmt_add.f |
c906108c SS |
1894 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1895 | int UNUSED written = 0; | |
1896 | IADDR UNUSED pc = abuf->addr; | |
1897 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1898 | ||
7a292a7a | 1899 | { |
c906108c SS |
1900 | SI tmp_shift; |
1901 | tmp_shift = ANDSI (* FLD (i_Rj), 31); | |
1902 | if (NESI (tmp_shift, 0)) { | |
7a292a7a | 1903 | { |
c906108c SS |
1904 | { |
1905 | BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (tmp_shift, 1))), 0); | |
1906 | CPU (h_cbit) = opval; | |
1907 | written |= (1 << 3); | |
1908 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
1909 | } | |
1910 | { | |
1911 | SI opval = SRLSI (* FLD (i_Ri), tmp_shift); | |
1912 | * FLD (i_Ri) = opval; | |
1913 | written |= (1 << 2); | |
1914 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
1915 | } | |
7a292a7a | 1916 | } |
c906108c SS |
1917 | } else { |
1918 | { | |
1919 | BI opval = 0; | |
1920 | CPU (h_cbit) = opval; | |
1921 | written |= (1 << 3); | |
1922 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
1923 | } | |
1924 | } | |
1925 | { | |
1926 | BI opval = LTSI (* FLD (i_Ri), 0); | |
1927 | CPU (h_nbit) = opval; | |
1928 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
1929 | } | |
1930 | { | |
1931 | BI opval = EQSI (* FLD (i_Ri), 0); | |
1932 | CPU (h_zbit) = opval; | |
1933 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1934 | } | |
7a292a7a | 1935 | } |
c906108c SS |
1936 | |
1937 | abuf->written = written; | |
1938 | return vpc; | |
1939 | #undef FLD | |
1940 | } | |
1941 | ||
1942 | /* lsri: lsr $u4,$Ri */ | |
1943 | ||
96baa820 | 1944 | static SEM_PC |
c906108c SS |
1945 | SEM_FN_NAME (fr30bf,lsri) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
1946 | { | |
96baa820 | 1947 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
1948 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
1949 | int UNUSED written = 0; | |
1950 | IADDR UNUSED pc = abuf->addr; | |
1951 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
1952 | ||
7a292a7a | 1953 | { |
c906108c SS |
1954 | SI tmp_shift; |
1955 | tmp_shift = FLD (f_u4); | |
1956 | if (NESI (tmp_shift, 0)) { | |
7a292a7a | 1957 | { |
c906108c SS |
1958 | { |
1959 | BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (tmp_shift, 1))), 0); | |
1960 | CPU (h_cbit) = opval; | |
1961 | written |= (1 << 3); | |
1962 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
1963 | } | |
1964 | { | |
1965 | SI opval = SRLSI (* FLD (i_Ri), tmp_shift); | |
1966 | * FLD (i_Ri) = opval; | |
1967 | written |= (1 << 2); | |
1968 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
1969 | } | |
7a292a7a | 1970 | } |
c906108c SS |
1971 | } else { |
1972 | { | |
1973 | BI opval = 0; | |
1974 | CPU (h_cbit) = opval; | |
1975 | written |= (1 << 3); | |
1976 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
1977 | } | |
1978 | } | |
1979 | { | |
1980 | BI opval = LTSI (* FLD (i_Ri), 0); | |
1981 | CPU (h_nbit) = opval; | |
1982 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
1983 | } | |
1984 | { | |
1985 | BI opval = EQSI (* FLD (i_Ri), 0); | |
1986 | CPU (h_zbit) = opval; | |
1987 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
1988 | } | |
7a292a7a | 1989 | } |
c906108c SS |
1990 | |
1991 | abuf->written = written; | |
1992 | return vpc; | |
1993 | #undef FLD | |
1994 | } | |
1995 | ||
1996 | /* lsr2: lsr2 $u4,$Ri */ | |
1997 | ||
96baa820 | 1998 | static SEM_PC |
c906108c SS |
1999 | SEM_FN_NAME (fr30bf,lsr2) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2000 | { | |
96baa820 | 2001 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
2002 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2003 | int UNUSED written = 0; | |
2004 | IADDR UNUSED pc = abuf->addr; | |
2005 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2006 | ||
7a292a7a | 2007 | { |
c906108c SS |
2008 | SI tmp_shift; |
2009 | tmp_shift = ADDSI (FLD (f_u4), 16); | |
2010 | if (NESI (tmp_shift, 0)) { | |
7a292a7a | 2011 | { |
c906108c SS |
2012 | { |
2013 | BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (tmp_shift, 1))), 0); | |
2014 | CPU (h_cbit) = opval; | |
2015 | written |= (1 << 3); | |
2016 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
2017 | } | |
2018 | { | |
2019 | SI opval = SRLSI (* FLD (i_Ri), tmp_shift); | |
2020 | * FLD (i_Ri) = opval; | |
2021 | written |= (1 << 2); | |
2022 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2023 | } | |
7a292a7a | 2024 | } |
c906108c SS |
2025 | } else { |
2026 | { | |
2027 | BI opval = 0; | |
2028 | CPU (h_cbit) = opval; | |
2029 | written |= (1 << 3); | |
2030 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
2031 | } | |
2032 | } | |
2033 | { | |
2034 | BI opval = LTSI (* FLD (i_Ri), 0); | |
2035 | CPU (h_nbit) = opval; | |
2036 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
2037 | } | |
2038 | { | |
2039 | BI opval = EQSI (* FLD (i_Ri), 0); | |
2040 | CPU (h_zbit) = opval; | |
2041 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
2042 | } | |
7a292a7a | 2043 | } |
c906108c SS |
2044 | |
2045 | abuf->written = written; | |
2046 | return vpc; | |
2047 | #undef FLD | |
2048 | } | |
2049 | ||
2050 | /* asr: asr $Rj,$Ri */ | |
2051 | ||
96baa820 | 2052 | static SEM_PC |
c906108c SS |
2053 | SEM_FN_NAME (fr30bf,asr) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2054 | { | |
96baa820 | 2055 | #define FLD(f) abuf->fields.sfmt_add.f |
c906108c SS |
2056 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2057 | int UNUSED written = 0; | |
2058 | IADDR UNUSED pc = abuf->addr; | |
2059 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2060 | ||
7a292a7a | 2061 | { |
c906108c SS |
2062 | SI tmp_shift; |
2063 | tmp_shift = ANDSI (* FLD (i_Rj), 31); | |
2064 | if (NESI (tmp_shift, 0)) { | |
7a292a7a | 2065 | { |
c906108c SS |
2066 | { |
2067 | BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (tmp_shift, 1))), 0); | |
2068 | CPU (h_cbit) = opval; | |
2069 | written |= (1 << 3); | |
2070 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
2071 | } | |
2072 | { | |
2073 | SI opval = SRASI (* FLD (i_Ri), tmp_shift); | |
2074 | * FLD (i_Ri) = opval; | |
2075 | written |= (1 << 2); | |
2076 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2077 | } | |
7a292a7a | 2078 | } |
c906108c SS |
2079 | } else { |
2080 | { | |
2081 | BI opval = 0; | |
2082 | CPU (h_cbit) = opval; | |
2083 | written |= (1 << 3); | |
2084 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
2085 | } | |
2086 | } | |
2087 | { | |
2088 | BI opval = LTSI (* FLD (i_Ri), 0); | |
2089 | CPU (h_nbit) = opval; | |
2090 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
2091 | } | |
2092 | { | |
2093 | BI opval = EQSI (* FLD (i_Ri), 0); | |
2094 | CPU (h_zbit) = opval; | |
2095 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
2096 | } | |
7a292a7a | 2097 | } |
c906108c SS |
2098 | |
2099 | abuf->written = written; | |
2100 | return vpc; | |
2101 | #undef FLD | |
2102 | } | |
2103 | ||
2104 | /* asri: asr $u4,$Ri */ | |
2105 | ||
96baa820 | 2106 | static SEM_PC |
c906108c SS |
2107 | SEM_FN_NAME (fr30bf,asri) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2108 | { | |
96baa820 | 2109 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
2110 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2111 | int UNUSED written = 0; | |
2112 | IADDR UNUSED pc = abuf->addr; | |
2113 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2114 | ||
7a292a7a | 2115 | { |
c906108c SS |
2116 | SI tmp_shift; |
2117 | tmp_shift = FLD (f_u4); | |
2118 | if (NESI (tmp_shift, 0)) { | |
7a292a7a | 2119 | { |
c906108c SS |
2120 | { |
2121 | BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (tmp_shift, 1))), 0); | |
2122 | CPU (h_cbit) = opval; | |
2123 | written |= (1 << 3); | |
2124 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
2125 | } | |
2126 | { | |
2127 | SI opval = SRASI (* FLD (i_Ri), tmp_shift); | |
2128 | * FLD (i_Ri) = opval; | |
2129 | written |= (1 << 2); | |
2130 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2131 | } | |
7a292a7a | 2132 | } |
c906108c SS |
2133 | } else { |
2134 | { | |
2135 | BI opval = 0; | |
2136 | CPU (h_cbit) = opval; | |
2137 | written |= (1 << 3); | |
2138 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
2139 | } | |
2140 | } | |
2141 | { | |
2142 | BI opval = LTSI (* FLD (i_Ri), 0); | |
2143 | CPU (h_nbit) = opval; | |
2144 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
2145 | } | |
2146 | { | |
2147 | BI opval = EQSI (* FLD (i_Ri), 0); | |
2148 | CPU (h_zbit) = opval; | |
2149 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
2150 | } | |
7a292a7a | 2151 | } |
c906108c SS |
2152 | |
2153 | abuf->written = written; | |
2154 | return vpc; | |
2155 | #undef FLD | |
2156 | } | |
2157 | ||
2158 | /* asr2: asr2 $u4,$Ri */ | |
2159 | ||
96baa820 | 2160 | static SEM_PC |
c906108c SS |
2161 | SEM_FN_NAME (fr30bf,asr2) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2162 | { | |
96baa820 | 2163 | #define FLD(f) abuf->fields.sfmt_addi.f |
c906108c SS |
2164 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2165 | int UNUSED written = 0; | |
2166 | IADDR UNUSED pc = abuf->addr; | |
2167 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2168 | ||
7a292a7a | 2169 | { |
c906108c SS |
2170 | SI tmp_shift; |
2171 | tmp_shift = ADDSI (FLD (f_u4), 16); | |
2172 | if (NESI (tmp_shift, 0)) { | |
7a292a7a | 2173 | { |
c906108c SS |
2174 | { |
2175 | BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (tmp_shift, 1))), 0); | |
2176 | CPU (h_cbit) = opval; | |
2177 | written |= (1 << 3); | |
2178 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
2179 | } | |
2180 | { | |
2181 | SI opval = SRASI (* FLD (i_Ri), tmp_shift); | |
2182 | * FLD (i_Ri) = opval; | |
2183 | written |= (1 << 2); | |
2184 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2185 | } | |
7a292a7a | 2186 | } |
c906108c SS |
2187 | } else { |
2188 | { | |
2189 | BI opval = 0; | |
2190 | CPU (h_cbit) = opval; | |
2191 | written |= (1 << 3); | |
2192 | TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval); | |
2193 | } | |
2194 | } | |
2195 | { | |
2196 | BI opval = LTSI (* FLD (i_Ri), 0); | |
2197 | CPU (h_nbit) = opval; | |
2198 | TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval); | |
2199 | } | |
2200 | { | |
2201 | BI opval = EQSI (* FLD (i_Ri), 0); | |
2202 | CPU (h_zbit) = opval; | |
2203 | TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval); | |
2204 | } | |
7a292a7a | 2205 | } |
c906108c SS |
2206 | |
2207 | abuf->written = written; | |
2208 | return vpc; | |
2209 | #undef FLD | |
2210 | } | |
2211 | ||
2212 | /* ldi8: ldi:8 $i8,$Ri */ | |
2213 | ||
96baa820 | 2214 | static SEM_PC |
c906108c SS |
2215 | SEM_FN_NAME (fr30bf,ldi8) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2216 | { | |
96baa820 | 2217 | #define FLD(f) abuf->fields.sfmt_ldi8.f |
c906108c SS |
2218 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2219 | int UNUSED written = 0; | |
2220 | IADDR UNUSED pc = abuf->addr; | |
2221 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2222 | ||
2223 | { | |
2224 | SI opval = FLD (f_i8); | |
2225 | * FLD (i_Ri) = opval; | |
2226 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2227 | } | |
2228 | ||
2229 | return vpc; | |
2230 | #undef FLD | |
2231 | } | |
2232 | ||
2233 | /* ldi20: ldi:20 $i20,$Ri */ | |
2234 | ||
96baa820 | 2235 | static SEM_PC |
c906108c SS |
2236 | SEM_FN_NAME (fr30bf,ldi20) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2237 | { | |
96baa820 | 2238 | #define FLD(f) abuf->fields.sfmt_ldi20.f |
c906108c SS |
2239 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2240 | int UNUSED written = 0; | |
2241 | IADDR UNUSED pc = abuf->addr; | |
2242 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4); | |
2243 | ||
2244 | { | |
2245 | SI opval = FLD (f_i20); | |
2246 | * FLD (i_Ri) = opval; | |
2247 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2248 | } | |
2249 | ||
2250 | return vpc; | |
2251 | #undef FLD | |
2252 | } | |
2253 | ||
2254 | /* ldi32: ldi:32 $i32,$Ri */ | |
2255 | ||
96baa820 | 2256 | static SEM_PC |
c906108c SS |
2257 | SEM_FN_NAME (fr30bf,ldi32) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2258 | { | |
96baa820 | 2259 | #define FLD(f) abuf->fields.sfmt_ldi32.f |
c906108c SS |
2260 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2261 | int UNUSED written = 0; | |
2262 | IADDR UNUSED pc = abuf->addr; | |
2263 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 6); | |
2264 | ||
2265 | { | |
2266 | SI opval = FLD (f_i32); | |
2267 | * FLD (i_Ri) = opval; | |
2268 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2269 | } | |
2270 | ||
2271 | return vpc; | |
2272 | #undef FLD | |
2273 | } | |
2274 | ||
2275 | /* ld: ld @$Rj,$Ri */ | |
2276 | ||
96baa820 | 2277 | static SEM_PC |
c906108c SS |
2278 | SEM_FN_NAME (fr30bf,ld) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2279 | { | |
96baa820 | 2280 | #define FLD(f) abuf->fields.sfmt_ldr13.f |
c906108c SS |
2281 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2282 | int UNUSED written = 0; | |
2283 | IADDR UNUSED pc = abuf->addr; | |
2284 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2285 | ||
2286 | { | |
2287 | SI opval = GETMEMSI (current_cpu, pc, * FLD (i_Rj)); | |
2288 | * FLD (i_Ri) = opval; | |
2289 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2290 | } | |
2291 | ||
2292 | return vpc; | |
2293 | #undef FLD | |
2294 | } | |
2295 | ||
2296 | /* lduh: lduh @$Rj,$Ri */ | |
2297 | ||
96baa820 | 2298 | static SEM_PC |
c906108c SS |
2299 | SEM_FN_NAME (fr30bf,lduh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2300 | { | |
96baa820 | 2301 | #define FLD(f) abuf->fields.sfmt_ldr13.f |
c906108c SS |
2302 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2303 | int UNUSED written = 0; | |
2304 | IADDR UNUSED pc = abuf->addr; | |
2305 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2306 | ||
2307 | { | |
2308 | SI opval = GETMEMUHI (current_cpu, pc, * FLD (i_Rj)); | |
2309 | * FLD (i_Ri) = opval; | |
2310 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2311 | } | |
2312 | ||
2313 | return vpc; | |
2314 | #undef FLD | |
2315 | } | |
2316 | ||
2317 | /* ldub: ldub @$Rj,$Ri */ | |
2318 | ||
96baa820 | 2319 | static SEM_PC |
c906108c SS |
2320 | SEM_FN_NAME (fr30bf,ldub) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2321 | { | |
96baa820 | 2322 | #define FLD(f) abuf->fields.sfmt_ldr13.f |
c906108c SS |
2323 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2324 | int UNUSED written = 0; | |
2325 | IADDR UNUSED pc = abuf->addr; | |
2326 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2327 | ||
2328 | { | |
2329 | SI opval = GETMEMUQI (current_cpu, pc, * FLD (i_Rj)); | |
2330 | * FLD (i_Ri) = opval; | |
2331 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2332 | } | |
2333 | ||
2334 | return vpc; | |
2335 | #undef FLD | |
2336 | } | |
2337 | ||
2338 | /* ldr13: ld @($R13,$Rj),$Ri */ | |
2339 | ||
96baa820 | 2340 | static SEM_PC |
c906108c SS |
2341 | SEM_FN_NAME (fr30bf,ldr13) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2342 | { | |
96baa820 | 2343 | #define FLD(f) abuf->fields.sfmt_ldr13.f |
c906108c SS |
2344 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2345 | int UNUSED written = 0; | |
2346 | IADDR UNUSED pc = abuf->addr; | |
2347 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2348 | ||
2349 | { | |
2350 | SI opval = GETMEMSI (current_cpu, pc, ADDSI (* FLD (i_Rj), CPU (h_gr[((UINT) 13)]))); | |
2351 | * FLD (i_Ri) = opval; | |
2352 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2353 | } | |
2354 | ||
2355 | return vpc; | |
2356 | #undef FLD | |
2357 | } | |
2358 | ||
2359 | /* ldr13uh: lduh @($R13,$Rj),$Ri */ | |
2360 | ||
96baa820 | 2361 | static SEM_PC |
c906108c SS |
2362 | SEM_FN_NAME (fr30bf,ldr13uh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2363 | { | |
96baa820 | 2364 | #define FLD(f) abuf->fields.sfmt_ldr13.f |
c906108c SS |
2365 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2366 | int UNUSED written = 0; | |
2367 | IADDR UNUSED pc = abuf->addr; | |
2368 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2369 | ||
2370 | { | |
2371 | SI opval = GETMEMUHI (current_cpu, pc, ADDSI (* FLD (i_Rj), CPU (h_gr[((UINT) 13)]))); | |
2372 | * FLD (i_Ri) = opval; | |
2373 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2374 | } | |
2375 | ||
2376 | return vpc; | |
2377 | #undef FLD | |
2378 | } | |
2379 | ||
2380 | /* ldr13ub: ldub @($R13,$Rj),$Ri */ | |
2381 | ||
96baa820 | 2382 | static SEM_PC |
c906108c SS |
2383 | SEM_FN_NAME (fr30bf,ldr13ub) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2384 | { | |
96baa820 | 2385 | #define FLD(f) abuf->fields.sfmt_ldr13.f |
c906108c SS |
2386 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2387 | int UNUSED written = 0; | |
2388 | IADDR UNUSED pc = abuf->addr; | |
2389 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2390 | ||
2391 | { | |
2392 | SI opval = GETMEMUQI (current_cpu, pc, ADDSI (* FLD (i_Rj), CPU (h_gr[((UINT) 13)]))); | |
2393 | * FLD (i_Ri) = opval; | |
2394 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2395 | } | |
2396 | ||
2397 | return vpc; | |
2398 | #undef FLD | |
2399 | } | |
2400 | ||
2401 | /* ldr14: ld @($R14,$disp10),$Ri */ | |
2402 | ||
96baa820 | 2403 | static SEM_PC |
c906108c SS |
2404 | SEM_FN_NAME (fr30bf,ldr14) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2405 | { | |
96baa820 | 2406 | #define FLD(f) abuf->fields.sfmt_ldr14.f |
c906108c SS |
2407 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2408 | int UNUSED written = 0; | |
2409 | IADDR UNUSED pc = abuf->addr; | |
2410 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2411 | ||
2412 | { | |
2413 | SI opval = GETMEMSI (current_cpu, pc, ADDSI (FLD (f_disp10), CPU (h_gr[((UINT) 14)]))); | |
2414 | * FLD (i_Ri) = opval; | |
2415 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2416 | } | |
2417 | ||
2418 | return vpc; | |
2419 | #undef FLD | |
2420 | } | |
2421 | ||
2422 | /* ldr14uh: lduh @($R14,$disp9),$Ri */ | |
2423 | ||
96baa820 | 2424 | static SEM_PC |
c906108c SS |
2425 | SEM_FN_NAME (fr30bf,ldr14uh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2426 | { | |
96baa820 | 2427 | #define FLD(f) abuf->fields.sfmt_ldr14uh.f |
c906108c SS |
2428 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2429 | int UNUSED written = 0; | |
2430 | IADDR UNUSED pc = abuf->addr; | |
2431 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2432 | ||
2433 | { | |
2434 | SI opval = GETMEMUHI (current_cpu, pc, ADDSI (FLD (f_disp9), CPU (h_gr[((UINT) 14)]))); | |
2435 | * FLD (i_Ri) = opval; | |
2436 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2437 | } | |
2438 | ||
2439 | return vpc; | |
2440 | #undef FLD | |
2441 | } | |
2442 | ||
2443 | /* ldr14ub: ldub @($R14,$disp8),$Ri */ | |
2444 | ||
96baa820 | 2445 | static SEM_PC |
c906108c SS |
2446 | SEM_FN_NAME (fr30bf,ldr14ub) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2447 | { | |
96baa820 | 2448 | #define FLD(f) abuf->fields.sfmt_ldr14ub.f |
c906108c SS |
2449 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2450 | int UNUSED written = 0; | |
2451 | IADDR UNUSED pc = abuf->addr; | |
2452 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2453 | ||
2454 | { | |
2455 | SI opval = GETMEMUQI (current_cpu, pc, ADDSI (FLD (f_disp8), CPU (h_gr[((UINT) 14)]))); | |
2456 | * FLD (i_Ri) = opval; | |
2457 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2458 | } | |
2459 | ||
2460 | return vpc; | |
2461 | #undef FLD | |
2462 | } | |
2463 | ||
2464 | /* ldr15: ld @($R15,$udisp6),$Ri */ | |
2465 | ||
96baa820 | 2466 | static SEM_PC |
c906108c SS |
2467 | SEM_FN_NAME (fr30bf,ldr15) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2468 | { | |
96baa820 | 2469 | #define FLD(f) abuf->fields.sfmt_ldr15.f |
c906108c SS |
2470 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2471 | int UNUSED written = 0; | |
2472 | IADDR UNUSED pc = abuf->addr; | |
2473 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2474 | ||
2475 | { | |
2476 | SI opval = GETMEMSI (current_cpu, pc, ADDSI (FLD (f_udisp6), CPU (h_gr[((UINT) 15)]))); | |
2477 | * FLD (i_Ri) = opval; | |
2478 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2479 | } | |
2480 | ||
2481 | return vpc; | |
2482 | #undef FLD | |
2483 | } | |
2484 | ||
2485 | /* ldr15gr: ld @$R15+,$Ri */ | |
2486 | ||
96baa820 | 2487 | static SEM_PC |
c906108c SS |
2488 | SEM_FN_NAME (fr30bf,ldr15gr) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2489 | { | |
96baa820 | 2490 | #define FLD(f) abuf->fields.sfmt_ldr15gr.f |
c906108c SS |
2491 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2492 | int UNUSED written = 0; | |
2493 | IADDR UNUSED pc = abuf->addr; | |
2494 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2495 | ||
7a292a7a | 2496 | { |
c906108c SS |
2497 | { |
2498 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
2499 | * FLD (i_Ri) = opval; | |
2500 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2501 | } | |
2502 | if (NESI (FLD (f_Ri), 15)) { | |
2503 | { | |
2504 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
2505 | CPU (h_gr[((UINT) 15)]) = opval; | |
2506 | written |= (1 << 4); | |
2507 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
2508 | } | |
2509 | } | |
7a292a7a | 2510 | } |
c906108c SS |
2511 | |
2512 | abuf->written = written; | |
2513 | return vpc; | |
2514 | #undef FLD | |
2515 | } | |
2516 | ||
2517 | /* ldr15dr: ld @$R15+,$Rs2 */ | |
2518 | ||
96baa820 | 2519 | static SEM_PC |
c906108c SS |
2520 | SEM_FN_NAME (fr30bf,ldr15dr) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2521 | { | |
96baa820 | 2522 | #define FLD(f) abuf->fields.sfmt_ldr15dr.f |
c906108c SS |
2523 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2524 | int UNUSED written = 0; | |
2525 | IADDR UNUSED pc = abuf->addr; | |
2526 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2527 | ||
7a292a7a | 2528 | { |
c906108c SS |
2529 | SI tmp_tmp; |
2530 | tmp_tmp = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
2531 | { | |
2532 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
2533 | CPU (h_gr[((UINT) 15)]) = opval; | |
2534 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
2535 | } | |
2536 | { | |
2537 | SI opval = tmp_tmp; | |
2538 | SET_H_DR (FLD (f_Rs2), opval); | |
2539 | TRACE_RESULT (current_cpu, abuf, "Rs2", 'x', opval); | |
2540 | } | |
7a292a7a | 2541 | } |
c906108c SS |
2542 | |
2543 | return vpc; | |
2544 | #undef FLD | |
2545 | } | |
2546 | ||
2547 | /* ldr15ps: ld @$R15+,$ps */ | |
2548 | ||
96baa820 | 2549 | static SEM_PC |
c906108c SS |
2550 | SEM_FN_NAME (fr30bf,ldr15ps) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2551 | { | |
96baa820 | 2552 | #define FLD(f) abuf->fields.sfmt_addsp.f |
c906108c SS |
2553 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2554 | int UNUSED written = 0; | |
2555 | IADDR UNUSED pc = abuf->addr; | |
2556 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2557 | ||
7a292a7a | 2558 | { |
c906108c SS |
2559 | { |
2560 | USI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
2561 | SET_H_PS (opval); | |
2562 | TRACE_RESULT (current_cpu, abuf, "ps", 'x', opval); | |
2563 | } | |
2564 | { | |
2565 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
2566 | CPU (h_gr[((UINT) 15)]) = opval; | |
2567 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
2568 | } | |
7a292a7a | 2569 | } |
c906108c SS |
2570 | |
2571 | return vpc; | |
2572 | #undef FLD | |
2573 | } | |
2574 | ||
2575 | /* st: st $Ri,@$Rj */ | |
2576 | ||
96baa820 | 2577 | static SEM_PC |
c906108c SS |
2578 | SEM_FN_NAME (fr30bf,st) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2579 | { | |
96baa820 | 2580 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
2581 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2582 | int UNUSED written = 0; | |
2583 | IADDR UNUSED pc = abuf->addr; | |
2584 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2585 | ||
2586 | { | |
2587 | SI opval = * FLD (i_Ri); | |
2588 | SETMEMSI (current_cpu, pc, * FLD (i_Rj), opval); | |
2589 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
2590 | } | |
2591 | ||
2592 | return vpc; | |
2593 | #undef FLD | |
2594 | } | |
2595 | ||
2596 | /* sth: sth $Ri,@$Rj */ | |
2597 | ||
96baa820 | 2598 | static SEM_PC |
c906108c SS |
2599 | SEM_FN_NAME (fr30bf,sth) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2600 | { | |
96baa820 | 2601 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
2602 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2603 | int UNUSED written = 0; | |
2604 | IADDR UNUSED pc = abuf->addr; | |
2605 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2606 | ||
2607 | { | |
2608 | HI opval = * FLD (i_Ri); | |
2609 | SETMEMHI (current_cpu, pc, * FLD (i_Rj), opval); | |
2610 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
2611 | } | |
2612 | ||
2613 | return vpc; | |
2614 | #undef FLD | |
2615 | } | |
2616 | ||
2617 | /* stb: stb $Ri,@$Rj */ | |
2618 | ||
96baa820 | 2619 | static SEM_PC |
c906108c SS |
2620 | SEM_FN_NAME (fr30bf,stb) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2621 | { | |
96baa820 | 2622 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
2623 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2624 | int UNUSED written = 0; | |
2625 | IADDR UNUSED pc = abuf->addr; | |
2626 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2627 | ||
2628 | { | |
2629 | QI opval = * FLD (i_Ri); | |
2630 | SETMEMQI (current_cpu, pc, * FLD (i_Rj), opval); | |
2631 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
2632 | } | |
2633 | ||
2634 | return vpc; | |
2635 | #undef FLD | |
2636 | } | |
2637 | ||
2638 | /* str13: st $Ri,@($R13,$Rj) */ | |
2639 | ||
96baa820 | 2640 | static SEM_PC |
c906108c SS |
2641 | SEM_FN_NAME (fr30bf,str13) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2642 | { | |
96baa820 | 2643 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
2644 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2645 | int UNUSED written = 0; | |
2646 | IADDR UNUSED pc = abuf->addr; | |
2647 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2648 | ||
2649 | { | |
2650 | SI opval = * FLD (i_Ri); | |
2651 | SETMEMSI (current_cpu, pc, ADDSI (* FLD (i_Rj), CPU (h_gr[((UINT) 13)])), opval); | |
2652 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
2653 | } | |
2654 | ||
2655 | return vpc; | |
2656 | #undef FLD | |
2657 | } | |
2658 | ||
2659 | /* str13h: sth $Ri,@($R13,$Rj) */ | |
2660 | ||
96baa820 | 2661 | static SEM_PC |
c906108c SS |
2662 | SEM_FN_NAME (fr30bf,str13h) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2663 | { | |
96baa820 | 2664 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
2665 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2666 | int UNUSED written = 0; | |
2667 | IADDR UNUSED pc = abuf->addr; | |
2668 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2669 | ||
2670 | { | |
2671 | HI opval = * FLD (i_Ri); | |
2672 | SETMEMHI (current_cpu, pc, ADDSI (* FLD (i_Rj), CPU (h_gr[((UINT) 13)])), opval); | |
2673 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
2674 | } | |
2675 | ||
2676 | return vpc; | |
2677 | #undef FLD | |
2678 | } | |
2679 | ||
2680 | /* str13b: stb $Ri,@($R13,$Rj) */ | |
2681 | ||
96baa820 | 2682 | static SEM_PC |
c906108c SS |
2683 | SEM_FN_NAME (fr30bf,str13b) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2684 | { | |
96baa820 | 2685 | #define FLD(f) abuf->fields.sfmt_str13.f |
c906108c SS |
2686 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2687 | int UNUSED written = 0; | |
2688 | IADDR UNUSED pc = abuf->addr; | |
2689 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2690 | ||
2691 | { | |
2692 | QI opval = * FLD (i_Ri); | |
2693 | SETMEMQI (current_cpu, pc, ADDSI (* FLD (i_Rj), CPU (h_gr[((UINT) 13)])), opval); | |
2694 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
2695 | } | |
2696 | ||
2697 | return vpc; | |
2698 | #undef FLD | |
2699 | } | |
2700 | ||
2701 | /* str14: st $Ri,@($R14,$disp10) */ | |
2702 | ||
96baa820 | 2703 | static SEM_PC |
c906108c SS |
2704 | SEM_FN_NAME (fr30bf,str14) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2705 | { | |
96baa820 | 2706 | #define FLD(f) abuf->fields.sfmt_str14.f |
c906108c SS |
2707 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2708 | int UNUSED written = 0; | |
2709 | IADDR UNUSED pc = abuf->addr; | |
2710 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2711 | ||
2712 | { | |
2713 | SI opval = * FLD (i_Ri); | |
2714 | SETMEMSI (current_cpu, pc, ADDSI (FLD (f_disp10), CPU (h_gr[((UINT) 14)])), opval); | |
2715 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
2716 | } | |
2717 | ||
2718 | return vpc; | |
2719 | #undef FLD | |
2720 | } | |
2721 | ||
2722 | /* str14h: sth $Ri,@($R14,$disp9) */ | |
2723 | ||
96baa820 | 2724 | static SEM_PC |
c906108c SS |
2725 | SEM_FN_NAME (fr30bf,str14h) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2726 | { | |
96baa820 | 2727 | #define FLD(f) abuf->fields.sfmt_str14h.f |
c906108c SS |
2728 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2729 | int UNUSED written = 0; | |
2730 | IADDR UNUSED pc = abuf->addr; | |
2731 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2732 | ||
2733 | { | |
2734 | HI opval = * FLD (i_Ri); | |
2735 | SETMEMHI (current_cpu, pc, ADDSI (FLD (f_disp9), CPU (h_gr[((UINT) 14)])), opval); | |
2736 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
2737 | } | |
2738 | ||
2739 | return vpc; | |
2740 | #undef FLD | |
2741 | } | |
2742 | ||
2743 | /* str14b: stb $Ri,@($R14,$disp8) */ | |
2744 | ||
96baa820 | 2745 | static SEM_PC |
c906108c SS |
2746 | SEM_FN_NAME (fr30bf,str14b) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2747 | { | |
96baa820 | 2748 | #define FLD(f) abuf->fields.sfmt_str14b.f |
c906108c SS |
2749 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2750 | int UNUSED written = 0; | |
2751 | IADDR UNUSED pc = abuf->addr; | |
2752 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2753 | ||
2754 | { | |
2755 | QI opval = * FLD (i_Ri); | |
2756 | SETMEMQI (current_cpu, pc, ADDSI (FLD (f_disp8), CPU (h_gr[((UINT) 14)])), opval); | |
2757 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
2758 | } | |
2759 | ||
2760 | return vpc; | |
2761 | #undef FLD | |
2762 | } | |
2763 | ||
2764 | /* str15: st $Ri,@($R15,$udisp6) */ | |
2765 | ||
96baa820 | 2766 | static SEM_PC |
c906108c SS |
2767 | SEM_FN_NAME (fr30bf,str15) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2768 | { | |
96baa820 | 2769 | #define FLD(f) abuf->fields.sfmt_str15.f |
c906108c SS |
2770 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2771 | int UNUSED written = 0; | |
2772 | IADDR UNUSED pc = abuf->addr; | |
2773 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2774 | ||
2775 | { | |
2776 | SI opval = * FLD (i_Ri); | |
2777 | SETMEMSI (current_cpu, pc, ADDSI (CPU (h_gr[((UINT) 15)]), FLD (f_udisp6)), opval); | |
2778 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
2779 | } | |
2780 | ||
2781 | return vpc; | |
2782 | #undef FLD | |
2783 | } | |
2784 | ||
2785 | /* str15gr: st $Ri,@-$R15 */ | |
2786 | ||
96baa820 | 2787 | static SEM_PC |
c906108c SS |
2788 | SEM_FN_NAME (fr30bf,str15gr) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2789 | { | |
96baa820 | 2790 | #define FLD(f) abuf->fields.sfmt_str15gr.f |
c906108c SS |
2791 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2792 | int UNUSED written = 0; | |
2793 | IADDR UNUSED pc = abuf->addr; | |
2794 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2795 | ||
7a292a7a | 2796 | { |
c906108c SS |
2797 | SI tmp_tmp; |
2798 | tmp_tmp = * FLD (i_Ri); | |
2799 | { | |
2800 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
2801 | CPU (h_gr[((UINT) 15)]) = opval; | |
2802 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
2803 | } | |
2804 | { | |
2805 | SI opval = tmp_tmp; | |
2806 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
2807 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
2808 | } | |
7a292a7a | 2809 | } |
c906108c SS |
2810 | |
2811 | return vpc; | |
2812 | #undef FLD | |
2813 | } | |
2814 | ||
2815 | /* str15dr: st $Rs2,@-$R15 */ | |
2816 | ||
96baa820 | 2817 | static SEM_PC |
c906108c SS |
2818 | SEM_FN_NAME (fr30bf,str15dr) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2819 | { | |
96baa820 | 2820 | #define FLD(f) abuf->fields.sfmt_ldr15dr.f |
c906108c SS |
2821 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2822 | int UNUSED written = 0; | |
2823 | IADDR UNUSED pc = abuf->addr; | |
2824 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2825 | ||
7a292a7a | 2826 | { |
c906108c SS |
2827 | SI tmp_tmp; |
2828 | tmp_tmp = GET_H_DR (FLD (f_Rs2)); | |
2829 | { | |
2830 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
2831 | CPU (h_gr[((UINT) 15)]) = opval; | |
2832 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
2833 | } | |
2834 | { | |
2835 | SI opval = tmp_tmp; | |
2836 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
2837 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
2838 | } | |
7a292a7a | 2839 | } |
c906108c SS |
2840 | |
2841 | return vpc; | |
2842 | #undef FLD | |
2843 | } | |
2844 | ||
2845 | /* str15ps: st $ps,@-$R15 */ | |
2846 | ||
96baa820 | 2847 | static SEM_PC |
c906108c SS |
2848 | SEM_FN_NAME (fr30bf,str15ps) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2849 | { | |
96baa820 | 2850 | #define FLD(f) abuf->fields.sfmt_addsp.f |
c906108c SS |
2851 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2852 | int UNUSED written = 0; | |
2853 | IADDR UNUSED pc = abuf->addr; | |
2854 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2855 | ||
7a292a7a | 2856 | { |
c906108c SS |
2857 | { |
2858 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
2859 | CPU (h_gr[((UINT) 15)]) = opval; | |
2860 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
2861 | } | |
2862 | { | |
2863 | SI opval = GET_H_PS (); | |
2864 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
2865 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
2866 | } | |
7a292a7a | 2867 | } |
c906108c SS |
2868 | |
2869 | return vpc; | |
2870 | #undef FLD | |
2871 | } | |
2872 | ||
2873 | /* mov: mov $Rj,$Ri */ | |
2874 | ||
96baa820 | 2875 | static SEM_PC |
c906108c SS |
2876 | SEM_FN_NAME (fr30bf,mov) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2877 | { | |
96baa820 | 2878 | #define FLD(f) abuf->fields.sfmt_ldr13.f |
c906108c SS |
2879 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2880 | int UNUSED written = 0; | |
2881 | IADDR UNUSED pc = abuf->addr; | |
2882 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2883 | ||
2884 | { | |
2885 | SI opval = * FLD (i_Rj); | |
2886 | * FLD (i_Ri) = opval; | |
2887 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2888 | } | |
2889 | ||
2890 | return vpc; | |
2891 | #undef FLD | |
2892 | } | |
2893 | ||
2894 | /* movdr: mov $Rs1,$Ri */ | |
2895 | ||
96baa820 | 2896 | static SEM_PC |
c906108c SS |
2897 | SEM_FN_NAME (fr30bf,movdr) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2898 | { | |
96baa820 | 2899 | #define FLD(f) abuf->fields.sfmt_movdr.f |
c906108c SS |
2900 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2901 | int UNUSED written = 0; | |
2902 | IADDR UNUSED pc = abuf->addr; | |
2903 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2904 | ||
2905 | { | |
2906 | SI opval = GET_H_DR (FLD (f_Rs1)); | |
2907 | * FLD (i_Ri) = opval; | |
2908 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2909 | } | |
2910 | ||
2911 | return vpc; | |
2912 | #undef FLD | |
2913 | } | |
2914 | ||
2915 | /* movps: mov $ps,$Ri */ | |
2916 | ||
96baa820 | 2917 | static SEM_PC |
c906108c SS |
2918 | SEM_FN_NAME (fr30bf,movps) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2919 | { | |
96baa820 | 2920 | #define FLD(f) abuf->fields.sfmt_movdr.f |
c906108c SS |
2921 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2922 | int UNUSED written = 0; | |
2923 | IADDR UNUSED pc = abuf->addr; | |
2924 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2925 | ||
2926 | { | |
2927 | SI opval = GET_H_PS (); | |
2928 | * FLD (i_Ri) = opval; | |
2929 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
2930 | } | |
2931 | ||
2932 | return vpc; | |
2933 | #undef FLD | |
2934 | } | |
2935 | ||
2936 | /* mov2dr: mov $Ri,$Rs1 */ | |
2937 | ||
96baa820 | 2938 | static SEM_PC |
c906108c SS |
2939 | SEM_FN_NAME (fr30bf,mov2dr) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2940 | { | |
96baa820 | 2941 | #define FLD(f) abuf->fields.sfmt_mov2dr.f |
c906108c SS |
2942 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2943 | int UNUSED written = 0; | |
2944 | IADDR UNUSED pc = abuf->addr; | |
2945 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2946 | ||
2947 | { | |
2948 | SI opval = * FLD (i_Ri); | |
2949 | SET_H_DR (FLD (f_Rs1), opval); | |
2950 | TRACE_RESULT (current_cpu, abuf, "Rs1", 'x', opval); | |
2951 | } | |
2952 | ||
2953 | return vpc; | |
2954 | #undef FLD | |
2955 | } | |
2956 | ||
2957 | /* mov2ps: mov $Ri,$ps */ | |
2958 | ||
96baa820 | 2959 | static SEM_PC |
c906108c SS |
2960 | SEM_FN_NAME (fr30bf,mov2ps) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2961 | { | |
96baa820 | 2962 | #define FLD(f) abuf->fields.sfmt_mov2dr.f |
c906108c SS |
2963 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2964 | int UNUSED written = 0; | |
2965 | IADDR UNUSED pc = abuf->addr; | |
2966 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2967 | ||
2968 | { | |
2969 | USI opval = * FLD (i_Ri); | |
2970 | SET_H_PS (opval); | |
2971 | TRACE_RESULT (current_cpu, abuf, "ps", 'x', opval); | |
2972 | } | |
2973 | ||
2974 | return vpc; | |
2975 | #undef FLD | |
2976 | } | |
2977 | ||
2978 | /* jmp: jmp @$Ri */ | |
2979 | ||
96baa820 | 2980 | static SEM_PC |
c906108c SS |
2981 | SEM_FN_NAME (fr30bf,jmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
2982 | { | |
96baa820 | 2983 | #define FLD(f) abuf->fields.sfmt_mov2dr.f |
c906108c SS |
2984 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
2985 | int UNUSED written = 0; | |
2986 | IADDR UNUSED pc = abuf->addr; | |
2987 | SEM_BRANCH_INIT | |
2988 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
2989 | ||
2990 | { | |
2991 | USI opval = * FLD (i_Ri); | |
2992 | SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc); | |
2993 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
2994 | } | |
2995 | ||
2996 | SEM_BRANCH_FINI (vpc); | |
2997 | return vpc; | |
2998 | #undef FLD | |
2999 | } | |
3000 | ||
3001 | /* jmpd: jmp:d @$Ri */ | |
3002 | ||
96baa820 | 3003 | static SEM_PC |
c906108c SS |
3004 | SEM_FN_NAME (fr30bf,jmpd) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3005 | { | |
96baa820 | 3006 | #define FLD(f) abuf->fields.sfmt_mov2dr.f |
c906108c SS |
3007 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3008 | int UNUSED written = 0; | |
3009 | IADDR UNUSED pc = abuf->addr; | |
3010 | SEM_BRANCH_INIT | |
3011 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3012 | ||
7a292a7a | 3013 | { |
c906108c SS |
3014 | { |
3015 | USI opval = * FLD (i_Ri); | |
3016 | SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc); | |
3017 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3018 | } | |
7a292a7a | 3019 | } |
c906108c SS |
3020 | |
3021 | SEM_BRANCH_FINI (vpc); | |
3022 | return vpc; | |
3023 | #undef FLD | |
3024 | } | |
3025 | ||
3026 | /* callr: call @$Ri */ | |
3027 | ||
96baa820 | 3028 | static SEM_PC |
c906108c SS |
3029 | SEM_FN_NAME (fr30bf,callr) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3030 | { | |
96baa820 | 3031 | #define FLD(f) abuf->fields.sfmt_mov2dr.f |
c906108c SS |
3032 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3033 | int UNUSED written = 0; | |
3034 | IADDR UNUSED pc = abuf->addr; | |
3035 | SEM_BRANCH_INIT | |
3036 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3037 | ||
7a292a7a | 3038 | { |
c906108c SS |
3039 | { |
3040 | SI opval = ADDSI (pc, 2); | |
3041 | SET_H_DR (((UINT) 1), opval); | |
3042 | TRACE_RESULT (current_cpu, abuf, "dr-1", 'x', opval); | |
3043 | } | |
3044 | { | |
3045 | USI opval = * FLD (i_Ri); | |
3046 | SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc); | |
3047 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3048 | } | |
7a292a7a | 3049 | } |
c906108c SS |
3050 | |
3051 | SEM_BRANCH_FINI (vpc); | |
3052 | return vpc; | |
3053 | #undef FLD | |
3054 | } | |
3055 | ||
3056 | /* callrd: call:d @$Ri */ | |
3057 | ||
96baa820 | 3058 | static SEM_PC |
c906108c SS |
3059 | SEM_FN_NAME (fr30bf,callrd) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3060 | { | |
96baa820 | 3061 | #define FLD(f) abuf->fields.sfmt_mov2dr.f |
c906108c SS |
3062 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3063 | int UNUSED written = 0; | |
3064 | IADDR UNUSED pc = abuf->addr; | |
3065 | SEM_BRANCH_INIT | |
3066 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3067 | ||
7a292a7a SS |
3068 | { |
3069 | { | |
c906108c SS |
3070 | { |
3071 | SI opval = ADDSI (pc, 4); | |
3072 | SET_H_DR (((UINT) 1), opval); | |
3073 | TRACE_RESULT (current_cpu, abuf, "dr-1", 'x', opval); | |
3074 | } | |
3075 | { | |
3076 | USI opval = * FLD (i_Ri); | |
3077 | SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc); | |
3078 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3079 | } | |
7a292a7a SS |
3080 | } |
3081 | } | |
c906108c SS |
3082 | |
3083 | SEM_BRANCH_FINI (vpc); | |
3084 | return vpc; | |
3085 | #undef FLD | |
3086 | } | |
3087 | ||
3088 | /* call: call $label12 */ | |
3089 | ||
96baa820 | 3090 | static SEM_PC |
c906108c SS |
3091 | SEM_FN_NAME (fr30bf,call) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3092 | { | |
96baa820 | 3093 | #define FLD(f) abuf->fields.sfmt_call.f |
c906108c SS |
3094 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3095 | int UNUSED written = 0; | |
3096 | IADDR UNUSED pc = abuf->addr; | |
3097 | SEM_BRANCH_INIT | |
3098 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3099 | ||
7a292a7a | 3100 | { |
c906108c SS |
3101 | { |
3102 | SI opval = ADDSI (pc, 2); | |
3103 | SET_H_DR (((UINT) 1), opval); | |
3104 | TRACE_RESULT (current_cpu, abuf, "dr-1", 'x', opval); | |
3105 | } | |
3106 | { | |
3107 | USI opval = FLD (i_label12); | |
96baa820 | 3108 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3109 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); |
3110 | } | |
7a292a7a | 3111 | } |
c906108c SS |
3112 | |
3113 | SEM_BRANCH_FINI (vpc); | |
3114 | return vpc; | |
3115 | #undef FLD | |
3116 | } | |
3117 | ||
3118 | /* calld: call:d $label12 */ | |
3119 | ||
96baa820 | 3120 | static SEM_PC |
c906108c SS |
3121 | SEM_FN_NAME (fr30bf,calld) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3122 | { | |
96baa820 | 3123 | #define FLD(f) abuf->fields.sfmt_call.f |
c906108c SS |
3124 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3125 | int UNUSED written = 0; | |
3126 | IADDR UNUSED pc = abuf->addr; | |
3127 | SEM_BRANCH_INIT | |
3128 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3129 | ||
7a292a7a SS |
3130 | { |
3131 | { | |
c906108c SS |
3132 | { |
3133 | SI opval = ADDSI (pc, 4); | |
3134 | SET_H_DR (((UINT) 1), opval); | |
3135 | TRACE_RESULT (current_cpu, abuf, "dr-1", 'x', opval); | |
3136 | } | |
3137 | { | |
3138 | USI opval = FLD (i_label12); | |
96baa820 | 3139 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3140 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); |
3141 | } | |
7a292a7a SS |
3142 | } |
3143 | } | |
c906108c SS |
3144 | |
3145 | SEM_BRANCH_FINI (vpc); | |
3146 | return vpc; | |
3147 | #undef FLD | |
3148 | } | |
3149 | ||
3150 | /* ret: ret */ | |
3151 | ||
96baa820 | 3152 | static SEM_PC |
c906108c SS |
3153 | SEM_FN_NAME (fr30bf,ret) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3154 | { | |
96baa820 | 3155 | #define FLD(f) abuf->fields.fmt_empty.f |
c906108c SS |
3156 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3157 | int UNUSED written = 0; | |
3158 | IADDR UNUSED pc = abuf->addr; | |
3159 | SEM_BRANCH_INIT | |
3160 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3161 | ||
3162 | { | |
3163 | USI opval = GET_H_DR (((UINT) 1)); | |
3164 | SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc); | |
3165 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3166 | } | |
3167 | ||
3168 | SEM_BRANCH_FINI (vpc); | |
3169 | return vpc; | |
3170 | #undef FLD | |
3171 | } | |
3172 | ||
3173 | /* ret:d: ret:d */ | |
3174 | ||
96baa820 | 3175 | static SEM_PC |
c906108c SS |
3176 | SEM_FN_NAME (fr30bf,ret_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3177 | { | |
96baa820 | 3178 | #define FLD(f) abuf->fields.fmt_empty.f |
c906108c SS |
3179 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3180 | int UNUSED written = 0; | |
3181 | IADDR UNUSED pc = abuf->addr; | |
3182 | SEM_BRANCH_INIT | |
3183 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3184 | ||
7a292a7a | 3185 | { |
c906108c SS |
3186 | { |
3187 | USI opval = GET_H_DR (((UINT) 1)); | |
3188 | SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc); | |
3189 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3190 | } | |
7a292a7a | 3191 | } |
c906108c SS |
3192 | |
3193 | SEM_BRANCH_FINI (vpc); | |
3194 | return vpc; | |
3195 | #undef FLD | |
3196 | } | |
3197 | ||
3198 | /* int: int $u8 */ | |
3199 | ||
96baa820 | 3200 | static SEM_PC |
c906108c SS |
3201 | SEM_FN_NAME (fr30bf,int) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3202 | { | |
96baa820 | 3203 | #define FLD(f) abuf->fields.sfmt_int.f |
c906108c SS |
3204 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3205 | int UNUSED written = 0; | |
3206 | IADDR UNUSED pc = abuf->addr; | |
3207 | SEM_BRANCH_INIT | |
3208 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3209 | ||
7a292a7a | 3210 | { |
c906108c SS |
3211 | ; /*clobber*/ |
3212 | ; /*clobber*/ | |
3213 | ; /*clobber*/ | |
3214 | { | |
3215 | SI opval = fr30_int (current_cpu, pc, FLD (f_u8)); | |
3216 | SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc); | |
3217 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3218 | } | |
7a292a7a | 3219 | } |
c906108c SS |
3220 | |
3221 | SEM_BRANCH_FINI (vpc); | |
3222 | return vpc; | |
3223 | #undef FLD | |
3224 | } | |
3225 | ||
3226 | /* inte: inte */ | |
3227 | ||
96baa820 | 3228 | static SEM_PC |
c906108c SS |
3229 | SEM_FN_NAME (fr30bf,inte) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3230 | { | |
96baa820 | 3231 | #define FLD(f) abuf->fields.fmt_empty.f |
c906108c SS |
3232 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3233 | int UNUSED written = 0; | |
3234 | IADDR UNUSED pc = abuf->addr; | |
3235 | SEM_BRANCH_INIT | |
3236 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3237 | ||
7a292a7a | 3238 | { |
c906108c SS |
3239 | ; /*clobber*/ |
3240 | ; /*clobber*/ | |
3241 | ; /*clobber*/ | |
3242 | { | |
3243 | SI opval = fr30_inte (current_cpu, pc); | |
3244 | SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc); | |
3245 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3246 | } | |
7a292a7a | 3247 | } |
c906108c SS |
3248 | |
3249 | SEM_BRANCH_FINI (vpc); | |
3250 | return vpc; | |
3251 | #undef FLD | |
3252 | } | |
3253 | ||
3254 | /* reti: reti */ | |
3255 | ||
96baa820 | 3256 | static SEM_PC |
c906108c SS |
3257 | SEM_FN_NAME (fr30bf,reti) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3258 | { | |
96baa820 | 3259 | #define FLD(f) abuf->fields.fmt_empty.f |
c906108c SS |
3260 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3261 | int UNUSED written = 0; | |
3262 | IADDR UNUSED pc = abuf->addr; | |
3263 | SEM_BRANCH_INIT | |
3264 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3265 | ||
3266 | if (EQBI (GET_H_SBIT (), 0)) { | |
7a292a7a | 3267 | { |
c906108c SS |
3268 | { |
3269 | SI opval = GETMEMSI (current_cpu, pc, GET_H_DR (((UINT) 2))); | |
3270 | SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc); | |
3271 | written |= (1 << 7); | |
3272 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3273 | } | |
3274 | { | |
3275 | SI opval = ADDSI (GET_H_DR (((UINT) 2)), 4); | |
3276 | SET_H_DR (((UINT) 2), opval); | |
3277 | written |= (1 << 5); | |
3278 | TRACE_RESULT (current_cpu, abuf, "dr-2", 'x', opval); | |
3279 | } | |
3280 | { | |
3281 | SI opval = GETMEMSI (current_cpu, pc, GET_H_DR (((UINT) 2))); | |
3282 | SET_H_PS (opval); | |
3283 | written |= (1 << 8); | |
3284 | TRACE_RESULT (current_cpu, abuf, "ps", 'x', opval); | |
3285 | } | |
3286 | { | |
3287 | SI opval = ADDSI (GET_H_DR (((UINT) 2)), 4); | |
3288 | SET_H_DR (((UINT) 2), opval); | |
3289 | written |= (1 << 5); | |
3290 | TRACE_RESULT (current_cpu, abuf, "dr-2", 'x', opval); | |
3291 | } | |
7a292a7a | 3292 | } |
c906108c | 3293 | } else { |
7a292a7a | 3294 | { |
c906108c SS |
3295 | { |
3296 | SI opval = GETMEMSI (current_cpu, pc, GET_H_DR (((UINT) 3))); | |
3297 | SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc); | |
3298 | written |= (1 << 7); | |
3299 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3300 | } | |
3301 | { | |
3302 | SI opval = ADDSI (GET_H_DR (((UINT) 3)), 4); | |
3303 | SET_H_DR (((UINT) 3), opval); | |
3304 | written |= (1 << 6); | |
3305 | TRACE_RESULT (current_cpu, abuf, "dr-3", 'x', opval); | |
3306 | } | |
3307 | { | |
3308 | SI opval = GETMEMSI (current_cpu, pc, GET_H_DR (((UINT) 3))); | |
3309 | SET_H_PS (opval); | |
3310 | written |= (1 << 8); | |
3311 | TRACE_RESULT (current_cpu, abuf, "ps", 'x', opval); | |
3312 | } | |
3313 | { | |
3314 | SI opval = ADDSI (GET_H_DR (((UINT) 3)), 4); | |
3315 | SET_H_DR (((UINT) 3), opval); | |
3316 | written |= (1 << 6); | |
3317 | TRACE_RESULT (current_cpu, abuf, "dr-3", 'x', opval); | |
3318 | } | |
7a292a7a | 3319 | } |
c906108c SS |
3320 | } |
3321 | ||
3322 | abuf->written = written; | |
3323 | SEM_BRANCH_FINI (vpc); | |
3324 | return vpc; | |
3325 | #undef FLD | |
3326 | } | |
3327 | ||
3328 | /* brad: bra:d $label9 */ | |
3329 | ||
96baa820 | 3330 | static SEM_PC |
c906108c SS |
3331 | SEM_FN_NAME (fr30bf,brad) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3332 | { | |
96baa820 | 3333 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3334 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3335 | int UNUSED written = 0; | |
3336 | IADDR UNUSED pc = abuf->addr; | |
3337 | SEM_BRANCH_INIT | |
3338 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3339 | ||
7a292a7a | 3340 | { |
c906108c SS |
3341 | { |
3342 | USI opval = FLD (i_label9); | |
96baa820 | 3343 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3344 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); |
3345 | } | |
7a292a7a | 3346 | } |
c906108c SS |
3347 | |
3348 | SEM_BRANCH_FINI (vpc); | |
3349 | return vpc; | |
3350 | #undef FLD | |
3351 | } | |
3352 | ||
3353 | /* bra: bra $label9 */ | |
3354 | ||
96baa820 | 3355 | static SEM_PC |
c906108c SS |
3356 | SEM_FN_NAME (fr30bf,bra) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3357 | { | |
96baa820 | 3358 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3359 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3360 | int UNUSED written = 0; | |
3361 | IADDR UNUSED pc = abuf->addr; | |
3362 | SEM_BRANCH_INIT | |
3363 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3364 | ||
3365 | { | |
3366 | USI opval = FLD (i_label9); | |
96baa820 | 3367 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3368 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); |
3369 | } | |
3370 | ||
3371 | SEM_BRANCH_FINI (vpc); | |
3372 | return vpc; | |
3373 | #undef FLD | |
3374 | } | |
3375 | ||
3376 | /* bnod: bno:d $label9 */ | |
3377 | ||
96baa820 | 3378 | static SEM_PC |
c906108c SS |
3379 | SEM_FN_NAME (fr30bf,bnod) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3380 | { | |
96baa820 | 3381 | #define FLD(f) abuf->fields.fmt_empty.f |
c906108c SS |
3382 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3383 | int UNUSED written = 0; | |
3384 | IADDR UNUSED pc = abuf->addr; | |
3385 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3386 | ||
7a292a7a | 3387 | { |
c906108c | 3388 | do { } while (0); /*nop*/ |
7a292a7a | 3389 | } |
c906108c SS |
3390 | |
3391 | return vpc; | |
3392 | #undef FLD | |
3393 | } | |
3394 | ||
3395 | /* bno: bno $label9 */ | |
3396 | ||
96baa820 | 3397 | static SEM_PC |
c906108c SS |
3398 | SEM_FN_NAME (fr30bf,bno) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3399 | { | |
96baa820 | 3400 | #define FLD(f) abuf->fields.fmt_empty.f |
c906108c SS |
3401 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3402 | int UNUSED written = 0; | |
3403 | IADDR UNUSED pc = abuf->addr; | |
3404 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3405 | ||
3406 | do { } while (0); /*nop*/ | |
3407 | ||
3408 | return vpc; | |
3409 | #undef FLD | |
3410 | } | |
3411 | ||
3412 | /* beqd: beq:d $label9 */ | |
3413 | ||
96baa820 | 3414 | static SEM_PC |
c906108c SS |
3415 | SEM_FN_NAME (fr30bf,beqd) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3416 | { | |
96baa820 | 3417 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3418 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3419 | int UNUSED written = 0; | |
3420 | IADDR UNUSED pc = abuf->addr; | |
3421 | SEM_BRANCH_INIT | |
3422 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3423 | ||
7a292a7a | 3424 | { |
c906108c SS |
3425 | if (CPU (h_zbit)) { |
3426 | { | |
3427 | USI opval = FLD (i_label9); | |
96baa820 | 3428 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3429 | written |= (1 << 2); |
3430 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3431 | } | |
3432 | } | |
7a292a7a | 3433 | } |
c906108c SS |
3434 | |
3435 | abuf->written = written; | |
3436 | SEM_BRANCH_FINI (vpc); | |
3437 | return vpc; | |
3438 | #undef FLD | |
3439 | } | |
3440 | ||
3441 | /* beq: beq $label9 */ | |
3442 | ||
96baa820 | 3443 | static SEM_PC |
c906108c SS |
3444 | SEM_FN_NAME (fr30bf,beq) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3445 | { | |
96baa820 | 3446 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3447 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3448 | int UNUSED written = 0; | |
3449 | IADDR UNUSED pc = abuf->addr; | |
3450 | SEM_BRANCH_INIT | |
3451 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3452 | ||
3453 | if (CPU (h_zbit)) { | |
3454 | { | |
3455 | USI opval = FLD (i_label9); | |
96baa820 | 3456 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3457 | written |= (1 << 2); |
3458 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3459 | } | |
3460 | } | |
3461 | ||
3462 | abuf->written = written; | |
3463 | SEM_BRANCH_FINI (vpc); | |
3464 | return vpc; | |
3465 | #undef FLD | |
3466 | } | |
3467 | ||
3468 | /* bned: bne:d $label9 */ | |
3469 | ||
96baa820 | 3470 | static SEM_PC |
c906108c SS |
3471 | SEM_FN_NAME (fr30bf,bned) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3472 | { | |
96baa820 | 3473 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3474 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3475 | int UNUSED written = 0; | |
3476 | IADDR UNUSED pc = abuf->addr; | |
3477 | SEM_BRANCH_INIT | |
3478 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3479 | ||
7a292a7a | 3480 | { |
c906108c SS |
3481 | if (NOTBI (CPU (h_zbit))) { |
3482 | { | |
3483 | USI opval = FLD (i_label9); | |
96baa820 | 3484 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3485 | written |= (1 << 2); |
3486 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3487 | } | |
3488 | } | |
7a292a7a | 3489 | } |
c906108c SS |
3490 | |
3491 | abuf->written = written; | |
3492 | SEM_BRANCH_FINI (vpc); | |
3493 | return vpc; | |
3494 | #undef FLD | |
3495 | } | |
3496 | ||
3497 | /* bne: bne $label9 */ | |
3498 | ||
96baa820 | 3499 | static SEM_PC |
c906108c SS |
3500 | SEM_FN_NAME (fr30bf,bne) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3501 | { | |
96baa820 | 3502 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3503 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3504 | int UNUSED written = 0; | |
3505 | IADDR UNUSED pc = abuf->addr; | |
3506 | SEM_BRANCH_INIT | |
3507 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3508 | ||
3509 | if (NOTBI (CPU (h_zbit))) { | |
3510 | { | |
3511 | USI opval = FLD (i_label9); | |
96baa820 | 3512 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3513 | written |= (1 << 2); |
3514 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3515 | } | |
3516 | } | |
3517 | ||
3518 | abuf->written = written; | |
3519 | SEM_BRANCH_FINI (vpc); | |
3520 | return vpc; | |
3521 | #undef FLD | |
3522 | } | |
3523 | ||
3524 | /* bcd: bc:d $label9 */ | |
3525 | ||
96baa820 | 3526 | static SEM_PC |
c906108c SS |
3527 | SEM_FN_NAME (fr30bf,bcd) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3528 | { | |
96baa820 | 3529 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3530 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3531 | int UNUSED written = 0; | |
3532 | IADDR UNUSED pc = abuf->addr; | |
3533 | SEM_BRANCH_INIT | |
3534 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3535 | ||
7a292a7a | 3536 | { |
c906108c SS |
3537 | if (CPU (h_cbit)) { |
3538 | { | |
3539 | USI opval = FLD (i_label9); | |
96baa820 | 3540 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3541 | written |= (1 << 2); |
3542 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3543 | } | |
3544 | } | |
7a292a7a | 3545 | } |
c906108c SS |
3546 | |
3547 | abuf->written = written; | |
3548 | SEM_BRANCH_FINI (vpc); | |
3549 | return vpc; | |
3550 | #undef FLD | |
3551 | } | |
3552 | ||
3553 | /* bc: bc $label9 */ | |
3554 | ||
96baa820 | 3555 | static SEM_PC |
c906108c SS |
3556 | SEM_FN_NAME (fr30bf,bc) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3557 | { | |
96baa820 | 3558 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3559 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3560 | int UNUSED written = 0; | |
3561 | IADDR UNUSED pc = abuf->addr; | |
3562 | SEM_BRANCH_INIT | |
3563 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3564 | ||
3565 | if (CPU (h_cbit)) { | |
3566 | { | |
3567 | USI opval = FLD (i_label9); | |
96baa820 | 3568 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3569 | written |= (1 << 2); |
3570 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3571 | } | |
3572 | } | |
3573 | ||
3574 | abuf->written = written; | |
3575 | SEM_BRANCH_FINI (vpc); | |
3576 | return vpc; | |
3577 | #undef FLD | |
3578 | } | |
3579 | ||
3580 | /* bncd: bnc:d $label9 */ | |
3581 | ||
96baa820 | 3582 | static SEM_PC |
c906108c SS |
3583 | SEM_FN_NAME (fr30bf,bncd) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3584 | { | |
96baa820 | 3585 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3586 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3587 | int UNUSED written = 0; | |
3588 | IADDR UNUSED pc = abuf->addr; | |
3589 | SEM_BRANCH_INIT | |
3590 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3591 | ||
7a292a7a | 3592 | { |
c906108c SS |
3593 | if (NOTBI (CPU (h_cbit))) { |
3594 | { | |
3595 | USI opval = FLD (i_label9); | |
96baa820 | 3596 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3597 | written |= (1 << 2); |
3598 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3599 | } | |
3600 | } | |
7a292a7a | 3601 | } |
c906108c SS |
3602 | |
3603 | abuf->written = written; | |
3604 | SEM_BRANCH_FINI (vpc); | |
3605 | return vpc; | |
3606 | #undef FLD | |
3607 | } | |
3608 | ||
3609 | /* bnc: bnc $label9 */ | |
3610 | ||
96baa820 | 3611 | static SEM_PC |
c906108c SS |
3612 | SEM_FN_NAME (fr30bf,bnc) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3613 | { | |
96baa820 | 3614 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3615 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3616 | int UNUSED written = 0; | |
3617 | IADDR UNUSED pc = abuf->addr; | |
3618 | SEM_BRANCH_INIT | |
3619 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3620 | ||
3621 | if (NOTBI (CPU (h_cbit))) { | |
3622 | { | |
3623 | USI opval = FLD (i_label9); | |
96baa820 | 3624 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3625 | written |= (1 << 2); |
3626 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3627 | } | |
3628 | } | |
3629 | ||
3630 | abuf->written = written; | |
3631 | SEM_BRANCH_FINI (vpc); | |
3632 | return vpc; | |
3633 | #undef FLD | |
3634 | } | |
3635 | ||
3636 | /* bnd: bn:d $label9 */ | |
3637 | ||
96baa820 | 3638 | static SEM_PC |
c906108c SS |
3639 | SEM_FN_NAME (fr30bf,bnd) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3640 | { | |
96baa820 | 3641 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3642 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3643 | int UNUSED written = 0; | |
3644 | IADDR UNUSED pc = abuf->addr; | |
3645 | SEM_BRANCH_INIT | |
3646 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3647 | ||
7a292a7a | 3648 | { |
c906108c SS |
3649 | if (CPU (h_nbit)) { |
3650 | { | |
3651 | USI opval = FLD (i_label9); | |
96baa820 | 3652 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3653 | written |= (1 << 2); |
3654 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3655 | } | |
3656 | } | |
7a292a7a | 3657 | } |
c906108c SS |
3658 | |
3659 | abuf->written = written; | |
3660 | SEM_BRANCH_FINI (vpc); | |
3661 | return vpc; | |
3662 | #undef FLD | |
3663 | } | |
3664 | ||
3665 | /* bn: bn $label9 */ | |
3666 | ||
96baa820 | 3667 | static SEM_PC |
c906108c SS |
3668 | SEM_FN_NAME (fr30bf,bn) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3669 | { | |
96baa820 | 3670 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3671 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3672 | int UNUSED written = 0; | |
3673 | IADDR UNUSED pc = abuf->addr; | |
3674 | SEM_BRANCH_INIT | |
3675 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3676 | ||
3677 | if (CPU (h_nbit)) { | |
3678 | { | |
3679 | USI opval = FLD (i_label9); | |
96baa820 | 3680 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3681 | written |= (1 << 2); |
3682 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3683 | } | |
3684 | } | |
3685 | ||
3686 | abuf->written = written; | |
3687 | SEM_BRANCH_FINI (vpc); | |
3688 | return vpc; | |
3689 | #undef FLD | |
3690 | } | |
3691 | ||
3692 | /* bpd: bp:d $label9 */ | |
3693 | ||
96baa820 | 3694 | static SEM_PC |
c906108c SS |
3695 | SEM_FN_NAME (fr30bf,bpd) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3696 | { | |
96baa820 | 3697 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3698 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3699 | int UNUSED written = 0; | |
3700 | IADDR UNUSED pc = abuf->addr; | |
3701 | SEM_BRANCH_INIT | |
3702 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3703 | ||
7a292a7a | 3704 | { |
c906108c SS |
3705 | if (NOTBI (CPU (h_nbit))) { |
3706 | { | |
3707 | USI opval = FLD (i_label9); | |
96baa820 | 3708 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3709 | written |= (1 << 2); |
3710 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3711 | } | |
3712 | } | |
7a292a7a | 3713 | } |
c906108c SS |
3714 | |
3715 | abuf->written = written; | |
3716 | SEM_BRANCH_FINI (vpc); | |
3717 | return vpc; | |
3718 | #undef FLD | |
3719 | } | |
3720 | ||
3721 | /* bp: bp $label9 */ | |
3722 | ||
96baa820 | 3723 | static SEM_PC |
c906108c SS |
3724 | SEM_FN_NAME (fr30bf,bp) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3725 | { | |
96baa820 | 3726 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3727 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3728 | int UNUSED written = 0; | |
3729 | IADDR UNUSED pc = abuf->addr; | |
3730 | SEM_BRANCH_INIT | |
3731 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3732 | ||
3733 | if (NOTBI (CPU (h_nbit))) { | |
3734 | { | |
3735 | USI opval = FLD (i_label9); | |
96baa820 | 3736 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3737 | written |= (1 << 2); |
3738 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3739 | } | |
3740 | } | |
3741 | ||
3742 | abuf->written = written; | |
3743 | SEM_BRANCH_FINI (vpc); | |
3744 | return vpc; | |
3745 | #undef FLD | |
3746 | } | |
3747 | ||
3748 | /* bvd: bv:d $label9 */ | |
3749 | ||
96baa820 | 3750 | static SEM_PC |
c906108c SS |
3751 | SEM_FN_NAME (fr30bf,bvd) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3752 | { | |
96baa820 | 3753 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3754 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3755 | int UNUSED written = 0; | |
3756 | IADDR UNUSED pc = abuf->addr; | |
3757 | SEM_BRANCH_INIT | |
3758 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3759 | ||
7a292a7a | 3760 | { |
c906108c SS |
3761 | if (CPU (h_vbit)) { |
3762 | { | |
3763 | USI opval = FLD (i_label9); | |
96baa820 | 3764 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3765 | written |= (1 << 2); |
3766 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3767 | } | |
3768 | } | |
7a292a7a | 3769 | } |
c906108c SS |
3770 | |
3771 | abuf->written = written; | |
3772 | SEM_BRANCH_FINI (vpc); | |
3773 | return vpc; | |
3774 | #undef FLD | |
3775 | } | |
3776 | ||
3777 | /* bv: bv $label9 */ | |
3778 | ||
96baa820 | 3779 | static SEM_PC |
c906108c SS |
3780 | SEM_FN_NAME (fr30bf,bv) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3781 | { | |
96baa820 | 3782 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3783 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3784 | int UNUSED written = 0; | |
3785 | IADDR UNUSED pc = abuf->addr; | |
3786 | SEM_BRANCH_INIT | |
3787 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3788 | ||
3789 | if (CPU (h_vbit)) { | |
3790 | { | |
3791 | USI opval = FLD (i_label9); | |
96baa820 | 3792 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3793 | written |= (1 << 2); |
3794 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3795 | } | |
3796 | } | |
3797 | ||
3798 | abuf->written = written; | |
3799 | SEM_BRANCH_FINI (vpc); | |
3800 | return vpc; | |
3801 | #undef FLD | |
3802 | } | |
3803 | ||
3804 | /* bnvd: bnv:d $label9 */ | |
3805 | ||
96baa820 | 3806 | static SEM_PC |
c906108c SS |
3807 | SEM_FN_NAME (fr30bf,bnvd) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3808 | { | |
96baa820 | 3809 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3810 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3811 | int UNUSED written = 0; | |
3812 | IADDR UNUSED pc = abuf->addr; | |
3813 | SEM_BRANCH_INIT | |
3814 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3815 | ||
7a292a7a | 3816 | { |
c906108c SS |
3817 | if (NOTBI (CPU (h_vbit))) { |
3818 | { | |
3819 | USI opval = FLD (i_label9); | |
96baa820 | 3820 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3821 | written |= (1 << 2); |
3822 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3823 | } | |
3824 | } | |
7a292a7a | 3825 | } |
c906108c SS |
3826 | |
3827 | abuf->written = written; | |
3828 | SEM_BRANCH_FINI (vpc); | |
3829 | return vpc; | |
3830 | #undef FLD | |
3831 | } | |
3832 | ||
3833 | /* bnv: bnv $label9 */ | |
3834 | ||
96baa820 | 3835 | static SEM_PC |
c906108c SS |
3836 | SEM_FN_NAME (fr30bf,bnv) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3837 | { | |
96baa820 | 3838 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3839 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3840 | int UNUSED written = 0; | |
3841 | IADDR UNUSED pc = abuf->addr; | |
3842 | SEM_BRANCH_INIT | |
3843 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3844 | ||
3845 | if (NOTBI (CPU (h_vbit))) { | |
3846 | { | |
3847 | USI opval = FLD (i_label9); | |
96baa820 | 3848 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3849 | written |= (1 << 2); |
3850 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3851 | } | |
3852 | } | |
3853 | ||
3854 | abuf->written = written; | |
3855 | SEM_BRANCH_FINI (vpc); | |
3856 | return vpc; | |
3857 | #undef FLD | |
3858 | } | |
3859 | ||
3860 | /* bltd: blt:d $label9 */ | |
3861 | ||
96baa820 | 3862 | static SEM_PC |
c906108c SS |
3863 | SEM_FN_NAME (fr30bf,bltd) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3864 | { | |
96baa820 | 3865 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3866 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3867 | int UNUSED written = 0; | |
3868 | IADDR UNUSED pc = abuf->addr; | |
3869 | SEM_BRANCH_INIT | |
3870 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3871 | ||
7a292a7a | 3872 | { |
c906108c SS |
3873 | if (XORBI (CPU (h_vbit), CPU (h_nbit))) { |
3874 | { | |
3875 | USI opval = FLD (i_label9); | |
96baa820 | 3876 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3877 | written |= (1 << 3); |
3878 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3879 | } | |
3880 | } | |
7a292a7a | 3881 | } |
c906108c SS |
3882 | |
3883 | abuf->written = written; | |
3884 | SEM_BRANCH_FINI (vpc); | |
3885 | return vpc; | |
3886 | #undef FLD | |
3887 | } | |
3888 | ||
3889 | /* blt: blt $label9 */ | |
3890 | ||
96baa820 | 3891 | static SEM_PC |
c906108c SS |
3892 | SEM_FN_NAME (fr30bf,blt) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3893 | { | |
96baa820 | 3894 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3895 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3896 | int UNUSED written = 0; | |
3897 | IADDR UNUSED pc = abuf->addr; | |
3898 | SEM_BRANCH_INIT | |
3899 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3900 | ||
3901 | if (XORBI (CPU (h_vbit), CPU (h_nbit))) { | |
3902 | { | |
3903 | USI opval = FLD (i_label9); | |
96baa820 | 3904 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3905 | written |= (1 << 3); |
3906 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3907 | } | |
3908 | } | |
3909 | ||
3910 | abuf->written = written; | |
3911 | SEM_BRANCH_FINI (vpc); | |
3912 | return vpc; | |
3913 | #undef FLD | |
3914 | } | |
3915 | ||
3916 | /* bged: bge:d $label9 */ | |
3917 | ||
96baa820 | 3918 | static SEM_PC |
c906108c SS |
3919 | SEM_FN_NAME (fr30bf,bged) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3920 | { | |
96baa820 | 3921 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3922 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3923 | int UNUSED written = 0; | |
3924 | IADDR UNUSED pc = abuf->addr; | |
3925 | SEM_BRANCH_INIT | |
3926 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3927 | ||
7a292a7a | 3928 | { |
c906108c SS |
3929 | if (NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)))) { |
3930 | { | |
3931 | USI opval = FLD (i_label9); | |
96baa820 | 3932 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3933 | written |= (1 << 3); |
3934 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3935 | } | |
3936 | } | |
7a292a7a | 3937 | } |
c906108c SS |
3938 | |
3939 | abuf->written = written; | |
3940 | SEM_BRANCH_FINI (vpc); | |
3941 | return vpc; | |
3942 | #undef FLD | |
3943 | } | |
3944 | ||
3945 | /* bge: bge $label9 */ | |
3946 | ||
96baa820 | 3947 | static SEM_PC |
c906108c SS |
3948 | SEM_FN_NAME (fr30bf,bge) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3949 | { | |
96baa820 | 3950 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3951 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3952 | int UNUSED written = 0; | |
3953 | IADDR UNUSED pc = abuf->addr; | |
3954 | SEM_BRANCH_INIT | |
3955 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3956 | ||
3957 | if (NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)))) { | |
3958 | { | |
3959 | USI opval = FLD (i_label9); | |
96baa820 | 3960 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3961 | written |= (1 << 3); |
3962 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3963 | } | |
3964 | } | |
3965 | ||
3966 | abuf->written = written; | |
3967 | SEM_BRANCH_FINI (vpc); | |
3968 | return vpc; | |
3969 | #undef FLD | |
3970 | } | |
3971 | ||
3972 | /* bled: ble:d $label9 */ | |
3973 | ||
96baa820 | 3974 | static SEM_PC |
c906108c SS |
3975 | SEM_FN_NAME (fr30bf,bled) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
3976 | { | |
96baa820 | 3977 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
3978 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
3979 | int UNUSED written = 0; | |
3980 | IADDR UNUSED pc = abuf->addr; | |
3981 | SEM_BRANCH_INIT | |
3982 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
3983 | ||
7a292a7a | 3984 | { |
c906108c SS |
3985 | if (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit))) { |
3986 | { | |
3987 | USI opval = FLD (i_label9); | |
96baa820 | 3988 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
3989 | written |= (1 << 4); |
3990 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
3991 | } | |
3992 | } | |
7a292a7a | 3993 | } |
c906108c SS |
3994 | |
3995 | abuf->written = written; | |
3996 | SEM_BRANCH_FINI (vpc); | |
3997 | return vpc; | |
3998 | #undef FLD | |
3999 | } | |
4000 | ||
4001 | /* ble: ble $label9 */ | |
4002 | ||
96baa820 | 4003 | static SEM_PC |
c906108c SS |
4004 | SEM_FN_NAME (fr30bf,ble) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4005 | { | |
96baa820 | 4006 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
4007 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4008 | int UNUSED written = 0; | |
4009 | IADDR UNUSED pc = abuf->addr; | |
4010 | SEM_BRANCH_INIT | |
4011 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4012 | ||
4013 | if (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit))) { | |
4014 | { | |
4015 | USI opval = FLD (i_label9); | |
96baa820 | 4016 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
4017 | written |= (1 << 4); |
4018 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
4019 | } | |
4020 | } | |
4021 | ||
4022 | abuf->written = written; | |
4023 | SEM_BRANCH_FINI (vpc); | |
4024 | return vpc; | |
4025 | #undef FLD | |
4026 | } | |
4027 | ||
4028 | /* bgtd: bgt:d $label9 */ | |
4029 | ||
96baa820 | 4030 | static SEM_PC |
c906108c SS |
4031 | SEM_FN_NAME (fr30bf,bgtd) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4032 | { | |
96baa820 | 4033 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
4034 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4035 | int UNUSED written = 0; | |
4036 | IADDR UNUSED pc = abuf->addr; | |
4037 | SEM_BRANCH_INIT | |
4038 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4039 | ||
7a292a7a | 4040 | { |
c906108c SS |
4041 | if (NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)))) { |
4042 | { | |
4043 | USI opval = FLD (i_label9); | |
96baa820 | 4044 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
4045 | written |= (1 << 4); |
4046 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
4047 | } | |
4048 | } | |
7a292a7a | 4049 | } |
c906108c SS |
4050 | |
4051 | abuf->written = written; | |
4052 | SEM_BRANCH_FINI (vpc); | |
4053 | return vpc; | |
4054 | #undef FLD | |
4055 | } | |
4056 | ||
4057 | /* bgt: bgt $label9 */ | |
4058 | ||
96baa820 | 4059 | static SEM_PC |
c906108c SS |
4060 | SEM_FN_NAME (fr30bf,bgt) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4061 | { | |
96baa820 | 4062 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
4063 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4064 | int UNUSED written = 0; | |
4065 | IADDR UNUSED pc = abuf->addr; | |
4066 | SEM_BRANCH_INIT | |
4067 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4068 | ||
4069 | if (NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)))) { | |
4070 | { | |
4071 | USI opval = FLD (i_label9); | |
96baa820 | 4072 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
4073 | written |= (1 << 4); |
4074 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
4075 | } | |
4076 | } | |
4077 | ||
4078 | abuf->written = written; | |
4079 | SEM_BRANCH_FINI (vpc); | |
4080 | return vpc; | |
4081 | #undef FLD | |
4082 | } | |
4083 | ||
4084 | /* blsd: bls:d $label9 */ | |
4085 | ||
96baa820 | 4086 | static SEM_PC |
c906108c SS |
4087 | SEM_FN_NAME (fr30bf,blsd) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4088 | { | |
96baa820 | 4089 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
4090 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4091 | int UNUSED written = 0; | |
4092 | IADDR UNUSED pc = abuf->addr; | |
4093 | SEM_BRANCH_INIT | |
4094 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4095 | ||
7a292a7a | 4096 | { |
c906108c SS |
4097 | if (ORBI (CPU (h_cbit), CPU (h_zbit))) { |
4098 | { | |
4099 | USI opval = FLD (i_label9); | |
96baa820 | 4100 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
4101 | written |= (1 << 3); |
4102 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
4103 | } | |
4104 | } | |
7a292a7a | 4105 | } |
c906108c SS |
4106 | |
4107 | abuf->written = written; | |
4108 | SEM_BRANCH_FINI (vpc); | |
4109 | return vpc; | |
4110 | #undef FLD | |
4111 | } | |
4112 | ||
4113 | /* bls: bls $label9 */ | |
4114 | ||
96baa820 | 4115 | static SEM_PC |
c906108c SS |
4116 | SEM_FN_NAME (fr30bf,bls) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4117 | { | |
96baa820 | 4118 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
4119 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4120 | int UNUSED written = 0; | |
4121 | IADDR UNUSED pc = abuf->addr; | |
4122 | SEM_BRANCH_INIT | |
4123 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4124 | ||
4125 | if (ORBI (CPU (h_cbit), CPU (h_zbit))) { | |
4126 | { | |
4127 | USI opval = FLD (i_label9); | |
96baa820 | 4128 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
4129 | written |= (1 << 3); |
4130 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
4131 | } | |
4132 | } | |
4133 | ||
4134 | abuf->written = written; | |
4135 | SEM_BRANCH_FINI (vpc); | |
4136 | return vpc; | |
4137 | #undef FLD | |
4138 | } | |
4139 | ||
4140 | /* bhid: bhi:d $label9 */ | |
4141 | ||
96baa820 | 4142 | static SEM_PC |
c906108c SS |
4143 | SEM_FN_NAME (fr30bf,bhid) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4144 | { | |
96baa820 | 4145 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
4146 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4147 | int UNUSED written = 0; | |
4148 | IADDR UNUSED pc = abuf->addr; | |
4149 | SEM_BRANCH_INIT | |
4150 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4151 | ||
7a292a7a | 4152 | { |
c906108c SS |
4153 | if (NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)))) { |
4154 | { | |
4155 | USI opval = FLD (i_label9); | |
96baa820 | 4156 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
4157 | written |= (1 << 3); |
4158 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
4159 | } | |
4160 | } | |
7a292a7a | 4161 | } |
c906108c SS |
4162 | |
4163 | abuf->written = written; | |
4164 | SEM_BRANCH_FINI (vpc); | |
4165 | return vpc; | |
4166 | #undef FLD | |
4167 | } | |
4168 | ||
4169 | /* bhi: bhi $label9 */ | |
4170 | ||
96baa820 | 4171 | static SEM_PC |
c906108c SS |
4172 | SEM_FN_NAME (fr30bf,bhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4173 | { | |
96baa820 | 4174 | #define FLD(f) abuf->fields.sfmt_brad.f |
c906108c SS |
4175 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4176 | int UNUSED written = 0; | |
4177 | IADDR UNUSED pc = abuf->addr; | |
4178 | SEM_BRANCH_INIT | |
4179 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4180 | ||
4181 | if (NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)))) { | |
4182 | { | |
4183 | USI opval = FLD (i_label9); | |
96baa820 | 4184 | SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc); |
c906108c SS |
4185 | written |= (1 << 3); |
4186 | TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval); | |
4187 | } | |
4188 | } | |
4189 | ||
4190 | abuf->written = written; | |
4191 | SEM_BRANCH_FINI (vpc); | |
4192 | return vpc; | |
4193 | #undef FLD | |
4194 | } | |
4195 | ||
4196 | /* dmovr13: dmov $R13,@$dir10 */ | |
4197 | ||
96baa820 | 4198 | static SEM_PC |
c906108c SS |
4199 | SEM_FN_NAME (fr30bf,dmovr13) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4200 | { | |
96baa820 | 4201 | #define FLD(f) abuf->fields.sfmt_dmovr13pi.f |
c906108c SS |
4202 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4203 | int UNUSED written = 0; | |
4204 | IADDR UNUSED pc = abuf->addr; | |
4205 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4206 | ||
4207 | { | |
4208 | SI opval = CPU (h_gr[((UINT) 13)]); | |
4209 | SETMEMSI (current_cpu, pc, FLD (f_dir10), opval); | |
4210 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
4211 | } | |
4212 | ||
4213 | return vpc; | |
4214 | #undef FLD | |
4215 | } | |
4216 | ||
4217 | /* dmovr13h: dmovh $R13,@$dir9 */ | |
4218 | ||
96baa820 | 4219 | static SEM_PC |
c906108c SS |
4220 | SEM_FN_NAME (fr30bf,dmovr13h) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4221 | { | |
96baa820 | 4222 | #define FLD(f) abuf->fields.sfmt_dmovr13pih.f |
c906108c SS |
4223 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4224 | int UNUSED written = 0; | |
4225 | IADDR UNUSED pc = abuf->addr; | |
4226 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4227 | ||
4228 | { | |
4229 | HI opval = CPU (h_gr[((UINT) 13)]); | |
4230 | SETMEMHI (current_cpu, pc, FLD (f_dir9), opval); | |
4231 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
4232 | } | |
4233 | ||
4234 | return vpc; | |
4235 | #undef FLD | |
4236 | } | |
4237 | ||
4238 | /* dmovr13b: dmovb $R13,@$dir8 */ | |
4239 | ||
96baa820 | 4240 | static SEM_PC |
c906108c SS |
4241 | SEM_FN_NAME (fr30bf,dmovr13b) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4242 | { | |
96baa820 | 4243 | #define FLD(f) abuf->fields.sfmt_dmovr13pib.f |
c906108c SS |
4244 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4245 | int UNUSED written = 0; | |
4246 | IADDR UNUSED pc = abuf->addr; | |
4247 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4248 | ||
4249 | { | |
4250 | QI opval = CPU (h_gr[((UINT) 13)]); | |
4251 | SETMEMQI (current_cpu, pc, FLD (f_dir8), opval); | |
4252 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
4253 | } | |
4254 | ||
4255 | return vpc; | |
4256 | #undef FLD | |
4257 | } | |
4258 | ||
4259 | /* dmovr13pi: dmov @$R13+,@$dir10 */ | |
4260 | ||
96baa820 | 4261 | static SEM_PC |
c906108c SS |
4262 | SEM_FN_NAME (fr30bf,dmovr13pi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4263 | { | |
96baa820 | 4264 | #define FLD(f) abuf->fields.sfmt_dmovr13pi.f |
c906108c SS |
4265 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4266 | int UNUSED written = 0; | |
4267 | IADDR UNUSED pc = abuf->addr; | |
4268 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4269 | ||
7a292a7a | 4270 | { |
c906108c SS |
4271 | { |
4272 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 13)])); | |
4273 | SETMEMSI (current_cpu, pc, FLD (f_dir10), opval); | |
4274 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
4275 | } | |
4276 | { | |
4277 | SI opval = ADDSI (CPU (h_gr[((UINT) 13)]), 4); | |
4278 | CPU (h_gr[((UINT) 13)]) = opval; | |
4279 | TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval); | |
4280 | } | |
7a292a7a | 4281 | } |
c906108c SS |
4282 | |
4283 | return vpc; | |
4284 | #undef FLD | |
4285 | } | |
4286 | ||
4287 | /* dmovr13pih: dmovh @$R13+,@$dir9 */ | |
4288 | ||
96baa820 | 4289 | static SEM_PC |
c906108c SS |
4290 | SEM_FN_NAME (fr30bf,dmovr13pih) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4291 | { | |
96baa820 | 4292 | #define FLD(f) abuf->fields.sfmt_dmovr13pih.f |
c906108c SS |
4293 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4294 | int UNUSED written = 0; | |
4295 | IADDR UNUSED pc = abuf->addr; | |
4296 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4297 | ||
7a292a7a | 4298 | { |
c906108c SS |
4299 | { |
4300 | HI opval = GETMEMHI (current_cpu, pc, CPU (h_gr[((UINT) 13)])); | |
4301 | SETMEMHI (current_cpu, pc, FLD (f_dir9), opval); | |
4302 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
4303 | } | |
4304 | { | |
4305 | SI opval = ADDSI (CPU (h_gr[((UINT) 13)]), 2); | |
4306 | CPU (h_gr[((UINT) 13)]) = opval; | |
4307 | TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval); | |
4308 | } | |
7a292a7a | 4309 | } |
c906108c SS |
4310 | |
4311 | return vpc; | |
4312 | #undef FLD | |
4313 | } | |
4314 | ||
4315 | /* dmovr13pib: dmovb @$R13+,@$dir8 */ | |
4316 | ||
96baa820 | 4317 | static SEM_PC |
c906108c SS |
4318 | SEM_FN_NAME (fr30bf,dmovr13pib) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4319 | { | |
96baa820 | 4320 | #define FLD(f) abuf->fields.sfmt_dmovr13pib.f |
c906108c SS |
4321 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4322 | int UNUSED written = 0; | |
4323 | IADDR UNUSED pc = abuf->addr; | |
4324 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4325 | ||
7a292a7a | 4326 | { |
c906108c SS |
4327 | { |
4328 | QI opval = GETMEMQI (current_cpu, pc, CPU (h_gr[((UINT) 13)])); | |
4329 | SETMEMQI (current_cpu, pc, FLD (f_dir8), opval); | |
4330 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
4331 | } | |
4332 | { | |
4333 | SI opval = ADDSI (CPU (h_gr[((UINT) 13)]), 1); | |
4334 | CPU (h_gr[((UINT) 13)]) = opval; | |
4335 | TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval); | |
4336 | } | |
7a292a7a | 4337 | } |
c906108c SS |
4338 | |
4339 | return vpc; | |
4340 | #undef FLD | |
4341 | } | |
4342 | ||
4343 | /* dmovr15pi: dmov @$R15+,@$dir10 */ | |
4344 | ||
96baa820 | 4345 | static SEM_PC |
c906108c SS |
4346 | SEM_FN_NAME (fr30bf,dmovr15pi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4347 | { | |
96baa820 | 4348 | #define FLD(f) abuf->fields.sfmt_dmovr15pi.f |
c906108c SS |
4349 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4350 | int UNUSED written = 0; | |
4351 | IADDR UNUSED pc = abuf->addr; | |
4352 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4353 | ||
7a292a7a | 4354 | { |
c906108c SS |
4355 | { |
4356 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
4357 | SETMEMSI (current_cpu, pc, FLD (f_dir10), opval); | |
4358 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
4359 | } | |
4360 | { | |
4361 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
4362 | CPU (h_gr[((UINT) 15)]) = opval; | |
4363 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
4364 | } | |
7a292a7a | 4365 | } |
c906108c SS |
4366 | |
4367 | return vpc; | |
4368 | #undef FLD | |
4369 | } | |
4370 | ||
4371 | /* dmov2r13: dmov @$dir10,$R13 */ | |
4372 | ||
96baa820 | 4373 | static SEM_PC |
c906108c SS |
4374 | SEM_FN_NAME (fr30bf,dmov2r13) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4375 | { | |
96baa820 | 4376 | #define FLD(f) abuf->fields.sfmt_dmovr13pi.f |
c906108c SS |
4377 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4378 | int UNUSED written = 0; | |
4379 | IADDR UNUSED pc = abuf->addr; | |
4380 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4381 | ||
4382 | { | |
4383 | SI opval = GETMEMSI (current_cpu, pc, FLD (f_dir10)); | |
4384 | CPU (h_gr[((UINT) 13)]) = opval; | |
4385 | TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval); | |
4386 | } | |
4387 | ||
4388 | return vpc; | |
4389 | #undef FLD | |
4390 | } | |
4391 | ||
4392 | /* dmov2r13h: dmovh @$dir9,$R13 */ | |
4393 | ||
96baa820 | 4394 | static SEM_PC |
c906108c SS |
4395 | SEM_FN_NAME (fr30bf,dmov2r13h) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4396 | { | |
96baa820 | 4397 | #define FLD(f) abuf->fields.sfmt_dmovr13pih.f |
c906108c SS |
4398 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4399 | int UNUSED written = 0; | |
4400 | IADDR UNUSED pc = abuf->addr; | |
4401 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4402 | ||
4403 | { | |
4404 | SI opval = GETMEMHI (current_cpu, pc, FLD (f_dir9)); | |
4405 | CPU (h_gr[((UINT) 13)]) = opval; | |
4406 | TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval); | |
4407 | } | |
4408 | ||
4409 | return vpc; | |
4410 | #undef FLD | |
4411 | } | |
4412 | ||
4413 | /* dmov2r13b: dmovb @$dir8,$R13 */ | |
4414 | ||
96baa820 | 4415 | static SEM_PC |
c906108c SS |
4416 | SEM_FN_NAME (fr30bf,dmov2r13b) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4417 | { | |
96baa820 | 4418 | #define FLD(f) abuf->fields.sfmt_dmovr13pib.f |
c906108c SS |
4419 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4420 | int UNUSED written = 0; | |
4421 | IADDR UNUSED pc = abuf->addr; | |
4422 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4423 | ||
4424 | { | |
4425 | SI opval = GETMEMQI (current_cpu, pc, FLD (f_dir8)); | |
4426 | CPU (h_gr[((UINT) 13)]) = opval; | |
4427 | TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval); | |
4428 | } | |
4429 | ||
4430 | return vpc; | |
4431 | #undef FLD | |
4432 | } | |
4433 | ||
4434 | /* dmov2r13pi: dmov @$dir10,@$R13+ */ | |
4435 | ||
96baa820 | 4436 | static SEM_PC |
c906108c SS |
4437 | SEM_FN_NAME (fr30bf,dmov2r13pi) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4438 | { | |
96baa820 | 4439 | #define FLD(f) abuf->fields.sfmt_dmovr13pi.f |
c906108c SS |
4440 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4441 | int UNUSED written = 0; | |
4442 | IADDR UNUSED pc = abuf->addr; | |
4443 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4444 | ||
7a292a7a | 4445 | { |
c906108c SS |
4446 | { |
4447 | SI opval = GETMEMSI (current_cpu, pc, FLD (f_dir10)); | |
4448 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 13)]), opval); | |
4449 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
4450 | } | |
4451 | { | |
4452 | SI opval = ADDSI (CPU (h_gr[((UINT) 13)]), 4); | |
4453 | CPU (h_gr[((UINT) 13)]) = opval; | |
4454 | TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval); | |
4455 | } | |
7a292a7a | 4456 | } |
c906108c SS |
4457 | |
4458 | return vpc; | |
4459 | #undef FLD | |
4460 | } | |
4461 | ||
4462 | /* dmov2r13pih: dmovh @$dir9,@$R13+ */ | |
4463 | ||
96baa820 | 4464 | static SEM_PC |
c906108c SS |
4465 | SEM_FN_NAME (fr30bf,dmov2r13pih) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4466 | { | |
96baa820 | 4467 | #define FLD(f) abuf->fields.sfmt_dmovr13pih.f |
c906108c SS |
4468 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4469 | int UNUSED written = 0; | |
4470 | IADDR UNUSED pc = abuf->addr; | |
4471 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4472 | ||
7a292a7a | 4473 | { |
c906108c SS |
4474 | { |
4475 | HI opval = GETMEMHI (current_cpu, pc, FLD (f_dir9)); | |
4476 | SETMEMHI (current_cpu, pc, CPU (h_gr[((UINT) 13)]), opval); | |
4477 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
4478 | } | |
4479 | { | |
4480 | SI opval = ADDSI (CPU (h_gr[((UINT) 13)]), 2); | |
4481 | CPU (h_gr[((UINT) 13)]) = opval; | |
4482 | TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval); | |
4483 | } | |
7a292a7a | 4484 | } |
c906108c SS |
4485 | |
4486 | return vpc; | |
4487 | #undef FLD | |
4488 | } | |
4489 | ||
4490 | /* dmov2r13pib: dmovb @$dir8,@$R13+ */ | |
4491 | ||
96baa820 | 4492 | static SEM_PC |
c906108c SS |
4493 | SEM_FN_NAME (fr30bf,dmov2r13pib) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4494 | { | |
96baa820 | 4495 | #define FLD(f) abuf->fields.sfmt_dmovr13pib.f |
c906108c SS |
4496 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4497 | int UNUSED written = 0; | |
4498 | IADDR UNUSED pc = abuf->addr; | |
4499 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4500 | ||
7a292a7a | 4501 | { |
c906108c SS |
4502 | { |
4503 | QI opval = GETMEMQI (current_cpu, pc, FLD (f_dir8)); | |
4504 | SETMEMQI (current_cpu, pc, CPU (h_gr[((UINT) 13)]), opval); | |
4505 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
4506 | } | |
4507 | { | |
4508 | SI opval = ADDSI (CPU (h_gr[((UINT) 13)]), 1); | |
4509 | CPU (h_gr[((UINT) 13)]) = opval; | |
4510 | TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval); | |
4511 | } | |
7a292a7a | 4512 | } |
c906108c SS |
4513 | |
4514 | return vpc; | |
4515 | #undef FLD | |
4516 | } | |
4517 | ||
4518 | /* dmov2r15pd: dmov @$dir10,@-$R15 */ | |
4519 | ||
96baa820 | 4520 | static SEM_PC |
c906108c SS |
4521 | SEM_FN_NAME (fr30bf,dmov2r15pd) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4522 | { | |
96baa820 | 4523 | #define FLD(f) abuf->fields.sfmt_dmovr15pi.f |
c906108c SS |
4524 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4525 | int UNUSED written = 0; | |
4526 | IADDR UNUSED pc = abuf->addr; | |
4527 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4528 | ||
7a292a7a | 4529 | { |
c906108c SS |
4530 | { |
4531 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
4532 | CPU (h_gr[((UINT) 15)]) = opval; | |
4533 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
4534 | } | |
4535 | { | |
4536 | SI opval = GETMEMSI (current_cpu, pc, FLD (f_dir10)); | |
4537 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
4538 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
4539 | } | |
7a292a7a | 4540 | } |
c906108c SS |
4541 | |
4542 | return vpc; | |
4543 | #undef FLD | |
4544 | } | |
4545 | ||
4546 | /* ldres: ldres @$Ri+,$u4 */ | |
4547 | ||
96baa820 | 4548 | static SEM_PC |
c906108c SS |
4549 | SEM_FN_NAME (fr30bf,ldres) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4550 | { | |
96baa820 | 4551 | #define FLD(f) abuf->fields.sfmt_add2.f |
c906108c SS |
4552 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4553 | int UNUSED written = 0; | |
4554 | IADDR UNUSED pc = abuf->addr; | |
4555 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4556 | ||
4557 | { | |
4558 | SI opval = ADDSI (* FLD (i_Ri), 4); | |
4559 | * FLD (i_Ri) = opval; | |
4560 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
4561 | } | |
4562 | ||
4563 | return vpc; | |
4564 | #undef FLD | |
4565 | } | |
4566 | ||
4567 | /* stres: stres $u4,@$Ri+ */ | |
4568 | ||
96baa820 | 4569 | static SEM_PC |
c906108c SS |
4570 | SEM_FN_NAME (fr30bf,stres) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4571 | { | |
96baa820 | 4572 | #define FLD(f) abuf->fields.sfmt_add2.f |
c906108c SS |
4573 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4574 | int UNUSED written = 0; | |
4575 | IADDR UNUSED pc = abuf->addr; | |
4576 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4577 | ||
4578 | { | |
4579 | SI opval = ADDSI (* FLD (i_Ri), 4); | |
4580 | * FLD (i_Ri) = opval; | |
4581 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
4582 | } | |
4583 | ||
4584 | return vpc; | |
4585 | #undef FLD | |
4586 | } | |
4587 | ||
4588 | /* copop: copop $u4c,$ccc,$CRj,$CRi */ | |
4589 | ||
96baa820 | 4590 | static SEM_PC |
c906108c SS |
4591 | SEM_FN_NAME (fr30bf,copop) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4592 | { | |
96baa820 | 4593 | #define FLD(f) abuf->fields.fmt_empty.f |
c906108c SS |
4594 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4595 | int UNUSED written = 0; | |
4596 | IADDR UNUSED pc = abuf->addr; | |
4597 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4); | |
4598 | ||
4599 | do { } while (0); /*nop*/ | |
4600 | ||
4601 | return vpc; | |
4602 | #undef FLD | |
4603 | } | |
4604 | ||
4605 | /* copld: copld $u4c,$ccc,$Rjc,$CRi */ | |
4606 | ||
96baa820 | 4607 | static SEM_PC |
c906108c SS |
4608 | SEM_FN_NAME (fr30bf,copld) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4609 | { | |
96baa820 | 4610 | #define FLD(f) abuf->fields.fmt_empty.f |
c906108c SS |
4611 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4612 | int UNUSED written = 0; | |
4613 | IADDR UNUSED pc = abuf->addr; | |
4614 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4); | |
4615 | ||
4616 | do { } while (0); /*nop*/ | |
4617 | ||
4618 | return vpc; | |
4619 | #undef FLD | |
4620 | } | |
4621 | ||
4622 | /* copst: copst $u4c,$ccc,$CRj,$Ric */ | |
4623 | ||
96baa820 | 4624 | static SEM_PC |
c906108c SS |
4625 | SEM_FN_NAME (fr30bf,copst) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4626 | { | |
96baa820 | 4627 | #define FLD(f) abuf->fields.fmt_empty.f |
c906108c SS |
4628 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4629 | int UNUSED written = 0; | |
4630 | IADDR UNUSED pc = abuf->addr; | |
4631 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4); | |
4632 | ||
4633 | do { } while (0); /*nop*/ | |
4634 | ||
4635 | return vpc; | |
4636 | #undef FLD | |
4637 | } | |
4638 | ||
4639 | /* copsv: copsv $u4c,$ccc,$CRj,$Ric */ | |
4640 | ||
96baa820 | 4641 | static SEM_PC |
c906108c SS |
4642 | SEM_FN_NAME (fr30bf,copsv) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4643 | { | |
96baa820 | 4644 | #define FLD(f) abuf->fields.fmt_empty.f |
c906108c SS |
4645 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4646 | int UNUSED written = 0; | |
4647 | IADDR UNUSED pc = abuf->addr; | |
4648 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4); | |
4649 | ||
4650 | do { } while (0); /*nop*/ | |
4651 | ||
4652 | return vpc; | |
4653 | #undef FLD | |
4654 | } | |
4655 | ||
4656 | /* nop: nop */ | |
4657 | ||
96baa820 | 4658 | static SEM_PC |
c906108c SS |
4659 | SEM_FN_NAME (fr30bf,nop) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4660 | { | |
96baa820 | 4661 | #define FLD(f) abuf->fields.fmt_empty.f |
c906108c SS |
4662 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4663 | int UNUSED written = 0; | |
4664 | IADDR UNUSED pc = abuf->addr; | |
4665 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4666 | ||
4667 | do { } while (0); /*nop*/ | |
4668 | ||
4669 | return vpc; | |
4670 | #undef FLD | |
4671 | } | |
4672 | ||
4673 | /* andccr: andccr $u8 */ | |
4674 | ||
96baa820 | 4675 | static SEM_PC |
c906108c SS |
4676 | SEM_FN_NAME (fr30bf,andccr) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4677 | { | |
96baa820 | 4678 | #define FLD(f) abuf->fields.sfmt_int.f |
c906108c SS |
4679 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4680 | int UNUSED written = 0; | |
4681 | IADDR UNUSED pc = abuf->addr; | |
4682 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4683 | ||
4684 | { | |
4685 | UQI opval = ANDQI (GET_H_CCR (), FLD (f_u8)); | |
4686 | SET_H_CCR (opval); | |
4687 | TRACE_RESULT (current_cpu, abuf, "ccr", 'x', opval); | |
4688 | } | |
4689 | ||
4690 | return vpc; | |
4691 | #undef FLD | |
4692 | } | |
4693 | ||
4694 | /* orccr: orccr $u8 */ | |
4695 | ||
96baa820 | 4696 | static SEM_PC |
c906108c SS |
4697 | SEM_FN_NAME (fr30bf,orccr) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4698 | { | |
96baa820 | 4699 | #define FLD(f) abuf->fields.sfmt_int.f |
c906108c SS |
4700 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4701 | int UNUSED written = 0; | |
4702 | IADDR UNUSED pc = abuf->addr; | |
4703 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4704 | ||
4705 | { | |
4706 | UQI opval = ORQI (GET_H_CCR (), FLD (f_u8)); | |
4707 | SET_H_CCR (opval); | |
4708 | TRACE_RESULT (current_cpu, abuf, "ccr", 'x', opval); | |
4709 | } | |
4710 | ||
4711 | return vpc; | |
4712 | #undef FLD | |
4713 | } | |
4714 | ||
4715 | /* stilm: stilm $u8 */ | |
4716 | ||
96baa820 | 4717 | static SEM_PC |
c906108c SS |
4718 | SEM_FN_NAME (fr30bf,stilm) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4719 | { | |
96baa820 | 4720 | #define FLD(f) abuf->fields.sfmt_int.f |
c906108c SS |
4721 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4722 | int UNUSED written = 0; | |
4723 | IADDR UNUSED pc = abuf->addr; | |
4724 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4725 | ||
4726 | { | |
4727 | UQI opval = ANDSI (FLD (f_u8), 31); | |
4728 | SET_H_ILM (opval); | |
4729 | TRACE_RESULT (current_cpu, abuf, "ilm", 'x', opval); | |
4730 | } | |
4731 | ||
4732 | return vpc; | |
4733 | #undef FLD | |
4734 | } | |
4735 | ||
4736 | /* addsp: addsp $s10 */ | |
4737 | ||
96baa820 | 4738 | static SEM_PC |
c906108c SS |
4739 | SEM_FN_NAME (fr30bf,addsp) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4740 | { | |
96baa820 | 4741 | #define FLD(f) abuf->fields.sfmt_addsp.f |
c906108c SS |
4742 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4743 | int UNUSED written = 0; | |
4744 | IADDR UNUSED pc = abuf->addr; | |
4745 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4746 | ||
4747 | { | |
4748 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), FLD (f_s10)); | |
4749 | CPU (h_gr[((UINT) 15)]) = opval; | |
4750 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
4751 | } | |
4752 | ||
4753 | return vpc; | |
4754 | #undef FLD | |
4755 | } | |
4756 | ||
4757 | /* extsb: extsb $Ri */ | |
4758 | ||
96baa820 | 4759 | static SEM_PC |
c906108c SS |
4760 | SEM_FN_NAME (fr30bf,extsb) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4761 | { | |
96baa820 | 4762 | #define FLD(f) abuf->fields.sfmt_add2.f |
c906108c SS |
4763 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4764 | int UNUSED written = 0; | |
4765 | IADDR UNUSED pc = abuf->addr; | |
4766 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4767 | ||
4768 | { | |
4769 | SI opval = EXTQISI (ANDQI (* FLD (i_Ri), 255)); | |
4770 | * FLD (i_Ri) = opval; | |
4771 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
4772 | } | |
4773 | ||
4774 | return vpc; | |
4775 | #undef FLD | |
4776 | } | |
4777 | ||
4778 | /* extub: extub $Ri */ | |
4779 | ||
96baa820 | 4780 | static SEM_PC |
c906108c SS |
4781 | SEM_FN_NAME (fr30bf,extub) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4782 | { | |
96baa820 | 4783 | #define FLD(f) abuf->fields.sfmt_add2.f |
c906108c SS |
4784 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4785 | int UNUSED written = 0; | |
4786 | IADDR UNUSED pc = abuf->addr; | |
4787 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4788 | ||
4789 | { | |
4790 | SI opval = ZEXTQISI (ANDQI (* FLD (i_Ri), 255)); | |
4791 | * FLD (i_Ri) = opval; | |
4792 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
4793 | } | |
4794 | ||
4795 | return vpc; | |
4796 | #undef FLD | |
4797 | } | |
4798 | ||
4799 | /* extsh: extsh $Ri */ | |
4800 | ||
96baa820 | 4801 | static SEM_PC |
c906108c SS |
4802 | SEM_FN_NAME (fr30bf,extsh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4803 | { | |
96baa820 | 4804 | #define FLD(f) abuf->fields.sfmt_add2.f |
c906108c SS |
4805 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4806 | int UNUSED written = 0; | |
4807 | IADDR UNUSED pc = abuf->addr; | |
4808 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4809 | ||
4810 | { | |
4811 | SI opval = EXTHISI (ANDHI (* FLD (i_Ri), 65535)); | |
4812 | * FLD (i_Ri) = opval; | |
4813 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
4814 | } | |
4815 | ||
4816 | return vpc; | |
4817 | #undef FLD | |
4818 | } | |
4819 | ||
4820 | /* extuh: extuh $Ri */ | |
4821 | ||
96baa820 | 4822 | static SEM_PC |
c906108c SS |
4823 | SEM_FN_NAME (fr30bf,extuh) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4824 | { | |
96baa820 | 4825 | #define FLD(f) abuf->fields.sfmt_add2.f |
c906108c SS |
4826 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4827 | int UNUSED written = 0; | |
4828 | IADDR UNUSED pc = abuf->addr; | |
4829 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4830 | ||
4831 | { | |
4832 | SI opval = ZEXTHISI (ANDHI (* FLD (i_Ri), 65535)); | |
4833 | * FLD (i_Ri) = opval; | |
4834 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
4835 | } | |
4836 | ||
4837 | return vpc; | |
4838 | #undef FLD | |
4839 | } | |
4840 | ||
4841 | /* ldm0: ldm0 ($reglist_low_ld) */ | |
4842 | ||
96baa820 | 4843 | static SEM_PC |
c906108c SS |
4844 | SEM_FN_NAME (fr30bf,ldm0) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4845 | { | |
96baa820 | 4846 | #define FLD(f) abuf->fields.sfmt_ldm0.f |
c906108c SS |
4847 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4848 | int UNUSED written = 0; | |
4849 | IADDR UNUSED pc = abuf->addr; | |
4850 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4851 | ||
7a292a7a | 4852 | { |
c906108c | 4853 | if (ANDSI (FLD (f_reglist_low_ld), 1)) { |
7a292a7a | 4854 | { |
c906108c SS |
4855 | { |
4856 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
4857 | CPU (h_gr[((UINT) 0)]) = opval; | |
4858 | written |= (1 << 3); | |
4859 | TRACE_RESULT (current_cpu, abuf, "gr-0", 'x', opval); | |
4860 | } | |
4861 | { | |
4862 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
4863 | CPU (h_gr[((UINT) 15)]) = opval; | |
4864 | written |= (1 << 5); | |
4865 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
4866 | } | |
7a292a7a | 4867 | } |
c906108c SS |
4868 | } |
4869 | if (ANDSI (FLD (f_reglist_low_ld), 2)) { | |
7a292a7a | 4870 | { |
c906108c SS |
4871 | { |
4872 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
4873 | CPU (h_gr[((UINT) 1)]) = opval; | |
4874 | written |= (1 << 4); | |
4875 | TRACE_RESULT (current_cpu, abuf, "gr-1", 'x', opval); | |
4876 | } | |
4877 | { | |
4878 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
4879 | CPU (h_gr[((UINT) 15)]) = opval; | |
4880 | written |= (1 << 5); | |
4881 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
4882 | } | |
7a292a7a | 4883 | } |
c906108c SS |
4884 | } |
4885 | if (ANDSI (FLD (f_reglist_low_ld), 4)) { | |
7a292a7a | 4886 | { |
c906108c SS |
4887 | { |
4888 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
4889 | CPU (h_gr[((UINT) 2)]) = opval; | |
4890 | written |= (1 << 6); | |
4891 | TRACE_RESULT (current_cpu, abuf, "gr-2", 'x', opval); | |
4892 | } | |
4893 | { | |
4894 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
4895 | CPU (h_gr[((UINT) 15)]) = opval; | |
4896 | written |= (1 << 5); | |
4897 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
4898 | } | |
7a292a7a | 4899 | } |
c906108c SS |
4900 | } |
4901 | if (ANDSI (FLD (f_reglist_low_ld), 8)) { | |
7a292a7a | 4902 | { |
c906108c SS |
4903 | { |
4904 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
4905 | CPU (h_gr[((UINT) 3)]) = opval; | |
4906 | written |= (1 << 7); | |
4907 | TRACE_RESULT (current_cpu, abuf, "gr-3", 'x', opval); | |
4908 | } | |
4909 | { | |
4910 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
4911 | CPU (h_gr[((UINT) 15)]) = opval; | |
4912 | written |= (1 << 5); | |
4913 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
4914 | } | |
7a292a7a | 4915 | } |
c906108c SS |
4916 | } |
4917 | if (ANDSI (FLD (f_reglist_low_ld), 16)) { | |
7a292a7a | 4918 | { |
c906108c SS |
4919 | { |
4920 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
4921 | CPU (h_gr[((UINT) 4)]) = opval; | |
4922 | written |= (1 << 8); | |
4923 | TRACE_RESULT (current_cpu, abuf, "gr-4", 'x', opval); | |
4924 | } | |
4925 | { | |
4926 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
4927 | CPU (h_gr[((UINT) 15)]) = opval; | |
4928 | written |= (1 << 5); | |
4929 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
4930 | } | |
7a292a7a | 4931 | } |
c906108c SS |
4932 | } |
4933 | if (ANDSI (FLD (f_reglist_low_ld), 32)) { | |
7a292a7a | 4934 | { |
c906108c SS |
4935 | { |
4936 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
4937 | CPU (h_gr[((UINT) 5)]) = opval; | |
4938 | written |= (1 << 9); | |
4939 | TRACE_RESULT (current_cpu, abuf, "gr-5", 'x', opval); | |
4940 | } | |
4941 | { | |
4942 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
4943 | CPU (h_gr[((UINT) 15)]) = opval; | |
4944 | written |= (1 << 5); | |
4945 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
4946 | } | |
7a292a7a | 4947 | } |
c906108c SS |
4948 | } |
4949 | if (ANDSI (FLD (f_reglist_low_ld), 64)) { | |
7a292a7a | 4950 | { |
c906108c SS |
4951 | { |
4952 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
4953 | CPU (h_gr[((UINT) 6)]) = opval; | |
4954 | written |= (1 << 10); | |
4955 | TRACE_RESULT (current_cpu, abuf, "gr-6", 'x', opval); | |
4956 | } | |
4957 | { | |
4958 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
4959 | CPU (h_gr[((UINT) 15)]) = opval; | |
4960 | written |= (1 << 5); | |
4961 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
4962 | } | |
7a292a7a | 4963 | } |
c906108c SS |
4964 | } |
4965 | if (ANDSI (FLD (f_reglist_low_ld), 128)) { | |
7a292a7a | 4966 | { |
c906108c SS |
4967 | { |
4968 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
4969 | CPU (h_gr[((UINT) 7)]) = opval; | |
4970 | written |= (1 << 11); | |
4971 | TRACE_RESULT (current_cpu, abuf, "gr-7", 'x', opval); | |
4972 | } | |
4973 | { | |
4974 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
4975 | CPU (h_gr[((UINT) 15)]) = opval; | |
4976 | written |= (1 << 5); | |
4977 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
4978 | } | |
c906108c | 4979 | } |
7a292a7a SS |
4980 | } |
4981 | } | |
c906108c SS |
4982 | |
4983 | abuf->written = written; | |
4984 | return vpc; | |
4985 | #undef FLD | |
4986 | } | |
4987 | ||
4988 | /* ldm1: ldm1 ($reglist_hi_ld) */ | |
4989 | ||
96baa820 | 4990 | static SEM_PC |
c906108c SS |
4991 | SEM_FN_NAME (fr30bf,ldm1) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
4992 | { | |
96baa820 | 4993 | #define FLD(f) abuf->fields.sfmt_ldm1.f |
c906108c SS |
4994 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
4995 | int UNUSED written = 0; | |
4996 | IADDR UNUSED pc = abuf->addr; | |
4997 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
4998 | ||
7a292a7a | 4999 | { |
c906108c | 5000 | if (ANDSI (FLD (f_reglist_hi_ld), 1)) { |
7a292a7a | 5001 | { |
c906108c SS |
5002 | { |
5003 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
5004 | CPU (h_gr[((UINT) 8)]) = opval; | |
5005 | written |= (1 << 9); | |
5006 | TRACE_RESULT (current_cpu, abuf, "gr-8", 'x', opval); | |
5007 | } | |
5008 | { | |
5009 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
5010 | CPU (h_gr[((UINT) 15)]) = opval; | |
5011 | written |= (1 << 8); | |
5012 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5013 | } | |
7a292a7a | 5014 | } |
c906108c SS |
5015 | } |
5016 | if (ANDSI (FLD (f_reglist_hi_ld), 2)) { | |
7a292a7a | 5017 | { |
c906108c SS |
5018 | { |
5019 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
5020 | CPU (h_gr[((UINT) 9)]) = opval; | |
5021 | written |= (1 << 10); | |
5022 | TRACE_RESULT (current_cpu, abuf, "gr-9", 'x', opval); | |
5023 | } | |
5024 | { | |
5025 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
5026 | CPU (h_gr[((UINT) 15)]) = opval; | |
5027 | written |= (1 << 8); | |
5028 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5029 | } | |
7a292a7a | 5030 | } |
c906108c SS |
5031 | } |
5032 | if (ANDSI (FLD (f_reglist_hi_ld), 4)) { | |
7a292a7a | 5033 | { |
c906108c SS |
5034 | { |
5035 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
5036 | CPU (h_gr[((UINT) 10)]) = opval; | |
5037 | written |= (1 << 3); | |
5038 | TRACE_RESULT (current_cpu, abuf, "gr-10", 'x', opval); | |
5039 | } | |
5040 | { | |
5041 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
5042 | CPU (h_gr[((UINT) 15)]) = opval; | |
5043 | written |= (1 << 8); | |
5044 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5045 | } | |
7a292a7a | 5046 | } |
c906108c SS |
5047 | } |
5048 | if (ANDSI (FLD (f_reglist_hi_ld), 8)) { | |
7a292a7a | 5049 | { |
c906108c SS |
5050 | { |
5051 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
5052 | CPU (h_gr[((UINT) 11)]) = opval; | |
5053 | written |= (1 << 4); | |
5054 | TRACE_RESULT (current_cpu, abuf, "gr-11", 'x', opval); | |
5055 | } | |
5056 | { | |
5057 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
5058 | CPU (h_gr[((UINT) 15)]) = opval; | |
5059 | written |= (1 << 8); | |
5060 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5061 | } | |
7a292a7a | 5062 | } |
c906108c SS |
5063 | } |
5064 | if (ANDSI (FLD (f_reglist_hi_ld), 16)) { | |
7a292a7a | 5065 | { |
c906108c SS |
5066 | { |
5067 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
5068 | CPU (h_gr[((UINT) 12)]) = opval; | |
5069 | written |= (1 << 5); | |
5070 | TRACE_RESULT (current_cpu, abuf, "gr-12", 'x', opval); | |
5071 | } | |
5072 | { | |
5073 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
5074 | CPU (h_gr[((UINT) 15)]) = opval; | |
5075 | written |= (1 << 8); | |
5076 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5077 | } | |
7a292a7a | 5078 | } |
c906108c SS |
5079 | } |
5080 | if (ANDSI (FLD (f_reglist_hi_ld), 32)) { | |
7a292a7a | 5081 | { |
c906108c SS |
5082 | { |
5083 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
5084 | CPU (h_gr[((UINT) 13)]) = opval; | |
5085 | written |= (1 << 6); | |
5086 | TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval); | |
5087 | } | |
5088 | { | |
5089 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
5090 | CPU (h_gr[((UINT) 15)]) = opval; | |
5091 | written |= (1 << 8); | |
5092 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5093 | } | |
7a292a7a | 5094 | } |
c906108c SS |
5095 | } |
5096 | if (ANDSI (FLD (f_reglist_hi_ld), 64)) { | |
7a292a7a | 5097 | { |
c906108c SS |
5098 | { |
5099 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
5100 | CPU (h_gr[((UINT) 14)]) = opval; | |
5101 | written |= (1 << 7); | |
5102 | TRACE_RESULT (current_cpu, abuf, "gr-14", 'x', opval); | |
5103 | } | |
5104 | { | |
5105 | SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4); | |
5106 | CPU (h_gr[((UINT) 15)]) = opval; | |
5107 | written |= (1 << 8); | |
5108 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5109 | } | |
7a292a7a | 5110 | } |
c906108c SS |
5111 | } |
5112 | if (ANDSI (FLD (f_reglist_hi_ld), 128)) { | |
5113 | { | |
5114 | SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)])); | |
5115 | CPU (h_gr[((UINT) 15)]) = opval; | |
5116 | written |= (1 << 8); | |
5117 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5118 | } | |
5119 | } | |
7a292a7a | 5120 | } |
c906108c SS |
5121 | |
5122 | abuf->written = written; | |
5123 | return vpc; | |
5124 | #undef FLD | |
5125 | } | |
5126 | ||
5127 | /* stm0: stm0 ($reglist_low_st) */ | |
5128 | ||
96baa820 | 5129 | static SEM_PC |
c906108c SS |
5130 | SEM_FN_NAME (fr30bf,stm0) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
5131 | { | |
96baa820 | 5132 | #define FLD(f) abuf->fields.sfmt_stm0.f |
c906108c SS |
5133 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
5134 | int UNUSED written = 0; | |
5135 | IADDR UNUSED pc = abuf->addr; | |
5136 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
5137 | ||
7a292a7a | 5138 | { |
c906108c | 5139 | if (ANDSI (FLD (f_reglist_low_st), 1)) { |
7a292a7a | 5140 | { |
c906108c SS |
5141 | { |
5142 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5143 | CPU (h_gr[((UINT) 15)]) = opval; | |
5144 | written |= (1 << 10); | |
5145 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5146 | } | |
5147 | { | |
5148 | SI opval = CPU (h_gr[((UINT) 7)]); | |
5149 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
5150 | written |= (1 << 11); | |
5151 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5152 | } | |
7a292a7a | 5153 | } |
c906108c SS |
5154 | } |
5155 | if (ANDSI (FLD (f_reglist_low_st), 2)) { | |
7a292a7a | 5156 | { |
c906108c SS |
5157 | { |
5158 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5159 | CPU (h_gr[((UINT) 15)]) = opval; | |
5160 | written |= (1 << 10); | |
5161 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5162 | } | |
5163 | { | |
5164 | SI opval = CPU (h_gr[((UINT) 6)]); | |
5165 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
5166 | written |= (1 << 11); | |
5167 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5168 | } | |
7a292a7a | 5169 | } |
c906108c SS |
5170 | } |
5171 | if (ANDSI (FLD (f_reglist_low_st), 4)) { | |
7a292a7a | 5172 | { |
c906108c SS |
5173 | { |
5174 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5175 | CPU (h_gr[((UINT) 15)]) = opval; | |
5176 | written |= (1 << 10); | |
5177 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5178 | } | |
5179 | { | |
5180 | SI opval = CPU (h_gr[((UINT) 5)]); | |
5181 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
5182 | written |= (1 << 11); | |
5183 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5184 | } | |
7a292a7a | 5185 | } |
c906108c SS |
5186 | } |
5187 | if (ANDSI (FLD (f_reglist_low_st), 8)) { | |
7a292a7a | 5188 | { |
c906108c SS |
5189 | { |
5190 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5191 | CPU (h_gr[((UINT) 15)]) = opval; | |
5192 | written |= (1 << 10); | |
5193 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5194 | } | |
5195 | { | |
5196 | SI opval = CPU (h_gr[((UINT) 4)]); | |
5197 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
5198 | written |= (1 << 11); | |
5199 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5200 | } | |
7a292a7a | 5201 | } |
c906108c SS |
5202 | } |
5203 | if (ANDSI (FLD (f_reglist_low_st), 16)) { | |
7a292a7a | 5204 | { |
c906108c SS |
5205 | { |
5206 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5207 | CPU (h_gr[((UINT) 15)]) = opval; | |
5208 | written |= (1 << 10); | |
5209 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5210 | } | |
5211 | { | |
5212 | SI opval = CPU (h_gr[((UINT) 3)]); | |
5213 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
5214 | written |= (1 << 11); | |
5215 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5216 | } | |
7a292a7a | 5217 | } |
c906108c SS |
5218 | } |
5219 | if (ANDSI (FLD (f_reglist_low_st), 32)) { | |
7a292a7a | 5220 | { |
c906108c SS |
5221 | { |
5222 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5223 | CPU (h_gr[((UINT) 15)]) = opval; | |
5224 | written |= (1 << 10); | |
5225 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5226 | } | |
5227 | { | |
5228 | SI opval = CPU (h_gr[((UINT) 2)]); | |
5229 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
5230 | written |= (1 << 11); | |
5231 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5232 | } | |
7a292a7a | 5233 | } |
c906108c SS |
5234 | } |
5235 | if (ANDSI (FLD (f_reglist_low_st), 64)) { | |
7a292a7a | 5236 | { |
c906108c SS |
5237 | { |
5238 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5239 | CPU (h_gr[((UINT) 15)]) = opval; | |
5240 | written |= (1 << 10); | |
5241 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5242 | } | |
5243 | { | |
5244 | SI opval = CPU (h_gr[((UINT) 1)]); | |
5245 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
5246 | written |= (1 << 11); | |
5247 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5248 | } | |
7a292a7a | 5249 | } |
c906108c SS |
5250 | } |
5251 | if (ANDSI (FLD (f_reglist_low_st), 128)) { | |
7a292a7a | 5252 | { |
c906108c SS |
5253 | { |
5254 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5255 | CPU (h_gr[((UINT) 15)]) = opval; | |
5256 | written |= (1 << 10); | |
5257 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5258 | } | |
5259 | { | |
5260 | SI opval = CPU (h_gr[((UINT) 0)]); | |
5261 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
5262 | written |= (1 << 11); | |
5263 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5264 | } | |
c906108c | 5265 | } |
7a292a7a SS |
5266 | } |
5267 | } | |
c906108c SS |
5268 | |
5269 | abuf->written = written; | |
5270 | return vpc; | |
5271 | #undef FLD | |
5272 | } | |
5273 | ||
5274 | /* stm1: stm1 ($reglist_hi_st) */ | |
5275 | ||
96baa820 | 5276 | static SEM_PC |
c906108c SS |
5277 | SEM_FN_NAME (fr30bf,stm1) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
5278 | { | |
96baa820 | 5279 | #define FLD(f) abuf->fields.sfmt_stm1.f |
c906108c SS |
5280 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
5281 | int UNUSED written = 0; | |
5282 | IADDR UNUSED pc = abuf->addr; | |
5283 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
5284 | ||
7a292a7a | 5285 | { |
c906108c | 5286 | if (ANDSI (FLD (f_reglist_hi_st), 1)) { |
7a292a7a | 5287 | { |
c906108c SS |
5288 | SI tmp_save_r15; |
5289 | tmp_save_r15 = CPU (h_gr[((UINT) 15)]); | |
5290 | { | |
5291 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5292 | CPU (h_gr[((UINT) 15)]) = opval; | |
5293 | written |= (1 << 9); | |
5294 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5295 | } | |
5296 | { | |
5297 | SI opval = tmp_save_r15; | |
5298 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
5299 | written |= (1 << 10); | |
5300 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5301 | } | |
7a292a7a | 5302 | } |
c906108c SS |
5303 | } |
5304 | if (ANDSI (FLD (f_reglist_hi_st), 2)) { | |
7a292a7a | 5305 | { |
c906108c SS |
5306 | { |
5307 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5308 | CPU (h_gr[((UINT) 15)]) = opval; | |
5309 | written |= (1 << 9); | |
5310 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5311 | } | |
5312 | { | |
5313 | SI opval = CPU (h_gr[((UINT) 14)]); | |
5314 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
5315 | written |= (1 << 10); | |
5316 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5317 | } | |
7a292a7a | 5318 | } |
c906108c SS |
5319 | } |
5320 | if (ANDSI (FLD (f_reglist_hi_st), 4)) { | |
7a292a7a | 5321 | { |
c906108c SS |
5322 | { |
5323 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5324 | CPU (h_gr[((UINT) 15)]) = opval; | |
5325 | written |= (1 << 9); | |
5326 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5327 | } | |
5328 | { | |
5329 | SI opval = CPU (h_gr[((UINT) 13)]); | |
5330 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
5331 | written |= (1 << 10); | |
5332 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5333 | } | |
7a292a7a | 5334 | } |
c906108c SS |
5335 | } |
5336 | if (ANDSI (FLD (f_reglist_hi_st), 8)) { | |
7a292a7a | 5337 | { |
c906108c SS |
5338 | { |
5339 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5340 | CPU (h_gr[((UINT) 15)]) = opval; | |
5341 | written |= (1 << 9); | |
5342 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5343 | } | |
5344 | { | |
5345 | SI opval = CPU (h_gr[((UINT) 12)]); | |
5346 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
5347 | written |= (1 << 10); | |
5348 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5349 | } | |
7a292a7a | 5350 | } |
c906108c SS |
5351 | } |
5352 | if (ANDSI (FLD (f_reglist_hi_st), 16)) { | |
7a292a7a | 5353 | { |
c906108c SS |
5354 | { |
5355 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5356 | CPU (h_gr[((UINT) 15)]) = opval; | |
5357 | written |= (1 << 9); | |
5358 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5359 | } | |
5360 | { | |
5361 | SI opval = CPU (h_gr[((UINT) 11)]); | |
5362 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
5363 | written |= (1 << 10); | |
5364 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5365 | } | |
7a292a7a | 5366 | } |
c906108c SS |
5367 | } |
5368 | if (ANDSI (FLD (f_reglist_hi_st), 32)) { | |
7a292a7a | 5369 | { |
c906108c SS |
5370 | { |
5371 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5372 | CPU (h_gr[((UINT) 15)]) = opval; | |
5373 | written |= (1 << 9); | |
5374 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5375 | } | |
5376 | { | |
5377 | SI opval = CPU (h_gr[((UINT) 10)]); | |
5378 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
5379 | written |= (1 << 10); | |
5380 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5381 | } | |
7a292a7a | 5382 | } |
c906108c SS |
5383 | } |
5384 | if (ANDSI (FLD (f_reglist_hi_st), 64)) { | |
7a292a7a | 5385 | { |
c906108c SS |
5386 | { |
5387 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5388 | CPU (h_gr[((UINT) 15)]) = opval; | |
5389 | written |= (1 << 9); | |
5390 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5391 | } | |
5392 | { | |
5393 | SI opval = CPU (h_gr[((UINT) 9)]); | |
5394 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
5395 | written |= (1 << 10); | |
5396 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5397 | } | |
7a292a7a | 5398 | } |
c906108c SS |
5399 | } |
5400 | if (ANDSI (FLD (f_reglist_hi_st), 128)) { | |
7a292a7a | 5401 | { |
c906108c SS |
5402 | { |
5403 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5404 | CPU (h_gr[((UINT) 15)]) = opval; | |
5405 | written |= (1 << 9); | |
5406 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5407 | } | |
5408 | { | |
5409 | SI opval = CPU (h_gr[((UINT) 8)]); | |
5410 | SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval); | |
5411 | written |= (1 << 10); | |
5412 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5413 | } | |
c906108c | 5414 | } |
7a292a7a SS |
5415 | } |
5416 | } | |
c906108c SS |
5417 | |
5418 | abuf->written = written; | |
5419 | return vpc; | |
5420 | #undef FLD | |
5421 | } | |
5422 | ||
5423 | /* enter: enter $u10 */ | |
5424 | ||
96baa820 | 5425 | static SEM_PC |
c906108c SS |
5426 | SEM_FN_NAME (fr30bf,enter) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
5427 | { | |
96baa820 | 5428 | #define FLD(f) abuf->fields.sfmt_enter.f |
c906108c SS |
5429 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
5430 | int UNUSED written = 0; | |
5431 | IADDR UNUSED pc = abuf->addr; | |
5432 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
5433 | ||
7a292a7a | 5434 | { |
c906108c SS |
5435 | SI tmp_tmp; |
5436 | tmp_tmp = SUBSI (CPU (h_gr[((UINT) 15)]), 4); | |
5437 | { | |
5438 | SI opval = CPU (h_gr[((UINT) 14)]); | |
5439 | SETMEMSI (current_cpu, pc, tmp_tmp, opval); | |
5440 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5441 | } | |
5442 | { | |
5443 | SI opval = tmp_tmp; | |
5444 | CPU (h_gr[((UINT) 14)]) = opval; | |
5445 | TRACE_RESULT (current_cpu, abuf, "gr-14", 'x', opval); | |
5446 | } | |
5447 | { | |
5448 | SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), FLD (f_u10)); | |
5449 | CPU (h_gr[((UINT) 15)]) = opval; | |
5450 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5451 | } | |
7a292a7a | 5452 | } |
c906108c SS |
5453 | |
5454 | return vpc; | |
5455 | #undef FLD | |
5456 | } | |
5457 | ||
5458 | /* leave: leave */ | |
5459 | ||
96baa820 | 5460 | static SEM_PC |
c906108c SS |
5461 | SEM_FN_NAME (fr30bf,leave) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
5462 | { | |
96baa820 | 5463 | #define FLD(f) abuf->fields.sfmt_enter.f |
c906108c SS |
5464 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
5465 | int UNUSED written = 0; | |
5466 | IADDR UNUSED pc = abuf->addr; | |
5467 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
5468 | ||
7a292a7a | 5469 | { |
c906108c SS |
5470 | { |
5471 | SI opval = ADDSI (CPU (h_gr[((UINT) 14)]), 4); | |
5472 | CPU (h_gr[((UINT) 15)]) = opval; | |
5473 | TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval); | |
5474 | } | |
5475 | { | |
5476 | SI opval = GETMEMSI (current_cpu, pc, SUBSI (CPU (h_gr[((UINT) 15)]), 4)); | |
5477 | CPU (h_gr[((UINT) 14)]) = opval; | |
5478 | TRACE_RESULT (current_cpu, abuf, "gr-14", 'x', opval); | |
5479 | } | |
7a292a7a | 5480 | } |
c906108c SS |
5481 | |
5482 | return vpc; | |
5483 | #undef FLD | |
5484 | } | |
5485 | ||
5486 | /* xchb: xchb @$Rj,$Ri */ | |
5487 | ||
96baa820 | 5488 | static SEM_PC |
c906108c SS |
5489 | SEM_FN_NAME (fr30bf,xchb) (SIM_CPU *current_cpu, SEM_ARG sem_arg) |
5490 | { | |
96baa820 | 5491 | #define FLD(f) abuf->fields.sfmt_add.f |
c906108c SS |
5492 | ARGBUF *abuf = SEM_ARGBUF (sem_arg); |
5493 | int UNUSED written = 0; | |
5494 | IADDR UNUSED pc = abuf->addr; | |
5495 | SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); | |
5496 | ||
7a292a7a | 5497 | { |
c906108c SS |
5498 | SI tmp_tmp; |
5499 | tmp_tmp = * FLD (i_Ri); | |
5500 | { | |
5501 | SI opval = GETMEMUQI (current_cpu, pc, * FLD (i_Rj)); | |
5502 | * FLD (i_Ri) = opval; | |
5503 | TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval); | |
5504 | } | |
5505 | { | |
5506 | UQI opval = tmp_tmp; | |
5507 | SETMEMUQI (current_cpu, pc, * FLD (i_Rj), opval); | |
5508 | TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); | |
5509 | } | |
7a292a7a | 5510 | } |
c906108c SS |
5511 | |
5512 | return vpc; | |
5513 | #undef FLD | |
5514 | } | |
5515 | ||
96baa820 JM |
5516 | /* Table of all semantic fns. */ |
5517 | ||
5518 | static const struct sem_fn_desc sem_fns[] = { | |
5519 | { FR30BF_INSN_X_INVALID, SEM_FN_NAME (fr30bf,x_invalid) }, | |
5520 | { FR30BF_INSN_X_AFTER, SEM_FN_NAME (fr30bf,x_after) }, | |
5521 | { FR30BF_INSN_X_BEFORE, SEM_FN_NAME (fr30bf,x_before) }, | |
5522 | { FR30BF_INSN_X_CTI_CHAIN, SEM_FN_NAME (fr30bf,x_cti_chain) }, | |
5523 | { FR30BF_INSN_X_CHAIN, SEM_FN_NAME (fr30bf,x_chain) }, | |
5524 | { FR30BF_INSN_X_BEGIN, SEM_FN_NAME (fr30bf,x_begin) }, | |
5525 | { FR30BF_INSN_ADD, SEM_FN_NAME (fr30bf,add) }, | |
5526 | { FR30BF_INSN_ADDI, SEM_FN_NAME (fr30bf,addi) }, | |
5527 | { FR30BF_INSN_ADD2, SEM_FN_NAME (fr30bf,add2) }, | |
5528 | { FR30BF_INSN_ADDC, SEM_FN_NAME (fr30bf,addc) }, | |
5529 | { FR30BF_INSN_ADDN, SEM_FN_NAME (fr30bf,addn) }, | |
5530 | { FR30BF_INSN_ADDNI, SEM_FN_NAME (fr30bf,addni) }, | |
5531 | { FR30BF_INSN_ADDN2, SEM_FN_NAME (fr30bf,addn2) }, | |
5532 | { FR30BF_INSN_SUB, SEM_FN_NAME (fr30bf,sub) }, | |
5533 | { FR30BF_INSN_SUBC, SEM_FN_NAME (fr30bf,subc) }, | |
5534 | { FR30BF_INSN_SUBN, SEM_FN_NAME (fr30bf,subn) }, | |
5535 | { FR30BF_INSN_CMP, SEM_FN_NAME (fr30bf,cmp) }, | |
5536 | { FR30BF_INSN_CMPI, SEM_FN_NAME (fr30bf,cmpi) }, | |
5537 | { FR30BF_INSN_CMP2, SEM_FN_NAME (fr30bf,cmp2) }, | |
5538 | { FR30BF_INSN_AND, SEM_FN_NAME (fr30bf,and) }, | |
5539 | { FR30BF_INSN_OR, SEM_FN_NAME (fr30bf,or) }, | |
5540 | { FR30BF_INSN_EOR, SEM_FN_NAME (fr30bf,eor) }, | |
5541 | { FR30BF_INSN_ANDM, SEM_FN_NAME (fr30bf,andm) }, | |
5542 | { FR30BF_INSN_ANDH, SEM_FN_NAME (fr30bf,andh) }, | |
5543 | { FR30BF_INSN_ANDB, SEM_FN_NAME (fr30bf,andb) }, | |
5544 | { FR30BF_INSN_ORM, SEM_FN_NAME (fr30bf,orm) }, | |
5545 | { FR30BF_INSN_ORH, SEM_FN_NAME (fr30bf,orh) }, | |
5546 | { FR30BF_INSN_ORB, SEM_FN_NAME (fr30bf,orb) }, | |
5547 | { FR30BF_INSN_EORM, SEM_FN_NAME (fr30bf,eorm) }, | |
5548 | { FR30BF_INSN_EORH, SEM_FN_NAME (fr30bf,eorh) }, | |
5549 | { FR30BF_INSN_EORB, SEM_FN_NAME (fr30bf,eorb) }, | |
5550 | { FR30BF_INSN_BANDL, SEM_FN_NAME (fr30bf,bandl) }, | |
5551 | { FR30BF_INSN_BORL, SEM_FN_NAME (fr30bf,borl) }, | |
5552 | { FR30BF_INSN_BEORL, SEM_FN_NAME (fr30bf,beorl) }, | |
5553 | { FR30BF_INSN_BANDH, SEM_FN_NAME (fr30bf,bandh) }, | |
5554 | { FR30BF_INSN_BORH, SEM_FN_NAME (fr30bf,borh) }, | |
5555 | { FR30BF_INSN_BEORH, SEM_FN_NAME (fr30bf,beorh) }, | |
5556 | { FR30BF_INSN_BTSTL, SEM_FN_NAME (fr30bf,btstl) }, | |
5557 | { FR30BF_INSN_BTSTH, SEM_FN_NAME (fr30bf,btsth) }, | |
5558 | { FR30BF_INSN_MUL, SEM_FN_NAME (fr30bf,mul) }, | |
5559 | { FR30BF_INSN_MULU, SEM_FN_NAME (fr30bf,mulu) }, | |
5560 | { FR30BF_INSN_MULH, SEM_FN_NAME (fr30bf,mulh) }, | |
5561 | { FR30BF_INSN_MULUH, SEM_FN_NAME (fr30bf,muluh) }, | |
5562 | { FR30BF_INSN_DIV0S, SEM_FN_NAME (fr30bf,div0s) }, | |
5563 | { FR30BF_INSN_DIV0U, SEM_FN_NAME (fr30bf,div0u) }, | |
5564 | { FR30BF_INSN_DIV1, SEM_FN_NAME (fr30bf,div1) }, | |
5565 | { FR30BF_INSN_DIV2, SEM_FN_NAME (fr30bf,div2) }, | |
5566 | { FR30BF_INSN_DIV3, SEM_FN_NAME (fr30bf,div3) }, | |
5567 | { FR30BF_INSN_DIV4S, SEM_FN_NAME (fr30bf,div4s) }, | |
5568 | { FR30BF_INSN_LSL, SEM_FN_NAME (fr30bf,lsl) }, | |
5569 | { FR30BF_INSN_LSLI, SEM_FN_NAME (fr30bf,lsli) }, | |
5570 | { FR30BF_INSN_LSL2, SEM_FN_NAME (fr30bf,lsl2) }, | |
5571 | { FR30BF_INSN_LSR, SEM_FN_NAME (fr30bf,lsr) }, | |
5572 | { FR30BF_INSN_LSRI, SEM_FN_NAME (fr30bf,lsri) }, | |
5573 | { FR30BF_INSN_LSR2, SEM_FN_NAME (fr30bf,lsr2) }, | |
5574 | { FR30BF_INSN_ASR, SEM_FN_NAME (fr30bf,asr) }, | |
5575 | { FR30BF_INSN_ASRI, SEM_FN_NAME (fr30bf,asri) }, | |
5576 | { FR30BF_INSN_ASR2, SEM_FN_NAME (fr30bf,asr2) }, | |
5577 | { FR30BF_INSN_LDI8, SEM_FN_NAME (fr30bf,ldi8) }, | |
5578 | { FR30BF_INSN_LDI20, SEM_FN_NAME (fr30bf,ldi20) }, | |
5579 | { FR30BF_INSN_LDI32, SEM_FN_NAME (fr30bf,ldi32) }, | |
5580 | { FR30BF_INSN_LD, SEM_FN_NAME (fr30bf,ld) }, | |
5581 | { FR30BF_INSN_LDUH, SEM_FN_NAME (fr30bf,lduh) }, | |
5582 | { FR30BF_INSN_LDUB, SEM_FN_NAME (fr30bf,ldub) }, | |
5583 | { FR30BF_INSN_LDR13, SEM_FN_NAME (fr30bf,ldr13) }, | |
5584 | { FR30BF_INSN_LDR13UH, SEM_FN_NAME (fr30bf,ldr13uh) }, | |
5585 | { FR30BF_INSN_LDR13UB, SEM_FN_NAME (fr30bf,ldr13ub) }, | |
5586 | { FR30BF_INSN_LDR14, SEM_FN_NAME (fr30bf,ldr14) }, | |
5587 | { FR30BF_INSN_LDR14UH, SEM_FN_NAME (fr30bf,ldr14uh) }, | |
5588 | { FR30BF_INSN_LDR14UB, SEM_FN_NAME (fr30bf,ldr14ub) }, | |
5589 | { FR30BF_INSN_LDR15, SEM_FN_NAME (fr30bf,ldr15) }, | |
5590 | { FR30BF_INSN_LDR15GR, SEM_FN_NAME (fr30bf,ldr15gr) }, | |
5591 | { FR30BF_INSN_LDR15DR, SEM_FN_NAME (fr30bf,ldr15dr) }, | |
5592 | { FR30BF_INSN_LDR15PS, SEM_FN_NAME (fr30bf,ldr15ps) }, | |
5593 | { FR30BF_INSN_ST, SEM_FN_NAME (fr30bf,st) }, | |
5594 | { FR30BF_INSN_STH, SEM_FN_NAME (fr30bf,sth) }, | |
5595 | { FR30BF_INSN_STB, SEM_FN_NAME (fr30bf,stb) }, | |
5596 | { FR30BF_INSN_STR13, SEM_FN_NAME (fr30bf,str13) }, | |
5597 | { FR30BF_INSN_STR13H, SEM_FN_NAME (fr30bf,str13h) }, | |
5598 | { FR30BF_INSN_STR13B, SEM_FN_NAME (fr30bf,str13b) }, | |
5599 | { FR30BF_INSN_STR14, SEM_FN_NAME (fr30bf,str14) }, | |
5600 | { FR30BF_INSN_STR14H, SEM_FN_NAME (fr30bf,str14h) }, | |
5601 | { FR30BF_INSN_STR14B, SEM_FN_NAME (fr30bf,str14b) }, | |
5602 | { FR30BF_INSN_STR15, SEM_FN_NAME (fr30bf,str15) }, | |
5603 | { FR30BF_INSN_STR15GR, SEM_FN_NAME (fr30bf,str15gr) }, | |
5604 | { FR30BF_INSN_STR15DR, SEM_FN_NAME (fr30bf,str15dr) }, | |
5605 | { FR30BF_INSN_STR15PS, SEM_FN_NAME (fr30bf,str15ps) }, | |
5606 | { FR30BF_INSN_MOV, SEM_FN_NAME (fr30bf,mov) }, | |
5607 | { FR30BF_INSN_MOVDR, SEM_FN_NAME (fr30bf,movdr) }, | |
5608 | { FR30BF_INSN_MOVPS, SEM_FN_NAME (fr30bf,movps) }, | |
5609 | { FR30BF_INSN_MOV2DR, SEM_FN_NAME (fr30bf,mov2dr) }, | |
5610 | { FR30BF_INSN_MOV2PS, SEM_FN_NAME (fr30bf,mov2ps) }, | |
5611 | { FR30BF_INSN_JMP, SEM_FN_NAME (fr30bf,jmp) }, | |
5612 | { FR30BF_INSN_JMPD, SEM_FN_NAME (fr30bf,jmpd) }, | |
5613 | { FR30BF_INSN_CALLR, SEM_FN_NAME (fr30bf,callr) }, | |
5614 | { FR30BF_INSN_CALLRD, SEM_FN_NAME (fr30bf,callrd) }, | |
5615 | { FR30BF_INSN_CALL, SEM_FN_NAME (fr30bf,call) }, | |
5616 | { FR30BF_INSN_CALLD, SEM_FN_NAME (fr30bf,calld) }, | |
5617 | { FR30BF_INSN_RET, SEM_FN_NAME (fr30bf,ret) }, | |
5618 | { FR30BF_INSN_RET_D, SEM_FN_NAME (fr30bf,ret_d) }, | |
5619 | { FR30BF_INSN_INT, SEM_FN_NAME (fr30bf,int) }, | |
5620 | { FR30BF_INSN_INTE, SEM_FN_NAME (fr30bf,inte) }, | |
5621 | { FR30BF_INSN_RETI, SEM_FN_NAME (fr30bf,reti) }, | |
5622 | { FR30BF_INSN_BRAD, SEM_FN_NAME (fr30bf,brad) }, | |
5623 | { FR30BF_INSN_BRA, SEM_FN_NAME (fr30bf,bra) }, | |
5624 | { FR30BF_INSN_BNOD, SEM_FN_NAME (fr30bf,bnod) }, | |
5625 | { FR30BF_INSN_BNO, SEM_FN_NAME (fr30bf,bno) }, | |
5626 | { FR30BF_INSN_BEQD, SEM_FN_NAME (fr30bf,beqd) }, | |
5627 | { FR30BF_INSN_BEQ, SEM_FN_NAME (fr30bf,beq) }, | |
5628 | { FR30BF_INSN_BNED, SEM_FN_NAME (fr30bf,bned) }, | |
5629 | { FR30BF_INSN_BNE, SEM_FN_NAME (fr30bf,bne) }, | |
5630 | { FR30BF_INSN_BCD, SEM_FN_NAME (fr30bf,bcd) }, | |
5631 | { FR30BF_INSN_BC, SEM_FN_NAME (fr30bf,bc) }, | |
5632 | { FR30BF_INSN_BNCD, SEM_FN_NAME (fr30bf,bncd) }, | |
5633 | { FR30BF_INSN_BNC, SEM_FN_NAME (fr30bf,bnc) }, | |
5634 | { FR30BF_INSN_BND, SEM_FN_NAME (fr30bf,bnd) }, | |
5635 | { FR30BF_INSN_BN, SEM_FN_NAME (fr30bf,bn) }, | |
5636 | { FR30BF_INSN_BPD, SEM_FN_NAME (fr30bf,bpd) }, | |
5637 | { FR30BF_INSN_BP, SEM_FN_NAME (fr30bf,bp) }, | |
5638 | { FR30BF_INSN_BVD, SEM_FN_NAME (fr30bf,bvd) }, | |
5639 | { FR30BF_INSN_BV, SEM_FN_NAME (fr30bf,bv) }, | |
5640 | { FR30BF_INSN_BNVD, SEM_FN_NAME (fr30bf,bnvd) }, | |
5641 | { FR30BF_INSN_BNV, SEM_FN_NAME (fr30bf,bnv) }, | |
5642 | { FR30BF_INSN_BLTD, SEM_FN_NAME (fr30bf,bltd) }, | |
5643 | { FR30BF_INSN_BLT, SEM_FN_NAME (fr30bf,blt) }, | |
5644 | { FR30BF_INSN_BGED, SEM_FN_NAME (fr30bf,bged) }, | |
5645 | { FR30BF_INSN_BGE, SEM_FN_NAME (fr30bf,bge) }, | |
5646 | { FR30BF_INSN_BLED, SEM_FN_NAME (fr30bf,bled) }, | |
5647 | { FR30BF_INSN_BLE, SEM_FN_NAME (fr30bf,ble) }, | |
5648 | { FR30BF_INSN_BGTD, SEM_FN_NAME (fr30bf,bgtd) }, | |
5649 | { FR30BF_INSN_BGT, SEM_FN_NAME (fr30bf,bgt) }, | |
5650 | { FR30BF_INSN_BLSD, SEM_FN_NAME (fr30bf,blsd) }, | |
5651 | { FR30BF_INSN_BLS, SEM_FN_NAME (fr30bf,bls) }, | |
5652 | { FR30BF_INSN_BHID, SEM_FN_NAME (fr30bf,bhid) }, | |
5653 | { FR30BF_INSN_BHI, SEM_FN_NAME (fr30bf,bhi) }, | |
5654 | { FR30BF_INSN_DMOVR13, SEM_FN_NAME (fr30bf,dmovr13) }, | |
5655 | { FR30BF_INSN_DMOVR13H, SEM_FN_NAME (fr30bf,dmovr13h) }, | |
5656 | { FR30BF_INSN_DMOVR13B, SEM_FN_NAME (fr30bf,dmovr13b) }, | |
5657 | { FR30BF_INSN_DMOVR13PI, SEM_FN_NAME (fr30bf,dmovr13pi) }, | |
5658 | { FR30BF_INSN_DMOVR13PIH, SEM_FN_NAME (fr30bf,dmovr13pih) }, | |
5659 | { FR30BF_INSN_DMOVR13PIB, SEM_FN_NAME (fr30bf,dmovr13pib) }, | |
5660 | { FR30BF_INSN_DMOVR15PI, SEM_FN_NAME (fr30bf,dmovr15pi) }, | |
5661 | { FR30BF_INSN_DMOV2R13, SEM_FN_NAME (fr30bf,dmov2r13) }, | |
5662 | { FR30BF_INSN_DMOV2R13H, SEM_FN_NAME (fr30bf,dmov2r13h) }, | |
5663 | { FR30BF_INSN_DMOV2R13B, SEM_FN_NAME (fr30bf,dmov2r13b) }, | |
5664 | { FR30BF_INSN_DMOV2R13PI, SEM_FN_NAME (fr30bf,dmov2r13pi) }, | |
5665 | { FR30BF_INSN_DMOV2R13PIH, SEM_FN_NAME (fr30bf,dmov2r13pih) }, | |
5666 | { FR30BF_INSN_DMOV2R13PIB, SEM_FN_NAME (fr30bf,dmov2r13pib) }, | |
5667 | { FR30BF_INSN_DMOV2R15PD, SEM_FN_NAME (fr30bf,dmov2r15pd) }, | |
5668 | { FR30BF_INSN_LDRES, SEM_FN_NAME (fr30bf,ldres) }, | |
5669 | { FR30BF_INSN_STRES, SEM_FN_NAME (fr30bf,stres) }, | |
5670 | { FR30BF_INSN_COPOP, SEM_FN_NAME (fr30bf,copop) }, | |
5671 | { FR30BF_INSN_COPLD, SEM_FN_NAME (fr30bf,copld) }, | |
5672 | { FR30BF_INSN_COPST, SEM_FN_NAME (fr30bf,copst) }, | |
5673 | { FR30BF_INSN_COPSV, SEM_FN_NAME (fr30bf,copsv) }, | |
5674 | { FR30BF_INSN_NOP, SEM_FN_NAME (fr30bf,nop) }, | |
5675 | { FR30BF_INSN_ANDCCR, SEM_FN_NAME (fr30bf,andccr) }, | |
5676 | { FR30BF_INSN_ORCCR, SEM_FN_NAME (fr30bf,orccr) }, | |
5677 | { FR30BF_INSN_STILM, SEM_FN_NAME (fr30bf,stilm) }, | |
5678 | { FR30BF_INSN_ADDSP, SEM_FN_NAME (fr30bf,addsp) }, | |
5679 | { FR30BF_INSN_EXTSB, SEM_FN_NAME (fr30bf,extsb) }, | |
5680 | { FR30BF_INSN_EXTUB, SEM_FN_NAME (fr30bf,extub) }, | |
5681 | { FR30BF_INSN_EXTSH, SEM_FN_NAME (fr30bf,extsh) }, | |
5682 | { FR30BF_INSN_EXTUH, SEM_FN_NAME (fr30bf,extuh) }, | |
5683 | { FR30BF_INSN_LDM0, SEM_FN_NAME (fr30bf,ldm0) }, | |
5684 | { FR30BF_INSN_LDM1, SEM_FN_NAME (fr30bf,ldm1) }, | |
5685 | { FR30BF_INSN_STM0, SEM_FN_NAME (fr30bf,stm0) }, | |
5686 | { FR30BF_INSN_STM1, SEM_FN_NAME (fr30bf,stm1) }, | |
5687 | { FR30BF_INSN_ENTER, SEM_FN_NAME (fr30bf,enter) }, | |
5688 | { FR30BF_INSN_LEAVE, SEM_FN_NAME (fr30bf,leave) }, | |
5689 | { FR30BF_INSN_XCHB, SEM_FN_NAME (fr30bf,xchb) }, | |
5690 | { 0, 0 } | |
5691 | }; | |
5692 | ||
5693 | /* Add the semantic fns to IDESC_TABLE. */ | |
5694 | ||
5695 | void | |
5696 | SEM_FN_NAME (fr30bf,init_idesc_table) (SIM_CPU *current_cpu) | |
5697 | { | |
5698 | IDESC *idesc_table = CPU_IDESC (current_cpu); | |
5699 | const struct sem_fn_desc *sf; | |
d4f3574e | 5700 | int mach_num = MACH_NUM (CPU_MACH (current_cpu)); |
96baa820 JM |
5701 | |
5702 | for (sf = &sem_fns[0]; sf->fn != 0; ++sf) | |
5703 | { | |
d4f3574e | 5704 | int valid_p = CGEN_INSN_MACH_HAS_P (idesc_table[sf->index].idata, mach_num); |
96baa820 | 5705 | #if FAST_P |
d4f3574e SS |
5706 | if (valid_p) |
5707 | idesc_table[sf->index].sem_fast = sf->fn; | |
5708 | else | |
5709 | idesc_table[sf->index].sem_fast = SEM_FN_NAME (fr30bf,x_invalid); | |
96baa820 | 5710 | #else |
d4f3574e SS |
5711 | if (valid_p) |
5712 | idesc_table[sf->index].sem_full = sf->fn; | |
5713 | else | |
5714 | idesc_table[sf->index].sem_full = SEM_FN_NAME (fr30bf,x_invalid); | |
96baa820 JM |
5715 | #endif |
5716 | } | |
5717 | } | |
5718 |