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