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