modelv32.c revision 1.11 1 1.1 christos /* Simulator model support for crisv32f.
2 1.1 christos
3 1.1 christos THIS FILE IS MACHINE GENERATED WITH CGEN.
4 1.1 christos
5 1.11 christos Copyright (C) 1996-2024 Free Software Foundation, Inc.
6 1.1 christos
7 1.1 christos This file is part of the GNU simulators.
8 1.1 christos
9 1.1 christos This file is free software; you can redistribute it and/or modify
10 1.1 christos it under the terms of the GNU General Public License as published by
11 1.1 christos the Free Software Foundation; either version 3, or (at your option)
12 1.1 christos any later version.
13 1.1 christos
14 1.1 christos It is distributed in the hope that it will be useful, but WITHOUT
15 1.1 christos ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 1.1 christos or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 1.1 christos License for more details.
18 1.1 christos
19 1.1 christos You should have received a copy of the GNU General Public License along
20 1.11 christos with this program; if not, write to the Free Software Foundation, Inc.,
21 1.11 christos 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
22 1.1 christos
23 1.1 christos */
24 1.1 christos
25 1.1 christos #define WANT_CPU crisv32f
26 1.1 christos #define WANT_CPU_CRISV32F
27 1.1 christos
28 1.1 christos #include "sim-main.h"
29 1.1 christos
30 1.1 christos /* The profiling data is recorded here, but is accessed via the profiling
31 1.1 christos mechanism. After all, this is information for profiling. */
32 1.1 christos
33 1.1 christos #if WITH_PROFILE_MODEL_P
34 1.1 christos
35 1.1 christos /* Model handlers for each insn. */
36 1.1 christos
37 1.1 christos static int
38 1.1 christos model_crisv32_move_b_r (SIM_CPU *current_cpu, void *sem_arg)
39 1.1 christos {
40 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
41 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
42 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
43 1.1 christos int cycles = 0;
44 1.1 christos {
45 1.1 christos int referenced = 0;
46 1.1 christos int UNUSED insn_referenced = abuf->written;
47 1.1 christos INT in_Rd = -1;
48 1.1 christos INT in_Rs = -1;
49 1.1 christos INT out_Rd = -1;
50 1.1 christos in_Rs = FLD (in_Rs);
51 1.1 christos referenced |= 1 << 1;
52 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
53 1.1 christos }
54 1.1 christos return cycles;
55 1.1 christos #undef FLD
56 1.1 christos }
57 1.1 christos
58 1.1 christos static int
59 1.1 christos model_crisv32_move_w_r (SIM_CPU *current_cpu, void *sem_arg)
60 1.1 christos {
61 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
62 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
63 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
64 1.1 christos int cycles = 0;
65 1.1 christos {
66 1.1 christos int referenced = 0;
67 1.1 christos int UNUSED insn_referenced = abuf->written;
68 1.1 christos INT in_Rd = -1;
69 1.1 christos INT in_Rs = -1;
70 1.1 christos INT out_Rd = -1;
71 1.1 christos in_Rs = FLD (in_Rs);
72 1.1 christos referenced |= 1 << 1;
73 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
74 1.1 christos }
75 1.1 christos return cycles;
76 1.1 christos #undef FLD
77 1.1 christos }
78 1.1 christos
79 1.1 christos static int
80 1.1 christos model_crisv32_move_d_r (SIM_CPU *current_cpu, void *sem_arg)
81 1.1 christos {
82 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
83 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
84 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
85 1.1 christos int cycles = 0;
86 1.1 christos {
87 1.1 christos int referenced = 0;
88 1.1 christos int UNUSED insn_referenced = abuf->written;
89 1.1 christos INT in_Rd = -1;
90 1.1 christos INT in_Rs = -1;
91 1.1 christos INT out_Rd = -1;
92 1.1 christos in_Rs = FLD (in_Rs);
93 1.1 christos referenced |= 1 << 1;
94 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
95 1.1 christos }
96 1.1 christos return cycles;
97 1.1 christos #undef FLD
98 1.1 christos }
99 1.1 christos
100 1.1 christos static int
101 1.1 christos model_crisv32_moveq (SIM_CPU *current_cpu, void *sem_arg)
102 1.1 christos {
103 1.1 christos #define FLD(f) abuf->fields.sfmt_moveq.f
104 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
105 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
106 1.1 christos int cycles = 0;
107 1.1 christos {
108 1.1 christos int referenced = 0;
109 1.1 christos int UNUSED insn_referenced = abuf->written;
110 1.1 christos INT in_Rd = -1;
111 1.1 christos INT in_Rs = -1;
112 1.1 christos INT out_Rd = -1;
113 1.1 christos out_Rd = FLD (out_Rd);
114 1.1 christos referenced |= 1 << 2;
115 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
116 1.1 christos }
117 1.1 christos return cycles;
118 1.1 christos #undef FLD
119 1.1 christos }
120 1.1 christos
121 1.1 christos static int
122 1.1 christos model_crisv32_movs_b_r (SIM_CPU *current_cpu, void *sem_arg)
123 1.1 christos {
124 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
125 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
126 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
127 1.1 christos int cycles = 0;
128 1.1 christos {
129 1.1 christos int referenced = 0;
130 1.1 christos int UNUSED insn_referenced = abuf->written;
131 1.1 christos INT in_Rd = -1;
132 1.1 christos INT in_Rs = -1;
133 1.1 christos INT out_Rd = -1;
134 1.1 christos in_Rs = FLD (in_Rs);
135 1.1 christos out_Rd = FLD (out_Rd);
136 1.1 christos referenced |= 1 << 1;
137 1.1 christos referenced |= 1 << 2;
138 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
139 1.1 christos }
140 1.1 christos return cycles;
141 1.1 christos #undef FLD
142 1.1 christos }
143 1.1 christos
144 1.1 christos static int
145 1.1 christos model_crisv32_movs_w_r (SIM_CPU *current_cpu, void *sem_arg)
146 1.1 christos {
147 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
148 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
149 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
150 1.1 christos int cycles = 0;
151 1.1 christos {
152 1.1 christos int referenced = 0;
153 1.1 christos int UNUSED insn_referenced = abuf->written;
154 1.1 christos INT in_Rd = -1;
155 1.1 christos INT in_Rs = -1;
156 1.1 christos INT out_Rd = -1;
157 1.1 christos in_Rs = FLD (in_Rs);
158 1.1 christos out_Rd = FLD (out_Rd);
159 1.1 christos referenced |= 1 << 1;
160 1.1 christos referenced |= 1 << 2;
161 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
162 1.1 christos }
163 1.1 christos return cycles;
164 1.1 christos #undef FLD
165 1.1 christos }
166 1.1 christos
167 1.1 christos static int
168 1.1 christos model_crisv32_movu_b_r (SIM_CPU *current_cpu, void *sem_arg)
169 1.1 christos {
170 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
171 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
172 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
173 1.1 christos int cycles = 0;
174 1.1 christos {
175 1.1 christos int referenced = 0;
176 1.1 christos int UNUSED insn_referenced = abuf->written;
177 1.1 christos INT in_Rd = -1;
178 1.1 christos INT in_Rs = -1;
179 1.1 christos INT out_Rd = -1;
180 1.1 christos in_Rs = FLD (in_Rs);
181 1.1 christos out_Rd = FLD (out_Rd);
182 1.1 christos referenced |= 1 << 1;
183 1.1 christos referenced |= 1 << 2;
184 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
185 1.1 christos }
186 1.1 christos return cycles;
187 1.1 christos #undef FLD
188 1.1 christos }
189 1.1 christos
190 1.1 christos static int
191 1.1 christos model_crisv32_movu_w_r (SIM_CPU *current_cpu, void *sem_arg)
192 1.1 christos {
193 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
194 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
195 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
196 1.1 christos int cycles = 0;
197 1.1 christos {
198 1.1 christos int referenced = 0;
199 1.1 christos int UNUSED insn_referenced = abuf->written;
200 1.1 christos INT in_Rd = -1;
201 1.1 christos INT in_Rs = -1;
202 1.1 christos INT out_Rd = -1;
203 1.1 christos in_Rs = FLD (in_Rs);
204 1.1 christos out_Rd = FLD (out_Rd);
205 1.1 christos referenced |= 1 << 1;
206 1.1 christos referenced |= 1 << 2;
207 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
208 1.1 christos }
209 1.1 christos return cycles;
210 1.1 christos #undef FLD
211 1.1 christos }
212 1.1 christos
213 1.1 christos static int
214 1.1 christos model_crisv32_movecbr (SIM_CPU *current_cpu, void *sem_arg)
215 1.1 christos {
216 1.1 christos #define FLD(f) abuf->fields.sfmt_addcbr.f
217 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
218 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
219 1.1 christos int cycles = 0;
220 1.1 christos {
221 1.1 christos int referenced = 0;
222 1.1 christos int UNUSED insn_referenced = abuf->written;
223 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
224 1.1 christos }
225 1.1 christos {
226 1.1 christos int referenced = 0;
227 1.1 christos int UNUSED insn_referenced = abuf->written;
228 1.1 christos INT in_Rd = -1;
229 1.1 christos INT in_Rs = -1;
230 1.1 christos INT out_Rd = -1;
231 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
232 1.1 christos }
233 1.1 christos return cycles;
234 1.1 christos #undef FLD
235 1.1 christos }
236 1.1 christos
237 1.1 christos static int
238 1.1 christos model_crisv32_movecwr (SIM_CPU *current_cpu, void *sem_arg)
239 1.1 christos {
240 1.1 christos #define FLD(f) abuf->fields.sfmt_addcwr.f
241 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
242 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
243 1.1 christos int cycles = 0;
244 1.1 christos {
245 1.1 christos int referenced = 0;
246 1.1 christos int UNUSED insn_referenced = abuf->written;
247 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
248 1.1 christos }
249 1.1 christos {
250 1.1 christos int referenced = 0;
251 1.1 christos int UNUSED insn_referenced = abuf->written;
252 1.1 christos INT in_Rd = -1;
253 1.1 christos INT in_Rs = -1;
254 1.1 christos INT out_Rd = -1;
255 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
256 1.1 christos }
257 1.1 christos return cycles;
258 1.1 christos #undef FLD
259 1.1 christos }
260 1.1 christos
261 1.1 christos static int
262 1.1 christos model_crisv32_movecdr (SIM_CPU *current_cpu, void *sem_arg)
263 1.1 christos {
264 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cd.f
265 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
266 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
267 1.1 christos int cycles = 0;
268 1.1 christos {
269 1.1 christos int referenced = 0;
270 1.1 christos int UNUSED insn_referenced = abuf->written;
271 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
272 1.1 christos }
273 1.1 christos {
274 1.1 christos int referenced = 0;
275 1.1 christos int UNUSED insn_referenced = abuf->written;
276 1.1 christos INT in_Rd = -1;
277 1.1 christos INT in_Rs = -1;
278 1.1 christos INT out_Rd = -1;
279 1.1 christos out_Rd = FLD (out_Rd);
280 1.1 christos referenced |= 1 << 2;
281 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
282 1.1 christos }
283 1.1 christos return cycles;
284 1.1 christos #undef FLD
285 1.1 christos }
286 1.1 christos
287 1.1 christos static int
288 1.1 christos model_crisv32_movscbr (SIM_CPU *current_cpu, void *sem_arg)
289 1.1 christos {
290 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cb.f
291 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
292 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
293 1.1 christos int cycles = 0;
294 1.1 christos {
295 1.1 christos int referenced = 0;
296 1.1 christos int UNUSED insn_referenced = abuf->written;
297 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
298 1.1 christos }
299 1.1 christos {
300 1.1 christos int referenced = 0;
301 1.1 christos int UNUSED insn_referenced = abuf->written;
302 1.1 christos INT in_Rd = -1;
303 1.1 christos INT in_Rs = -1;
304 1.1 christos INT out_Rd = -1;
305 1.1 christos out_Rd = FLD (out_Rd);
306 1.1 christos referenced |= 1 << 2;
307 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
308 1.1 christos }
309 1.1 christos return cycles;
310 1.1 christos #undef FLD
311 1.1 christos }
312 1.1 christos
313 1.1 christos static int
314 1.1 christos model_crisv32_movscwr (SIM_CPU *current_cpu, void *sem_arg)
315 1.1 christos {
316 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cw.f
317 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
318 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
319 1.1 christos int cycles = 0;
320 1.1 christos {
321 1.1 christos int referenced = 0;
322 1.1 christos int UNUSED insn_referenced = abuf->written;
323 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
324 1.1 christos }
325 1.1 christos {
326 1.1 christos int referenced = 0;
327 1.1 christos int UNUSED insn_referenced = abuf->written;
328 1.1 christos INT in_Rd = -1;
329 1.1 christos INT in_Rs = -1;
330 1.1 christos INT out_Rd = -1;
331 1.1 christos out_Rd = FLD (out_Rd);
332 1.1 christos referenced |= 1 << 2;
333 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
334 1.1 christos }
335 1.1 christos return cycles;
336 1.1 christos #undef FLD
337 1.1 christos }
338 1.1 christos
339 1.1 christos static int
340 1.1 christos model_crisv32_movucbr (SIM_CPU *current_cpu, void *sem_arg)
341 1.1 christos {
342 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cb.f
343 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
344 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
345 1.1 christos int cycles = 0;
346 1.1 christos {
347 1.1 christos int referenced = 0;
348 1.1 christos int UNUSED insn_referenced = abuf->written;
349 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
350 1.1 christos }
351 1.1 christos {
352 1.1 christos int referenced = 0;
353 1.1 christos int UNUSED insn_referenced = abuf->written;
354 1.1 christos INT in_Rd = -1;
355 1.1 christos INT in_Rs = -1;
356 1.1 christos INT out_Rd = -1;
357 1.1 christos out_Rd = FLD (out_Rd);
358 1.1 christos referenced |= 1 << 2;
359 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
360 1.1 christos }
361 1.1 christos return cycles;
362 1.1 christos #undef FLD
363 1.1 christos }
364 1.1 christos
365 1.1 christos static int
366 1.1 christos model_crisv32_movucwr (SIM_CPU *current_cpu, void *sem_arg)
367 1.1 christos {
368 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cw.f
369 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
370 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
371 1.1 christos int cycles = 0;
372 1.1 christos {
373 1.1 christos int referenced = 0;
374 1.1 christos int UNUSED insn_referenced = abuf->written;
375 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
376 1.1 christos }
377 1.1 christos {
378 1.1 christos int referenced = 0;
379 1.1 christos int UNUSED insn_referenced = abuf->written;
380 1.1 christos INT in_Rd = -1;
381 1.1 christos INT in_Rs = -1;
382 1.1 christos INT out_Rd = -1;
383 1.1 christos out_Rd = FLD (out_Rd);
384 1.1 christos referenced |= 1 << 2;
385 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
386 1.1 christos }
387 1.1 christos return cycles;
388 1.1 christos #undef FLD
389 1.1 christos }
390 1.1 christos
391 1.1 christos static int
392 1.1 christos model_crisv32_addq (SIM_CPU *current_cpu, void *sem_arg)
393 1.1 christos {
394 1.1 christos #define FLD(f) abuf->fields.sfmt_addq.f
395 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
396 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
397 1.1 christos int cycles = 0;
398 1.1 christos {
399 1.1 christos int referenced = 0;
400 1.1 christos int UNUSED insn_referenced = abuf->written;
401 1.1 christos INT in_Rd = -1;
402 1.1 christos INT in_Rs = -1;
403 1.1 christos INT out_Rd = -1;
404 1.1 christos in_Rd = FLD (in_Rd);
405 1.1 christos referenced |= 1 << 0;
406 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
407 1.1 christos }
408 1.1 christos return cycles;
409 1.1 christos #undef FLD
410 1.1 christos }
411 1.1 christos
412 1.1 christos static int
413 1.1 christos model_crisv32_subq (SIM_CPU *current_cpu, void *sem_arg)
414 1.1 christos {
415 1.1 christos #define FLD(f) abuf->fields.sfmt_addq.f
416 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
417 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
418 1.1 christos int cycles = 0;
419 1.1 christos {
420 1.1 christos int referenced = 0;
421 1.1 christos int UNUSED insn_referenced = abuf->written;
422 1.1 christos INT in_Rd = -1;
423 1.1 christos INT in_Rs = -1;
424 1.1 christos INT out_Rd = -1;
425 1.1 christos in_Rd = FLD (in_Rd);
426 1.1 christos referenced |= 1 << 0;
427 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
428 1.1 christos }
429 1.1 christos return cycles;
430 1.1 christos #undef FLD
431 1.1 christos }
432 1.1 christos
433 1.1 christos static int
434 1.1 christos model_crisv32_cmp_r_b_r (SIM_CPU *current_cpu, void *sem_arg)
435 1.1 christos {
436 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
437 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
438 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
439 1.1 christos int cycles = 0;
440 1.1 christos {
441 1.1 christos int referenced = 0;
442 1.1 christos int UNUSED insn_referenced = abuf->written;
443 1.1 christos INT in_Rd = -1;
444 1.1 christos INT in_Rs = -1;
445 1.1 christos INT out_Rd = -1;
446 1.1 christos in_Rd = FLD (in_Rd);
447 1.1 christos in_Rs = FLD (in_Rs);
448 1.1 christos referenced |= 1 << 0;
449 1.1 christos referenced |= 1 << 1;
450 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
451 1.1 christos }
452 1.1 christos return cycles;
453 1.1 christos #undef FLD
454 1.1 christos }
455 1.1 christos
456 1.1 christos static int
457 1.1 christos model_crisv32_cmp_r_w_r (SIM_CPU *current_cpu, void *sem_arg)
458 1.1 christos {
459 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
460 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
461 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
462 1.1 christos int cycles = 0;
463 1.1 christos {
464 1.1 christos int referenced = 0;
465 1.1 christos int UNUSED insn_referenced = abuf->written;
466 1.1 christos INT in_Rd = -1;
467 1.1 christos INT in_Rs = -1;
468 1.1 christos INT out_Rd = -1;
469 1.1 christos in_Rd = FLD (in_Rd);
470 1.1 christos in_Rs = FLD (in_Rs);
471 1.1 christos referenced |= 1 << 0;
472 1.1 christos referenced |= 1 << 1;
473 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
474 1.1 christos }
475 1.1 christos return cycles;
476 1.1 christos #undef FLD
477 1.1 christos }
478 1.1 christos
479 1.1 christos static int
480 1.1 christos model_crisv32_cmp_r_d_r (SIM_CPU *current_cpu, void *sem_arg)
481 1.1 christos {
482 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
483 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
484 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
485 1.1 christos int cycles = 0;
486 1.1 christos {
487 1.1 christos int referenced = 0;
488 1.1 christos int UNUSED insn_referenced = abuf->written;
489 1.1 christos INT in_Rd = -1;
490 1.1 christos INT in_Rs = -1;
491 1.1 christos INT out_Rd = -1;
492 1.1 christos in_Rd = FLD (in_Rd);
493 1.1 christos in_Rs = FLD (in_Rs);
494 1.1 christos referenced |= 1 << 0;
495 1.1 christos referenced |= 1 << 1;
496 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
497 1.1 christos }
498 1.1 christos return cycles;
499 1.1 christos #undef FLD
500 1.1 christos }
501 1.1 christos
502 1.1 christos static int
503 1.1 christos model_crisv32_cmp_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
504 1.1 christos {
505 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
506 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
507 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
508 1.1 christos int cycles = 0;
509 1.1 christos {
510 1.1 christos int referenced = 0;
511 1.1 christos int UNUSED insn_referenced = abuf->written;
512 1.1 christos INT in_Rs = -1;
513 1.1 christos in_Rs = FLD (in_Rs);
514 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
515 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
516 1.1 christos }
517 1.1 christos {
518 1.1 christos int referenced = 0;
519 1.1 christos int UNUSED insn_referenced = abuf->written;
520 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
521 1.1 christos }
522 1.1 christos {
523 1.1 christos int referenced = 0;
524 1.1 christos int UNUSED insn_referenced = abuf->written;
525 1.1 christos INT in_Rd = -1;
526 1.1 christos INT in_Rs = -1;
527 1.1 christos INT out_Rd = -1;
528 1.1 christos in_Rd = FLD (in_Rd);
529 1.1 christos in_Rs = FLD (in_Rs);
530 1.1 christos referenced |= 1 << 0;
531 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
532 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
533 1.1 christos }
534 1.1 christos return cycles;
535 1.1 christos #undef FLD
536 1.1 christos }
537 1.1 christos
538 1.1 christos static int
539 1.1 christos model_crisv32_cmp_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
540 1.1 christos {
541 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
542 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
543 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
544 1.1 christos int cycles = 0;
545 1.1 christos {
546 1.1 christos int referenced = 0;
547 1.1 christos int UNUSED insn_referenced = abuf->written;
548 1.1 christos INT in_Rs = -1;
549 1.1 christos in_Rs = FLD (in_Rs);
550 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
551 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
552 1.1 christos }
553 1.1 christos {
554 1.1 christos int referenced = 0;
555 1.1 christos int UNUSED insn_referenced = abuf->written;
556 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
557 1.1 christos }
558 1.1 christos {
559 1.1 christos int referenced = 0;
560 1.1 christos int UNUSED insn_referenced = abuf->written;
561 1.1 christos INT in_Rd = -1;
562 1.1 christos INT in_Rs = -1;
563 1.1 christos INT out_Rd = -1;
564 1.1 christos in_Rd = FLD (in_Rd);
565 1.1 christos in_Rs = FLD (in_Rs);
566 1.1 christos referenced |= 1 << 0;
567 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
568 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
569 1.1 christos }
570 1.1 christos return cycles;
571 1.1 christos #undef FLD
572 1.1 christos }
573 1.1 christos
574 1.1 christos static int
575 1.1 christos model_crisv32_cmp_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
576 1.1 christos {
577 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
578 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
579 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
580 1.1 christos int cycles = 0;
581 1.1 christos {
582 1.1 christos int referenced = 0;
583 1.1 christos int UNUSED insn_referenced = abuf->written;
584 1.1 christos INT in_Rs = -1;
585 1.1 christos in_Rs = FLD (in_Rs);
586 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
587 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
588 1.1 christos }
589 1.1 christos {
590 1.1 christos int referenced = 0;
591 1.1 christos int UNUSED insn_referenced = abuf->written;
592 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
593 1.1 christos }
594 1.1 christos {
595 1.1 christos int referenced = 0;
596 1.1 christos int UNUSED insn_referenced = abuf->written;
597 1.1 christos INT in_Rd = -1;
598 1.1 christos INT in_Rs = -1;
599 1.1 christos INT out_Rd = -1;
600 1.1 christos in_Rd = FLD (in_Rd);
601 1.1 christos in_Rs = FLD (in_Rs);
602 1.1 christos referenced |= 1 << 0;
603 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
604 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
605 1.1 christos }
606 1.1 christos return cycles;
607 1.1 christos #undef FLD
608 1.1 christos }
609 1.1 christos
610 1.1 christos static int
611 1.1 christos model_crisv32_cmpcbr (SIM_CPU *current_cpu, void *sem_arg)
612 1.1 christos {
613 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cb.f
614 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
615 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
616 1.1 christos int cycles = 0;
617 1.1 christos {
618 1.1 christos int referenced = 0;
619 1.1 christos int UNUSED insn_referenced = abuf->written;
620 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
621 1.1 christos }
622 1.1 christos {
623 1.1 christos int referenced = 0;
624 1.1 christos int UNUSED insn_referenced = abuf->written;
625 1.1 christos INT in_Rd = -1;
626 1.1 christos INT in_Rs = -1;
627 1.1 christos INT out_Rd = -1;
628 1.1 christos in_Rd = FLD (in_Rd);
629 1.1 christos referenced |= 1 << 0;
630 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
631 1.1 christos }
632 1.1 christos return cycles;
633 1.1 christos #undef FLD
634 1.1 christos }
635 1.1 christos
636 1.1 christos static int
637 1.1 christos model_crisv32_cmpcwr (SIM_CPU *current_cpu, void *sem_arg)
638 1.1 christos {
639 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cw.f
640 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
641 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
642 1.1 christos int cycles = 0;
643 1.1 christos {
644 1.1 christos int referenced = 0;
645 1.1 christos int UNUSED insn_referenced = abuf->written;
646 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
647 1.1 christos }
648 1.1 christos {
649 1.1 christos int referenced = 0;
650 1.1 christos int UNUSED insn_referenced = abuf->written;
651 1.1 christos INT in_Rd = -1;
652 1.1 christos INT in_Rs = -1;
653 1.1 christos INT out_Rd = -1;
654 1.1 christos in_Rd = FLD (in_Rd);
655 1.1 christos referenced |= 1 << 0;
656 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
657 1.1 christos }
658 1.1 christos return cycles;
659 1.1 christos #undef FLD
660 1.1 christos }
661 1.1 christos
662 1.1 christos static int
663 1.1 christos model_crisv32_cmpcdr (SIM_CPU *current_cpu, void *sem_arg)
664 1.1 christos {
665 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cd.f
666 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
667 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
668 1.1 christos int cycles = 0;
669 1.1 christos {
670 1.1 christos int referenced = 0;
671 1.1 christos int UNUSED insn_referenced = abuf->written;
672 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
673 1.1 christos }
674 1.1 christos {
675 1.1 christos int referenced = 0;
676 1.1 christos int UNUSED insn_referenced = abuf->written;
677 1.1 christos INT in_Rd = -1;
678 1.1 christos INT in_Rs = -1;
679 1.1 christos INT out_Rd = -1;
680 1.1 christos in_Rd = FLD (in_Rd);
681 1.1 christos referenced |= 1 << 0;
682 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
683 1.1 christos }
684 1.1 christos return cycles;
685 1.1 christos #undef FLD
686 1.1 christos }
687 1.1 christos
688 1.1 christos static int
689 1.1 christos model_crisv32_cmpq (SIM_CPU *current_cpu, void *sem_arg)
690 1.1 christos {
691 1.1 christos #define FLD(f) abuf->fields.sfmt_andq.f
692 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
693 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
694 1.1 christos int cycles = 0;
695 1.1 christos {
696 1.1 christos int referenced = 0;
697 1.1 christos int UNUSED insn_referenced = abuf->written;
698 1.1 christos INT in_Rd = -1;
699 1.1 christos INT in_Rs = -1;
700 1.1 christos INT out_Rd = -1;
701 1.1 christos in_Rd = FLD (in_Rd);
702 1.1 christos referenced |= 1 << 0;
703 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
704 1.1 christos }
705 1.1 christos return cycles;
706 1.1 christos #undef FLD
707 1.1 christos }
708 1.1 christos
709 1.1 christos static int
710 1.1 christos model_crisv32_cmps_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
711 1.1 christos {
712 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
713 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
714 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
715 1.1 christos int cycles = 0;
716 1.1 christos {
717 1.1 christos int referenced = 0;
718 1.1 christos int UNUSED insn_referenced = abuf->written;
719 1.1 christos INT in_Rs = -1;
720 1.1 christos in_Rs = FLD (in_Rs);
721 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
722 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
723 1.1 christos }
724 1.1 christos {
725 1.1 christos int referenced = 0;
726 1.1 christos int UNUSED insn_referenced = abuf->written;
727 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
728 1.1 christos }
729 1.1 christos {
730 1.1 christos int referenced = 0;
731 1.1 christos int UNUSED insn_referenced = abuf->written;
732 1.1 christos INT in_Rd = -1;
733 1.1 christos INT in_Rs = -1;
734 1.1 christos INT out_Rd = -1;
735 1.1 christos in_Rd = FLD (in_Rd);
736 1.1 christos in_Rs = FLD (in_Rs);
737 1.1 christos referenced |= 1 << 0;
738 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
739 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
740 1.1 christos }
741 1.1 christos return cycles;
742 1.1 christos #undef FLD
743 1.1 christos }
744 1.1 christos
745 1.1 christos static int
746 1.1 christos model_crisv32_cmps_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
747 1.1 christos {
748 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
749 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
750 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
751 1.1 christos int cycles = 0;
752 1.1 christos {
753 1.1 christos int referenced = 0;
754 1.1 christos int UNUSED insn_referenced = abuf->written;
755 1.1 christos INT in_Rs = -1;
756 1.1 christos in_Rs = FLD (in_Rs);
757 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
758 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
759 1.1 christos }
760 1.1 christos {
761 1.1 christos int referenced = 0;
762 1.1 christos int UNUSED insn_referenced = abuf->written;
763 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
764 1.1 christos }
765 1.1 christos {
766 1.1 christos int referenced = 0;
767 1.1 christos int UNUSED insn_referenced = abuf->written;
768 1.1 christos INT in_Rd = -1;
769 1.1 christos INT in_Rs = -1;
770 1.1 christos INT out_Rd = -1;
771 1.1 christos in_Rd = FLD (in_Rd);
772 1.1 christos in_Rs = FLD (in_Rs);
773 1.1 christos referenced |= 1 << 0;
774 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
775 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
776 1.1 christos }
777 1.1 christos return cycles;
778 1.1 christos #undef FLD
779 1.1 christos }
780 1.1 christos
781 1.1 christos static int
782 1.1 christos model_crisv32_cmpscbr (SIM_CPU *current_cpu, void *sem_arg)
783 1.1 christos {
784 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cb.f
785 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
786 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
787 1.1 christos int cycles = 0;
788 1.1 christos {
789 1.1 christos int referenced = 0;
790 1.1 christos int UNUSED insn_referenced = abuf->written;
791 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
792 1.1 christos }
793 1.1 christos {
794 1.1 christos int referenced = 0;
795 1.1 christos int UNUSED insn_referenced = abuf->written;
796 1.1 christos INT in_Rd = -1;
797 1.1 christos INT in_Rs = -1;
798 1.1 christos INT out_Rd = -1;
799 1.1 christos in_Rd = FLD (in_Rd);
800 1.1 christos referenced |= 1 << 0;
801 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
802 1.1 christos }
803 1.1 christos return cycles;
804 1.1 christos #undef FLD
805 1.1 christos }
806 1.1 christos
807 1.1 christos static int
808 1.1 christos model_crisv32_cmpscwr (SIM_CPU *current_cpu, void *sem_arg)
809 1.1 christos {
810 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cw.f
811 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
812 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
813 1.1 christos int cycles = 0;
814 1.1 christos {
815 1.1 christos int referenced = 0;
816 1.1 christos int UNUSED insn_referenced = abuf->written;
817 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
818 1.1 christos }
819 1.1 christos {
820 1.1 christos int referenced = 0;
821 1.1 christos int UNUSED insn_referenced = abuf->written;
822 1.1 christos INT in_Rd = -1;
823 1.1 christos INT in_Rs = -1;
824 1.1 christos INT out_Rd = -1;
825 1.1 christos in_Rd = FLD (in_Rd);
826 1.1 christos referenced |= 1 << 0;
827 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
828 1.1 christos }
829 1.1 christos return cycles;
830 1.1 christos #undef FLD
831 1.1 christos }
832 1.1 christos
833 1.1 christos static int
834 1.1 christos model_crisv32_cmpu_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
835 1.1 christos {
836 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
837 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
838 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
839 1.1 christos int cycles = 0;
840 1.1 christos {
841 1.1 christos int referenced = 0;
842 1.1 christos int UNUSED insn_referenced = abuf->written;
843 1.1 christos INT in_Rs = -1;
844 1.1 christos in_Rs = FLD (in_Rs);
845 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
846 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
847 1.1 christos }
848 1.1 christos {
849 1.1 christos int referenced = 0;
850 1.1 christos int UNUSED insn_referenced = abuf->written;
851 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
852 1.1 christos }
853 1.1 christos {
854 1.1 christos int referenced = 0;
855 1.1 christos int UNUSED insn_referenced = abuf->written;
856 1.1 christos INT in_Rd = -1;
857 1.1 christos INT in_Rs = -1;
858 1.1 christos INT out_Rd = -1;
859 1.1 christos in_Rd = FLD (in_Rd);
860 1.1 christos in_Rs = FLD (in_Rs);
861 1.1 christos referenced |= 1 << 0;
862 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
863 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
864 1.1 christos }
865 1.1 christos return cycles;
866 1.1 christos #undef FLD
867 1.1 christos }
868 1.1 christos
869 1.1 christos static int
870 1.1 christos model_crisv32_cmpu_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
871 1.1 christos {
872 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
873 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
874 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
875 1.1 christos int cycles = 0;
876 1.1 christos {
877 1.1 christos int referenced = 0;
878 1.1 christos int UNUSED insn_referenced = abuf->written;
879 1.1 christos INT in_Rs = -1;
880 1.1 christos in_Rs = FLD (in_Rs);
881 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
882 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
883 1.1 christos }
884 1.1 christos {
885 1.1 christos int referenced = 0;
886 1.1 christos int UNUSED insn_referenced = abuf->written;
887 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
888 1.1 christos }
889 1.1 christos {
890 1.1 christos int referenced = 0;
891 1.1 christos int UNUSED insn_referenced = abuf->written;
892 1.1 christos INT in_Rd = -1;
893 1.1 christos INT in_Rs = -1;
894 1.1 christos INT out_Rd = -1;
895 1.1 christos in_Rd = FLD (in_Rd);
896 1.1 christos in_Rs = FLD (in_Rs);
897 1.1 christos referenced |= 1 << 0;
898 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
899 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
900 1.1 christos }
901 1.1 christos return cycles;
902 1.1 christos #undef FLD
903 1.1 christos }
904 1.1 christos
905 1.1 christos static int
906 1.1 christos model_crisv32_cmpucbr (SIM_CPU *current_cpu, void *sem_arg)
907 1.1 christos {
908 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cb.f
909 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
910 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
911 1.1 christos int cycles = 0;
912 1.1 christos {
913 1.1 christos int referenced = 0;
914 1.1 christos int UNUSED insn_referenced = abuf->written;
915 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
916 1.1 christos }
917 1.1 christos {
918 1.1 christos int referenced = 0;
919 1.1 christos int UNUSED insn_referenced = abuf->written;
920 1.1 christos INT in_Rd = -1;
921 1.1 christos INT in_Rs = -1;
922 1.1 christos INT out_Rd = -1;
923 1.1 christos in_Rd = FLD (in_Rd);
924 1.1 christos referenced |= 1 << 0;
925 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
926 1.1 christos }
927 1.1 christos return cycles;
928 1.1 christos #undef FLD
929 1.1 christos }
930 1.1 christos
931 1.1 christos static int
932 1.1 christos model_crisv32_cmpucwr (SIM_CPU *current_cpu, void *sem_arg)
933 1.1 christos {
934 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cw.f
935 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
936 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
937 1.1 christos int cycles = 0;
938 1.1 christos {
939 1.1 christos int referenced = 0;
940 1.1 christos int UNUSED insn_referenced = abuf->written;
941 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
942 1.1 christos }
943 1.1 christos {
944 1.1 christos int referenced = 0;
945 1.1 christos int UNUSED insn_referenced = abuf->written;
946 1.1 christos INT in_Rd = -1;
947 1.1 christos INT in_Rs = -1;
948 1.1 christos INT out_Rd = -1;
949 1.1 christos in_Rd = FLD (in_Rd);
950 1.1 christos referenced |= 1 << 0;
951 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
952 1.1 christos }
953 1.1 christos return cycles;
954 1.1 christos #undef FLD
955 1.1 christos }
956 1.1 christos
957 1.1 christos static int
958 1.1 christos model_crisv32_move_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
959 1.1 christos {
960 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
961 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
962 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
963 1.1 christos int cycles = 0;
964 1.1 christos {
965 1.1 christos int referenced = 0;
966 1.1 christos int UNUSED insn_referenced = abuf->written;
967 1.1 christos INT in_Rs = -1;
968 1.1 christos in_Rs = FLD (in_Rs);
969 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
970 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
971 1.1 christos }
972 1.1 christos {
973 1.1 christos int referenced = 0;
974 1.1 christos int UNUSED insn_referenced = abuf->written;
975 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
976 1.1 christos }
977 1.1 christos {
978 1.1 christos int referenced = 0;
979 1.1 christos int UNUSED insn_referenced = abuf->written;
980 1.1 christos INT in_Rd = -1;
981 1.1 christos INT in_Rs = -1;
982 1.1 christos INT out_Rd = -1;
983 1.1 christos in_Rs = FLD (in_Rs);
984 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
985 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
986 1.1 christos }
987 1.1 christos return cycles;
988 1.1 christos #undef FLD
989 1.1 christos }
990 1.1 christos
991 1.1 christos static int
992 1.1 christos model_crisv32_move_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
993 1.1 christos {
994 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
995 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
996 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
997 1.1 christos int cycles = 0;
998 1.1 christos {
999 1.1 christos int referenced = 0;
1000 1.1 christos int UNUSED insn_referenced = abuf->written;
1001 1.1 christos INT in_Rs = -1;
1002 1.1 christos in_Rs = FLD (in_Rs);
1003 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1004 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1005 1.1 christos }
1006 1.1 christos {
1007 1.1 christos int referenced = 0;
1008 1.1 christos int UNUSED insn_referenced = abuf->written;
1009 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1010 1.1 christos }
1011 1.1 christos {
1012 1.1 christos int referenced = 0;
1013 1.1 christos int UNUSED insn_referenced = abuf->written;
1014 1.1 christos INT in_Rd = -1;
1015 1.1 christos INT in_Rs = -1;
1016 1.1 christos INT out_Rd = -1;
1017 1.1 christos in_Rs = FLD (in_Rs);
1018 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1019 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1020 1.1 christos }
1021 1.1 christos return cycles;
1022 1.1 christos #undef FLD
1023 1.1 christos }
1024 1.1 christos
1025 1.1 christos static int
1026 1.1 christos model_crisv32_move_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
1027 1.1 christos {
1028 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
1029 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1030 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1031 1.1 christos int cycles = 0;
1032 1.1 christos {
1033 1.1 christos int referenced = 0;
1034 1.1 christos int UNUSED insn_referenced = abuf->written;
1035 1.1 christos INT in_Rs = -1;
1036 1.1 christos in_Rs = FLD (in_Rs);
1037 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1038 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1039 1.1 christos }
1040 1.1 christos {
1041 1.1 christos int referenced = 0;
1042 1.1 christos int UNUSED insn_referenced = abuf->written;
1043 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1044 1.1 christos }
1045 1.1 christos {
1046 1.1 christos int referenced = 0;
1047 1.1 christos int UNUSED insn_referenced = abuf->written;
1048 1.1 christos INT in_Rd = -1;
1049 1.1 christos INT in_Rs = -1;
1050 1.1 christos INT out_Rd = -1;
1051 1.1 christos in_Rs = FLD (in_Rs);
1052 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1053 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1054 1.1 christos }
1055 1.1 christos return cycles;
1056 1.1 christos #undef FLD
1057 1.1 christos }
1058 1.1 christos
1059 1.1 christos static int
1060 1.1 christos model_crisv32_movs_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
1061 1.1 christos {
1062 1.1 christos #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
1063 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1064 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1065 1.1 christos int cycles = 0;
1066 1.1 christos {
1067 1.1 christos int referenced = 0;
1068 1.1 christos int UNUSED insn_referenced = abuf->written;
1069 1.1 christos INT in_Rs = -1;
1070 1.1 christos in_Rs = FLD (in_Rs);
1071 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1072 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1073 1.1 christos }
1074 1.1 christos {
1075 1.1 christos int referenced = 0;
1076 1.1 christos int UNUSED insn_referenced = abuf->written;
1077 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1078 1.1 christos }
1079 1.1 christos {
1080 1.1 christos int referenced = 0;
1081 1.1 christos int UNUSED insn_referenced = abuf->written;
1082 1.1 christos INT in_Rd = -1;
1083 1.1 christos INT in_Rs = -1;
1084 1.1 christos INT out_Rd = -1;
1085 1.1 christos in_Rs = FLD (in_Rs);
1086 1.1 christos out_Rd = FLD (out_Rd);
1087 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1088 1.1 christos if (insn_referenced & (1 << 7)) referenced |= 1 << 2;
1089 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1090 1.1 christos }
1091 1.1 christos return cycles;
1092 1.1 christos #undef FLD
1093 1.1 christos }
1094 1.1 christos
1095 1.1 christos static int
1096 1.1 christos model_crisv32_movs_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
1097 1.1 christos {
1098 1.1 christos #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
1099 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1100 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1101 1.1 christos int cycles = 0;
1102 1.1 christos {
1103 1.1 christos int referenced = 0;
1104 1.1 christos int UNUSED insn_referenced = abuf->written;
1105 1.1 christos INT in_Rs = -1;
1106 1.1 christos in_Rs = FLD (in_Rs);
1107 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1108 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1109 1.1 christos }
1110 1.1 christos {
1111 1.1 christos int referenced = 0;
1112 1.1 christos int UNUSED insn_referenced = abuf->written;
1113 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1114 1.1 christos }
1115 1.1 christos {
1116 1.1 christos int referenced = 0;
1117 1.1 christos int UNUSED insn_referenced = abuf->written;
1118 1.1 christos INT in_Rd = -1;
1119 1.1 christos INT in_Rs = -1;
1120 1.1 christos INT out_Rd = -1;
1121 1.1 christos in_Rs = FLD (in_Rs);
1122 1.1 christos out_Rd = FLD (out_Rd);
1123 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1124 1.1 christos if (insn_referenced & (1 << 7)) referenced |= 1 << 2;
1125 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1126 1.1 christos }
1127 1.1 christos return cycles;
1128 1.1 christos #undef FLD
1129 1.1 christos }
1130 1.1 christos
1131 1.1 christos static int
1132 1.1 christos model_crisv32_movu_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
1133 1.1 christos {
1134 1.1 christos #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
1135 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1136 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1137 1.1 christos int cycles = 0;
1138 1.1 christos {
1139 1.1 christos int referenced = 0;
1140 1.1 christos int UNUSED insn_referenced = abuf->written;
1141 1.1 christos INT in_Rs = -1;
1142 1.1 christos in_Rs = FLD (in_Rs);
1143 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1144 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1145 1.1 christos }
1146 1.1 christos {
1147 1.1 christos int referenced = 0;
1148 1.1 christos int UNUSED insn_referenced = abuf->written;
1149 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1150 1.1 christos }
1151 1.1 christos {
1152 1.1 christos int referenced = 0;
1153 1.1 christos int UNUSED insn_referenced = abuf->written;
1154 1.1 christos INT in_Rd = -1;
1155 1.1 christos INT in_Rs = -1;
1156 1.1 christos INT out_Rd = -1;
1157 1.1 christos in_Rs = FLD (in_Rs);
1158 1.1 christos out_Rd = FLD (out_Rd);
1159 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1160 1.1 christos if (insn_referenced & (1 << 7)) referenced |= 1 << 2;
1161 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1162 1.1 christos }
1163 1.1 christos return cycles;
1164 1.1 christos #undef FLD
1165 1.1 christos }
1166 1.1 christos
1167 1.1 christos static int
1168 1.1 christos model_crisv32_movu_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
1169 1.1 christos {
1170 1.1 christos #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
1171 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1172 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1173 1.1 christos int cycles = 0;
1174 1.1 christos {
1175 1.1 christos int referenced = 0;
1176 1.1 christos int UNUSED insn_referenced = abuf->written;
1177 1.1 christos INT in_Rs = -1;
1178 1.1 christos in_Rs = FLD (in_Rs);
1179 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1180 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1181 1.1 christos }
1182 1.1 christos {
1183 1.1 christos int referenced = 0;
1184 1.1 christos int UNUSED insn_referenced = abuf->written;
1185 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1186 1.1 christos }
1187 1.1 christos {
1188 1.1 christos int referenced = 0;
1189 1.1 christos int UNUSED insn_referenced = abuf->written;
1190 1.1 christos INT in_Rd = -1;
1191 1.1 christos INT in_Rs = -1;
1192 1.1 christos INT out_Rd = -1;
1193 1.1 christos in_Rs = FLD (in_Rs);
1194 1.1 christos out_Rd = FLD (out_Rd);
1195 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1196 1.1 christos if (insn_referenced & (1 << 7)) referenced |= 1 << 2;
1197 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1198 1.1 christos }
1199 1.1 christos return cycles;
1200 1.1 christos #undef FLD
1201 1.1 christos }
1202 1.1 christos
1203 1.1 christos static int
1204 1.1 christos model_crisv32_move_r_sprv32 (SIM_CPU *current_cpu, void *sem_arg)
1205 1.1 christos {
1206 1.1 christos #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
1207 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1208 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1209 1.1 christos int cycles = 0;
1210 1.1 christos {
1211 1.1 christos int referenced = 0;
1212 1.1 christos int UNUSED insn_referenced = abuf->written;
1213 1.1 christos INT in_Rs = -1;
1214 1.1 christos INT out_Pd = -1;
1215 1.1 christos in_Rs = FLD (in_Rs);
1216 1.1 christos out_Pd = FLD (out_Pd);
1217 1.1 christos referenced |= 1 << 0;
1218 1.1 christos if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
1219 1.1 christos cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 0, referenced, in_Rs, out_Pd);
1220 1.1 christos }
1221 1.1 christos return cycles;
1222 1.1 christos #undef FLD
1223 1.1 christos }
1224 1.1 christos
1225 1.1 christos static int
1226 1.1 christos model_crisv32_move_spr_rv32 (SIM_CPU *current_cpu, void *sem_arg)
1227 1.1 christos {
1228 1.1 christos #define FLD(f) abuf->fields.sfmt_mcp.f
1229 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1230 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1231 1.1 christos int cycles = 0;
1232 1.1 christos {
1233 1.1 christos int referenced = 0;
1234 1.1 christos int UNUSED insn_referenced = abuf->written;
1235 1.1 christos INT in_Rd = -1;
1236 1.1 christos INT in_Rs = -1;
1237 1.1 christos INT out_Rd = -1;
1238 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1239 1.1 christos }
1240 1.1 christos return cycles;
1241 1.1 christos #undef FLD
1242 1.1 christos }
1243 1.1 christos
1244 1.1 christos static int
1245 1.1 christos model_crisv32_move_m_sprv32 (SIM_CPU *current_cpu, void *sem_arg)
1246 1.1 christos {
1247 1.1 christos #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
1248 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1249 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1250 1.1 christos int cycles = 0;
1251 1.1 christos {
1252 1.1 christos int referenced = 0;
1253 1.1 christos int UNUSED insn_referenced = abuf->written;
1254 1.1 christos INT in_Rs = -1;
1255 1.1 christos in_Rs = FLD (in_Rs);
1256 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1257 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1258 1.1 christos }
1259 1.1 christos {
1260 1.1 christos int referenced = 0;
1261 1.1 christos int UNUSED insn_referenced = abuf->written;
1262 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1263 1.1 christos }
1264 1.1 christos {
1265 1.1 christos int referenced = 0;
1266 1.1 christos int UNUSED insn_referenced = abuf->written;
1267 1.1 christos INT in_Rs = -1;
1268 1.1 christos INT out_Pd = -1;
1269 1.1 christos in_Rs = FLD (in_Rs);
1270 1.1 christos out_Pd = FLD (out_Pd);
1271 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1272 1.1 christos referenced |= 1 << 1;
1273 1.1 christos cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 2, referenced, in_Rs, out_Pd);
1274 1.1 christos }
1275 1.1 christos return cycles;
1276 1.1 christos #undef FLD
1277 1.1 christos }
1278 1.1 christos
1279 1.1 christos static int
1280 1.1 christos model_crisv32_move_c_sprv32_p2 (SIM_CPU *current_cpu, void *sem_arg)
1281 1.1 christos {
1282 1.1 christos #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1283 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1284 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1285 1.1 christos int cycles = 0;
1286 1.1 christos {
1287 1.1 christos int referenced = 0;
1288 1.1 christos int UNUSED insn_referenced = abuf->written;
1289 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1290 1.1 christos }
1291 1.1 christos {
1292 1.1 christos int referenced = 0;
1293 1.1 christos int UNUSED insn_referenced = abuf->written;
1294 1.1 christos INT in_Rs = -1;
1295 1.1 christos INT out_Pd = -1;
1296 1.1 christos out_Pd = FLD (out_Pd);
1297 1.1 christos referenced |= 1 << 1;
1298 1.1 christos cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1299 1.1 christos }
1300 1.1 christos return cycles;
1301 1.1 christos #undef FLD
1302 1.1 christos }
1303 1.1 christos
1304 1.1 christos static int
1305 1.1 christos model_crisv32_move_c_sprv32_p3 (SIM_CPU *current_cpu, void *sem_arg)
1306 1.1 christos {
1307 1.1 christos #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1308 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1309 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1310 1.1 christos int cycles = 0;
1311 1.1 christos {
1312 1.1 christos int referenced = 0;
1313 1.1 christos int UNUSED insn_referenced = abuf->written;
1314 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1315 1.1 christos }
1316 1.1 christos {
1317 1.1 christos int referenced = 0;
1318 1.1 christos int UNUSED insn_referenced = abuf->written;
1319 1.1 christos INT in_Rs = -1;
1320 1.1 christos INT out_Pd = -1;
1321 1.1 christos out_Pd = FLD (out_Pd);
1322 1.1 christos referenced |= 1 << 1;
1323 1.1 christos cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1324 1.1 christos }
1325 1.1 christos return cycles;
1326 1.1 christos #undef FLD
1327 1.1 christos }
1328 1.1 christos
1329 1.1 christos static int
1330 1.1 christos model_crisv32_move_c_sprv32_p5 (SIM_CPU *current_cpu, void *sem_arg)
1331 1.1 christos {
1332 1.1 christos #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1333 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1334 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1335 1.1 christos int cycles = 0;
1336 1.1 christos {
1337 1.1 christos int referenced = 0;
1338 1.1 christos int UNUSED insn_referenced = abuf->written;
1339 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1340 1.1 christos }
1341 1.1 christos {
1342 1.1 christos int referenced = 0;
1343 1.1 christos int UNUSED insn_referenced = abuf->written;
1344 1.1 christos INT in_Rs = -1;
1345 1.1 christos INT out_Pd = -1;
1346 1.1 christos out_Pd = FLD (out_Pd);
1347 1.1 christos referenced |= 1 << 1;
1348 1.1 christos cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1349 1.1 christos }
1350 1.1 christos return cycles;
1351 1.1 christos #undef FLD
1352 1.1 christos }
1353 1.1 christos
1354 1.1 christos static int
1355 1.1 christos model_crisv32_move_c_sprv32_p6 (SIM_CPU *current_cpu, void *sem_arg)
1356 1.1 christos {
1357 1.1 christos #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1358 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1359 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1360 1.1 christos int cycles = 0;
1361 1.1 christos {
1362 1.1 christos int referenced = 0;
1363 1.1 christos int UNUSED insn_referenced = abuf->written;
1364 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1365 1.1 christos }
1366 1.1 christos {
1367 1.1 christos int referenced = 0;
1368 1.1 christos int UNUSED insn_referenced = abuf->written;
1369 1.1 christos INT in_Rs = -1;
1370 1.1 christos INT out_Pd = -1;
1371 1.1 christos out_Pd = FLD (out_Pd);
1372 1.1 christos referenced |= 1 << 1;
1373 1.1 christos cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1374 1.1 christos }
1375 1.1 christos return cycles;
1376 1.1 christos #undef FLD
1377 1.1 christos }
1378 1.1 christos
1379 1.1 christos static int
1380 1.1 christos model_crisv32_move_c_sprv32_p7 (SIM_CPU *current_cpu, void *sem_arg)
1381 1.1 christos {
1382 1.1 christos #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1383 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1384 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1385 1.1 christos int cycles = 0;
1386 1.1 christos {
1387 1.1 christos int referenced = 0;
1388 1.1 christos int UNUSED insn_referenced = abuf->written;
1389 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1390 1.1 christos }
1391 1.1 christos {
1392 1.1 christos int referenced = 0;
1393 1.1 christos int UNUSED insn_referenced = abuf->written;
1394 1.1 christos INT in_Rs = -1;
1395 1.1 christos INT out_Pd = -1;
1396 1.1 christos out_Pd = FLD (out_Pd);
1397 1.1 christos referenced |= 1 << 1;
1398 1.1 christos cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1399 1.1 christos }
1400 1.1 christos return cycles;
1401 1.1 christos #undef FLD
1402 1.1 christos }
1403 1.1 christos
1404 1.1 christos static int
1405 1.1 christos model_crisv32_move_c_sprv32_p9 (SIM_CPU *current_cpu, void *sem_arg)
1406 1.1 christos {
1407 1.1 christos #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1408 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1409 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1410 1.1 christos int cycles = 0;
1411 1.1 christos {
1412 1.1 christos int referenced = 0;
1413 1.1 christos int UNUSED insn_referenced = abuf->written;
1414 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1415 1.1 christos }
1416 1.1 christos {
1417 1.1 christos int referenced = 0;
1418 1.1 christos int UNUSED insn_referenced = abuf->written;
1419 1.1 christos INT in_Rs = -1;
1420 1.1 christos INT out_Pd = -1;
1421 1.1 christos out_Pd = FLD (out_Pd);
1422 1.1 christos referenced |= 1 << 1;
1423 1.1 christos cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1424 1.1 christos }
1425 1.1 christos return cycles;
1426 1.1 christos #undef FLD
1427 1.1 christos }
1428 1.1 christos
1429 1.1 christos static int
1430 1.1 christos model_crisv32_move_c_sprv32_p10 (SIM_CPU *current_cpu, void *sem_arg)
1431 1.1 christos {
1432 1.1 christos #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1433 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1434 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1435 1.1 christos int cycles = 0;
1436 1.1 christos {
1437 1.1 christos int referenced = 0;
1438 1.1 christos int UNUSED insn_referenced = abuf->written;
1439 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1440 1.1 christos }
1441 1.1 christos {
1442 1.1 christos int referenced = 0;
1443 1.1 christos int UNUSED insn_referenced = abuf->written;
1444 1.1 christos INT in_Rs = -1;
1445 1.1 christos INT out_Pd = -1;
1446 1.1 christos out_Pd = FLD (out_Pd);
1447 1.1 christos referenced |= 1 << 1;
1448 1.1 christos cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1449 1.1 christos }
1450 1.1 christos return cycles;
1451 1.1 christos #undef FLD
1452 1.1 christos }
1453 1.1 christos
1454 1.1 christos static int
1455 1.1 christos model_crisv32_move_c_sprv32_p11 (SIM_CPU *current_cpu, void *sem_arg)
1456 1.1 christos {
1457 1.1 christos #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1458 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1459 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1460 1.1 christos int cycles = 0;
1461 1.1 christos {
1462 1.1 christos int referenced = 0;
1463 1.1 christos int UNUSED insn_referenced = abuf->written;
1464 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1465 1.1 christos }
1466 1.1 christos {
1467 1.1 christos int referenced = 0;
1468 1.1 christos int UNUSED insn_referenced = abuf->written;
1469 1.1 christos INT in_Rs = -1;
1470 1.1 christos INT out_Pd = -1;
1471 1.1 christos out_Pd = FLD (out_Pd);
1472 1.1 christos referenced |= 1 << 1;
1473 1.1 christos cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1474 1.1 christos }
1475 1.1 christos return cycles;
1476 1.1 christos #undef FLD
1477 1.1 christos }
1478 1.1 christos
1479 1.1 christos static int
1480 1.1 christos model_crisv32_move_c_sprv32_p12 (SIM_CPU *current_cpu, void *sem_arg)
1481 1.1 christos {
1482 1.1 christos #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1483 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1484 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1485 1.1 christos int cycles = 0;
1486 1.1 christos {
1487 1.1 christos int referenced = 0;
1488 1.1 christos int UNUSED insn_referenced = abuf->written;
1489 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1490 1.1 christos }
1491 1.1 christos {
1492 1.1 christos int referenced = 0;
1493 1.1 christos int UNUSED insn_referenced = abuf->written;
1494 1.1 christos INT in_Rs = -1;
1495 1.1 christos INT out_Pd = -1;
1496 1.1 christos out_Pd = FLD (out_Pd);
1497 1.1 christos referenced |= 1 << 1;
1498 1.1 christos cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1499 1.1 christos }
1500 1.1 christos return cycles;
1501 1.1 christos #undef FLD
1502 1.1 christos }
1503 1.1 christos
1504 1.1 christos static int
1505 1.1 christos model_crisv32_move_c_sprv32_p13 (SIM_CPU *current_cpu, void *sem_arg)
1506 1.1 christos {
1507 1.1 christos #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1508 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1509 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1510 1.1 christos int cycles = 0;
1511 1.1 christos {
1512 1.1 christos int referenced = 0;
1513 1.1 christos int UNUSED insn_referenced = abuf->written;
1514 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1515 1.1 christos }
1516 1.1 christos {
1517 1.1 christos int referenced = 0;
1518 1.1 christos int UNUSED insn_referenced = abuf->written;
1519 1.1 christos INT in_Rs = -1;
1520 1.1 christos INT out_Pd = -1;
1521 1.1 christos out_Pd = FLD (out_Pd);
1522 1.1 christos referenced |= 1 << 1;
1523 1.1 christos cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1524 1.1 christos }
1525 1.1 christos return cycles;
1526 1.1 christos #undef FLD
1527 1.1 christos }
1528 1.1 christos
1529 1.1 christos static int
1530 1.1 christos model_crisv32_move_c_sprv32_p14 (SIM_CPU *current_cpu, void *sem_arg)
1531 1.1 christos {
1532 1.1 christos #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1533 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1534 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1535 1.1 christos int cycles = 0;
1536 1.1 christos {
1537 1.1 christos int referenced = 0;
1538 1.1 christos int UNUSED insn_referenced = abuf->written;
1539 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1540 1.1 christos }
1541 1.1 christos {
1542 1.1 christos int referenced = 0;
1543 1.1 christos int UNUSED insn_referenced = abuf->written;
1544 1.1 christos INT in_Rs = -1;
1545 1.1 christos INT out_Pd = -1;
1546 1.1 christos out_Pd = FLD (out_Pd);
1547 1.1 christos referenced |= 1 << 1;
1548 1.1 christos cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1549 1.1 christos }
1550 1.1 christos return cycles;
1551 1.1 christos #undef FLD
1552 1.1 christos }
1553 1.1 christos
1554 1.1 christos static int
1555 1.1 christos model_crisv32_move_c_sprv32_p15 (SIM_CPU *current_cpu, void *sem_arg)
1556 1.1 christos {
1557 1.1 christos #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1558 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1559 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1560 1.1 christos int cycles = 0;
1561 1.1 christos {
1562 1.1 christos int referenced = 0;
1563 1.1 christos int UNUSED insn_referenced = abuf->written;
1564 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1565 1.1 christos }
1566 1.1 christos {
1567 1.1 christos int referenced = 0;
1568 1.1 christos int UNUSED insn_referenced = abuf->written;
1569 1.1 christos INT in_Rs = -1;
1570 1.1 christos INT out_Pd = -1;
1571 1.1 christos out_Pd = FLD (out_Pd);
1572 1.1 christos referenced |= 1 << 1;
1573 1.1 christos cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1574 1.1 christos }
1575 1.1 christos return cycles;
1576 1.1 christos #undef FLD
1577 1.1 christos }
1578 1.1 christos
1579 1.1 christos static int
1580 1.1 christos model_crisv32_move_spr_mv32 (SIM_CPU *current_cpu, void *sem_arg)
1581 1.1 christos {
1582 1.1 christos #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
1583 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1584 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1585 1.1 christos int cycles = 0;
1586 1.1 christos {
1587 1.1 christos int referenced = 0;
1588 1.1 christos int UNUSED insn_referenced = abuf->written;
1589 1.1 christos INT in_Rs = -1;
1590 1.1 christos in_Rs = FLD (in_Rs);
1591 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
1592 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1593 1.1 christos }
1594 1.1 christos {
1595 1.1 christos int referenced = 0;
1596 1.1 christos int UNUSED insn_referenced = abuf->written;
1597 1.1 christos INT in_Rd = -1;
1598 1.1 christos INT in_Rs = -1;
1599 1.1 christos INT out_Rd = -1;
1600 1.1 christos in_Rs = FLD (in_Rs);
1601 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
1602 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
1603 1.1 christos }
1604 1.1 christos {
1605 1.1 christos int referenced = 0;
1606 1.1 christos int UNUSED insn_referenced = abuf->written;
1607 1.1 christos cycles += crisv32f_model_crisv32_u_mem_w (current_cpu, idesc, 2, referenced);
1608 1.1 christos }
1609 1.1 christos return cycles;
1610 1.1 christos #undef FLD
1611 1.1 christos }
1612 1.1 christos
1613 1.1 christos static int
1614 1.1 christos model_crisv32_move_ss_r (SIM_CPU *current_cpu, void *sem_arg)
1615 1.1 christos {
1616 1.1 christos #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
1617 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1618 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1619 1.1 christos int cycles = 0;
1620 1.1 christos {
1621 1.1 christos int referenced = 0;
1622 1.1 christos int UNUSED insn_referenced = abuf->written;
1623 1.1 christos INT in_Rd = -1;
1624 1.1 christos INT in_Rs = -1;
1625 1.1 christos INT out_Rd = -1;
1626 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1627 1.1 christos }
1628 1.1 christos return cycles;
1629 1.1 christos #undef FLD
1630 1.1 christos }
1631 1.1 christos
1632 1.1 christos static int
1633 1.1 christos model_crisv32_move_r_ss (SIM_CPU *current_cpu, void *sem_arg)
1634 1.1 christos {
1635 1.1 christos #define FLD(f) abuf->fields.sfmt_mcp.f
1636 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1637 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1638 1.1 christos int cycles = 0;
1639 1.1 christos {
1640 1.1 christos int referenced = 0;
1641 1.1 christos int UNUSED insn_referenced = abuf->written;
1642 1.1 christos INT in_Rd = -1;
1643 1.1 christos INT in_Rs = -1;
1644 1.1 christos INT out_Rd = -1;
1645 1.1 christos in_Rs = FLD (in_Rs);
1646 1.1 christos referenced |= 1 << 1;
1647 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1648 1.1 christos }
1649 1.1 christos return cycles;
1650 1.1 christos #undef FLD
1651 1.1 christos }
1652 1.1 christos
1653 1.1 christos static int
1654 1.1 christos model_crisv32_movem_r_m_v32 (SIM_CPU *current_cpu, void *sem_arg)
1655 1.1 christos {
1656 1.1 christos #define FLD(f) abuf->fields.sfmt_movem_r_m_v32.f
1657 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1658 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1659 1.1 christos int cycles = 0;
1660 1.1 christos {
1661 1.1 christos int referenced = 0;
1662 1.1 christos int UNUSED insn_referenced = abuf->written;
1663 1.1 christos INT in_Rs = -1;
1664 1.1 christos in_Rs = FLD (in_Rs);
1665 1.1 christos referenced |= 1 << 0;
1666 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1667 1.1 christos }
1668 1.1 christos {
1669 1.1 christos int referenced = 0;
1670 1.1 christos int UNUSED insn_referenced = abuf->written;
1671 1.1 christos INT in_Rs = -1;
1672 1.1 christos INT in_Rd = -1;
1673 1.1 christos in_Rs = FLD (in_Rs);
1674 1.1 christos in_Rd = FLD (in_Rd);
1675 1.1 christos referenced |= 1 << 0;
1676 1.1 christos referenced |= 1 << 1;
1677 1.1 christos cycles += crisv32f_model_crisv32_u_movem_rtom (current_cpu, idesc, 1, referenced, in_Rs, in_Rd);
1678 1.1 christos }
1679 1.1 christos {
1680 1.1 christos int referenced = 0;
1681 1.1 christos int UNUSED insn_referenced = abuf->written;
1682 1.1 christos INT in_Rs = -1;
1683 1.1 christos INT out_Rd = -1;
1684 1.1 christos in_Rs = FLD (in_Rs);
1685 1.1 christos referenced |= 1 << 0;
1686 1.1 christos cycles += crisv32f_model_crisv32_u_exec_movem (current_cpu, idesc, 2, referenced, in_Rs, out_Rd);
1687 1.1 christos }
1688 1.1 christos {
1689 1.1 christos int referenced = 0;
1690 1.1 christos int UNUSED insn_referenced = abuf->written;
1691 1.1 christos cycles += crisv32f_model_crisv32_u_mem_w (current_cpu, idesc, 3, referenced);
1692 1.1 christos }
1693 1.1 christos return cycles;
1694 1.1 christos #undef FLD
1695 1.1 christos }
1696 1.1 christos
1697 1.1 christos static int
1698 1.1 christos model_crisv32_movem_m_r_v32 (SIM_CPU *current_cpu, void *sem_arg)
1699 1.1 christos {
1700 1.1 christos #define FLD(f) abuf->fields.sfmt_movem_m_r_v32.f
1701 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1702 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1703 1.1 christos int cycles = 0;
1704 1.1 christos {
1705 1.1 christos int referenced = 0;
1706 1.1 christos int UNUSED insn_referenced = abuf->written;
1707 1.1 christos INT in_Rs = -1;
1708 1.1 christos in_Rs = FLD (in_Rs);
1709 1.1 christos referenced |= 1 << 0;
1710 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1711 1.1 christos }
1712 1.1 christos {
1713 1.1 christos int referenced = 0;
1714 1.1 christos int UNUSED insn_referenced = abuf->written;
1715 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1716 1.1 christos }
1717 1.1 christos {
1718 1.1 christos int referenced = 0;
1719 1.1 christos int UNUSED insn_referenced = abuf->written;
1720 1.1 christos INT in_Rs = -1;
1721 1.1 christos INT in_Rd = -1;
1722 1.1 christos in_Rs = FLD (in_Rs);
1723 1.1 christos in_Rd = FLD (in_Rd);
1724 1.1 christos referenced |= 1 << 0;
1725 1.1 christos referenced |= 1 << 1;
1726 1.1 christos cycles += crisv32f_model_crisv32_u_movem_mtor (current_cpu, idesc, 2, referenced, in_Rs, in_Rd);
1727 1.1 christos }
1728 1.1 christos {
1729 1.1 christos int referenced = 0;
1730 1.1 christos int UNUSED insn_referenced = abuf->written;
1731 1.1 christos INT in_Rs = -1;
1732 1.1 christos INT out_Rd = -1;
1733 1.1 christos in_Rs = FLD (in_Rs);
1734 1.1 christos referenced |= 1 << 0;
1735 1.1 christos cycles += crisv32f_model_crisv32_u_exec_movem (current_cpu, idesc, 3, referenced, in_Rs, out_Rd);
1736 1.1 christos }
1737 1.1 christos return cycles;
1738 1.1 christos #undef FLD
1739 1.1 christos }
1740 1.1 christos
1741 1.1 christos static int
1742 1.1 christos model_crisv32_add_b_r (SIM_CPU *current_cpu, void *sem_arg)
1743 1.1 christos {
1744 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
1745 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1746 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1747 1.1 christos int cycles = 0;
1748 1.1 christos {
1749 1.1 christos int referenced = 0;
1750 1.1 christos int UNUSED insn_referenced = abuf->written;
1751 1.1 christos INT in_Rd = -1;
1752 1.1 christos INT in_Rs = -1;
1753 1.1 christos INT out_Rd = -1;
1754 1.1 christos in_Rd = FLD (in_Rd);
1755 1.1 christos in_Rs = FLD (in_Rs);
1756 1.1 christos referenced |= 1 << 0;
1757 1.1 christos referenced |= 1 << 1;
1758 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1759 1.1 christos }
1760 1.1 christos return cycles;
1761 1.1 christos #undef FLD
1762 1.1 christos }
1763 1.1 christos
1764 1.1 christos static int
1765 1.1 christos model_crisv32_add_w_r (SIM_CPU *current_cpu, void *sem_arg)
1766 1.1 christos {
1767 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
1768 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1769 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1770 1.1 christos int cycles = 0;
1771 1.1 christos {
1772 1.1 christos int referenced = 0;
1773 1.1 christos int UNUSED insn_referenced = abuf->written;
1774 1.1 christos INT in_Rd = -1;
1775 1.1 christos INT in_Rs = -1;
1776 1.1 christos INT out_Rd = -1;
1777 1.1 christos in_Rd = FLD (in_Rd);
1778 1.1 christos in_Rs = FLD (in_Rs);
1779 1.1 christos referenced |= 1 << 0;
1780 1.1 christos referenced |= 1 << 1;
1781 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1782 1.1 christos }
1783 1.1 christos return cycles;
1784 1.1 christos #undef FLD
1785 1.1 christos }
1786 1.1 christos
1787 1.1 christos static int
1788 1.1 christos model_crisv32_add_d_r (SIM_CPU *current_cpu, void *sem_arg)
1789 1.1 christos {
1790 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
1791 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1792 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1793 1.1 christos int cycles = 0;
1794 1.1 christos {
1795 1.1 christos int referenced = 0;
1796 1.1 christos int UNUSED insn_referenced = abuf->written;
1797 1.1 christos INT in_Rd = -1;
1798 1.1 christos INT in_Rs = -1;
1799 1.1 christos INT out_Rd = -1;
1800 1.1 christos in_Rd = FLD (in_Rd);
1801 1.1 christos in_Rs = FLD (in_Rs);
1802 1.1 christos referenced |= 1 << 0;
1803 1.1 christos referenced |= 1 << 1;
1804 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1805 1.1 christos }
1806 1.1 christos return cycles;
1807 1.1 christos #undef FLD
1808 1.1 christos }
1809 1.1 christos
1810 1.1 christos static int
1811 1.1 christos model_crisv32_add_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
1812 1.1 christos {
1813 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
1814 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1815 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1816 1.1 christos int cycles = 0;
1817 1.1 christos {
1818 1.1 christos int referenced = 0;
1819 1.1 christos int UNUSED insn_referenced = abuf->written;
1820 1.1 christos INT in_Rs = -1;
1821 1.1 christos in_Rs = FLD (in_Rs);
1822 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
1823 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1824 1.1 christos }
1825 1.1 christos {
1826 1.1 christos int referenced = 0;
1827 1.1 christos int UNUSED insn_referenced = abuf->written;
1828 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1829 1.1 christos }
1830 1.1 christos {
1831 1.1 christos int referenced = 0;
1832 1.1 christos int UNUSED insn_referenced = abuf->written;
1833 1.1 christos INT in_Rd = -1;
1834 1.1 christos INT in_Rs = -1;
1835 1.1 christos INT out_Rd = -1;
1836 1.1 christos in_Rd = FLD (in_Rd);
1837 1.1 christos in_Rs = FLD (in_Rs);
1838 1.1 christos referenced |= 1 << 0;
1839 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
1840 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1841 1.1 christos }
1842 1.1 christos return cycles;
1843 1.1 christos #undef FLD
1844 1.1 christos }
1845 1.1 christos
1846 1.1 christos static int
1847 1.1 christos model_crisv32_add_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
1848 1.1 christos {
1849 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
1850 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1851 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1852 1.1 christos int cycles = 0;
1853 1.1 christos {
1854 1.1 christos int referenced = 0;
1855 1.1 christos int UNUSED insn_referenced = abuf->written;
1856 1.1 christos INT in_Rs = -1;
1857 1.1 christos in_Rs = FLD (in_Rs);
1858 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
1859 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1860 1.1 christos }
1861 1.1 christos {
1862 1.1 christos int referenced = 0;
1863 1.1 christos int UNUSED insn_referenced = abuf->written;
1864 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1865 1.1 christos }
1866 1.1 christos {
1867 1.1 christos int referenced = 0;
1868 1.1 christos int UNUSED insn_referenced = abuf->written;
1869 1.1 christos INT in_Rd = -1;
1870 1.1 christos INT in_Rs = -1;
1871 1.1 christos INT out_Rd = -1;
1872 1.1 christos in_Rd = FLD (in_Rd);
1873 1.1 christos in_Rs = FLD (in_Rs);
1874 1.1 christos referenced |= 1 << 0;
1875 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
1876 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1877 1.1 christos }
1878 1.1 christos return cycles;
1879 1.1 christos #undef FLD
1880 1.1 christos }
1881 1.1 christos
1882 1.1 christos static int
1883 1.1 christos model_crisv32_add_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
1884 1.1 christos {
1885 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
1886 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1887 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1888 1.1 christos int cycles = 0;
1889 1.1 christos {
1890 1.1 christos int referenced = 0;
1891 1.1 christos int UNUSED insn_referenced = abuf->written;
1892 1.1 christos INT in_Rs = -1;
1893 1.1 christos in_Rs = FLD (in_Rs);
1894 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
1895 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1896 1.1 christos }
1897 1.1 christos {
1898 1.1 christos int referenced = 0;
1899 1.1 christos int UNUSED insn_referenced = abuf->written;
1900 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1901 1.1 christos }
1902 1.1 christos {
1903 1.1 christos int referenced = 0;
1904 1.1 christos int UNUSED insn_referenced = abuf->written;
1905 1.1 christos INT in_Rd = -1;
1906 1.1 christos INT in_Rs = -1;
1907 1.1 christos INT out_Rd = -1;
1908 1.1 christos in_Rd = FLD (in_Rd);
1909 1.1 christos in_Rs = FLD (in_Rs);
1910 1.1 christos referenced |= 1 << 0;
1911 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
1912 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1913 1.1 christos }
1914 1.1 christos return cycles;
1915 1.1 christos #undef FLD
1916 1.1 christos }
1917 1.1 christos
1918 1.1 christos static int
1919 1.1 christos model_crisv32_addcbr (SIM_CPU *current_cpu, void *sem_arg)
1920 1.1 christos {
1921 1.1 christos #define FLD(f) abuf->fields.sfmt_addcbr.f
1922 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1923 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1924 1.1 christos int cycles = 0;
1925 1.1 christos {
1926 1.1 christos int referenced = 0;
1927 1.1 christos int UNUSED insn_referenced = abuf->written;
1928 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
1929 1.1 christos }
1930 1.1 christos {
1931 1.1 christos int referenced = 0;
1932 1.1 christos int UNUSED insn_referenced = abuf->written;
1933 1.1 christos INT in_Rd = -1;
1934 1.1 christos INT in_Rs = -1;
1935 1.1 christos INT out_Rd = -1;
1936 1.1 christos in_Rd = FLD (in_Rd);
1937 1.1 christos referenced |= 1 << 0;
1938 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
1939 1.1 christos }
1940 1.1 christos return cycles;
1941 1.1 christos #undef FLD
1942 1.1 christos }
1943 1.1 christos
1944 1.1 christos static int
1945 1.1 christos model_crisv32_addcwr (SIM_CPU *current_cpu, void *sem_arg)
1946 1.1 christos {
1947 1.1 christos #define FLD(f) abuf->fields.sfmt_addcwr.f
1948 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1949 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1950 1.1 christos int cycles = 0;
1951 1.1 christos {
1952 1.1 christos int referenced = 0;
1953 1.1 christos int UNUSED insn_referenced = abuf->written;
1954 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
1955 1.1 christos }
1956 1.1 christos {
1957 1.1 christos int referenced = 0;
1958 1.1 christos int UNUSED insn_referenced = abuf->written;
1959 1.1 christos INT in_Rd = -1;
1960 1.1 christos INT in_Rs = -1;
1961 1.1 christos INT out_Rd = -1;
1962 1.1 christos in_Rd = FLD (in_Rd);
1963 1.1 christos referenced |= 1 << 0;
1964 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
1965 1.1 christos }
1966 1.1 christos return cycles;
1967 1.1 christos #undef FLD
1968 1.1 christos }
1969 1.1 christos
1970 1.1 christos static int
1971 1.1 christos model_crisv32_addcdr (SIM_CPU *current_cpu, void *sem_arg)
1972 1.1 christos {
1973 1.1 christos #define FLD(f) abuf->fields.sfmt_addcdr.f
1974 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1975 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
1976 1.1 christos int cycles = 0;
1977 1.1 christos {
1978 1.1 christos int referenced = 0;
1979 1.1 christos int UNUSED insn_referenced = abuf->written;
1980 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1981 1.1 christos }
1982 1.1 christos {
1983 1.1 christos int referenced = 0;
1984 1.1 christos int UNUSED insn_referenced = abuf->written;
1985 1.1 christos INT in_Rd = -1;
1986 1.1 christos INT in_Rs = -1;
1987 1.1 christos INT out_Rd = -1;
1988 1.1 christos in_Rd = FLD (in_Rd);
1989 1.1 christos referenced |= 1 << 0;
1990 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
1991 1.1 christos }
1992 1.1 christos return cycles;
1993 1.1 christos #undef FLD
1994 1.1 christos }
1995 1.1 christos
1996 1.1 christos static int
1997 1.1 christos model_crisv32_adds_b_r (SIM_CPU *current_cpu, void *sem_arg)
1998 1.1 christos {
1999 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
2000 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2001 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2002 1.1 christos int cycles = 0;
2003 1.1 christos {
2004 1.1 christos int referenced = 0;
2005 1.1 christos int UNUSED insn_referenced = abuf->written;
2006 1.1 christos INT in_Rd = -1;
2007 1.1 christos INT in_Rs = -1;
2008 1.1 christos INT out_Rd = -1;
2009 1.1 christos in_Rd = FLD (in_Rd);
2010 1.1 christos in_Rs = FLD (in_Rs);
2011 1.1 christos referenced |= 1 << 0;
2012 1.1 christos referenced |= 1 << 1;
2013 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2014 1.1 christos }
2015 1.1 christos return cycles;
2016 1.1 christos #undef FLD
2017 1.1 christos }
2018 1.1 christos
2019 1.1 christos static int
2020 1.1 christos model_crisv32_adds_w_r (SIM_CPU *current_cpu, void *sem_arg)
2021 1.1 christos {
2022 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
2023 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2024 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2025 1.1 christos int cycles = 0;
2026 1.1 christos {
2027 1.1 christos int referenced = 0;
2028 1.1 christos int UNUSED insn_referenced = abuf->written;
2029 1.1 christos INT in_Rd = -1;
2030 1.1 christos INT in_Rs = -1;
2031 1.1 christos INT out_Rd = -1;
2032 1.1 christos in_Rd = FLD (in_Rd);
2033 1.1 christos in_Rs = FLD (in_Rs);
2034 1.1 christos referenced |= 1 << 0;
2035 1.1 christos referenced |= 1 << 1;
2036 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2037 1.1 christos }
2038 1.1 christos return cycles;
2039 1.1 christos #undef FLD
2040 1.1 christos }
2041 1.1 christos
2042 1.1 christos static int
2043 1.1 christos model_crisv32_adds_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
2044 1.1 christos {
2045 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2046 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2047 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2048 1.1 christos int cycles = 0;
2049 1.1 christos {
2050 1.1 christos int referenced = 0;
2051 1.1 christos int UNUSED insn_referenced = abuf->written;
2052 1.1 christos INT in_Rs = -1;
2053 1.1 christos in_Rs = FLD (in_Rs);
2054 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2055 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2056 1.1 christos }
2057 1.1 christos {
2058 1.1 christos int referenced = 0;
2059 1.1 christos int UNUSED insn_referenced = abuf->written;
2060 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2061 1.1 christos }
2062 1.1 christos {
2063 1.1 christos int referenced = 0;
2064 1.1 christos int UNUSED insn_referenced = abuf->written;
2065 1.1 christos INT in_Rd = -1;
2066 1.1 christos INT in_Rs = -1;
2067 1.1 christos INT out_Rd = -1;
2068 1.1 christos in_Rd = FLD (in_Rd);
2069 1.1 christos in_Rs = FLD (in_Rs);
2070 1.1 christos referenced |= 1 << 0;
2071 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2072 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2073 1.1 christos }
2074 1.1 christos return cycles;
2075 1.1 christos #undef FLD
2076 1.1 christos }
2077 1.1 christos
2078 1.1 christos static int
2079 1.1 christos model_crisv32_adds_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
2080 1.1 christos {
2081 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2082 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2083 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2084 1.1 christos int cycles = 0;
2085 1.1 christos {
2086 1.1 christos int referenced = 0;
2087 1.1 christos int UNUSED insn_referenced = abuf->written;
2088 1.1 christos INT in_Rs = -1;
2089 1.1 christos in_Rs = FLD (in_Rs);
2090 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2091 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2092 1.1 christos }
2093 1.1 christos {
2094 1.1 christos int referenced = 0;
2095 1.1 christos int UNUSED insn_referenced = abuf->written;
2096 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2097 1.1 christos }
2098 1.1 christos {
2099 1.1 christos int referenced = 0;
2100 1.1 christos int UNUSED insn_referenced = abuf->written;
2101 1.1 christos INT in_Rd = -1;
2102 1.1 christos INT in_Rs = -1;
2103 1.1 christos INT out_Rd = -1;
2104 1.1 christos in_Rd = FLD (in_Rd);
2105 1.1 christos in_Rs = FLD (in_Rs);
2106 1.1 christos referenced |= 1 << 0;
2107 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2108 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2109 1.1 christos }
2110 1.1 christos return cycles;
2111 1.1 christos #undef FLD
2112 1.1 christos }
2113 1.1 christos
2114 1.1 christos static int
2115 1.1 christos model_crisv32_addscbr (SIM_CPU *current_cpu, void *sem_arg)
2116 1.1 christos {
2117 1.1 christos #define FLD(f) abuf->fields.sfmt_addcbr.f
2118 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2119 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2120 1.1 christos int cycles = 0;
2121 1.1 christos {
2122 1.1 christos int referenced = 0;
2123 1.1 christos int UNUSED insn_referenced = abuf->written;
2124 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2125 1.1 christos }
2126 1.1 christos {
2127 1.1 christos int referenced = 0;
2128 1.1 christos int UNUSED insn_referenced = abuf->written;
2129 1.1 christos INT in_Rd = -1;
2130 1.1 christos INT in_Rs = -1;
2131 1.1 christos INT out_Rd = -1;
2132 1.1 christos in_Rd = FLD (in_Rd);
2133 1.1 christos referenced |= 1 << 0;
2134 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2135 1.1 christos }
2136 1.1 christos return cycles;
2137 1.1 christos #undef FLD
2138 1.1 christos }
2139 1.1 christos
2140 1.1 christos static int
2141 1.1 christos model_crisv32_addscwr (SIM_CPU *current_cpu, void *sem_arg)
2142 1.1 christos {
2143 1.1 christos #define FLD(f) abuf->fields.sfmt_addcwr.f
2144 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2145 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2146 1.1 christos int cycles = 0;
2147 1.1 christos {
2148 1.1 christos int referenced = 0;
2149 1.1 christos int UNUSED insn_referenced = abuf->written;
2150 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2151 1.1 christos }
2152 1.1 christos {
2153 1.1 christos int referenced = 0;
2154 1.1 christos int UNUSED insn_referenced = abuf->written;
2155 1.1 christos INT in_Rd = -1;
2156 1.1 christos INT in_Rs = -1;
2157 1.1 christos INT out_Rd = -1;
2158 1.1 christos in_Rd = FLD (in_Rd);
2159 1.1 christos referenced |= 1 << 0;
2160 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2161 1.1 christos }
2162 1.1 christos return cycles;
2163 1.1 christos #undef FLD
2164 1.1 christos }
2165 1.1 christos
2166 1.1 christos static int
2167 1.1 christos model_crisv32_addu_b_r (SIM_CPU *current_cpu, void *sem_arg)
2168 1.1 christos {
2169 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
2170 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2171 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2172 1.1 christos int cycles = 0;
2173 1.1 christos {
2174 1.1 christos int referenced = 0;
2175 1.1 christos int UNUSED insn_referenced = abuf->written;
2176 1.1 christos INT in_Rd = -1;
2177 1.1 christos INT in_Rs = -1;
2178 1.1 christos INT out_Rd = -1;
2179 1.1 christos in_Rd = FLD (in_Rd);
2180 1.1 christos in_Rs = FLD (in_Rs);
2181 1.1 christos referenced |= 1 << 0;
2182 1.1 christos referenced |= 1 << 1;
2183 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2184 1.1 christos }
2185 1.1 christos return cycles;
2186 1.1 christos #undef FLD
2187 1.1 christos }
2188 1.1 christos
2189 1.1 christos static int
2190 1.1 christos model_crisv32_addu_w_r (SIM_CPU *current_cpu, void *sem_arg)
2191 1.1 christos {
2192 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
2193 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2194 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2195 1.1 christos int cycles = 0;
2196 1.1 christos {
2197 1.1 christos int referenced = 0;
2198 1.1 christos int UNUSED insn_referenced = abuf->written;
2199 1.1 christos INT in_Rd = -1;
2200 1.1 christos INT in_Rs = -1;
2201 1.1 christos INT out_Rd = -1;
2202 1.1 christos in_Rd = FLD (in_Rd);
2203 1.1 christos in_Rs = FLD (in_Rs);
2204 1.1 christos referenced |= 1 << 0;
2205 1.1 christos referenced |= 1 << 1;
2206 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2207 1.1 christos }
2208 1.1 christos return cycles;
2209 1.1 christos #undef FLD
2210 1.1 christos }
2211 1.1 christos
2212 1.1 christos static int
2213 1.1 christos model_crisv32_addu_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
2214 1.1 christos {
2215 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2216 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2217 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2218 1.1 christos int cycles = 0;
2219 1.1 christos {
2220 1.1 christos int referenced = 0;
2221 1.1 christos int UNUSED insn_referenced = abuf->written;
2222 1.1 christos INT in_Rs = -1;
2223 1.1 christos in_Rs = FLD (in_Rs);
2224 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2225 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2226 1.1 christos }
2227 1.1 christos {
2228 1.1 christos int referenced = 0;
2229 1.1 christos int UNUSED insn_referenced = abuf->written;
2230 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2231 1.1 christos }
2232 1.1 christos {
2233 1.1 christos int referenced = 0;
2234 1.1 christos int UNUSED insn_referenced = abuf->written;
2235 1.1 christos INT in_Rd = -1;
2236 1.1 christos INT in_Rs = -1;
2237 1.1 christos INT out_Rd = -1;
2238 1.1 christos in_Rd = FLD (in_Rd);
2239 1.1 christos in_Rs = FLD (in_Rs);
2240 1.1 christos referenced |= 1 << 0;
2241 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2242 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2243 1.1 christos }
2244 1.1 christos return cycles;
2245 1.1 christos #undef FLD
2246 1.1 christos }
2247 1.1 christos
2248 1.1 christos static int
2249 1.1 christos model_crisv32_addu_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
2250 1.1 christos {
2251 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2252 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2253 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2254 1.1 christos int cycles = 0;
2255 1.1 christos {
2256 1.1 christos int referenced = 0;
2257 1.1 christos int UNUSED insn_referenced = abuf->written;
2258 1.1 christos INT in_Rs = -1;
2259 1.1 christos in_Rs = FLD (in_Rs);
2260 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2261 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2262 1.1 christos }
2263 1.1 christos {
2264 1.1 christos int referenced = 0;
2265 1.1 christos int UNUSED insn_referenced = abuf->written;
2266 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2267 1.1 christos }
2268 1.1 christos {
2269 1.1 christos int referenced = 0;
2270 1.1 christos int UNUSED insn_referenced = abuf->written;
2271 1.1 christos INT in_Rd = -1;
2272 1.1 christos INT in_Rs = -1;
2273 1.1 christos INT out_Rd = -1;
2274 1.1 christos in_Rd = FLD (in_Rd);
2275 1.1 christos in_Rs = FLD (in_Rs);
2276 1.1 christos referenced |= 1 << 0;
2277 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2278 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2279 1.1 christos }
2280 1.1 christos return cycles;
2281 1.1 christos #undef FLD
2282 1.1 christos }
2283 1.1 christos
2284 1.1 christos static int
2285 1.1 christos model_crisv32_adducbr (SIM_CPU *current_cpu, void *sem_arg)
2286 1.1 christos {
2287 1.1 christos #define FLD(f) abuf->fields.sfmt_addcbr.f
2288 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2289 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2290 1.1 christos int cycles = 0;
2291 1.1 christos {
2292 1.1 christos int referenced = 0;
2293 1.1 christos int UNUSED insn_referenced = abuf->written;
2294 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2295 1.1 christos }
2296 1.1 christos {
2297 1.1 christos int referenced = 0;
2298 1.1 christos int UNUSED insn_referenced = abuf->written;
2299 1.1 christos INT in_Rd = -1;
2300 1.1 christos INT in_Rs = -1;
2301 1.1 christos INT out_Rd = -1;
2302 1.1 christos in_Rd = FLD (in_Rd);
2303 1.1 christos referenced |= 1 << 0;
2304 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2305 1.1 christos }
2306 1.1 christos return cycles;
2307 1.1 christos #undef FLD
2308 1.1 christos }
2309 1.1 christos
2310 1.1 christos static int
2311 1.1 christos model_crisv32_adducwr (SIM_CPU *current_cpu, void *sem_arg)
2312 1.1 christos {
2313 1.1 christos #define FLD(f) abuf->fields.sfmt_addcwr.f
2314 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2315 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2316 1.1 christos int cycles = 0;
2317 1.1 christos {
2318 1.1 christos int referenced = 0;
2319 1.1 christos int UNUSED insn_referenced = abuf->written;
2320 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2321 1.1 christos }
2322 1.1 christos {
2323 1.1 christos int referenced = 0;
2324 1.1 christos int UNUSED insn_referenced = abuf->written;
2325 1.1 christos INT in_Rd = -1;
2326 1.1 christos INT in_Rs = -1;
2327 1.1 christos INT out_Rd = -1;
2328 1.1 christos in_Rd = FLD (in_Rd);
2329 1.1 christos referenced |= 1 << 0;
2330 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2331 1.1 christos }
2332 1.1 christos return cycles;
2333 1.1 christos #undef FLD
2334 1.1 christos }
2335 1.1 christos
2336 1.1 christos static int
2337 1.1 christos model_crisv32_sub_b_r (SIM_CPU *current_cpu, void *sem_arg)
2338 1.1 christos {
2339 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
2340 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2341 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2342 1.1 christos int cycles = 0;
2343 1.1 christos {
2344 1.1 christos int referenced = 0;
2345 1.1 christos int UNUSED insn_referenced = abuf->written;
2346 1.1 christos INT in_Rd = -1;
2347 1.1 christos INT in_Rs = -1;
2348 1.1 christos INT out_Rd = -1;
2349 1.1 christos in_Rd = FLD (in_Rd);
2350 1.1 christos in_Rs = FLD (in_Rs);
2351 1.1 christos referenced |= 1 << 0;
2352 1.1 christos referenced |= 1 << 1;
2353 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2354 1.1 christos }
2355 1.1 christos return cycles;
2356 1.1 christos #undef FLD
2357 1.1 christos }
2358 1.1 christos
2359 1.1 christos static int
2360 1.1 christos model_crisv32_sub_w_r (SIM_CPU *current_cpu, void *sem_arg)
2361 1.1 christos {
2362 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
2363 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2364 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2365 1.1 christos int cycles = 0;
2366 1.1 christos {
2367 1.1 christos int referenced = 0;
2368 1.1 christos int UNUSED insn_referenced = abuf->written;
2369 1.1 christos INT in_Rd = -1;
2370 1.1 christos INT in_Rs = -1;
2371 1.1 christos INT out_Rd = -1;
2372 1.1 christos in_Rd = FLD (in_Rd);
2373 1.1 christos in_Rs = FLD (in_Rs);
2374 1.1 christos referenced |= 1 << 0;
2375 1.1 christos referenced |= 1 << 1;
2376 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2377 1.1 christos }
2378 1.1 christos return cycles;
2379 1.1 christos #undef FLD
2380 1.1 christos }
2381 1.1 christos
2382 1.1 christos static int
2383 1.1 christos model_crisv32_sub_d_r (SIM_CPU *current_cpu, void *sem_arg)
2384 1.1 christos {
2385 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
2386 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2387 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2388 1.1 christos int cycles = 0;
2389 1.1 christos {
2390 1.1 christos int referenced = 0;
2391 1.1 christos int UNUSED insn_referenced = abuf->written;
2392 1.1 christos INT in_Rd = -1;
2393 1.1 christos INT in_Rs = -1;
2394 1.1 christos INT out_Rd = -1;
2395 1.1 christos in_Rd = FLD (in_Rd);
2396 1.1 christos in_Rs = FLD (in_Rs);
2397 1.1 christos referenced |= 1 << 0;
2398 1.1 christos referenced |= 1 << 1;
2399 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2400 1.1 christos }
2401 1.1 christos return cycles;
2402 1.1 christos #undef FLD
2403 1.1 christos }
2404 1.1 christos
2405 1.1 christos static int
2406 1.1 christos model_crisv32_sub_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
2407 1.1 christos {
2408 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2409 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2410 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2411 1.1 christos int cycles = 0;
2412 1.1 christos {
2413 1.1 christos int referenced = 0;
2414 1.1 christos int UNUSED insn_referenced = abuf->written;
2415 1.1 christos INT in_Rs = -1;
2416 1.1 christos in_Rs = FLD (in_Rs);
2417 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2418 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2419 1.1 christos }
2420 1.1 christos {
2421 1.1 christos int referenced = 0;
2422 1.1 christos int UNUSED insn_referenced = abuf->written;
2423 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2424 1.1 christos }
2425 1.1 christos {
2426 1.1 christos int referenced = 0;
2427 1.1 christos int UNUSED insn_referenced = abuf->written;
2428 1.1 christos INT in_Rd = -1;
2429 1.1 christos INT in_Rs = -1;
2430 1.1 christos INT out_Rd = -1;
2431 1.1 christos in_Rd = FLD (in_Rd);
2432 1.1 christos in_Rs = FLD (in_Rs);
2433 1.1 christos referenced |= 1 << 0;
2434 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2435 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2436 1.1 christos }
2437 1.1 christos return cycles;
2438 1.1 christos #undef FLD
2439 1.1 christos }
2440 1.1 christos
2441 1.1 christos static int
2442 1.1 christos model_crisv32_sub_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
2443 1.1 christos {
2444 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2445 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2446 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2447 1.1 christos int cycles = 0;
2448 1.1 christos {
2449 1.1 christos int referenced = 0;
2450 1.1 christos int UNUSED insn_referenced = abuf->written;
2451 1.1 christos INT in_Rs = -1;
2452 1.1 christos in_Rs = FLD (in_Rs);
2453 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2454 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2455 1.1 christos }
2456 1.1 christos {
2457 1.1 christos int referenced = 0;
2458 1.1 christos int UNUSED insn_referenced = abuf->written;
2459 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2460 1.1 christos }
2461 1.1 christos {
2462 1.1 christos int referenced = 0;
2463 1.1 christos int UNUSED insn_referenced = abuf->written;
2464 1.1 christos INT in_Rd = -1;
2465 1.1 christos INT in_Rs = -1;
2466 1.1 christos INT out_Rd = -1;
2467 1.1 christos in_Rd = FLD (in_Rd);
2468 1.1 christos in_Rs = FLD (in_Rs);
2469 1.1 christos referenced |= 1 << 0;
2470 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2471 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2472 1.1 christos }
2473 1.1 christos return cycles;
2474 1.1 christos #undef FLD
2475 1.1 christos }
2476 1.1 christos
2477 1.1 christos static int
2478 1.1 christos model_crisv32_sub_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
2479 1.1 christos {
2480 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2481 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2482 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2483 1.1 christos int cycles = 0;
2484 1.1 christos {
2485 1.1 christos int referenced = 0;
2486 1.1 christos int UNUSED insn_referenced = abuf->written;
2487 1.1 christos INT in_Rs = -1;
2488 1.1 christos in_Rs = FLD (in_Rs);
2489 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2490 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2491 1.1 christos }
2492 1.1 christos {
2493 1.1 christos int referenced = 0;
2494 1.1 christos int UNUSED insn_referenced = abuf->written;
2495 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2496 1.1 christos }
2497 1.1 christos {
2498 1.1 christos int referenced = 0;
2499 1.1 christos int UNUSED insn_referenced = abuf->written;
2500 1.1 christos INT in_Rd = -1;
2501 1.1 christos INT in_Rs = -1;
2502 1.1 christos INT out_Rd = -1;
2503 1.1 christos in_Rd = FLD (in_Rd);
2504 1.1 christos in_Rs = FLD (in_Rs);
2505 1.1 christos referenced |= 1 << 0;
2506 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2507 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2508 1.1 christos }
2509 1.1 christos return cycles;
2510 1.1 christos #undef FLD
2511 1.1 christos }
2512 1.1 christos
2513 1.1 christos static int
2514 1.1 christos model_crisv32_subcbr (SIM_CPU *current_cpu, void *sem_arg)
2515 1.1 christos {
2516 1.1 christos #define FLD(f) abuf->fields.sfmt_addcbr.f
2517 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2518 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2519 1.1 christos int cycles = 0;
2520 1.1 christos {
2521 1.1 christos int referenced = 0;
2522 1.1 christos int UNUSED insn_referenced = abuf->written;
2523 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2524 1.1 christos }
2525 1.1 christos {
2526 1.1 christos int referenced = 0;
2527 1.1 christos int UNUSED insn_referenced = abuf->written;
2528 1.1 christos INT in_Rd = -1;
2529 1.1 christos INT in_Rs = -1;
2530 1.1 christos INT out_Rd = -1;
2531 1.1 christos in_Rd = FLD (in_Rd);
2532 1.1 christos referenced |= 1 << 0;
2533 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2534 1.1 christos }
2535 1.1 christos return cycles;
2536 1.1 christos #undef FLD
2537 1.1 christos }
2538 1.1 christos
2539 1.1 christos static int
2540 1.1 christos model_crisv32_subcwr (SIM_CPU *current_cpu, void *sem_arg)
2541 1.1 christos {
2542 1.1 christos #define FLD(f) abuf->fields.sfmt_addcwr.f
2543 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2544 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2545 1.1 christos int cycles = 0;
2546 1.1 christos {
2547 1.1 christos int referenced = 0;
2548 1.1 christos int UNUSED insn_referenced = abuf->written;
2549 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2550 1.1 christos }
2551 1.1 christos {
2552 1.1 christos int referenced = 0;
2553 1.1 christos int UNUSED insn_referenced = abuf->written;
2554 1.1 christos INT in_Rd = -1;
2555 1.1 christos INT in_Rs = -1;
2556 1.1 christos INT out_Rd = -1;
2557 1.1 christos in_Rd = FLD (in_Rd);
2558 1.1 christos referenced |= 1 << 0;
2559 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2560 1.1 christos }
2561 1.1 christos return cycles;
2562 1.1 christos #undef FLD
2563 1.1 christos }
2564 1.1 christos
2565 1.1 christos static int
2566 1.1 christos model_crisv32_subcdr (SIM_CPU *current_cpu, void *sem_arg)
2567 1.1 christos {
2568 1.1 christos #define FLD(f) abuf->fields.sfmt_addcdr.f
2569 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2570 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2571 1.1 christos int cycles = 0;
2572 1.1 christos {
2573 1.1 christos int referenced = 0;
2574 1.1 christos int UNUSED insn_referenced = abuf->written;
2575 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
2576 1.1 christos }
2577 1.1 christos {
2578 1.1 christos int referenced = 0;
2579 1.1 christos int UNUSED insn_referenced = abuf->written;
2580 1.1 christos INT in_Rd = -1;
2581 1.1 christos INT in_Rs = -1;
2582 1.1 christos INT out_Rd = -1;
2583 1.1 christos in_Rd = FLD (in_Rd);
2584 1.1 christos referenced |= 1 << 0;
2585 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2586 1.1 christos }
2587 1.1 christos return cycles;
2588 1.1 christos #undef FLD
2589 1.1 christos }
2590 1.1 christos
2591 1.1 christos static int
2592 1.1 christos model_crisv32_subs_b_r (SIM_CPU *current_cpu, void *sem_arg)
2593 1.1 christos {
2594 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
2595 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2596 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2597 1.1 christos int cycles = 0;
2598 1.1 christos {
2599 1.1 christos int referenced = 0;
2600 1.1 christos int UNUSED insn_referenced = abuf->written;
2601 1.1 christos INT in_Rd = -1;
2602 1.1 christos INT in_Rs = -1;
2603 1.1 christos INT out_Rd = -1;
2604 1.1 christos in_Rd = FLD (in_Rd);
2605 1.1 christos in_Rs = FLD (in_Rs);
2606 1.1 christos referenced |= 1 << 0;
2607 1.1 christos referenced |= 1 << 1;
2608 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2609 1.1 christos }
2610 1.1 christos return cycles;
2611 1.1 christos #undef FLD
2612 1.1 christos }
2613 1.1 christos
2614 1.1 christos static int
2615 1.1 christos model_crisv32_subs_w_r (SIM_CPU *current_cpu, void *sem_arg)
2616 1.1 christos {
2617 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
2618 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2619 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2620 1.1 christos int cycles = 0;
2621 1.1 christos {
2622 1.1 christos int referenced = 0;
2623 1.1 christos int UNUSED insn_referenced = abuf->written;
2624 1.1 christos INT in_Rd = -1;
2625 1.1 christos INT in_Rs = -1;
2626 1.1 christos INT out_Rd = -1;
2627 1.1 christos in_Rd = FLD (in_Rd);
2628 1.1 christos in_Rs = FLD (in_Rs);
2629 1.1 christos referenced |= 1 << 0;
2630 1.1 christos referenced |= 1 << 1;
2631 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2632 1.1 christos }
2633 1.1 christos return cycles;
2634 1.1 christos #undef FLD
2635 1.1 christos }
2636 1.1 christos
2637 1.1 christos static int
2638 1.1 christos model_crisv32_subs_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
2639 1.1 christos {
2640 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2641 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2642 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2643 1.1 christos int cycles = 0;
2644 1.1 christos {
2645 1.1 christos int referenced = 0;
2646 1.1 christos int UNUSED insn_referenced = abuf->written;
2647 1.1 christos INT in_Rs = -1;
2648 1.1 christos in_Rs = FLD (in_Rs);
2649 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2650 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2651 1.1 christos }
2652 1.1 christos {
2653 1.1 christos int referenced = 0;
2654 1.1 christos int UNUSED insn_referenced = abuf->written;
2655 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2656 1.1 christos }
2657 1.1 christos {
2658 1.1 christos int referenced = 0;
2659 1.1 christos int UNUSED insn_referenced = abuf->written;
2660 1.1 christos INT in_Rd = -1;
2661 1.1 christos INT in_Rs = -1;
2662 1.1 christos INT out_Rd = -1;
2663 1.1 christos in_Rd = FLD (in_Rd);
2664 1.1 christos in_Rs = FLD (in_Rs);
2665 1.1 christos referenced |= 1 << 0;
2666 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2667 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2668 1.1 christos }
2669 1.1 christos return cycles;
2670 1.1 christos #undef FLD
2671 1.1 christos }
2672 1.1 christos
2673 1.1 christos static int
2674 1.1 christos model_crisv32_subs_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
2675 1.1 christos {
2676 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2677 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2678 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2679 1.1 christos int cycles = 0;
2680 1.1 christos {
2681 1.1 christos int referenced = 0;
2682 1.1 christos int UNUSED insn_referenced = abuf->written;
2683 1.1 christos INT in_Rs = -1;
2684 1.1 christos in_Rs = FLD (in_Rs);
2685 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2686 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2687 1.1 christos }
2688 1.1 christos {
2689 1.1 christos int referenced = 0;
2690 1.1 christos int UNUSED insn_referenced = abuf->written;
2691 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2692 1.1 christos }
2693 1.1 christos {
2694 1.1 christos int referenced = 0;
2695 1.1 christos int UNUSED insn_referenced = abuf->written;
2696 1.1 christos INT in_Rd = -1;
2697 1.1 christos INT in_Rs = -1;
2698 1.1 christos INT out_Rd = -1;
2699 1.1 christos in_Rd = FLD (in_Rd);
2700 1.1 christos in_Rs = FLD (in_Rs);
2701 1.1 christos referenced |= 1 << 0;
2702 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2703 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2704 1.1 christos }
2705 1.1 christos return cycles;
2706 1.1 christos #undef FLD
2707 1.1 christos }
2708 1.1 christos
2709 1.1 christos static int
2710 1.1 christos model_crisv32_subscbr (SIM_CPU *current_cpu, void *sem_arg)
2711 1.1 christos {
2712 1.1 christos #define FLD(f) abuf->fields.sfmt_addcbr.f
2713 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2714 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2715 1.1 christos int cycles = 0;
2716 1.1 christos {
2717 1.1 christos int referenced = 0;
2718 1.1 christos int UNUSED insn_referenced = abuf->written;
2719 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2720 1.1 christos }
2721 1.1 christos {
2722 1.1 christos int referenced = 0;
2723 1.1 christos int UNUSED insn_referenced = abuf->written;
2724 1.1 christos INT in_Rd = -1;
2725 1.1 christos INT in_Rs = -1;
2726 1.1 christos INT out_Rd = -1;
2727 1.1 christos in_Rd = FLD (in_Rd);
2728 1.1 christos referenced |= 1 << 0;
2729 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2730 1.1 christos }
2731 1.1 christos return cycles;
2732 1.1 christos #undef FLD
2733 1.1 christos }
2734 1.1 christos
2735 1.1 christos static int
2736 1.1 christos model_crisv32_subscwr (SIM_CPU *current_cpu, void *sem_arg)
2737 1.1 christos {
2738 1.1 christos #define FLD(f) abuf->fields.sfmt_addcwr.f
2739 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2740 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2741 1.1 christos int cycles = 0;
2742 1.1 christos {
2743 1.1 christos int referenced = 0;
2744 1.1 christos int UNUSED insn_referenced = abuf->written;
2745 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2746 1.1 christos }
2747 1.1 christos {
2748 1.1 christos int referenced = 0;
2749 1.1 christos int UNUSED insn_referenced = abuf->written;
2750 1.1 christos INT in_Rd = -1;
2751 1.1 christos INT in_Rs = -1;
2752 1.1 christos INT out_Rd = -1;
2753 1.1 christos in_Rd = FLD (in_Rd);
2754 1.1 christos referenced |= 1 << 0;
2755 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2756 1.1 christos }
2757 1.1 christos return cycles;
2758 1.1 christos #undef FLD
2759 1.1 christos }
2760 1.1 christos
2761 1.1 christos static int
2762 1.1 christos model_crisv32_subu_b_r (SIM_CPU *current_cpu, void *sem_arg)
2763 1.1 christos {
2764 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
2765 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2766 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2767 1.1 christos int cycles = 0;
2768 1.1 christos {
2769 1.1 christos int referenced = 0;
2770 1.1 christos int UNUSED insn_referenced = abuf->written;
2771 1.1 christos INT in_Rd = -1;
2772 1.1 christos INT in_Rs = -1;
2773 1.1 christos INT out_Rd = -1;
2774 1.1 christos in_Rd = FLD (in_Rd);
2775 1.1 christos in_Rs = FLD (in_Rs);
2776 1.1 christos referenced |= 1 << 0;
2777 1.1 christos referenced |= 1 << 1;
2778 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2779 1.1 christos }
2780 1.1 christos return cycles;
2781 1.1 christos #undef FLD
2782 1.1 christos }
2783 1.1 christos
2784 1.1 christos static int
2785 1.1 christos model_crisv32_subu_w_r (SIM_CPU *current_cpu, void *sem_arg)
2786 1.1 christos {
2787 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
2788 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2789 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2790 1.1 christos int cycles = 0;
2791 1.1 christos {
2792 1.1 christos int referenced = 0;
2793 1.1 christos int UNUSED insn_referenced = abuf->written;
2794 1.1 christos INT in_Rd = -1;
2795 1.1 christos INT in_Rs = -1;
2796 1.1 christos INT out_Rd = -1;
2797 1.1 christos in_Rd = FLD (in_Rd);
2798 1.1 christos in_Rs = FLD (in_Rs);
2799 1.1 christos referenced |= 1 << 0;
2800 1.1 christos referenced |= 1 << 1;
2801 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2802 1.1 christos }
2803 1.1 christos return cycles;
2804 1.1 christos #undef FLD
2805 1.1 christos }
2806 1.1 christos
2807 1.1 christos static int
2808 1.1 christos model_crisv32_subu_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
2809 1.1 christos {
2810 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2811 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2812 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2813 1.1 christos int cycles = 0;
2814 1.1 christos {
2815 1.1 christos int referenced = 0;
2816 1.1 christos int UNUSED insn_referenced = abuf->written;
2817 1.1 christos INT in_Rs = -1;
2818 1.1 christos in_Rs = FLD (in_Rs);
2819 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2820 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2821 1.1 christos }
2822 1.1 christos {
2823 1.1 christos int referenced = 0;
2824 1.1 christos int UNUSED insn_referenced = abuf->written;
2825 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2826 1.1 christos }
2827 1.1 christos {
2828 1.1 christos int referenced = 0;
2829 1.1 christos int UNUSED insn_referenced = abuf->written;
2830 1.1 christos INT in_Rd = -1;
2831 1.1 christos INT in_Rs = -1;
2832 1.1 christos INT out_Rd = -1;
2833 1.1 christos in_Rd = FLD (in_Rd);
2834 1.1 christos in_Rs = FLD (in_Rs);
2835 1.1 christos referenced |= 1 << 0;
2836 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2837 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2838 1.1 christos }
2839 1.1 christos return cycles;
2840 1.1 christos #undef FLD
2841 1.1 christos }
2842 1.1 christos
2843 1.1 christos static int
2844 1.1 christos model_crisv32_subu_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
2845 1.1 christos {
2846 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2847 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2848 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2849 1.1 christos int cycles = 0;
2850 1.1 christos {
2851 1.1 christos int referenced = 0;
2852 1.1 christos int UNUSED insn_referenced = abuf->written;
2853 1.1 christos INT in_Rs = -1;
2854 1.1 christos in_Rs = FLD (in_Rs);
2855 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2856 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2857 1.1 christos }
2858 1.1 christos {
2859 1.1 christos int referenced = 0;
2860 1.1 christos int UNUSED insn_referenced = abuf->written;
2861 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2862 1.1 christos }
2863 1.1 christos {
2864 1.1 christos int referenced = 0;
2865 1.1 christos int UNUSED insn_referenced = abuf->written;
2866 1.1 christos INT in_Rd = -1;
2867 1.1 christos INT in_Rs = -1;
2868 1.1 christos INT out_Rd = -1;
2869 1.1 christos in_Rd = FLD (in_Rd);
2870 1.1 christos in_Rs = FLD (in_Rs);
2871 1.1 christos referenced |= 1 << 0;
2872 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2873 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2874 1.1 christos }
2875 1.1 christos return cycles;
2876 1.1 christos #undef FLD
2877 1.1 christos }
2878 1.1 christos
2879 1.1 christos static int
2880 1.1 christos model_crisv32_subucbr (SIM_CPU *current_cpu, void *sem_arg)
2881 1.1 christos {
2882 1.1 christos #define FLD(f) abuf->fields.sfmt_addcbr.f
2883 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2884 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2885 1.1 christos int cycles = 0;
2886 1.1 christos {
2887 1.1 christos int referenced = 0;
2888 1.1 christos int UNUSED insn_referenced = abuf->written;
2889 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2890 1.1 christos }
2891 1.1 christos {
2892 1.1 christos int referenced = 0;
2893 1.1 christos int UNUSED insn_referenced = abuf->written;
2894 1.1 christos INT in_Rd = -1;
2895 1.1 christos INT in_Rs = -1;
2896 1.1 christos INT out_Rd = -1;
2897 1.1 christos in_Rd = FLD (in_Rd);
2898 1.1 christos referenced |= 1 << 0;
2899 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2900 1.1 christos }
2901 1.1 christos return cycles;
2902 1.1 christos #undef FLD
2903 1.1 christos }
2904 1.1 christos
2905 1.1 christos static int
2906 1.1 christos model_crisv32_subucwr (SIM_CPU *current_cpu, void *sem_arg)
2907 1.1 christos {
2908 1.1 christos #define FLD(f) abuf->fields.sfmt_addcwr.f
2909 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2910 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2911 1.1 christos int cycles = 0;
2912 1.1 christos {
2913 1.1 christos int referenced = 0;
2914 1.1 christos int UNUSED insn_referenced = abuf->written;
2915 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2916 1.1 christos }
2917 1.1 christos {
2918 1.1 christos int referenced = 0;
2919 1.1 christos int UNUSED insn_referenced = abuf->written;
2920 1.1 christos INT in_Rd = -1;
2921 1.1 christos INT in_Rs = -1;
2922 1.1 christos INT out_Rd = -1;
2923 1.1 christos in_Rd = FLD (in_Rd);
2924 1.1 christos referenced |= 1 << 0;
2925 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2926 1.1 christos }
2927 1.1 christos return cycles;
2928 1.1 christos #undef FLD
2929 1.1 christos }
2930 1.1 christos
2931 1.1 christos static int
2932 1.1 christos model_crisv32_addc_r (SIM_CPU *current_cpu, void *sem_arg)
2933 1.1 christos {
2934 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
2935 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2936 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2937 1.1 christos int cycles = 0;
2938 1.1 christos {
2939 1.1 christos int referenced = 0;
2940 1.1 christos int UNUSED insn_referenced = abuf->written;
2941 1.1 christos INT in_Rd = -1;
2942 1.1 christos INT in_Rs = -1;
2943 1.1 christos INT out_Rd = -1;
2944 1.1 christos in_Rd = FLD (in_Rd);
2945 1.1 christos in_Rs = FLD (in_Rs);
2946 1.1 christos referenced |= 1 << 0;
2947 1.1 christos referenced |= 1 << 1;
2948 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2949 1.1 christos }
2950 1.1 christos return cycles;
2951 1.1 christos #undef FLD
2952 1.1 christos }
2953 1.1 christos
2954 1.1 christos static int
2955 1.1 christos model_crisv32_addc_m (SIM_CPU *current_cpu, void *sem_arg)
2956 1.1 christos {
2957 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
2958 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2959 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2960 1.1 christos int cycles = 0;
2961 1.1 christos {
2962 1.1 christos int referenced = 0;
2963 1.1 christos int UNUSED insn_referenced = abuf->written;
2964 1.1 christos INT in_Rs = -1;
2965 1.1 christos in_Rs = FLD (in_Rs);
2966 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2967 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2968 1.1 christos }
2969 1.1 christos {
2970 1.1 christos int referenced = 0;
2971 1.1 christos int UNUSED insn_referenced = abuf->written;
2972 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2973 1.1 christos }
2974 1.1 christos {
2975 1.1 christos int referenced = 0;
2976 1.1 christos int UNUSED insn_referenced = abuf->written;
2977 1.1 christos INT in_Rd = -1;
2978 1.1 christos INT in_Rs = -1;
2979 1.1 christos INT out_Rd = -1;
2980 1.1 christos in_Rd = FLD (in_Rd);
2981 1.1 christos in_Rs = FLD (in_Rs);
2982 1.1 christos referenced |= 1 << 0;
2983 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2984 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2985 1.1 christos }
2986 1.1 christos return cycles;
2987 1.1 christos #undef FLD
2988 1.1 christos }
2989 1.1 christos
2990 1.1 christos static int
2991 1.1 christos model_crisv32_addc_c (SIM_CPU *current_cpu, void *sem_arg)
2992 1.1 christos {
2993 1.1 christos #define FLD(f) abuf->fields.sfmt_addcdr.f
2994 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2995 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
2996 1.1 christos int cycles = 0;
2997 1.1 christos {
2998 1.1 christos int referenced = 0;
2999 1.1 christos int UNUSED insn_referenced = abuf->written;
3000 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
3001 1.1 christos }
3002 1.1 christos {
3003 1.1 christos int referenced = 0;
3004 1.1 christos int UNUSED insn_referenced = abuf->written;
3005 1.1 christos INT in_Rd = -1;
3006 1.1 christos INT in_Rs = -1;
3007 1.1 christos INT out_Rd = -1;
3008 1.1 christos in_Rd = FLD (in_Rd);
3009 1.1 christos referenced |= 1 << 0;
3010 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3011 1.1 christos }
3012 1.1 christos return cycles;
3013 1.1 christos #undef FLD
3014 1.1 christos }
3015 1.1 christos
3016 1.1 christos static int
3017 1.1 christos model_crisv32_lapc_d (SIM_CPU *current_cpu, void *sem_arg)
3018 1.1 christos {
3019 1.1 christos #define FLD(f) abuf->fields.sfmt_lapc_d.f
3020 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3021 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3022 1.1 christos int cycles = 0;
3023 1.1 christos {
3024 1.1 christos int referenced = 0;
3025 1.1 christos int UNUSED insn_referenced = abuf->written;
3026 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
3027 1.1 christos }
3028 1.1 christos {
3029 1.1 christos int referenced = 0;
3030 1.1 christos int UNUSED insn_referenced = abuf->written;
3031 1.1 christos INT in_Rd = -1;
3032 1.1 christos INT in_Rs = -1;
3033 1.1 christos INT out_Rd = -1;
3034 1.1 christos out_Rd = FLD (out_Rd);
3035 1.1 christos referenced |= 1 << 2;
3036 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3037 1.1 christos }
3038 1.1 christos return cycles;
3039 1.1 christos #undef FLD
3040 1.1 christos }
3041 1.1 christos
3042 1.1 christos static int
3043 1.1 christos model_crisv32_lapcq (SIM_CPU *current_cpu, void *sem_arg)
3044 1.1 christos {
3045 1.1 christos #define FLD(f) abuf->fields.sfmt_lapcq.f
3046 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3047 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3048 1.1 christos int cycles = 0;
3049 1.1 christos {
3050 1.1 christos int referenced = 0;
3051 1.1 christos int UNUSED insn_referenced = abuf->written;
3052 1.1 christos INT in_Rd = -1;
3053 1.1 christos INT in_Rs = -1;
3054 1.1 christos INT out_Rd = -1;
3055 1.1 christos out_Rd = FLD (out_Rd);
3056 1.1 christos referenced |= 1 << 2;
3057 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3058 1.1 christos }
3059 1.1 christos return cycles;
3060 1.1 christos #undef FLD
3061 1.1 christos }
3062 1.1 christos
3063 1.1 christos static int
3064 1.1 christos model_crisv32_addi_b_r (SIM_CPU *current_cpu, void *sem_arg)
3065 1.1 christos {
3066 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
3067 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3068 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3069 1.1 christos int cycles = 0;
3070 1.1 christos {
3071 1.1 christos int referenced = 0;
3072 1.1 christos int UNUSED insn_referenced = abuf->written;
3073 1.1 christos INT in_Rd = -1;
3074 1.1 christos INT in_Rs = -1;
3075 1.1 christos INT out_Rd = -1;
3076 1.1 christos in_Rd = FLD (in_Rd);
3077 1.1 christos in_Rs = FLD (in_Rs);
3078 1.1 christos referenced |= 1 << 0;
3079 1.1 christos referenced |= 1 << 1;
3080 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3081 1.1 christos }
3082 1.1 christos return cycles;
3083 1.1 christos #undef FLD
3084 1.1 christos }
3085 1.1 christos
3086 1.1 christos static int
3087 1.1 christos model_crisv32_addi_w_r (SIM_CPU *current_cpu, void *sem_arg)
3088 1.1 christos {
3089 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
3090 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3091 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3092 1.1 christos int cycles = 0;
3093 1.1 christos {
3094 1.1 christos int referenced = 0;
3095 1.1 christos int UNUSED insn_referenced = abuf->written;
3096 1.1 christos INT in_Rd = -1;
3097 1.1 christos INT in_Rs = -1;
3098 1.1 christos INT out_Rd = -1;
3099 1.1 christos in_Rd = FLD (in_Rd);
3100 1.1 christos in_Rs = FLD (in_Rs);
3101 1.1 christos referenced |= 1 << 0;
3102 1.1 christos referenced |= 1 << 1;
3103 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3104 1.1 christos }
3105 1.1 christos return cycles;
3106 1.1 christos #undef FLD
3107 1.1 christos }
3108 1.1 christos
3109 1.1 christos static int
3110 1.1 christos model_crisv32_addi_d_r (SIM_CPU *current_cpu, void *sem_arg)
3111 1.1 christos {
3112 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
3113 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3114 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3115 1.1 christos int cycles = 0;
3116 1.1 christos {
3117 1.1 christos int referenced = 0;
3118 1.1 christos int UNUSED insn_referenced = abuf->written;
3119 1.1 christos INT in_Rd = -1;
3120 1.1 christos INT in_Rs = -1;
3121 1.1 christos INT out_Rd = -1;
3122 1.1 christos in_Rd = FLD (in_Rd);
3123 1.1 christos in_Rs = FLD (in_Rs);
3124 1.1 christos referenced |= 1 << 0;
3125 1.1 christos referenced |= 1 << 1;
3126 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3127 1.1 christos }
3128 1.1 christos return cycles;
3129 1.1 christos #undef FLD
3130 1.1 christos }
3131 1.1 christos
3132 1.1 christos static int
3133 1.1 christos model_crisv32_neg_b_r (SIM_CPU *current_cpu, void *sem_arg)
3134 1.1 christos {
3135 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
3136 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3137 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3138 1.1 christos int cycles = 0;
3139 1.1 christos {
3140 1.1 christos int referenced = 0;
3141 1.1 christos int UNUSED insn_referenced = abuf->written;
3142 1.1 christos INT in_Rd = -1;
3143 1.1 christos INT in_Rs = -1;
3144 1.1 christos INT out_Rd = -1;
3145 1.1 christos in_Rs = FLD (in_Rs);
3146 1.1 christos referenced |= 1 << 1;
3147 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3148 1.1 christos }
3149 1.1 christos return cycles;
3150 1.1 christos #undef FLD
3151 1.1 christos }
3152 1.1 christos
3153 1.1 christos static int
3154 1.1 christos model_crisv32_neg_w_r (SIM_CPU *current_cpu, void *sem_arg)
3155 1.1 christos {
3156 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
3157 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3158 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3159 1.1 christos int cycles = 0;
3160 1.1 christos {
3161 1.1 christos int referenced = 0;
3162 1.1 christos int UNUSED insn_referenced = abuf->written;
3163 1.1 christos INT in_Rd = -1;
3164 1.1 christos INT in_Rs = -1;
3165 1.1 christos INT out_Rd = -1;
3166 1.1 christos in_Rs = FLD (in_Rs);
3167 1.1 christos referenced |= 1 << 1;
3168 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3169 1.1 christos }
3170 1.1 christos return cycles;
3171 1.1 christos #undef FLD
3172 1.1 christos }
3173 1.1 christos
3174 1.1 christos static int
3175 1.1 christos model_crisv32_neg_d_r (SIM_CPU *current_cpu, void *sem_arg)
3176 1.1 christos {
3177 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
3178 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3179 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3180 1.1 christos int cycles = 0;
3181 1.1 christos {
3182 1.1 christos int referenced = 0;
3183 1.1 christos int UNUSED insn_referenced = abuf->written;
3184 1.1 christos INT in_Rd = -1;
3185 1.1 christos INT in_Rs = -1;
3186 1.1 christos INT out_Rd = -1;
3187 1.1 christos in_Rs = FLD (in_Rs);
3188 1.1 christos referenced |= 1 << 1;
3189 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3190 1.1 christos }
3191 1.1 christos return cycles;
3192 1.1 christos #undef FLD
3193 1.1 christos }
3194 1.1 christos
3195 1.1 christos static int
3196 1.1 christos model_crisv32_test_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
3197 1.1 christos {
3198 1.1 christos #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
3199 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3200 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3201 1.1 christos int cycles = 0;
3202 1.1 christos {
3203 1.1 christos int referenced = 0;
3204 1.1 christos int UNUSED insn_referenced = abuf->written;
3205 1.1 christos INT in_Rs = -1;
3206 1.1 christos in_Rs = FLD (in_Rs);
3207 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
3208 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3209 1.1 christos }
3210 1.1 christos {
3211 1.1 christos int referenced = 0;
3212 1.1 christos int UNUSED insn_referenced = abuf->written;
3213 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3214 1.1 christos }
3215 1.1 christos {
3216 1.1 christos int referenced = 0;
3217 1.1 christos int UNUSED insn_referenced = abuf->written;
3218 1.1 christos INT in_Rd = -1;
3219 1.1 christos INT in_Rs = -1;
3220 1.1 christos INT out_Rd = -1;
3221 1.1 christos in_Rs = FLD (in_Rs);
3222 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
3223 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3224 1.1 christos }
3225 1.1 christos return cycles;
3226 1.1 christos #undef FLD
3227 1.1 christos }
3228 1.1 christos
3229 1.1 christos static int
3230 1.1 christos model_crisv32_test_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
3231 1.1 christos {
3232 1.1 christos #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
3233 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3234 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3235 1.1 christos int cycles = 0;
3236 1.1 christos {
3237 1.1 christos int referenced = 0;
3238 1.1 christos int UNUSED insn_referenced = abuf->written;
3239 1.1 christos INT in_Rs = -1;
3240 1.1 christos in_Rs = FLD (in_Rs);
3241 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
3242 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3243 1.1 christos }
3244 1.1 christos {
3245 1.1 christos int referenced = 0;
3246 1.1 christos int UNUSED insn_referenced = abuf->written;
3247 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3248 1.1 christos }
3249 1.1 christos {
3250 1.1 christos int referenced = 0;
3251 1.1 christos int UNUSED insn_referenced = abuf->written;
3252 1.1 christos INT in_Rd = -1;
3253 1.1 christos INT in_Rs = -1;
3254 1.1 christos INT out_Rd = -1;
3255 1.1 christos in_Rs = FLD (in_Rs);
3256 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
3257 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3258 1.1 christos }
3259 1.1 christos return cycles;
3260 1.1 christos #undef FLD
3261 1.1 christos }
3262 1.1 christos
3263 1.1 christos static int
3264 1.1 christos model_crisv32_test_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
3265 1.1 christos {
3266 1.1 christos #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
3267 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3268 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3269 1.1 christos int cycles = 0;
3270 1.1 christos {
3271 1.1 christos int referenced = 0;
3272 1.1 christos int UNUSED insn_referenced = abuf->written;
3273 1.1 christos INT in_Rs = -1;
3274 1.1 christos in_Rs = FLD (in_Rs);
3275 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
3276 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3277 1.1 christos }
3278 1.1 christos {
3279 1.1 christos int referenced = 0;
3280 1.1 christos int UNUSED insn_referenced = abuf->written;
3281 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3282 1.1 christos }
3283 1.1 christos {
3284 1.1 christos int referenced = 0;
3285 1.1 christos int UNUSED insn_referenced = abuf->written;
3286 1.1 christos INT in_Rd = -1;
3287 1.1 christos INT in_Rs = -1;
3288 1.1 christos INT out_Rd = -1;
3289 1.1 christos in_Rs = FLD (in_Rs);
3290 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
3291 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3292 1.1 christos }
3293 1.1 christos return cycles;
3294 1.1 christos #undef FLD
3295 1.1 christos }
3296 1.1 christos
3297 1.1 christos static int
3298 1.1 christos model_crisv32_move_r_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
3299 1.1 christos {
3300 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
3301 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3302 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3303 1.1 christos int cycles = 0;
3304 1.1 christos {
3305 1.1 christos int referenced = 0;
3306 1.1 christos int UNUSED insn_referenced = abuf->written;
3307 1.1 christos INT in_Rs = -1;
3308 1.1 christos in_Rs = FLD (in_Rs);
3309 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3310 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3311 1.1 christos }
3312 1.1 christos {
3313 1.1 christos int referenced = 0;
3314 1.1 christos int UNUSED insn_referenced = abuf->written;
3315 1.1 christos INT in_Rd = -1;
3316 1.1 christos INT in_Rs = -1;
3317 1.1 christos INT out_Rd = -1;
3318 1.1 christos in_Rd = FLD (in_Rd);
3319 1.1 christos in_Rs = FLD (in_Rs);
3320 1.1 christos referenced |= 1 << 0;
3321 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3322 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3323 1.1 christos }
3324 1.1 christos {
3325 1.1 christos int referenced = 0;
3326 1.1 christos int UNUSED insn_referenced = abuf->written;
3327 1.1 christos cycles += crisv32f_model_crisv32_u_mem_w (current_cpu, idesc, 2, referenced);
3328 1.1 christos }
3329 1.1 christos return cycles;
3330 1.1 christos #undef FLD
3331 1.1 christos }
3332 1.1 christos
3333 1.1 christos static int
3334 1.1 christos model_crisv32_move_r_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
3335 1.1 christos {
3336 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
3337 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3338 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3339 1.1 christos int cycles = 0;
3340 1.1 christos {
3341 1.1 christos int referenced = 0;
3342 1.1 christos int UNUSED insn_referenced = abuf->written;
3343 1.1 christos INT in_Rs = -1;
3344 1.1 christos in_Rs = FLD (in_Rs);
3345 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3346 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3347 1.1 christos }
3348 1.1 christos {
3349 1.1 christos int referenced = 0;
3350 1.1 christos int UNUSED insn_referenced = abuf->written;
3351 1.1 christos INT in_Rd = -1;
3352 1.1 christos INT in_Rs = -1;
3353 1.1 christos INT out_Rd = -1;
3354 1.1 christos in_Rd = FLD (in_Rd);
3355 1.1 christos in_Rs = FLD (in_Rs);
3356 1.1 christos referenced |= 1 << 0;
3357 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3358 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3359 1.1 christos }
3360 1.1 christos {
3361 1.1 christos int referenced = 0;
3362 1.1 christos int UNUSED insn_referenced = abuf->written;
3363 1.1 christos cycles += crisv32f_model_crisv32_u_mem_w (current_cpu, idesc, 2, referenced);
3364 1.1 christos }
3365 1.1 christos return cycles;
3366 1.1 christos #undef FLD
3367 1.1 christos }
3368 1.1 christos
3369 1.1 christos static int
3370 1.1 christos model_crisv32_move_r_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
3371 1.1 christos {
3372 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
3373 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3374 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3375 1.1 christos int cycles = 0;
3376 1.1 christos {
3377 1.1 christos int referenced = 0;
3378 1.1 christos int UNUSED insn_referenced = abuf->written;
3379 1.1 christos INT in_Rs = -1;
3380 1.1 christos in_Rs = FLD (in_Rs);
3381 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3382 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3383 1.1 christos }
3384 1.1 christos {
3385 1.1 christos int referenced = 0;
3386 1.1 christos int UNUSED insn_referenced = abuf->written;
3387 1.1 christos INT in_Rd = -1;
3388 1.1 christos INT in_Rs = -1;
3389 1.1 christos INT out_Rd = -1;
3390 1.1 christos in_Rd = FLD (in_Rd);
3391 1.1 christos in_Rs = FLD (in_Rs);
3392 1.1 christos referenced |= 1 << 0;
3393 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3394 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3395 1.1 christos }
3396 1.1 christos {
3397 1.1 christos int referenced = 0;
3398 1.1 christos int UNUSED insn_referenced = abuf->written;
3399 1.1 christos cycles += crisv32f_model_crisv32_u_mem_w (current_cpu, idesc, 2, referenced);
3400 1.1 christos }
3401 1.1 christos return cycles;
3402 1.1 christos #undef FLD
3403 1.1 christos }
3404 1.1 christos
3405 1.1 christos static int
3406 1.1 christos model_crisv32_muls_b (SIM_CPU *current_cpu, void *sem_arg)
3407 1.1 christos {
3408 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
3409 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3410 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3411 1.1 christos int cycles = 0;
3412 1.1 christos {
3413 1.1 christos int referenced = 0;
3414 1.1 christos int UNUSED insn_referenced = abuf->written;
3415 1.1 christos INT in_Rs = -1;
3416 1.1 christos INT in_Rd = -1;
3417 1.1 christos in_Rs = FLD (in_Rs);
3418 1.1 christos in_Rd = FLD (in_Rd);
3419 1.1 christos referenced |= 1 << 0;
3420 1.1 christos referenced |= 1 << 1;
3421 1.1 christos cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3422 1.1 christos }
3423 1.1 christos {
3424 1.1 christos int referenced = 0;
3425 1.1 christos int UNUSED insn_referenced = abuf->written;
3426 1.1 christos INT in_Rd = -1;
3427 1.1 christos INT in_Rs = -1;
3428 1.1 christos INT out_Rd = -1;
3429 1.1 christos in_Rd = FLD (in_Rd);
3430 1.1 christos in_Rs = FLD (in_Rs);
3431 1.1 christos out_Rd = FLD (out_Rd);
3432 1.1 christos referenced |= 1 << 0;
3433 1.1 christos referenced |= 1 << 1;
3434 1.1 christos referenced |= 1 << 2;
3435 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3436 1.1 christos }
3437 1.1 christos return cycles;
3438 1.1 christos #undef FLD
3439 1.1 christos }
3440 1.1 christos
3441 1.1 christos static int
3442 1.1 christos model_crisv32_muls_w (SIM_CPU *current_cpu, void *sem_arg)
3443 1.1 christos {
3444 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
3445 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3446 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3447 1.1 christos int cycles = 0;
3448 1.1 christos {
3449 1.1 christos int referenced = 0;
3450 1.1 christos int UNUSED insn_referenced = abuf->written;
3451 1.1 christos INT in_Rs = -1;
3452 1.1 christos INT in_Rd = -1;
3453 1.1 christos in_Rs = FLD (in_Rs);
3454 1.1 christos in_Rd = FLD (in_Rd);
3455 1.1 christos referenced |= 1 << 0;
3456 1.1 christos referenced |= 1 << 1;
3457 1.1 christos cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3458 1.1 christos }
3459 1.1 christos {
3460 1.1 christos int referenced = 0;
3461 1.1 christos int UNUSED insn_referenced = abuf->written;
3462 1.1 christos INT in_Rd = -1;
3463 1.1 christos INT in_Rs = -1;
3464 1.1 christos INT out_Rd = -1;
3465 1.1 christos in_Rd = FLD (in_Rd);
3466 1.1 christos in_Rs = FLD (in_Rs);
3467 1.1 christos out_Rd = FLD (out_Rd);
3468 1.1 christos referenced |= 1 << 0;
3469 1.1 christos referenced |= 1 << 1;
3470 1.1 christos referenced |= 1 << 2;
3471 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3472 1.1 christos }
3473 1.1 christos return cycles;
3474 1.1 christos #undef FLD
3475 1.1 christos }
3476 1.1 christos
3477 1.1 christos static int
3478 1.1 christos model_crisv32_muls_d (SIM_CPU *current_cpu, void *sem_arg)
3479 1.1 christos {
3480 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
3481 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3482 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3483 1.1 christos int cycles = 0;
3484 1.1 christos {
3485 1.1 christos int referenced = 0;
3486 1.1 christos int UNUSED insn_referenced = abuf->written;
3487 1.1 christos INT in_Rs = -1;
3488 1.1 christos INT in_Rd = -1;
3489 1.1 christos in_Rs = FLD (in_Rs);
3490 1.1 christos in_Rd = FLD (in_Rd);
3491 1.1 christos referenced |= 1 << 0;
3492 1.1 christos referenced |= 1 << 1;
3493 1.1 christos cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3494 1.1 christos }
3495 1.1 christos {
3496 1.1 christos int referenced = 0;
3497 1.1 christos int UNUSED insn_referenced = abuf->written;
3498 1.1 christos INT in_Rd = -1;
3499 1.1 christos INT in_Rs = -1;
3500 1.1 christos INT out_Rd = -1;
3501 1.1 christos in_Rd = FLD (in_Rd);
3502 1.1 christos in_Rs = FLD (in_Rs);
3503 1.1 christos out_Rd = FLD (out_Rd);
3504 1.1 christos referenced |= 1 << 0;
3505 1.1 christos referenced |= 1 << 1;
3506 1.1 christos referenced |= 1 << 2;
3507 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3508 1.1 christos }
3509 1.1 christos return cycles;
3510 1.1 christos #undef FLD
3511 1.1 christos }
3512 1.1 christos
3513 1.1 christos static int
3514 1.1 christos model_crisv32_mulu_b (SIM_CPU *current_cpu, void *sem_arg)
3515 1.1 christos {
3516 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
3517 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3518 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3519 1.1 christos int cycles = 0;
3520 1.1 christos {
3521 1.1 christos int referenced = 0;
3522 1.1 christos int UNUSED insn_referenced = abuf->written;
3523 1.1 christos INT in_Rs = -1;
3524 1.1 christos INT in_Rd = -1;
3525 1.1 christos in_Rs = FLD (in_Rs);
3526 1.1 christos in_Rd = FLD (in_Rd);
3527 1.1 christos referenced |= 1 << 0;
3528 1.1 christos referenced |= 1 << 1;
3529 1.1 christos cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3530 1.1 christos }
3531 1.1 christos {
3532 1.1 christos int referenced = 0;
3533 1.1 christos int UNUSED insn_referenced = abuf->written;
3534 1.1 christos INT in_Rd = -1;
3535 1.1 christos INT in_Rs = -1;
3536 1.1 christos INT out_Rd = -1;
3537 1.1 christos in_Rd = FLD (in_Rd);
3538 1.1 christos in_Rs = FLD (in_Rs);
3539 1.1 christos out_Rd = FLD (out_Rd);
3540 1.1 christos referenced |= 1 << 0;
3541 1.1 christos referenced |= 1 << 1;
3542 1.1 christos referenced |= 1 << 2;
3543 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3544 1.1 christos }
3545 1.1 christos return cycles;
3546 1.1 christos #undef FLD
3547 1.1 christos }
3548 1.1 christos
3549 1.1 christos static int
3550 1.1 christos model_crisv32_mulu_w (SIM_CPU *current_cpu, void *sem_arg)
3551 1.1 christos {
3552 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
3553 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3554 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3555 1.1 christos int cycles = 0;
3556 1.1 christos {
3557 1.1 christos int referenced = 0;
3558 1.1 christos int UNUSED insn_referenced = abuf->written;
3559 1.1 christos INT in_Rs = -1;
3560 1.1 christos INT in_Rd = -1;
3561 1.1 christos in_Rs = FLD (in_Rs);
3562 1.1 christos in_Rd = FLD (in_Rd);
3563 1.1 christos referenced |= 1 << 0;
3564 1.1 christos referenced |= 1 << 1;
3565 1.1 christos cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3566 1.1 christos }
3567 1.1 christos {
3568 1.1 christos int referenced = 0;
3569 1.1 christos int UNUSED insn_referenced = abuf->written;
3570 1.1 christos INT in_Rd = -1;
3571 1.1 christos INT in_Rs = -1;
3572 1.1 christos INT out_Rd = -1;
3573 1.1 christos in_Rd = FLD (in_Rd);
3574 1.1 christos in_Rs = FLD (in_Rs);
3575 1.1 christos out_Rd = FLD (out_Rd);
3576 1.1 christos referenced |= 1 << 0;
3577 1.1 christos referenced |= 1 << 1;
3578 1.1 christos referenced |= 1 << 2;
3579 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3580 1.1 christos }
3581 1.1 christos return cycles;
3582 1.1 christos #undef FLD
3583 1.1 christos }
3584 1.1 christos
3585 1.1 christos static int
3586 1.1 christos model_crisv32_mulu_d (SIM_CPU *current_cpu, void *sem_arg)
3587 1.1 christos {
3588 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
3589 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3590 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3591 1.1 christos int cycles = 0;
3592 1.1 christos {
3593 1.1 christos int referenced = 0;
3594 1.1 christos int UNUSED insn_referenced = abuf->written;
3595 1.1 christos INT in_Rs = -1;
3596 1.1 christos INT in_Rd = -1;
3597 1.1 christos in_Rs = FLD (in_Rs);
3598 1.1 christos in_Rd = FLD (in_Rd);
3599 1.1 christos referenced |= 1 << 0;
3600 1.1 christos referenced |= 1 << 1;
3601 1.1 christos cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3602 1.1 christos }
3603 1.1 christos {
3604 1.1 christos int referenced = 0;
3605 1.1 christos int UNUSED insn_referenced = abuf->written;
3606 1.1 christos INT in_Rd = -1;
3607 1.1 christos INT in_Rs = -1;
3608 1.1 christos INT out_Rd = -1;
3609 1.1 christos in_Rd = FLD (in_Rd);
3610 1.1 christos in_Rs = FLD (in_Rs);
3611 1.1 christos out_Rd = FLD (out_Rd);
3612 1.1 christos referenced |= 1 << 0;
3613 1.1 christos referenced |= 1 << 1;
3614 1.1 christos referenced |= 1 << 2;
3615 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3616 1.1 christos }
3617 1.1 christos return cycles;
3618 1.1 christos #undef FLD
3619 1.1 christos }
3620 1.1 christos
3621 1.1 christos static int
3622 1.1 christos model_crisv32_mcp (SIM_CPU *current_cpu, void *sem_arg)
3623 1.1 christos {
3624 1.1 christos #define FLD(f) abuf->fields.sfmt_mcp.f
3625 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3626 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3627 1.1 christos int cycles = 0;
3628 1.1 christos {
3629 1.1 christos int referenced = 0;
3630 1.1 christos int UNUSED insn_referenced = abuf->written;
3631 1.1 christos INT in_Rd = -1;
3632 1.1 christos INT in_Rs = -1;
3633 1.1 christos INT out_Rd = -1;
3634 1.1 christos in_Rs = FLD (in_Rs);
3635 1.1 christos referenced |= 1 << 1;
3636 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3637 1.1 christos }
3638 1.1 christos return cycles;
3639 1.1 christos #undef FLD
3640 1.1 christos }
3641 1.1 christos
3642 1.1 christos static int
3643 1.1 christos model_crisv32_dstep (SIM_CPU *current_cpu, void *sem_arg)
3644 1.1 christos {
3645 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
3646 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3647 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3648 1.1 christos int cycles = 0;
3649 1.1 christos {
3650 1.1 christos int referenced = 0;
3651 1.1 christos int UNUSED insn_referenced = abuf->written;
3652 1.1 christos INT in_Rd = -1;
3653 1.1 christos INT in_Rs = -1;
3654 1.1 christos INT out_Rd = -1;
3655 1.1 christos in_Rd = FLD (in_Rd);
3656 1.1 christos in_Rs = FLD (in_Rs);
3657 1.1 christos out_Rd = FLD (out_Rd);
3658 1.1 christos referenced |= 1 << 0;
3659 1.1 christos referenced |= 1 << 1;
3660 1.1 christos referenced |= 1 << 2;
3661 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3662 1.1 christos }
3663 1.1 christos return cycles;
3664 1.1 christos #undef FLD
3665 1.1 christos }
3666 1.1 christos
3667 1.1 christos static int
3668 1.1 christos model_crisv32_abs (SIM_CPU *current_cpu, void *sem_arg)
3669 1.1 christos {
3670 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
3671 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3672 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3673 1.1 christos int cycles = 0;
3674 1.1 christos {
3675 1.1 christos int referenced = 0;
3676 1.1 christos int UNUSED insn_referenced = abuf->written;
3677 1.1 christos INT in_Rd = -1;
3678 1.1 christos INT in_Rs = -1;
3679 1.1 christos INT out_Rd = -1;
3680 1.1 christos in_Rs = FLD (in_Rs);
3681 1.1 christos out_Rd = FLD (out_Rd);
3682 1.1 christos referenced |= 1 << 1;
3683 1.1 christos referenced |= 1 << 2;
3684 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3685 1.1 christos }
3686 1.1 christos return cycles;
3687 1.1 christos #undef FLD
3688 1.1 christos }
3689 1.1 christos
3690 1.1 christos static int
3691 1.1 christos model_crisv32_and_b_r (SIM_CPU *current_cpu, void *sem_arg)
3692 1.1 christos {
3693 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
3694 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3695 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3696 1.1 christos int cycles = 0;
3697 1.1 christos {
3698 1.1 christos int referenced = 0;
3699 1.1 christos int UNUSED insn_referenced = abuf->written;
3700 1.1 christos INT in_Rd = -1;
3701 1.1 christos INT in_Rs = -1;
3702 1.1 christos INT out_Rd = -1;
3703 1.1 christos in_Rd = FLD (in_Rd);
3704 1.1 christos in_Rs = FLD (in_Rs);
3705 1.1 christos referenced |= 1 << 0;
3706 1.1 christos referenced |= 1 << 1;
3707 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3708 1.1 christos }
3709 1.1 christos return cycles;
3710 1.1 christos #undef FLD
3711 1.1 christos }
3712 1.1 christos
3713 1.1 christos static int
3714 1.1 christos model_crisv32_and_w_r (SIM_CPU *current_cpu, void *sem_arg)
3715 1.1 christos {
3716 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
3717 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3718 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3719 1.1 christos int cycles = 0;
3720 1.1 christos {
3721 1.1 christos int referenced = 0;
3722 1.1 christos int UNUSED insn_referenced = abuf->written;
3723 1.1 christos INT in_Rd = -1;
3724 1.1 christos INT in_Rs = -1;
3725 1.1 christos INT out_Rd = -1;
3726 1.1 christos in_Rd = FLD (in_Rd);
3727 1.1 christos in_Rs = FLD (in_Rs);
3728 1.1 christos referenced |= 1 << 0;
3729 1.1 christos referenced |= 1 << 1;
3730 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3731 1.1 christos }
3732 1.1 christos return cycles;
3733 1.1 christos #undef FLD
3734 1.1 christos }
3735 1.1 christos
3736 1.1 christos static int
3737 1.1 christos model_crisv32_and_d_r (SIM_CPU *current_cpu, void *sem_arg)
3738 1.1 christos {
3739 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
3740 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3741 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3742 1.1 christos int cycles = 0;
3743 1.1 christos {
3744 1.1 christos int referenced = 0;
3745 1.1 christos int UNUSED insn_referenced = abuf->written;
3746 1.1 christos INT in_Rd = -1;
3747 1.1 christos INT in_Rs = -1;
3748 1.1 christos INT out_Rd = -1;
3749 1.1 christos in_Rd = FLD (in_Rd);
3750 1.1 christos in_Rs = FLD (in_Rs);
3751 1.1 christos referenced |= 1 << 0;
3752 1.1 christos referenced |= 1 << 1;
3753 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3754 1.1 christos }
3755 1.1 christos return cycles;
3756 1.1 christos #undef FLD
3757 1.1 christos }
3758 1.1 christos
3759 1.1 christos static int
3760 1.1 christos model_crisv32_and_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
3761 1.1 christos {
3762 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
3763 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3764 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3765 1.1 christos int cycles = 0;
3766 1.1 christos {
3767 1.1 christos int referenced = 0;
3768 1.1 christos int UNUSED insn_referenced = abuf->written;
3769 1.1 christos INT in_Rs = -1;
3770 1.1 christos in_Rs = FLD (in_Rs);
3771 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3772 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3773 1.1 christos }
3774 1.1 christos {
3775 1.1 christos int referenced = 0;
3776 1.1 christos int UNUSED insn_referenced = abuf->written;
3777 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3778 1.1 christos }
3779 1.1 christos {
3780 1.1 christos int referenced = 0;
3781 1.1 christos int UNUSED insn_referenced = abuf->written;
3782 1.1 christos INT in_Rd = -1;
3783 1.1 christos INT in_Rs = -1;
3784 1.1 christos INT out_Rd = -1;
3785 1.1 christos in_Rd = FLD (in_Rd);
3786 1.1 christos in_Rs = FLD (in_Rs);
3787 1.1 christos referenced |= 1 << 0;
3788 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3789 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3790 1.1 christos }
3791 1.1 christos return cycles;
3792 1.1 christos #undef FLD
3793 1.1 christos }
3794 1.1 christos
3795 1.1 christos static int
3796 1.1 christos model_crisv32_and_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
3797 1.1 christos {
3798 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
3799 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3800 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3801 1.1 christos int cycles = 0;
3802 1.1 christos {
3803 1.1 christos int referenced = 0;
3804 1.1 christos int UNUSED insn_referenced = abuf->written;
3805 1.1 christos INT in_Rs = -1;
3806 1.1 christos in_Rs = FLD (in_Rs);
3807 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3808 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3809 1.1 christos }
3810 1.1 christos {
3811 1.1 christos int referenced = 0;
3812 1.1 christos int UNUSED insn_referenced = abuf->written;
3813 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3814 1.1 christos }
3815 1.1 christos {
3816 1.1 christos int referenced = 0;
3817 1.1 christos int UNUSED insn_referenced = abuf->written;
3818 1.1 christos INT in_Rd = -1;
3819 1.1 christos INT in_Rs = -1;
3820 1.1 christos INT out_Rd = -1;
3821 1.1 christos in_Rd = FLD (in_Rd);
3822 1.1 christos in_Rs = FLD (in_Rs);
3823 1.1 christos referenced |= 1 << 0;
3824 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3825 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3826 1.1 christos }
3827 1.1 christos return cycles;
3828 1.1 christos #undef FLD
3829 1.1 christos }
3830 1.1 christos
3831 1.1 christos static int
3832 1.1 christos model_crisv32_and_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
3833 1.1 christos {
3834 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
3835 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3836 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3837 1.1 christos int cycles = 0;
3838 1.1 christos {
3839 1.1 christos int referenced = 0;
3840 1.1 christos int UNUSED insn_referenced = abuf->written;
3841 1.1 christos INT in_Rs = -1;
3842 1.1 christos in_Rs = FLD (in_Rs);
3843 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3844 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3845 1.1 christos }
3846 1.1 christos {
3847 1.1 christos int referenced = 0;
3848 1.1 christos int UNUSED insn_referenced = abuf->written;
3849 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3850 1.1 christos }
3851 1.1 christos {
3852 1.1 christos int referenced = 0;
3853 1.1 christos int UNUSED insn_referenced = abuf->written;
3854 1.1 christos INT in_Rd = -1;
3855 1.1 christos INT in_Rs = -1;
3856 1.1 christos INT out_Rd = -1;
3857 1.1 christos in_Rd = FLD (in_Rd);
3858 1.1 christos in_Rs = FLD (in_Rs);
3859 1.1 christos referenced |= 1 << 0;
3860 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3861 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3862 1.1 christos }
3863 1.1 christos return cycles;
3864 1.1 christos #undef FLD
3865 1.1 christos }
3866 1.1 christos
3867 1.1 christos static int
3868 1.1 christos model_crisv32_andcbr (SIM_CPU *current_cpu, void *sem_arg)
3869 1.1 christos {
3870 1.1 christos #define FLD(f) abuf->fields.sfmt_addcbr.f
3871 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3872 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3873 1.1 christos int cycles = 0;
3874 1.1 christos {
3875 1.1 christos int referenced = 0;
3876 1.1 christos int UNUSED insn_referenced = abuf->written;
3877 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
3878 1.1 christos }
3879 1.1 christos {
3880 1.1 christos int referenced = 0;
3881 1.1 christos int UNUSED insn_referenced = abuf->written;
3882 1.1 christos INT in_Rd = -1;
3883 1.1 christos INT in_Rs = -1;
3884 1.1 christos INT out_Rd = -1;
3885 1.1 christos in_Rd = FLD (in_Rd);
3886 1.1 christos referenced |= 1 << 0;
3887 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3888 1.1 christos }
3889 1.1 christos return cycles;
3890 1.1 christos #undef FLD
3891 1.1 christos }
3892 1.1 christos
3893 1.1 christos static int
3894 1.1 christos model_crisv32_andcwr (SIM_CPU *current_cpu, void *sem_arg)
3895 1.1 christos {
3896 1.1 christos #define FLD(f) abuf->fields.sfmt_addcwr.f
3897 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3898 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3899 1.1 christos int cycles = 0;
3900 1.1 christos {
3901 1.1 christos int referenced = 0;
3902 1.1 christos int UNUSED insn_referenced = abuf->written;
3903 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
3904 1.1 christos }
3905 1.1 christos {
3906 1.1 christos int referenced = 0;
3907 1.1 christos int UNUSED insn_referenced = abuf->written;
3908 1.1 christos INT in_Rd = -1;
3909 1.1 christos INT in_Rs = -1;
3910 1.1 christos INT out_Rd = -1;
3911 1.1 christos in_Rd = FLD (in_Rd);
3912 1.1 christos referenced |= 1 << 0;
3913 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3914 1.1 christos }
3915 1.1 christos return cycles;
3916 1.1 christos #undef FLD
3917 1.1 christos }
3918 1.1 christos
3919 1.1 christos static int
3920 1.1 christos model_crisv32_andcdr (SIM_CPU *current_cpu, void *sem_arg)
3921 1.1 christos {
3922 1.1 christos #define FLD(f) abuf->fields.sfmt_addcdr.f
3923 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3924 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3925 1.1 christos int cycles = 0;
3926 1.1 christos {
3927 1.1 christos int referenced = 0;
3928 1.1 christos int UNUSED insn_referenced = abuf->written;
3929 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
3930 1.1 christos }
3931 1.1 christos {
3932 1.1 christos int referenced = 0;
3933 1.1 christos int UNUSED insn_referenced = abuf->written;
3934 1.1 christos INT in_Rd = -1;
3935 1.1 christos INT in_Rs = -1;
3936 1.1 christos INT out_Rd = -1;
3937 1.1 christos in_Rd = FLD (in_Rd);
3938 1.1 christos referenced |= 1 << 0;
3939 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3940 1.1 christos }
3941 1.1 christos return cycles;
3942 1.1 christos #undef FLD
3943 1.1 christos }
3944 1.1 christos
3945 1.1 christos static int
3946 1.1 christos model_crisv32_andq (SIM_CPU *current_cpu, void *sem_arg)
3947 1.1 christos {
3948 1.1 christos #define FLD(f) abuf->fields.sfmt_andq.f
3949 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3950 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3951 1.1 christos int cycles = 0;
3952 1.1 christos {
3953 1.1 christos int referenced = 0;
3954 1.1 christos int UNUSED insn_referenced = abuf->written;
3955 1.1 christos INT in_Rd = -1;
3956 1.1 christos INT in_Rs = -1;
3957 1.1 christos INT out_Rd = -1;
3958 1.1 christos in_Rd = FLD (in_Rd);
3959 1.1 christos referenced |= 1 << 0;
3960 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3961 1.1 christos }
3962 1.1 christos return cycles;
3963 1.1 christos #undef FLD
3964 1.1 christos }
3965 1.1 christos
3966 1.1 christos static int
3967 1.1 christos model_crisv32_orr_b_r (SIM_CPU *current_cpu, void *sem_arg)
3968 1.1 christos {
3969 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
3970 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3971 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3972 1.1 christos int cycles = 0;
3973 1.1 christos {
3974 1.1 christos int referenced = 0;
3975 1.1 christos int UNUSED insn_referenced = abuf->written;
3976 1.1 christos INT in_Rd = -1;
3977 1.1 christos INT in_Rs = -1;
3978 1.1 christos INT out_Rd = -1;
3979 1.1 christos in_Rd = FLD (in_Rd);
3980 1.1 christos in_Rs = FLD (in_Rs);
3981 1.1 christos referenced |= 1 << 0;
3982 1.1 christos referenced |= 1 << 1;
3983 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3984 1.1 christos }
3985 1.1 christos return cycles;
3986 1.1 christos #undef FLD
3987 1.1 christos }
3988 1.1 christos
3989 1.1 christos static int
3990 1.1 christos model_crisv32_orr_w_r (SIM_CPU *current_cpu, void *sem_arg)
3991 1.1 christos {
3992 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
3993 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3994 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
3995 1.1 christos int cycles = 0;
3996 1.1 christos {
3997 1.1 christos int referenced = 0;
3998 1.1 christos int UNUSED insn_referenced = abuf->written;
3999 1.1 christos INT in_Rd = -1;
4000 1.1 christos INT in_Rs = -1;
4001 1.1 christos INT out_Rd = -1;
4002 1.1 christos in_Rd = FLD (in_Rd);
4003 1.1 christos in_Rs = FLD (in_Rs);
4004 1.1 christos referenced |= 1 << 0;
4005 1.1 christos referenced |= 1 << 1;
4006 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4007 1.1 christos }
4008 1.1 christos return cycles;
4009 1.1 christos #undef FLD
4010 1.1 christos }
4011 1.1 christos
4012 1.1 christos static int
4013 1.1 christos model_crisv32_orr_d_r (SIM_CPU *current_cpu, void *sem_arg)
4014 1.1 christos {
4015 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
4016 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4017 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4018 1.1 christos int cycles = 0;
4019 1.1 christos {
4020 1.1 christos int referenced = 0;
4021 1.1 christos int UNUSED insn_referenced = abuf->written;
4022 1.1 christos INT in_Rd = -1;
4023 1.1 christos INT in_Rs = -1;
4024 1.1 christos INT out_Rd = -1;
4025 1.1 christos in_Rd = FLD (in_Rd);
4026 1.1 christos in_Rs = FLD (in_Rs);
4027 1.1 christos referenced |= 1 << 0;
4028 1.1 christos referenced |= 1 << 1;
4029 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4030 1.1 christos }
4031 1.1 christos return cycles;
4032 1.1 christos #undef FLD
4033 1.1 christos }
4034 1.1 christos
4035 1.1 christos static int
4036 1.1 christos model_crisv32_or_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
4037 1.1 christos {
4038 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
4039 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4040 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4041 1.1 christos int cycles = 0;
4042 1.1 christos {
4043 1.1 christos int referenced = 0;
4044 1.1 christos int UNUSED insn_referenced = abuf->written;
4045 1.1 christos INT in_Rs = -1;
4046 1.1 christos in_Rs = FLD (in_Rs);
4047 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
4048 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
4049 1.1 christos }
4050 1.1 christos {
4051 1.1 christos int referenced = 0;
4052 1.1 christos int UNUSED insn_referenced = abuf->written;
4053 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
4054 1.1 christos }
4055 1.1 christos {
4056 1.1 christos int referenced = 0;
4057 1.1 christos int UNUSED insn_referenced = abuf->written;
4058 1.1 christos INT in_Rd = -1;
4059 1.1 christos INT in_Rs = -1;
4060 1.1 christos INT out_Rd = -1;
4061 1.1 christos in_Rd = FLD (in_Rd);
4062 1.1 christos in_Rs = FLD (in_Rs);
4063 1.1 christos referenced |= 1 << 0;
4064 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
4065 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4066 1.1 christos }
4067 1.1 christos return cycles;
4068 1.1 christos #undef FLD
4069 1.1 christos }
4070 1.1 christos
4071 1.1 christos static int
4072 1.1 christos model_crisv32_or_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
4073 1.1 christos {
4074 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
4075 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4076 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4077 1.1 christos int cycles = 0;
4078 1.1 christos {
4079 1.1 christos int referenced = 0;
4080 1.1 christos int UNUSED insn_referenced = abuf->written;
4081 1.1 christos INT in_Rs = -1;
4082 1.1 christos in_Rs = FLD (in_Rs);
4083 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
4084 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
4085 1.1 christos }
4086 1.1 christos {
4087 1.1 christos int referenced = 0;
4088 1.1 christos int UNUSED insn_referenced = abuf->written;
4089 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
4090 1.1 christos }
4091 1.1 christos {
4092 1.1 christos int referenced = 0;
4093 1.1 christos int UNUSED insn_referenced = abuf->written;
4094 1.1 christos INT in_Rd = -1;
4095 1.1 christos INT in_Rs = -1;
4096 1.1 christos INT out_Rd = -1;
4097 1.1 christos in_Rd = FLD (in_Rd);
4098 1.1 christos in_Rs = FLD (in_Rs);
4099 1.1 christos referenced |= 1 << 0;
4100 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
4101 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4102 1.1 christos }
4103 1.1 christos return cycles;
4104 1.1 christos #undef FLD
4105 1.1 christos }
4106 1.1 christos
4107 1.1 christos static int
4108 1.1 christos model_crisv32_or_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
4109 1.1 christos {
4110 1.1 christos #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
4111 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4112 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4113 1.1 christos int cycles = 0;
4114 1.1 christos {
4115 1.1 christos int referenced = 0;
4116 1.1 christos int UNUSED insn_referenced = abuf->written;
4117 1.1 christos INT in_Rs = -1;
4118 1.1 christos in_Rs = FLD (in_Rs);
4119 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
4120 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
4121 1.1 christos }
4122 1.1 christos {
4123 1.1 christos int referenced = 0;
4124 1.1 christos int UNUSED insn_referenced = abuf->written;
4125 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
4126 1.1 christos }
4127 1.1 christos {
4128 1.1 christos int referenced = 0;
4129 1.1 christos int UNUSED insn_referenced = abuf->written;
4130 1.1 christos INT in_Rd = -1;
4131 1.1 christos INT in_Rs = -1;
4132 1.1 christos INT out_Rd = -1;
4133 1.1 christos in_Rd = FLD (in_Rd);
4134 1.1 christos in_Rs = FLD (in_Rs);
4135 1.1 christos referenced |= 1 << 0;
4136 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
4137 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4138 1.1 christos }
4139 1.1 christos return cycles;
4140 1.1 christos #undef FLD
4141 1.1 christos }
4142 1.1 christos
4143 1.1 christos static int
4144 1.1 christos model_crisv32_orcbr (SIM_CPU *current_cpu, void *sem_arg)
4145 1.1 christos {
4146 1.1 christos #define FLD(f) abuf->fields.sfmt_addcbr.f
4147 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4148 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4149 1.1 christos int cycles = 0;
4150 1.1 christos {
4151 1.1 christos int referenced = 0;
4152 1.1 christos int UNUSED insn_referenced = abuf->written;
4153 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
4154 1.1 christos }
4155 1.1 christos {
4156 1.1 christos int referenced = 0;
4157 1.1 christos int UNUSED insn_referenced = abuf->written;
4158 1.1 christos INT in_Rd = -1;
4159 1.1 christos INT in_Rs = -1;
4160 1.1 christos INT out_Rd = -1;
4161 1.1 christos in_Rd = FLD (in_Rd);
4162 1.1 christos referenced |= 1 << 0;
4163 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4164 1.1 christos }
4165 1.1 christos return cycles;
4166 1.1 christos #undef FLD
4167 1.1 christos }
4168 1.1 christos
4169 1.1 christos static int
4170 1.1 christos model_crisv32_orcwr (SIM_CPU *current_cpu, void *sem_arg)
4171 1.1 christos {
4172 1.1 christos #define FLD(f) abuf->fields.sfmt_addcwr.f
4173 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4174 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4175 1.1 christos int cycles = 0;
4176 1.1 christos {
4177 1.1 christos int referenced = 0;
4178 1.1 christos int UNUSED insn_referenced = abuf->written;
4179 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
4180 1.1 christos }
4181 1.1 christos {
4182 1.1 christos int referenced = 0;
4183 1.1 christos int UNUSED insn_referenced = abuf->written;
4184 1.1 christos INT in_Rd = -1;
4185 1.1 christos INT in_Rs = -1;
4186 1.1 christos INT out_Rd = -1;
4187 1.1 christos in_Rd = FLD (in_Rd);
4188 1.1 christos referenced |= 1 << 0;
4189 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4190 1.1 christos }
4191 1.1 christos return cycles;
4192 1.1 christos #undef FLD
4193 1.1 christos }
4194 1.1 christos
4195 1.1 christos static int
4196 1.1 christos model_crisv32_orcdr (SIM_CPU *current_cpu, void *sem_arg)
4197 1.1 christos {
4198 1.1 christos #define FLD(f) abuf->fields.sfmt_addcdr.f
4199 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4200 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4201 1.1 christos int cycles = 0;
4202 1.1 christos {
4203 1.1 christos int referenced = 0;
4204 1.1 christos int UNUSED insn_referenced = abuf->written;
4205 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
4206 1.1 christos }
4207 1.1 christos {
4208 1.1 christos int referenced = 0;
4209 1.1 christos int UNUSED insn_referenced = abuf->written;
4210 1.1 christos INT in_Rd = -1;
4211 1.1 christos INT in_Rs = -1;
4212 1.1 christos INT out_Rd = -1;
4213 1.1 christos in_Rd = FLD (in_Rd);
4214 1.1 christos referenced |= 1 << 0;
4215 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4216 1.1 christos }
4217 1.1 christos return cycles;
4218 1.1 christos #undef FLD
4219 1.1 christos }
4220 1.1 christos
4221 1.1 christos static int
4222 1.1 christos model_crisv32_orq (SIM_CPU *current_cpu, void *sem_arg)
4223 1.1 christos {
4224 1.1 christos #define FLD(f) abuf->fields.sfmt_andq.f
4225 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4226 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4227 1.1 christos int cycles = 0;
4228 1.1 christos {
4229 1.1 christos int referenced = 0;
4230 1.1 christos int UNUSED insn_referenced = abuf->written;
4231 1.1 christos INT in_Rd = -1;
4232 1.1 christos INT in_Rs = -1;
4233 1.1 christos INT out_Rd = -1;
4234 1.1 christos in_Rd = FLD (in_Rd);
4235 1.1 christos referenced |= 1 << 0;
4236 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4237 1.1 christos }
4238 1.1 christos return cycles;
4239 1.1 christos #undef FLD
4240 1.1 christos }
4241 1.1 christos
4242 1.1 christos static int
4243 1.1 christos model_crisv32_xor (SIM_CPU *current_cpu, void *sem_arg)
4244 1.1 christos {
4245 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
4246 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4247 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4248 1.1 christos int cycles = 0;
4249 1.1 christos {
4250 1.1 christos int referenced = 0;
4251 1.1 christos int UNUSED insn_referenced = abuf->written;
4252 1.1 christos INT in_Rd = -1;
4253 1.1 christos INT in_Rs = -1;
4254 1.1 christos INT out_Rd = -1;
4255 1.1 christos in_Rd = FLD (in_Rd);
4256 1.1 christos in_Rs = FLD (in_Rs);
4257 1.1 christos out_Rd = FLD (out_Rd);
4258 1.1 christos referenced |= 1 << 0;
4259 1.1 christos referenced |= 1 << 1;
4260 1.1 christos referenced |= 1 << 2;
4261 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4262 1.1 christos }
4263 1.1 christos return cycles;
4264 1.1 christos #undef FLD
4265 1.1 christos }
4266 1.1 christos
4267 1.1 christos static int
4268 1.1 christos model_crisv32_swap (SIM_CPU *current_cpu, void *sem_arg)
4269 1.1 christos {
4270 1.1 christos #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
4271 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4272 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4273 1.1 christos int cycles = 0;
4274 1.1 christos {
4275 1.1 christos int referenced = 0;
4276 1.1 christos int UNUSED insn_referenced = abuf->written;
4277 1.1 christos INT in_Rd = -1;
4278 1.1 christos INT in_Rs = -1;
4279 1.1 christos INT out_Rd = -1;
4280 1.1 christos in_Rs = FLD (in_Rs);
4281 1.1 christos referenced |= 1 << 1;
4282 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4283 1.1 christos }
4284 1.1 christos return cycles;
4285 1.1 christos #undef FLD
4286 1.1 christos }
4287 1.1 christos
4288 1.1 christos static int
4289 1.1 christos model_crisv32_asrr_b_r (SIM_CPU *current_cpu, void *sem_arg)
4290 1.1 christos {
4291 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
4292 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4293 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4294 1.1 christos int cycles = 0;
4295 1.1 christos {
4296 1.1 christos int referenced = 0;
4297 1.1 christos int UNUSED insn_referenced = abuf->written;
4298 1.1 christos INT in_Rd = -1;
4299 1.1 christos INT in_Rs = -1;
4300 1.1 christos INT out_Rd = -1;
4301 1.1 christos in_Rd = FLD (in_Rd);
4302 1.1 christos in_Rs = FLD (in_Rs);
4303 1.1 christos referenced |= 1 << 0;
4304 1.1 christos referenced |= 1 << 1;
4305 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4306 1.1 christos }
4307 1.1 christos return cycles;
4308 1.1 christos #undef FLD
4309 1.1 christos }
4310 1.1 christos
4311 1.1 christos static int
4312 1.1 christos model_crisv32_asrr_w_r (SIM_CPU *current_cpu, void *sem_arg)
4313 1.1 christos {
4314 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
4315 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4316 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4317 1.1 christos int cycles = 0;
4318 1.1 christos {
4319 1.1 christos int referenced = 0;
4320 1.1 christos int UNUSED insn_referenced = abuf->written;
4321 1.1 christos INT in_Rd = -1;
4322 1.1 christos INT in_Rs = -1;
4323 1.1 christos INT out_Rd = -1;
4324 1.1 christos in_Rd = FLD (in_Rd);
4325 1.1 christos in_Rs = FLD (in_Rs);
4326 1.1 christos referenced |= 1 << 0;
4327 1.1 christos referenced |= 1 << 1;
4328 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4329 1.1 christos }
4330 1.1 christos return cycles;
4331 1.1 christos #undef FLD
4332 1.1 christos }
4333 1.1 christos
4334 1.1 christos static int
4335 1.1 christos model_crisv32_asrr_d_r (SIM_CPU *current_cpu, void *sem_arg)
4336 1.1 christos {
4337 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
4338 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4339 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4340 1.1 christos int cycles = 0;
4341 1.1 christos {
4342 1.1 christos int referenced = 0;
4343 1.1 christos int UNUSED insn_referenced = abuf->written;
4344 1.1 christos INT in_Rd = -1;
4345 1.1 christos INT in_Rs = -1;
4346 1.1 christos INT out_Rd = -1;
4347 1.1 christos in_Rd = FLD (in_Rd);
4348 1.1 christos in_Rs = FLD (in_Rs);
4349 1.1 christos referenced |= 1 << 0;
4350 1.1 christos referenced |= 1 << 1;
4351 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4352 1.1 christos }
4353 1.1 christos return cycles;
4354 1.1 christos #undef FLD
4355 1.1 christos }
4356 1.1 christos
4357 1.1 christos static int
4358 1.1 christos model_crisv32_asrq (SIM_CPU *current_cpu, void *sem_arg)
4359 1.1 christos {
4360 1.1 christos #define FLD(f) abuf->fields.sfmt_asrq.f
4361 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4362 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4363 1.1 christos int cycles = 0;
4364 1.1 christos {
4365 1.1 christos int referenced = 0;
4366 1.1 christos int UNUSED insn_referenced = abuf->written;
4367 1.1 christos INT in_Rd = -1;
4368 1.1 christos INT in_Rs = -1;
4369 1.1 christos INT out_Rd = -1;
4370 1.1 christos in_Rd = FLD (in_Rd);
4371 1.1 christos out_Rd = FLD (out_Rd);
4372 1.1 christos referenced |= 1 << 0;
4373 1.1 christos referenced |= 1 << 2;
4374 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4375 1.1 christos }
4376 1.1 christos return cycles;
4377 1.1 christos #undef FLD
4378 1.1 christos }
4379 1.1 christos
4380 1.1 christos static int
4381 1.1 christos model_crisv32_lsrr_b_r (SIM_CPU *current_cpu, void *sem_arg)
4382 1.1 christos {
4383 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
4384 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4385 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4386 1.1 christos int cycles = 0;
4387 1.1 christos {
4388 1.1 christos int referenced = 0;
4389 1.1 christos int UNUSED insn_referenced = abuf->written;
4390 1.1 christos INT in_Rd = -1;
4391 1.1 christos INT in_Rs = -1;
4392 1.1 christos INT out_Rd = -1;
4393 1.1 christos in_Rd = FLD (in_Rd);
4394 1.1 christos in_Rs = FLD (in_Rs);
4395 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4396 1.1 christos referenced |= 1 << 1;
4397 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4398 1.1 christos }
4399 1.1 christos return cycles;
4400 1.1 christos #undef FLD
4401 1.1 christos }
4402 1.1 christos
4403 1.1 christos static int
4404 1.1 christos model_crisv32_lsrr_w_r (SIM_CPU *current_cpu, void *sem_arg)
4405 1.1 christos {
4406 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
4407 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4408 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4409 1.1 christos int cycles = 0;
4410 1.1 christos {
4411 1.1 christos int referenced = 0;
4412 1.1 christos int UNUSED insn_referenced = abuf->written;
4413 1.1 christos INT in_Rd = -1;
4414 1.1 christos INT in_Rs = -1;
4415 1.1 christos INT out_Rd = -1;
4416 1.1 christos in_Rd = FLD (in_Rd);
4417 1.1 christos in_Rs = FLD (in_Rs);
4418 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4419 1.1 christos referenced |= 1 << 1;
4420 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4421 1.1 christos }
4422 1.1 christos return cycles;
4423 1.1 christos #undef FLD
4424 1.1 christos }
4425 1.1 christos
4426 1.1 christos static int
4427 1.1 christos model_crisv32_lsrr_d_r (SIM_CPU *current_cpu, void *sem_arg)
4428 1.1 christos {
4429 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
4430 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4431 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4432 1.1 christos int cycles = 0;
4433 1.1 christos {
4434 1.1 christos int referenced = 0;
4435 1.1 christos int UNUSED insn_referenced = abuf->written;
4436 1.1 christos INT in_Rd = -1;
4437 1.1 christos INT in_Rs = -1;
4438 1.1 christos INT out_Rd = -1;
4439 1.1 christos in_Rd = FLD (in_Rd);
4440 1.1 christos in_Rs = FLD (in_Rs);
4441 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4442 1.1 christos referenced |= 1 << 1;
4443 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4444 1.1 christos }
4445 1.1 christos return cycles;
4446 1.1 christos #undef FLD
4447 1.1 christos }
4448 1.1 christos
4449 1.1 christos static int
4450 1.1 christos model_crisv32_lsrq (SIM_CPU *current_cpu, void *sem_arg)
4451 1.1 christos {
4452 1.1 christos #define FLD(f) abuf->fields.sfmt_asrq.f
4453 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4454 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4455 1.1 christos int cycles = 0;
4456 1.1 christos {
4457 1.1 christos int referenced = 0;
4458 1.1 christos int UNUSED insn_referenced = abuf->written;
4459 1.1 christos INT in_Rd = -1;
4460 1.1 christos INT in_Rs = -1;
4461 1.1 christos INT out_Rd = -1;
4462 1.1 christos in_Rd = FLD (in_Rd);
4463 1.1 christos out_Rd = FLD (out_Rd);
4464 1.1 christos referenced |= 1 << 0;
4465 1.1 christos referenced |= 1 << 2;
4466 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4467 1.1 christos }
4468 1.1 christos return cycles;
4469 1.1 christos #undef FLD
4470 1.1 christos }
4471 1.1 christos
4472 1.1 christos static int
4473 1.1 christos model_crisv32_lslr_b_r (SIM_CPU *current_cpu, void *sem_arg)
4474 1.1 christos {
4475 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
4476 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4477 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4478 1.1 christos int cycles = 0;
4479 1.1 christos {
4480 1.1 christos int referenced = 0;
4481 1.1 christos int UNUSED insn_referenced = abuf->written;
4482 1.1 christos INT in_Rd = -1;
4483 1.1 christos INT in_Rs = -1;
4484 1.1 christos INT out_Rd = -1;
4485 1.1 christos in_Rd = FLD (in_Rd);
4486 1.1 christos in_Rs = FLD (in_Rs);
4487 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4488 1.1 christos referenced |= 1 << 1;
4489 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4490 1.1 christos }
4491 1.1 christos return cycles;
4492 1.1 christos #undef FLD
4493 1.1 christos }
4494 1.1 christos
4495 1.1 christos static int
4496 1.1 christos model_crisv32_lslr_w_r (SIM_CPU *current_cpu, void *sem_arg)
4497 1.1 christos {
4498 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
4499 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4500 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4501 1.1 christos int cycles = 0;
4502 1.1 christos {
4503 1.1 christos int referenced = 0;
4504 1.1 christos int UNUSED insn_referenced = abuf->written;
4505 1.1 christos INT in_Rd = -1;
4506 1.1 christos INT in_Rs = -1;
4507 1.1 christos INT out_Rd = -1;
4508 1.1 christos in_Rd = FLD (in_Rd);
4509 1.1 christos in_Rs = FLD (in_Rs);
4510 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4511 1.1 christos referenced |= 1 << 1;
4512 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4513 1.1 christos }
4514 1.1 christos return cycles;
4515 1.1 christos #undef FLD
4516 1.1 christos }
4517 1.1 christos
4518 1.1 christos static int
4519 1.1 christos model_crisv32_lslr_d_r (SIM_CPU *current_cpu, void *sem_arg)
4520 1.1 christos {
4521 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
4522 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4523 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4524 1.1 christos int cycles = 0;
4525 1.1 christos {
4526 1.1 christos int referenced = 0;
4527 1.1 christos int UNUSED insn_referenced = abuf->written;
4528 1.1 christos INT in_Rd = -1;
4529 1.1 christos INT in_Rs = -1;
4530 1.1 christos INT out_Rd = -1;
4531 1.1 christos in_Rd = FLD (in_Rd);
4532 1.1 christos in_Rs = FLD (in_Rs);
4533 1.1 christos if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4534 1.1 christos referenced |= 1 << 1;
4535 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4536 1.1 christos }
4537 1.1 christos return cycles;
4538 1.1 christos #undef FLD
4539 1.1 christos }
4540 1.1 christos
4541 1.1 christos static int
4542 1.1 christos model_crisv32_lslq (SIM_CPU *current_cpu, void *sem_arg)
4543 1.1 christos {
4544 1.1 christos #define FLD(f) abuf->fields.sfmt_asrq.f
4545 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4546 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4547 1.1 christos int cycles = 0;
4548 1.1 christos {
4549 1.1 christos int referenced = 0;
4550 1.1 christos int UNUSED insn_referenced = abuf->written;
4551 1.1 christos INT in_Rd = -1;
4552 1.1 christos INT in_Rs = -1;
4553 1.1 christos INT out_Rd = -1;
4554 1.1 christos in_Rd = FLD (in_Rd);
4555 1.1 christos out_Rd = FLD (out_Rd);
4556 1.1 christos referenced |= 1 << 0;
4557 1.1 christos referenced |= 1 << 2;
4558 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4559 1.1 christos }
4560 1.1 christos return cycles;
4561 1.1 christos #undef FLD
4562 1.1 christos }
4563 1.1 christos
4564 1.1 christos static int
4565 1.1 christos model_crisv32_btst (SIM_CPU *current_cpu, void *sem_arg)
4566 1.1 christos {
4567 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
4568 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4569 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4570 1.1 christos int cycles = 0;
4571 1.1 christos {
4572 1.1 christos int referenced = 0;
4573 1.1 christos int UNUSED insn_referenced = abuf->written;
4574 1.1 christos INT in_Rd = -1;
4575 1.1 christos INT in_Rs = -1;
4576 1.1 christos INT out_Rd = -1;
4577 1.1 christos in_Rd = FLD (in_Rd);
4578 1.1 christos in_Rs = FLD (in_Rs);
4579 1.1 christos referenced |= 1 << 0;
4580 1.1 christos referenced |= 1 << 1;
4581 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4582 1.1 christos }
4583 1.1 christos return cycles;
4584 1.1 christos #undef FLD
4585 1.1 christos }
4586 1.1 christos
4587 1.1 christos static int
4588 1.1 christos model_crisv32_btstq (SIM_CPU *current_cpu, void *sem_arg)
4589 1.1 christos {
4590 1.1 christos #define FLD(f) abuf->fields.sfmt_asrq.f
4591 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4592 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4593 1.1 christos int cycles = 0;
4594 1.1 christos {
4595 1.1 christos int referenced = 0;
4596 1.1 christos int UNUSED insn_referenced = abuf->written;
4597 1.1 christos INT in_Rd = -1;
4598 1.1 christos INT in_Rs = -1;
4599 1.1 christos INT out_Rd = -1;
4600 1.1 christos in_Rd = FLD (in_Rd);
4601 1.1 christos referenced |= 1 << 0;
4602 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4603 1.1 christos }
4604 1.1 christos return cycles;
4605 1.1 christos #undef FLD
4606 1.1 christos }
4607 1.1 christos
4608 1.1 christos static int
4609 1.1 christos model_crisv32_setf (SIM_CPU *current_cpu, void *sem_arg)
4610 1.1 christos {
4611 1.1 christos #define FLD(f) abuf->fields.sfmt_setf.f
4612 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4613 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4614 1.1 christos int cycles = 0;
4615 1.1 christos {
4616 1.1 christos int referenced = 0;
4617 1.1 christos int UNUSED insn_referenced = abuf->written;
4618 1.1 christos INT in_Rd = -1;
4619 1.1 christos INT in_Rs = -1;
4620 1.1 christos INT out_Rd = -1;
4621 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4622 1.1 christos }
4623 1.1 christos return cycles;
4624 1.1 christos #undef FLD
4625 1.1 christos }
4626 1.1 christos
4627 1.1 christos static int
4628 1.1 christos model_crisv32_clearf (SIM_CPU *current_cpu, void *sem_arg)
4629 1.1 christos {
4630 1.1 christos #define FLD(f) abuf->fields.sfmt_setf.f
4631 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4632 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4633 1.1 christos int cycles = 0;
4634 1.1 christos {
4635 1.1 christos int referenced = 0;
4636 1.1 christos int UNUSED insn_referenced = abuf->written;
4637 1.1 christos INT in_Rd = -1;
4638 1.1 christos INT in_Rs = -1;
4639 1.1 christos INT out_Rd = -1;
4640 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4641 1.1 christos }
4642 1.1 christos return cycles;
4643 1.1 christos #undef FLD
4644 1.1 christos }
4645 1.1 christos
4646 1.1 christos static int
4647 1.1 christos model_crisv32_rfe (SIM_CPU *current_cpu, void *sem_arg)
4648 1.1 christos {
4649 1.1 christos #define FLD(f) abuf->fields.sfmt_rfe.f
4650 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4651 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4652 1.1 christos int cycles = 0;
4653 1.1 christos {
4654 1.1 christos int referenced = 0;
4655 1.1 christos int UNUSED insn_referenced = abuf->written;
4656 1.1 christos INT in_Rd = -1;
4657 1.1 christos INT in_Rs = -1;
4658 1.1 christos INT out_Rd = -1;
4659 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4660 1.1 christos }
4661 1.1 christos return cycles;
4662 1.1 christos #undef FLD
4663 1.1 christos }
4664 1.1 christos
4665 1.1 christos static int
4666 1.1 christos model_crisv32_sfe (SIM_CPU *current_cpu, void *sem_arg)
4667 1.1 christos {
4668 1.1 christos #define FLD(f) abuf->fields.sfmt_rfe.f
4669 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4670 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4671 1.1 christos int cycles = 0;
4672 1.1 christos {
4673 1.1 christos int referenced = 0;
4674 1.1 christos int UNUSED insn_referenced = abuf->written;
4675 1.1 christos INT in_Rd = -1;
4676 1.1 christos INT in_Rs = -1;
4677 1.1 christos INT out_Rd = -1;
4678 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4679 1.1 christos }
4680 1.1 christos return cycles;
4681 1.1 christos #undef FLD
4682 1.1 christos }
4683 1.1 christos
4684 1.1 christos static int
4685 1.1 christos model_crisv32_rfg (SIM_CPU *current_cpu, void *sem_arg)
4686 1.1 christos {
4687 1.1 christos #define FLD(f) abuf->fields.sfmt_empty.f
4688 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4689 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4690 1.1 christos int cycles = 0;
4691 1.1 christos {
4692 1.1 christos int referenced = 0;
4693 1.1 christos int UNUSED insn_referenced = abuf->written;
4694 1.1 christos INT in_Rd = -1;
4695 1.1 christos INT in_Rs = -1;
4696 1.1 christos INT out_Rd = -1;
4697 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4698 1.1 christos }
4699 1.1 christos return cycles;
4700 1.1 christos #undef FLD
4701 1.1 christos }
4702 1.1 christos
4703 1.1 christos static int
4704 1.1 christos model_crisv32_rfn (SIM_CPU *current_cpu, void *sem_arg)
4705 1.1 christos {
4706 1.1 christos #define FLD(f) abuf->fields.sfmt_rfe.f
4707 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4708 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4709 1.1 christos int cycles = 0;
4710 1.1 christos {
4711 1.1 christos int referenced = 0;
4712 1.1 christos int UNUSED insn_referenced = abuf->written;
4713 1.1 christos INT in_Rd = -1;
4714 1.1 christos INT in_Rs = -1;
4715 1.1 christos INT out_Rd = -1;
4716 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4717 1.1 christos }
4718 1.1 christos return cycles;
4719 1.1 christos #undef FLD
4720 1.1 christos }
4721 1.1 christos
4722 1.1 christos static int
4723 1.1 christos model_crisv32_halt (SIM_CPU *current_cpu, void *sem_arg)
4724 1.1 christos {
4725 1.1 christos #define FLD(f) abuf->fields.sfmt_empty.f
4726 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4727 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4728 1.1 christos int cycles = 0;
4729 1.1 christos {
4730 1.1 christos int referenced = 0;
4731 1.1 christos int UNUSED insn_referenced = abuf->written;
4732 1.1 christos INT in_Rd = -1;
4733 1.1 christos INT in_Rs = -1;
4734 1.1 christos INT out_Rd = -1;
4735 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4736 1.1 christos }
4737 1.1 christos return cycles;
4738 1.1 christos #undef FLD
4739 1.1 christos }
4740 1.1 christos
4741 1.1 christos static int
4742 1.1 christos model_crisv32_bcc_b (SIM_CPU *current_cpu, void *sem_arg)
4743 1.1 christos {
4744 1.1 christos #define FLD(f) abuf->fields.sfmt_bcc_b.f
4745 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4746 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4747 1.1 christos int cycles = 0;
4748 1.1 christos {
4749 1.1 christos int referenced = 0;
4750 1.1 christos int UNUSED insn_referenced = abuf->written;
4751 1.1 christos cycles += crisv32f_model_crisv32_u_branch (current_cpu, idesc, 0, referenced);
4752 1.1 christos }
4753 1.1 christos {
4754 1.1 christos int referenced = 0;
4755 1.1 christos int UNUSED insn_referenced = abuf->written;
4756 1.1 christos INT in_Rd = -1;
4757 1.1 christos INT in_Rs = -1;
4758 1.1 christos INT out_Rd = -1;
4759 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4760 1.1 christos }
4761 1.1 christos return cycles;
4762 1.1 christos #undef FLD
4763 1.1 christos }
4764 1.1 christos
4765 1.1 christos static int
4766 1.1 christos model_crisv32_ba_b (SIM_CPU *current_cpu, void *sem_arg)
4767 1.1 christos {
4768 1.1 christos #define FLD(f) abuf->fields.sfmt_bcc_b.f
4769 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4770 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4771 1.1 christos int cycles = 0;
4772 1.1 christos {
4773 1.1 christos int referenced = 0;
4774 1.1 christos int UNUSED insn_referenced = abuf->written;
4775 1.1 christos INT out_Pd = -1;
4776 1.1 christos cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 0, referenced, out_Pd);
4777 1.1 christos }
4778 1.1 christos {
4779 1.1 christos int referenced = 0;
4780 1.1 christos int UNUSED insn_referenced = abuf->written;
4781 1.1 christos INT in_Rd = -1;
4782 1.1 christos INT in_Rs = -1;
4783 1.1 christos INT out_Rd = -1;
4784 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4785 1.1 christos }
4786 1.1 christos return cycles;
4787 1.1 christos #undef FLD
4788 1.1 christos }
4789 1.1 christos
4790 1.1 christos static int
4791 1.1 christos model_crisv32_bcc_w (SIM_CPU *current_cpu, void *sem_arg)
4792 1.1 christos {
4793 1.1 christos #define FLD(f) abuf->fields.sfmt_bcc_w.f
4794 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4795 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4796 1.1 christos int cycles = 0;
4797 1.1 christos {
4798 1.1 christos int referenced = 0;
4799 1.1 christos int UNUSED insn_referenced = abuf->written;
4800 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
4801 1.1 christos }
4802 1.1 christos {
4803 1.1 christos int referenced = 0;
4804 1.1 christos int UNUSED insn_referenced = abuf->written;
4805 1.1 christos cycles += crisv32f_model_crisv32_u_branch (current_cpu, idesc, 1, referenced);
4806 1.1 christos }
4807 1.1 christos {
4808 1.1 christos int referenced = 0;
4809 1.1 christos int UNUSED insn_referenced = abuf->written;
4810 1.1 christos INT in_Rd = -1;
4811 1.1 christos INT in_Rs = -1;
4812 1.1 christos INT out_Rd = -1;
4813 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4814 1.1 christos }
4815 1.1 christos return cycles;
4816 1.1 christos #undef FLD
4817 1.1 christos }
4818 1.1 christos
4819 1.1 christos static int
4820 1.1 christos model_crisv32_ba_w (SIM_CPU *current_cpu, void *sem_arg)
4821 1.1 christos {
4822 1.1 christos #define FLD(f) abuf->fields.sfmt_bcc_w.f
4823 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4824 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4825 1.1 christos int cycles = 0;
4826 1.1 christos {
4827 1.1 christos int referenced = 0;
4828 1.1 christos int UNUSED insn_referenced = abuf->written;
4829 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
4830 1.1 christos }
4831 1.1 christos {
4832 1.1 christos int referenced = 0;
4833 1.1 christos int UNUSED insn_referenced = abuf->written;
4834 1.1 christos INT out_Pd = -1;
4835 1.1 christos cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 1, referenced, out_Pd);
4836 1.1 christos }
4837 1.1 christos {
4838 1.1 christos int referenced = 0;
4839 1.1 christos int UNUSED insn_referenced = abuf->written;
4840 1.1 christos INT in_Rd = -1;
4841 1.1 christos INT in_Rs = -1;
4842 1.1 christos INT out_Rd = -1;
4843 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4844 1.1 christos }
4845 1.1 christos return cycles;
4846 1.1 christos #undef FLD
4847 1.1 christos }
4848 1.1 christos
4849 1.1 christos static int
4850 1.1 christos model_crisv32_jas_r (SIM_CPU *current_cpu, void *sem_arg)
4851 1.1 christos {
4852 1.1 christos #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
4853 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4854 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4855 1.1 christos int cycles = 0;
4856 1.1 christos {
4857 1.1 christos int referenced = 0;
4858 1.1 christos int UNUSED insn_referenced = abuf->written;
4859 1.1 christos INT in_Rs = -1;
4860 1.1 christos in_Rs = FLD (in_Rs);
4861 1.1 christos referenced |= 1 << 0;
4862 1.1 christos cycles += crisv32f_model_crisv32_u_jump_r (current_cpu, idesc, 0, referenced, in_Rs);
4863 1.1 christos }
4864 1.1 christos {
4865 1.1 christos int referenced = 0;
4866 1.1 christos int UNUSED insn_referenced = abuf->written;
4867 1.1 christos INT out_Pd = -1;
4868 1.1 christos out_Pd = FLD (out_Pd);
4869 1.1 christos referenced |= 1 << 0;
4870 1.1 christos cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 1, referenced, out_Pd);
4871 1.1 christos }
4872 1.1 christos {
4873 1.1 christos int referenced = 0;
4874 1.1 christos int UNUSED insn_referenced = abuf->written;
4875 1.1 christos INT in_Rd = -1;
4876 1.1 christos INT in_Rs = -1;
4877 1.1 christos INT out_Rd = -1;
4878 1.1 christos in_Rs = FLD (in_Rs);
4879 1.1 christos referenced |= 1 << 1;
4880 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4881 1.1 christos }
4882 1.1 christos return cycles;
4883 1.1 christos #undef FLD
4884 1.1 christos }
4885 1.1 christos
4886 1.1 christos static int
4887 1.1 christos model_crisv32_jas_c (SIM_CPU *current_cpu, void *sem_arg)
4888 1.1 christos {
4889 1.1 christos #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
4890 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4891 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4892 1.1 christos int cycles = 0;
4893 1.1 christos {
4894 1.1 christos int referenced = 0;
4895 1.1 christos int UNUSED insn_referenced = abuf->written;
4896 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
4897 1.1 christos }
4898 1.1 christos {
4899 1.1 christos int referenced = 0;
4900 1.1 christos int UNUSED insn_referenced = abuf->written;
4901 1.1 christos INT out_Pd = -1;
4902 1.1 christos out_Pd = FLD (out_Pd);
4903 1.1 christos referenced |= 1 << 0;
4904 1.1 christos cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 1, referenced, out_Pd);
4905 1.1 christos }
4906 1.1 christos {
4907 1.1 christos int referenced = 0;
4908 1.1 christos int UNUSED insn_referenced = abuf->written;
4909 1.1 christos INT in_Rd = -1;
4910 1.1 christos INT in_Rs = -1;
4911 1.1 christos INT out_Rd = -1;
4912 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4913 1.1 christos }
4914 1.1 christos return cycles;
4915 1.1 christos #undef FLD
4916 1.1 christos }
4917 1.1 christos
4918 1.1 christos static int
4919 1.1 christos model_crisv32_jump_p (SIM_CPU *current_cpu, void *sem_arg)
4920 1.1 christos {
4921 1.1 christos #define FLD(f) abuf->fields.sfmt_mcp.f
4922 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4923 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4924 1.1 christos int cycles = 0;
4925 1.1 christos {
4926 1.1 christos int referenced = 0;
4927 1.1 christos int UNUSED insn_referenced = abuf->written;
4928 1.1 christos INT in_Ps = -1;
4929 1.1 christos in_Ps = FLD (in_Ps);
4930 1.1 christos referenced |= 1 << 0;
4931 1.1 christos cycles += crisv32f_model_crisv32_u_jump_sr (current_cpu, idesc, 0, referenced, in_Ps);
4932 1.1 christos }
4933 1.1 christos {
4934 1.1 christos int referenced = 0;
4935 1.1 christos int UNUSED insn_referenced = abuf->written;
4936 1.1 christos INT in_Rd = -1;
4937 1.1 christos INT in_Rs = -1;
4938 1.1 christos INT out_Rd = -1;
4939 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4940 1.1 christos }
4941 1.1 christos return cycles;
4942 1.1 christos #undef FLD
4943 1.1 christos }
4944 1.1 christos
4945 1.1 christos static int
4946 1.1 christos model_crisv32_bas_c (SIM_CPU *current_cpu, void *sem_arg)
4947 1.1 christos {
4948 1.1 christos #define FLD(f) abuf->fields.sfmt_bas_c.f
4949 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4950 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4951 1.1 christos int cycles = 0;
4952 1.1 christos {
4953 1.1 christos int referenced = 0;
4954 1.1 christos int UNUSED insn_referenced = abuf->written;
4955 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
4956 1.1 christos }
4957 1.1 christos {
4958 1.1 christos int referenced = 0;
4959 1.1 christos int UNUSED insn_referenced = abuf->written;
4960 1.1 christos INT out_Pd = -1;
4961 1.1 christos out_Pd = FLD (out_Pd);
4962 1.1 christos referenced |= 1 << 0;
4963 1.1 christos cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 1, referenced, out_Pd);
4964 1.1 christos }
4965 1.1 christos {
4966 1.1 christos int referenced = 0;
4967 1.1 christos int UNUSED insn_referenced = abuf->written;
4968 1.1 christos INT in_Rd = -1;
4969 1.1 christos INT in_Rs = -1;
4970 1.1 christos INT out_Rd = -1;
4971 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4972 1.1 christos }
4973 1.1 christos return cycles;
4974 1.1 christos #undef FLD
4975 1.1 christos }
4976 1.1 christos
4977 1.1 christos static int
4978 1.1 christos model_crisv32_jasc_r (SIM_CPU *current_cpu, void *sem_arg)
4979 1.1 christos {
4980 1.1 christos #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
4981 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4982 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
4983 1.1 christos int cycles = 0;
4984 1.1 christos {
4985 1.1 christos int referenced = 0;
4986 1.1 christos int UNUSED insn_referenced = abuf->written;
4987 1.1 christos INT in_Rs = -1;
4988 1.1 christos in_Rs = FLD (in_Rs);
4989 1.1 christos referenced |= 1 << 0;
4990 1.1 christos cycles += crisv32f_model_crisv32_u_jump_r (current_cpu, idesc, 0, referenced, in_Rs);
4991 1.1 christos }
4992 1.1 christos {
4993 1.1 christos int referenced = 0;
4994 1.1 christos int UNUSED insn_referenced = abuf->written;
4995 1.1 christos cycles += crisv32f_model_crisv32_u_skip4 (current_cpu, idesc, 1, referenced);
4996 1.1 christos }
4997 1.1 christos {
4998 1.1 christos int referenced = 0;
4999 1.1 christos int UNUSED insn_referenced = abuf->written;
5000 1.1 christos INT out_Pd = -1;
5001 1.1 christos out_Pd = FLD (out_Pd);
5002 1.1 christos referenced |= 1 << 0;
5003 1.1 christos cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 2, referenced, out_Pd);
5004 1.1 christos }
5005 1.1 christos {
5006 1.1 christos int referenced = 0;
5007 1.1 christos int UNUSED insn_referenced = abuf->written;
5008 1.1 christos INT in_Rd = -1;
5009 1.1 christos INT in_Rs = -1;
5010 1.1 christos INT out_Rd = -1;
5011 1.1 christos in_Rs = FLD (in_Rs);
5012 1.1 christos referenced |= 1 << 1;
5013 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 3, referenced, in_Rd, in_Rs, out_Rd);
5014 1.1 christos }
5015 1.1 christos return cycles;
5016 1.1 christos #undef FLD
5017 1.1 christos }
5018 1.1 christos
5019 1.1 christos static int
5020 1.1 christos model_crisv32_jasc_c (SIM_CPU *current_cpu, void *sem_arg)
5021 1.1 christos {
5022 1.1 christos #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
5023 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5024 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5025 1.1 christos int cycles = 0;
5026 1.1 christos {
5027 1.1 christos int referenced = 0;
5028 1.1 christos int UNUSED insn_referenced = abuf->written;
5029 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
5030 1.1 christos }
5031 1.1 christos {
5032 1.1 christos int referenced = 0;
5033 1.1 christos int UNUSED insn_referenced = abuf->written;
5034 1.1 christos cycles += crisv32f_model_crisv32_u_skip4 (current_cpu, idesc, 1, referenced);
5035 1.1 christos }
5036 1.1 christos {
5037 1.1 christos int referenced = 0;
5038 1.1 christos int UNUSED insn_referenced = abuf->written;
5039 1.1 christos INT out_Pd = -1;
5040 1.1 christos out_Pd = FLD (out_Pd);
5041 1.1 christos referenced |= 1 << 0;
5042 1.1 christos cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 2, referenced, out_Pd);
5043 1.1 christos }
5044 1.1 christos {
5045 1.1 christos int referenced = 0;
5046 1.1 christos int UNUSED insn_referenced = abuf->written;
5047 1.1 christos INT in_Rd = -1;
5048 1.1 christos INT in_Rs = -1;
5049 1.1 christos INT out_Rd = -1;
5050 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 3, referenced, in_Rd, in_Rs, out_Rd);
5051 1.1 christos }
5052 1.1 christos return cycles;
5053 1.1 christos #undef FLD
5054 1.1 christos }
5055 1.1 christos
5056 1.1 christos static int
5057 1.1 christos model_crisv32_basc_c (SIM_CPU *current_cpu, void *sem_arg)
5058 1.1 christos {
5059 1.1 christos #define FLD(f) abuf->fields.sfmt_bas_c.f
5060 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5061 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5062 1.1 christos int cycles = 0;
5063 1.1 christos {
5064 1.1 christos int referenced = 0;
5065 1.1 christos int UNUSED insn_referenced = abuf->written;
5066 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
5067 1.1 christos }
5068 1.1 christos {
5069 1.1 christos int referenced = 0;
5070 1.1 christos int UNUSED insn_referenced = abuf->written;
5071 1.1 christos cycles += crisv32f_model_crisv32_u_skip4 (current_cpu, idesc, 1, referenced);
5072 1.1 christos }
5073 1.1 christos {
5074 1.1 christos int referenced = 0;
5075 1.1 christos int UNUSED insn_referenced = abuf->written;
5076 1.1 christos INT out_Pd = -1;
5077 1.1 christos out_Pd = FLD (out_Pd);
5078 1.1 christos referenced |= 1 << 0;
5079 1.1 christos cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 2, referenced, out_Pd);
5080 1.1 christos }
5081 1.1 christos {
5082 1.1 christos int referenced = 0;
5083 1.1 christos int UNUSED insn_referenced = abuf->written;
5084 1.1 christos INT in_Rd = -1;
5085 1.1 christos INT in_Rs = -1;
5086 1.1 christos INT out_Rd = -1;
5087 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 3, referenced, in_Rd, in_Rs, out_Rd);
5088 1.1 christos }
5089 1.1 christos return cycles;
5090 1.1 christos #undef FLD
5091 1.1 christos }
5092 1.1 christos
5093 1.1 christos static int
5094 1.1 christos model_crisv32_break (SIM_CPU *current_cpu, void *sem_arg)
5095 1.1 christos {
5096 1.1 christos #define FLD(f) abuf->fields.sfmt_break.f
5097 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5098 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5099 1.1 christos int cycles = 0;
5100 1.1 christos {
5101 1.1 christos int referenced = 0;
5102 1.1 christos int UNUSED insn_referenced = abuf->written;
5103 1.1 christos INT in_Rd = -1;
5104 1.1 christos INT in_Rs = -1;
5105 1.1 christos INT out_Rd = -1;
5106 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5107 1.1 christos }
5108 1.1 christos return cycles;
5109 1.1 christos #undef FLD
5110 1.1 christos }
5111 1.1 christos
5112 1.1 christos static int
5113 1.1 christos model_crisv32_bound_r_b_r (SIM_CPU *current_cpu, void *sem_arg)
5114 1.1 christos {
5115 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
5116 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5117 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5118 1.1 christos int cycles = 0;
5119 1.1 christos {
5120 1.1 christos int referenced = 0;
5121 1.1 christos int UNUSED insn_referenced = abuf->written;
5122 1.1 christos INT in_Rd = -1;
5123 1.1 christos INT in_Rs = -1;
5124 1.1 christos INT out_Rd = -1;
5125 1.1 christos in_Rd = FLD (in_Rd);
5126 1.1 christos in_Rs = FLD (in_Rs);
5127 1.1 christos out_Rd = FLD (out_Rd);
5128 1.1 christos referenced |= 1 << 0;
5129 1.1 christos referenced |= 1 << 1;
5130 1.1 christos referenced |= 1 << 2;
5131 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5132 1.1 christos }
5133 1.1 christos return cycles;
5134 1.1 christos #undef FLD
5135 1.1 christos }
5136 1.1 christos
5137 1.1 christos static int
5138 1.1 christos model_crisv32_bound_r_w_r (SIM_CPU *current_cpu, void *sem_arg)
5139 1.1 christos {
5140 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
5141 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5142 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5143 1.1 christos int cycles = 0;
5144 1.1 christos {
5145 1.1 christos int referenced = 0;
5146 1.1 christos int UNUSED insn_referenced = abuf->written;
5147 1.1 christos INT in_Rd = -1;
5148 1.1 christos INT in_Rs = -1;
5149 1.1 christos INT out_Rd = -1;
5150 1.1 christos in_Rd = FLD (in_Rd);
5151 1.1 christos in_Rs = FLD (in_Rs);
5152 1.1 christos out_Rd = FLD (out_Rd);
5153 1.1 christos referenced |= 1 << 0;
5154 1.1 christos referenced |= 1 << 1;
5155 1.1 christos referenced |= 1 << 2;
5156 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5157 1.1 christos }
5158 1.1 christos return cycles;
5159 1.1 christos #undef FLD
5160 1.1 christos }
5161 1.1 christos
5162 1.1 christos static int
5163 1.1 christos model_crisv32_bound_r_d_r (SIM_CPU *current_cpu, void *sem_arg)
5164 1.1 christos {
5165 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
5166 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5167 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5168 1.1 christos int cycles = 0;
5169 1.1 christos {
5170 1.1 christos int referenced = 0;
5171 1.1 christos int UNUSED insn_referenced = abuf->written;
5172 1.1 christos INT in_Rd = -1;
5173 1.1 christos INT in_Rs = -1;
5174 1.1 christos INT out_Rd = -1;
5175 1.1 christos in_Rd = FLD (in_Rd);
5176 1.1 christos in_Rs = FLD (in_Rs);
5177 1.1 christos out_Rd = FLD (out_Rd);
5178 1.1 christos referenced |= 1 << 0;
5179 1.1 christos referenced |= 1 << 1;
5180 1.1 christos referenced |= 1 << 2;
5181 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5182 1.1 christos }
5183 1.1 christos return cycles;
5184 1.1 christos #undef FLD
5185 1.1 christos }
5186 1.1 christos
5187 1.1 christos static int
5188 1.1 christos model_crisv32_bound_cb (SIM_CPU *current_cpu, void *sem_arg)
5189 1.1 christos {
5190 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cb.f
5191 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5192 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5193 1.1 christos int cycles = 0;
5194 1.1 christos {
5195 1.1 christos int referenced = 0;
5196 1.1 christos int UNUSED insn_referenced = abuf->written;
5197 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
5198 1.1 christos }
5199 1.1 christos {
5200 1.1 christos int referenced = 0;
5201 1.1 christos int UNUSED insn_referenced = abuf->written;
5202 1.1 christos INT in_Rd = -1;
5203 1.1 christos INT in_Rs = -1;
5204 1.1 christos INT out_Rd = -1;
5205 1.1 christos in_Rd = FLD (in_Rd);
5206 1.1 christos out_Rd = FLD (out_Rd);
5207 1.1 christos referenced |= 1 << 0;
5208 1.1 christos referenced |= 1 << 2;
5209 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5210 1.1 christos }
5211 1.1 christos return cycles;
5212 1.1 christos #undef FLD
5213 1.1 christos }
5214 1.1 christos
5215 1.1 christos static int
5216 1.1 christos model_crisv32_bound_cw (SIM_CPU *current_cpu, void *sem_arg)
5217 1.1 christos {
5218 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cw.f
5219 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5220 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5221 1.1 christos int cycles = 0;
5222 1.1 christos {
5223 1.1 christos int referenced = 0;
5224 1.1 christos int UNUSED insn_referenced = abuf->written;
5225 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
5226 1.1 christos }
5227 1.1 christos {
5228 1.1 christos int referenced = 0;
5229 1.1 christos int UNUSED insn_referenced = abuf->written;
5230 1.1 christos INT in_Rd = -1;
5231 1.1 christos INT in_Rs = -1;
5232 1.1 christos INT out_Rd = -1;
5233 1.1 christos in_Rd = FLD (in_Rd);
5234 1.1 christos out_Rd = FLD (out_Rd);
5235 1.1 christos referenced |= 1 << 0;
5236 1.1 christos referenced |= 1 << 2;
5237 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5238 1.1 christos }
5239 1.1 christos return cycles;
5240 1.1 christos #undef FLD
5241 1.1 christos }
5242 1.1 christos
5243 1.1 christos static int
5244 1.1 christos model_crisv32_bound_cd (SIM_CPU *current_cpu, void *sem_arg)
5245 1.1 christos {
5246 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cd.f
5247 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5248 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5249 1.1 christos int cycles = 0;
5250 1.1 christos {
5251 1.1 christos int referenced = 0;
5252 1.1 christos int UNUSED insn_referenced = abuf->written;
5253 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
5254 1.1 christos }
5255 1.1 christos {
5256 1.1 christos int referenced = 0;
5257 1.1 christos int UNUSED insn_referenced = abuf->written;
5258 1.1 christos INT in_Rd = -1;
5259 1.1 christos INT in_Rs = -1;
5260 1.1 christos INT out_Rd = -1;
5261 1.1 christos in_Rd = FLD (in_Rd);
5262 1.1 christos out_Rd = FLD (out_Rd);
5263 1.1 christos referenced |= 1 << 0;
5264 1.1 christos referenced |= 1 << 2;
5265 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5266 1.1 christos }
5267 1.1 christos return cycles;
5268 1.1 christos #undef FLD
5269 1.1 christos }
5270 1.1 christos
5271 1.1 christos static int
5272 1.1 christos model_crisv32_scc (SIM_CPU *current_cpu, void *sem_arg)
5273 1.1 christos {
5274 1.1 christos #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
5275 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5276 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5277 1.1 christos int cycles = 0;
5278 1.1 christos {
5279 1.1 christos int referenced = 0;
5280 1.1 christos int UNUSED insn_referenced = abuf->written;
5281 1.1 christos INT in_Rd = -1;
5282 1.1 christos INT in_Rs = -1;
5283 1.1 christos INT out_Rd = -1;
5284 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5285 1.1 christos }
5286 1.1 christos return cycles;
5287 1.1 christos #undef FLD
5288 1.1 christos }
5289 1.1 christos
5290 1.1 christos static int
5291 1.1 christos model_crisv32_lz (SIM_CPU *current_cpu, void *sem_arg)
5292 1.1 christos {
5293 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
5294 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5295 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5296 1.1 christos int cycles = 0;
5297 1.1 christos {
5298 1.1 christos int referenced = 0;
5299 1.1 christos int UNUSED insn_referenced = abuf->written;
5300 1.1 christos INT in_Rd = -1;
5301 1.1 christos INT in_Rs = -1;
5302 1.1 christos INT out_Rd = -1;
5303 1.1 christos in_Rs = FLD (in_Rs);
5304 1.1 christos out_Rd = FLD (out_Rd);
5305 1.1 christos referenced |= 1 << 1;
5306 1.1 christos referenced |= 1 << 2;
5307 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5308 1.1 christos }
5309 1.1 christos return cycles;
5310 1.1 christos #undef FLD
5311 1.1 christos }
5312 1.1 christos
5313 1.1 christos static int
5314 1.1 christos model_crisv32_addoq (SIM_CPU *current_cpu, void *sem_arg)
5315 1.1 christos {
5316 1.1 christos #define FLD(f) abuf->fields.sfmt_addoq.f
5317 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5318 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5319 1.1 christos int cycles = 0;
5320 1.1 christos {
5321 1.1 christos int referenced = 0;
5322 1.1 christos int UNUSED insn_referenced = abuf->written;
5323 1.1 christos INT in_Rd = -1;
5324 1.1 christos INT in_Rs = -1;
5325 1.1 christos INT out_Rd = -1;
5326 1.1 christos in_Rd = FLD (in_Rd);
5327 1.1 christos referenced |= 1 << 0;
5328 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5329 1.1 christos }
5330 1.1 christos return cycles;
5331 1.1 christos #undef FLD
5332 1.1 christos }
5333 1.1 christos
5334 1.1 christos static int
5335 1.1 christos model_crisv32_addo_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
5336 1.1 christos {
5337 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
5338 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5339 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5340 1.1 christos int cycles = 0;
5341 1.1 christos {
5342 1.1 christos int referenced = 0;
5343 1.1 christos int UNUSED insn_referenced = abuf->written;
5344 1.1 christos INT in_Rs = -1;
5345 1.1 christos in_Rs = FLD (in_Rs);
5346 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
5347 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
5348 1.1 christos }
5349 1.1 christos {
5350 1.1 christos int referenced = 0;
5351 1.1 christos int UNUSED insn_referenced = abuf->written;
5352 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
5353 1.1 christos }
5354 1.1 christos {
5355 1.1 christos int referenced = 0;
5356 1.1 christos int UNUSED insn_referenced = abuf->written;
5357 1.1 christos INT in_Rd = -1;
5358 1.1 christos INT in_Rs = -1;
5359 1.1 christos INT out_Rd = -1;
5360 1.1 christos in_Rd = FLD (in_Rd);
5361 1.1 christos in_Rs = FLD (in_Rs);
5362 1.1 christos referenced |= 1 << 0;
5363 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
5364 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
5365 1.1 christos }
5366 1.1 christos return cycles;
5367 1.1 christos #undef FLD
5368 1.1 christos }
5369 1.1 christos
5370 1.1 christos static int
5371 1.1 christos model_crisv32_addo_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
5372 1.1 christos {
5373 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
5374 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5375 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5376 1.1 christos int cycles = 0;
5377 1.1 christos {
5378 1.1 christos int referenced = 0;
5379 1.1 christos int UNUSED insn_referenced = abuf->written;
5380 1.1 christos INT in_Rs = -1;
5381 1.1 christos in_Rs = FLD (in_Rs);
5382 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
5383 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
5384 1.1 christos }
5385 1.1 christos {
5386 1.1 christos int referenced = 0;
5387 1.1 christos int UNUSED insn_referenced = abuf->written;
5388 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
5389 1.1 christos }
5390 1.1 christos {
5391 1.1 christos int referenced = 0;
5392 1.1 christos int UNUSED insn_referenced = abuf->written;
5393 1.1 christos INT in_Rd = -1;
5394 1.1 christos INT in_Rs = -1;
5395 1.1 christos INT out_Rd = -1;
5396 1.1 christos in_Rd = FLD (in_Rd);
5397 1.1 christos in_Rs = FLD (in_Rs);
5398 1.1 christos referenced |= 1 << 0;
5399 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
5400 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
5401 1.1 christos }
5402 1.1 christos return cycles;
5403 1.1 christos #undef FLD
5404 1.1 christos }
5405 1.1 christos
5406 1.1 christos static int
5407 1.1 christos model_crisv32_addo_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
5408 1.1 christos {
5409 1.1 christos #define FLD(f) abuf->fields.sfmt_addc_m.f
5410 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5411 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5412 1.1 christos int cycles = 0;
5413 1.1 christos {
5414 1.1 christos int referenced = 0;
5415 1.1 christos int UNUSED insn_referenced = abuf->written;
5416 1.1 christos INT in_Rs = -1;
5417 1.1 christos in_Rs = FLD (in_Rs);
5418 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
5419 1.1 christos cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
5420 1.1 christos }
5421 1.1 christos {
5422 1.1 christos int referenced = 0;
5423 1.1 christos int UNUSED insn_referenced = abuf->written;
5424 1.1 christos cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
5425 1.1 christos }
5426 1.1 christos {
5427 1.1 christos int referenced = 0;
5428 1.1 christos int UNUSED insn_referenced = abuf->written;
5429 1.1 christos INT in_Rd = -1;
5430 1.1 christos INT in_Rs = -1;
5431 1.1 christos INT out_Rd = -1;
5432 1.1 christos in_Rd = FLD (in_Rd);
5433 1.1 christos in_Rs = FLD (in_Rs);
5434 1.1 christos referenced |= 1 << 0;
5435 1.1 christos if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
5436 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
5437 1.1 christos }
5438 1.1 christos return cycles;
5439 1.1 christos #undef FLD
5440 1.1 christos }
5441 1.1 christos
5442 1.1 christos static int
5443 1.1 christos model_crisv32_addo_cb (SIM_CPU *current_cpu, void *sem_arg)
5444 1.1 christos {
5445 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cb.f
5446 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5447 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5448 1.1 christos int cycles = 0;
5449 1.1 christos {
5450 1.1 christos int referenced = 0;
5451 1.1 christos int UNUSED insn_referenced = abuf->written;
5452 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
5453 1.1 christos }
5454 1.1 christos {
5455 1.1 christos int referenced = 0;
5456 1.1 christos int UNUSED insn_referenced = abuf->written;
5457 1.1 christos INT in_Rd = -1;
5458 1.1 christos INT in_Rs = -1;
5459 1.1 christos INT out_Rd = -1;
5460 1.1 christos in_Rd = FLD (in_Rd);
5461 1.1 christos referenced |= 1 << 0;
5462 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5463 1.1 christos }
5464 1.1 christos return cycles;
5465 1.1 christos #undef FLD
5466 1.1 christos }
5467 1.1 christos
5468 1.1 christos static int
5469 1.1 christos model_crisv32_addo_cw (SIM_CPU *current_cpu, void *sem_arg)
5470 1.1 christos {
5471 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cw.f
5472 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5473 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5474 1.1 christos int cycles = 0;
5475 1.1 christos {
5476 1.1 christos int referenced = 0;
5477 1.1 christos int UNUSED insn_referenced = abuf->written;
5478 1.1 christos cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
5479 1.1 christos }
5480 1.1 christos {
5481 1.1 christos int referenced = 0;
5482 1.1 christos int UNUSED insn_referenced = abuf->written;
5483 1.1 christos INT in_Rd = -1;
5484 1.1 christos INT in_Rs = -1;
5485 1.1 christos INT out_Rd = -1;
5486 1.1 christos in_Rd = FLD (in_Rd);
5487 1.1 christos referenced |= 1 << 0;
5488 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5489 1.1 christos }
5490 1.1 christos return cycles;
5491 1.1 christos #undef FLD
5492 1.1 christos }
5493 1.1 christos
5494 1.1 christos static int
5495 1.1 christos model_crisv32_addo_cd (SIM_CPU *current_cpu, void *sem_arg)
5496 1.1 christos {
5497 1.1 christos #define FLD(f) abuf->fields.sfmt_bound_cd.f
5498 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5499 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5500 1.1 christos int cycles = 0;
5501 1.1 christos {
5502 1.1 christos int referenced = 0;
5503 1.1 christos int UNUSED insn_referenced = abuf->written;
5504 1.1 christos cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
5505 1.1 christos }
5506 1.1 christos {
5507 1.1 christos int referenced = 0;
5508 1.1 christos int UNUSED insn_referenced = abuf->written;
5509 1.1 christos INT in_Rd = -1;
5510 1.1 christos INT in_Rs = -1;
5511 1.1 christos INT out_Rd = -1;
5512 1.1 christos in_Rd = FLD (in_Rd);
5513 1.1 christos referenced |= 1 << 0;
5514 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5515 1.1 christos }
5516 1.1 christos return cycles;
5517 1.1 christos #undef FLD
5518 1.1 christos }
5519 1.1 christos
5520 1.1 christos static int
5521 1.1 christos model_crisv32_addi_acr_b_r (SIM_CPU *current_cpu, void *sem_arg)
5522 1.1 christos {
5523 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
5524 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5525 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5526 1.1 christos int cycles = 0;
5527 1.1 christos {
5528 1.1 christos int referenced = 0;
5529 1.1 christos int UNUSED insn_referenced = abuf->written;
5530 1.1 christos INT in_Rd = -1;
5531 1.1 christos INT in_Rs = -1;
5532 1.1 christos INT out_Rd = -1;
5533 1.1 christos in_Rd = FLD (in_Rd);
5534 1.1 christos in_Rs = FLD (in_Rs);
5535 1.1 christos referenced |= 1 << 0;
5536 1.1 christos referenced |= 1 << 1;
5537 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5538 1.1 christos }
5539 1.1 christos return cycles;
5540 1.1 christos #undef FLD
5541 1.1 christos }
5542 1.1 christos
5543 1.1 christos static int
5544 1.1 christos model_crisv32_addi_acr_w_r (SIM_CPU *current_cpu, void *sem_arg)
5545 1.1 christos {
5546 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
5547 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5548 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5549 1.1 christos int cycles = 0;
5550 1.1 christos {
5551 1.1 christos int referenced = 0;
5552 1.1 christos int UNUSED insn_referenced = abuf->written;
5553 1.1 christos INT in_Rd = -1;
5554 1.1 christos INT in_Rs = -1;
5555 1.1 christos INT out_Rd = -1;
5556 1.1 christos in_Rd = FLD (in_Rd);
5557 1.1 christos in_Rs = FLD (in_Rs);
5558 1.1 christos referenced |= 1 << 0;
5559 1.1 christos referenced |= 1 << 1;
5560 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5561 1.1 christos }
5562 1.1 christos return cycles;
5563 1.1 christos #undef FLD
5564 1.1 christos }
5565 1.1 christos
5566 1.1 christos static int
5567 1.1 christos model_crisv32_addi_acr_d_r (SIM_CPU *current_cpu, void *sem_arg)
5568 1.1 christos {
5569 1.1 christos #define FLD(f) abuf->fields.sfmt_muls_b.f
5570 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5571 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5572 1.1 christos int cycles = 0;
5573 1.1 christos {
5574 1.1 christos int referenced = 0;
5575 1.1 christos int UNUSED insn_referenced = abuf->written;
5576 1.1 christos INT in_Rd = -1;
5577 1.1 christos INT in_Rs = -1;
5578 1.1 christos INT out_Rd = -1;
5579 1.1 christos in_Rd = FLD (in_Rd);
5580 1.1 christos in_Rs = FLD (in_Rs);
5581 1.1 christos referenced |= 1 << 0;
5582 1.1 christos referenced |= 1 << 1;
5583 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5584 1.1 christos }
5585 1.1 christos return cycles;
5586 1.1 christos #undef FLD
5587 1.1 christos }
5588 1.1 christos
5589 1.1 christos static int
5590 1.1 christos model_crisv32_fidxi (SIM_CPU *current_cpu, void *sem_arg)
5591 1.1 christos {
5592 1.1 christos #define FLD(f) abuf->fields.sfmt_mcp.f
5593 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5594 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5595 1.1 christos int cycles = 0;
5596 1.1 christos {
5597 1.1 christos int referenced = 0;
5598 1.1 christos int UNUSED insn_referenced = abuf->written;
5599 1.1 christos INT in_Rd = -1;
5600 1.1 christos INT in_Rs = -1;
5601 1.1 christos INT out_Rd = -1;
5602 1.1 christos in_Rs = FLD (in_Rs);
5603 1.1 christos referenced |= 1 << 1;
5604 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5605 1.1 christos }
5606 1.1 christos return cycles;
5607 1.1 christos #undef FLD
5608 1.1 christos }
5609 1.1 christos
5610 1.1 christos static int
5611 1.1 christos model_crisv32_ftagi (SIM_CPU *current_cpu, void *sem_arg)
5612 1.1 christos {
5613 1.1 christos #define FLD(f) abuf->fields.sfmt_mcp.f
5614 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5615 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5616 1.1 christos int cycles = 0;
5617 1.1 christos {
5618 1.1 christos int referenced = 0;
5619 1.1 christos int UNUSED insn_referenced = abuf->written;
5620 1.1 christos INT in_Rd = -1;
5621 1.1 christos INT in_Rs = -1;
5622 1.1 christos INT out_Rd = -1;
5623 1.1 christos in_Rs = FLD (in_Rs);
5624 1.1 christos referenced |= 1 << 1;
5625 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5626 1.1 christos }
5627 1.1 christos return cycles;
5628 1.1 christos #undef FLD
5629 1.1 christos }
5630 1.1 christos
5631 1.1 christos static int
5632 1.1 christos model_crisv32_fidxd (SIM_CPU *current_cpu, void *sem_arg)
5633 1.1 christos {
5634 1.1 christos #define FLD(f) abuf->fields.sfmt_mcp.f
5635 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5636 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5637 1.1 christos int cycles = 0;
5638 1.1 christos {
5639 1.1 christos int referenced = 0;
5640 1.1 christos int UNUSED insn_referenced = abuf->written;
5641 1.1 christos INT in_Rd = -1;
5642 1.1 christos INT in_Rs = -1;
5643 1.1 christos INT out_Rd = -1;
5644 1.1 christos in_Rs = FLD (in_Rs);
5645 1.1 christos referenced |= 1 << 1;
5646 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5647 1.1 christos }
5648 1.1 christos return cycles;
5649 1.1 christos #undef FLD
5650 1.1 christos }
5651 1.1 christos
5652 1.1 christos static int
5653 1.1 christos model_crisv32_ftagd (SIM_CPU *current_cpu, void *sem_arg)
5654 1.1 christos {
5655 1.1 christos #define FLD(f) abuf->fields.sfmt_mcp.f
5656 1.1 christos const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5657 1.1 christos const IDESC * UNUSED idesc = abuf->idesc;
5658 1.1 christos int cycles = 0;
5659 1.1 christos {
5660 1.1 christos int referenced = 0;
5661 1.1 christos int UNUSED insn_referenced = abuf->written;
5662 1.1 christos INT in_Rd = -1;
5663 1.1 christos INT in_Rs = -1;
5664 1.1 christos INT out_Rd = -1;
5665 1.1 christos in_Rs = FLD (in_Rs);
5666 1.1 christos referenced |= 1 << 1;
5667 1.1 christos cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5668 1.1 christos }
5669 1.1 christos return cycles;
5670 1.1 christos #undef FLD
5671 1.1 christos }
5672 1.1 christos
5673 1.1 christos /* We assume UNIT_NONE == 0 because the tables don't always terminate
5674 1.1 christos entries with it. */
5675 1.1 christos
5676 1.1 christos /* Model timing data for `crisv32'. */
5677 1.1 christos
5678 1.1 christos static const INSN_TIMING crisv32_timing[] = {
5679 1.1 christos { CRISV32F_INSN_X_INVALID, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5680 1.1 christos { CRISV32F_INSN_X_AFTER, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5681 1.1 christos { CRISV32F_INSN_X_BEFORE, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5682 1.1 christos { CRISV32F_INSN_X_CTI_CHAIN, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5683 1.1 christos { CRISV32F_INSN_X_CHAIN, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5684 1.1 christos { CRISV32F_INSN_X_BEGIN, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5685 1.1 christos { CRISV32F_INSN_MOVE_B_R, model_crisv32_move_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5686 1.1 christos { CRISV32F_INSN_MOVE_W_R, model_crisv32_move_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5687 1.1 christos { CRISV32F_INSN_MOVE_D_R, model_crisv32_move_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5688 1.1 christos { CRISV32F_INSN_MOVEQ, model_crisv32_moveq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5689 1.1 christos { CRISV32F_INSN_MOVS_B_R, model_crisv32_movs_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5690 1.1 christos { CRISV32F_INSN_MOVS_W_R, model_crisv32_movs_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5691 1.1 christos { CRISV32F_INSN_MOVU_B_R, model_crisv32_movu_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5692 1.1 christos { CRISV32F_INSN_MOVU_W_R, model_crisv32_movu_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5693 1.1 christos { CRISV32F_INSN_MOVECBR, model_crisv32_movecbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5694 1.1 christos { CRISV32F_INSN_MOVECWR, model_crisv32_movecwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5695 1.1 christos { CRISV32F_INSN_MOVECDR, model_crisv32_movecdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5696 1.1 christos { CRISV32F_INSN_MOVSCBR, model_crisv32_movscbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5697 1.1 christos { CRISV32F_INSN_MOVSCWR, model_crisv32_movscwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5698 1.1 christos { CRISV32F_INSN_MOVUCBR, model_crisv32_movucbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5699 1.1 christos { CRISV32F_INSN_MOVUCWR, model_crisv32_movucwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5700 1.1 christos { CRISV32F_INSN_ADDQ, model_crisv32_addq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5701 1.1 christos { CRISV32F_INSN_SUBQ, model_crisv32_subq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5702 1.1 christos { CRISV32F_INSN_CMP_R_B_R, model_crisv32_cmp_r_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5703 1.1 christos { CRISV32F_INSN_CMP_R_W_R, model_crisv32_cmp_r_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5704 1.1 christos { CRISV32F_INSN_CMP_R_D_R, model_crisv32_cmp_r_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5705 1.1 christos { CRISV32F_INSN_CMP_M_B_M, model_crisv32_cmp_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5706 1.1 christos { CRISV32F_INSN_CMP_M_W_M, model_crisv32_cmp_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5707 1.1 christos { CRISV32F_INSN_CMP_M_D_M, model_crisv32_cmp_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5708 1.1 christos { CRISV32F_INSN_CMPCBR, model_crisv32_cmpcbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5709 1.1 christos { CRISV32F_INSN_CMPCWR, model_crisv32_cmpcwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5710 1.1 christos { CRISV32F_INSN_CMPCDR, model_crisv32_cmpcdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5711 1.1 christos { CRISV32F_INSN_CMPQ, model_crisv32_cmpq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5712 1.1 christos { CRISV32F_INSN_CMPS_M_B_M, model_crisv32_cmps_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5713 1.1 christos { CRISV32F_INSN_CMPS_M_W_M, model_crisv32_cmps_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5714 1.1 christos { CRISV32F_INSN_CMPSCBR, model_crisv32_cmpscbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5715 1.1 christos { CRISV32F_INSN_CMPSCWR, model_crisv32_cmpscwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5716 1.1 christos { CRISV32F_INSN_CMPU_M_B_M, model_crisv32_cmpu_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5717 1.1 christos { CRISV32F_INSN_CMPU_M_W_M, model_crisv32_cmpu_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5718 1.1 christos { CRISV32F_INSN_CMPUCBR, model_crisv32_cmpucbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5719 1.1 christos { CRISV32F_INSN_CMPUCWR, model_crisv32_cmpucwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5720 1.1 christos { CRISV32F_INSN_MOVE_M_B_M, model_crisv32_move_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5721 1.1 christos { CRISV32F_INSN_MOVE_M_W_M, model_crisv32_move_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5722 1.1 christos { CRISV32F_INSN_MOVE_M_D_M, model_crisv32_move_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5723 1.1 christos { CRISV32F_INSN_MOVS_M_B_M, model_crisv32_movs_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5724 1.1 christos { CRISV32F_INSN_MOVS_M_W_M, model_crisv32_movs_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5725 1.1 christos { CRISV32F_INSN_MOVU_M_B_M, model_crisv32_movu_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5726 1.1 christos { CRISV32F_INSN_MOVU_M_W_M, model_crisv32_movu_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5727 1.1 christos { CRISV32F_INSN_MOVE_R_SPRV32, model_crisv32_move_r_sprv32, { { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5728 1.1 christos { CRISV32F_INSN_MOVE_SPR_RV32, model_crisv32_move_spr_rv32, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5729 1.1 christos { CRISV32F_INSN_MOVE_M_SPRV32, model_crisv32_move_m_sprv32, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5730 1.1 christos { CRISV32F_INSN_MOVE_C_SPRV32_P2, model_crisv32_move_c_sprv32_p2, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5731 1.1 christos { CRISV32F_INSN_MOVE_C_SPRV32_P3, model_crisv32_move_c_sprv32_p3, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5732 1.1 christos { CRISV32F_INSN_MOVE_C_SPRV32_P5, model_crisv32_move_c_sprv32_p5, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5733 1.1 christos { CRISV32F_INSN_MOVE_C_SPRV32_P6, model_crisv32_move_c_sprv32_p6, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5734 1.1 christos { CRISV32F_INSN_MOVE_C_SPRV32_P7, model_crisv32_move_c_sprv32_p7, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5735 1.1 christos { CRISV32F_INSN_MOVE_C_SPRV32_P9, model_crisv32_move_c_sprv32_p9, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5736 1.1 christos { CRISV32F_INSN_MOVE_C_SPRV32_P10, model_crisv32_move_c_sprv32_p10, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5737 1.1 christos { CRISV32F_INSN_MOVE_C_SPRV32_P11, model_crisv32_move_c_sprv32_p11, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5738 1.1 christos { CRISV32F_INSN_MOVE_C_SPRV32_P12, model_crisv32_move_c_sprv32_p12, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5739 1.1 christos { CRISV32F_INSN_MOVE_C_SPRV32_P13, model_crisv32_move_c_sprv32_p13, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5740 1.1 christos { CRISV32F_INSN_MOVE_C_SPRV32_P14, model_crisv32_move_c_sprv32_p14, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5741 1.1 christos { CRISV32F_INSN_MOVE_C_SPRV32_P15, model_crisv32_move_c_sprv32_p15, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5742 1.1 christos { CRISV32F_INSN_MOVE_SPR_MV32, model_crisv32_move_spr_mv32, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_W, 1, 1 } } },
5743 1.1 christos { CRISV32F_INSN_MOVE_SS_R, model_crisv32_move_ss_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5744 1.1 christos { CRISV32F_INSN_MOVE_R_SS, model_crisv32_move_r_ss, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5745 1.1 christos { CRISV32F_INSN_MOVEM_R_M_V32, model_crisv32_movem_r_m_v32, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MOVEM_RTOM, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_MOVEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_W, 1, 1 } } },
5746 1.1 christos { CRISV32F_INSN_MOVEM_M_R_V32, model_crisv32_movem_m_r_v32, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_MOVEM_MTOR, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_MOVEM, 1, 1 } } },
5747 1.1 christos { CRISV32F_INSN_ADD_B_R, model_crisv32_add_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5748 1.1 christos { CRISV32F_INSN_ADD_W_R, model_crisv32_add_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5749 1.1 christos { CRISV32F_INSN_ADD_D_R, model_crisv32_add_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5750 1.1 christos { CRISV32F_INSN_ADD_M_B_M, model_crisv32_add_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5751 1.1 christos { CRISV32F_INSN_ADD_M_W_M, model_crisv32_add_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5752 1.1 christos { CRISV32F_INSN_ADD_M_D_M, model_crisv32_add_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5753 1.1 christos { CRISV32F_INSN_ADDCBR, model_crisv32_addcbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5754 1.1 christos { CRISV32F_INSN_ADDCWR, model_crisv32_addcwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5755 1.1 christos { CRISV32F_INSN_ADDCDR, model_crisv32_addcdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5756 1.1 christos { CRISV32F_INSN_ADDS_B_R, model_crisv32_adds_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5757 1.1 christos { CRISV32F_INSN_ADDS_W_R, model_crisv32_adds_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5758 1.1 christos { CRISV32F_INSN_ADDS_M_B_M, model_crisv32_adds_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5759 1.1 christos { CRISV32F_INSN_ADDS_M_W_M, model_crisv32_adds_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5760 1.1 christos { CRISV32F_INSN_ADDSCBR, model_crisv32_addscbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5761 1.1 christos { CRISV32F_INSN_ADDSCWR, model_crisv32_addscwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5762 1.1 christos { CRISV32F_INSN_ADDU_B_R, model_crisv32_addu_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5763 1.1 christos { CRISV32F_INSN_ADDU_W_R, model_crisv32_addu_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5764 1.1 christos { CRISV32F_INSN_ADDU_M_B_M, model_crisv32_addu_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5765 1.1 christos { CRISV32F_INSN_ADDU_M_W_M, model_crisv32_addu_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5766 1.1 christos { CRISV32F_INSN_ADDUCBR, model_crisv32_adducbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5767 1.1 christos { CRISV32F_INSN_ADDUCWR, model_crisv32_adducwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5768 1.1 christos { CRISV32F_INSN_SUB_B_R, model_crisv32_sub_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5769 1.1 christos { CRISV32F_INSN_SUB_W_R, model_crisv32_sub_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5770 1.1 christos { CRISV32F_INSN_SUB_D_R, model_crisv32_sub_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5771 1.1 christos { CRISV32F_INSN_SUB_M_B_M, model_crisv32_sub_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5772 1.1 christos { CRISV32F_INSN_SUB_M_W_M, model_crisv32_sub_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5773 1.1 christos { CRISV32F_INSN_SUB_M_D_M, model_crisv32_sub_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5774 1.1 christos { CRISV32F_INSN_SUBCBR, model_crisv32_subcbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5775 1.1 christos { CRISV32F_INSN_SUBCWR, model_crisv32_subcwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5776 1.1 christos { CRISV32F_INSN_SUBCDR, model_crisv32_subcdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5777 1.1 christos { CRISV32F_INSN_SUBS_B_R, model_crisv32_subs_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5778 1.1 christos { CRISV32F_INSN_SUBS_W_R, model_crisv32_subs_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5779 1.1 christos { CRISV32F_INSN_SUBS_M_B_M, model_crisv32_subs_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5780 1.1 christos { CRISV32F_INSN_SUBS_M_W_M, model_crisv32_subs_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5781 1.1 christos { CRISV32F_INSN_SUBSCBR, model_crisv32_subscbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5782 1.1 christos { CRISV32F_INSN_SUBSCWR, model_crisv32_subscwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5783 1.1 christos { CRISV32F_INSN_SUBU_B_R, model_crisv32_subu_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5784 1.1 christos { CRISV32F_INSN_SUBU_W_R, model_crisv32_subu_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5785 1.1 christos { CRISV32F_INSN_SUBU_M_B_M, model_crisv32_subu_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5786 1.1 christos { CRISV32F_INSN_SUBU_M_W_M, model_crisv32_subu_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5787 1.1 christos { CRISV32F_INSN_SUBUCBR, model_crisv32_subucbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5788 1.1 christos { CRISV32F_INSN_SUBUCWR, model_crisv32_subucwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5789 1.1 christos { CRISV32F_INSN_ADDC_R, model_crisv32_addc_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5790 1.1 christos { CRISV32F_INSN_ADDC_M, model_crisv32_addc_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5791 1.1 christos { CRISV32F_INSN_ADDC_C, model_crisv32_addc_c, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5792 1.1 christos { CRISV32F_INSN_LAPC_D, model_crisv32_lapc_d, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5793 1.1 christos { CRISV32F_INSN_LAPCQ, model_crisv32_lapcq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5794 1.1 christos { CRISV32F_INSN_ADDI_B_R, model_crisv32_addi_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5795 1.1 christos { CRISV32F_INSN_ADDI_W_R, model_crisv32_addi_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5796 1.1 christos { CRISV32F_INSN_ADDI_D_R, model_crisv32_addi_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5797 1.1 christos { CRISV32F_INSN_NEG_B_R, model_crisv32_neg_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5798 1.1 christos { CRISV32F_INSN_NEG_W_R, model_crisv32_neg_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5799 1.1 christos { CRISV32F_INSN_NEG_D_R, model_crisv32_neg_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5800 1.1 christos { CRISV32F_INSN_TEST_M_B_M, model_crisv32_test_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5801 1.1 christos { CRISV32F_INSN_TEST_M_W_M, model_crisv32_test_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5802 1.1 christos { CRISV32F_INSN_TEST_M_D_M, model_crisv32_test_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5803 1.1 christos { CRISV32F_INSN_MOVE_R_M_B_M, model_crisv32_move_r_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_W, 1, 1 } } },
5804 1.1 christos { CRISV32F_INSN_MOVE_R_M_W_M, model_crisv32_move_r_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_W, 1, 1 } } },
5805 1.1 christos { CRISV32F_INSN_MOVE_R_M_D_M, model_crisv32_move_r_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_W, 1, 1 } } },
5806 1.1 christos { CRISV32F_INSN_MULS_B, model_crisv32_muls_b, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5807 1.1 christos { CRISV32F_INSN_MULS_W, model_crisv32_muls_w, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5808 1.1 christos { CRISV32F_INSN_MULS_D, model_crisv32_muls_d, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5809 1.1 christos { CRISV32F_INSN_MULU_B, model_crisv32_mulu_b, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5810 1.1 christos { CRISV32F_INSN_MULU_W, model_crisv32_mulu_w, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5811 1.1 christos { CRISV32F_INSN_MULU_D, model_crisv32_mulu_d, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5812 1.1 christos { CRISV32F_INSN_MCP, model_crisv32_mcp, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5813 1.1 christos { CRISV32F_INSN_DSTEP, model_crisv32_dstep, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5814 1.1 christos { CRISV32F_INSN_ABS, model_crisv32_abs, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5815 1.1 christos { CRISV32F_INSN_AND_B_R, model_crisv32_and_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5816 1.1 christos { CRISV32F_INSN_AND_W_R, model_crisv32_and_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5817 1.1 christos { CRISV32F_INSN_AND_D_R, model_crisv32_and_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5818 1.1 christos { CRISV32F_INSN_AND_M_B_M, model_crisv32_and_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5819 1.1 christos { CRISV32F_INSN_AND_M_W_M, model_crisv32_and_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5820 1.1 christos { CRISV32F_INSN_AND_M_D_M, model_crisv32_and_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5821 1.1 christos { CRISV32F_INSN_ANDCBR, model_crisv32_andcbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5822 1.1 christos { CRISV32F_INSN_ANDCWR, model_crisv32_andcwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5823 1.1 christos { CRISV32F_INSN_ANDCDR, model_crisv32_andcdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5824 1.1 christos { CRISV32F_INSN_ANDQ, model_crisv32_andq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5825 1.1 christos { CRISV32F_INSN_ORR_B_R, model_crisv32_orr_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5826 1.1 christos { CRISV32F_INSN_ORR_W_R, model_crisv32_orr_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5827 1.1 christos { CRISV32F_INSN_ORR_D_R, model_crisv32_orr_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5828 1.1 christos { CRISV32F_INSN_OR_M_B_M, model_crisv32_or_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5829 1.1 christos { CRISV32F_INSN_OR_M_W_M, model_crisv32_or_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5830 1.1 christos { CRISV32F_INSN_OR_M_D_M, model_crisv32_or_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5831 1.1 christos { CRISV32F_INSN_ORCBR, model_crisv32_orcbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5832 1.1 christos { CRISV32F_INSN_ORCWR, model_crisv32_orcwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5833 1.1 christos { CRISV32F_INSN_ORCDR, model_crisv32_orcdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5834 1.1 christos { CRISV32F_INSN_ORQ, model_crisv32_orq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5835 1.1 christos { CRISV32F_INSN_XOR, model_crisv32_xor, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5836 1.1 christos { CRISV32F_INSN_SWAP, model_crisv32_swap, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5837 1.1 christos { CRISV32F_INSN_ASRR_B_R, model_crisv32_asrr_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5838 1.1 christos { CRISV32F_INSN_ASRR_W_R, model_crisv32_asrr_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5839 1.1 christos { CRISV32F_INSN_ASRR_D_R, model_crisv32_asrr_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5840 1.1 christos { CRISV32F_INSN_ASRQ, model_crisv32_asrq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5841 1.1 christos { CRISV32F_INSN_LSRR_B_R, model_crisv32_lsrr_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5842 1.1 christos { CRISV32F_INSN_LSRR_W_R, model_crisv32_lsrr_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5843 1.1 christos { CRISV32F_INSN_LSRR_D_R, model_crisv32_lsrr_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5844 1.1 christos { CRISV32F_INSN_LSRQ, model_crisv32_lsrq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5845 1.1 christos { CRISV32F_INSN_LSLR_B_R, model_crisv32_lslr_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5846 1.1 christos { CRISV32F_INSN_LSLR_W_R, model_crisv32_lslr_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5847 1.1 christos { CRISV32F_INSN_LSLR_D_R, model_crisv32_lslr_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5848 1.1 christos { CRISV32F_INSN_LSLQ, model_crisv32_lslq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5849 1.1 christos { CRISV32F_INSN_BTST, model_crisv32_btst, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5850 1.1 christos { CRISV32F_INSN_BTSTQ, model_crisv32_btstq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5851 1.1 christos { CRISV32F_INSN_SETF, model_crisv32_setf, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5852 1.1 christos { CRISV32F_INSN_CLEARF, model_crisv32_clearf, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5853 1.1 christos { CRISV32F_INSN_RFE, model_crisv32_rfe, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5854 1.1 christos { CRISV32F_INSN_SFE, model_crisv32_sfe, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5855 1.1 christos { CRISV32F_INSN_RFG, model_crisv32_rfg, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5856 1.1 christos { CRISV32F_INSN_RFN, model_crisv32_rfn, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5857 1.1 christos { CRISV32F_INSN_HALT, model_crisv32_halt, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5858 1.1 christos { CRISV32F_INSN_BCC_B, model_crisv32_bcc_b, { { (int) UNIT_CRISV32_U_BRANCH, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5859 1.1 christos { CRISV32F_INSN_BA_B, model_crisv32_ba_b, { { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5860 1.1 christos { CRISV32F_INSN_BCC_W, model_crisv32_bcc_w, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_BRANCH, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5861 1.1 christos { CRISV32F_INSN_BA_W, model_crisv32_ba_w, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5862 1.1 christos { CRISV32F_INSN_JAS_R, model_crisv32_jas_r, { { (int) UNIT_CRISV32_U_JUMP_R, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5863 1.1 christos { CRISV32F_INSN_JAS_C, model_crisv32_jas_c, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5864 1.1 christos { CRISV32F_INSN_JUMP_P, model_crisv32_jump_p, { { (int) UNIT_CRISV32_U_JUMP_SR, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5865 1.1 christos { CRISV32F_INSN_BAS_C, model_crisv32_bas_c, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5866 1.1 christos { CRISV32F_INSN_JASC_R, model_crisv32_jasc_r, { { (int) UNIT_CRISV32_U_JUMP_R, 1, 1 }, { (int) UNIT_CRISV32_U_SKIP4, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5867 1.1 christos { CRISV32F_INSN_JASC_C, model_crisv32_jasc_c, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_SKIP4, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5868 1.1 christos { CRISV32F_INSN_BASC_C, model_crisv32_basc_c, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_SKIP4, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5869 1.1 christos { CRISV32F_INSN_BREAK, model_crisv32_break, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5870 1.1 christos { CRISV32F_INSN_BOUND_R_B_R, model_crisv32_bound_r_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5871 1.1 christos { CRISV32F_INSN_BOUND_R_W_R, model_crisv32_bound_r_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5872 1.1 christos { CRISV32F_INSN_BOUND_R_D_R, model_crisv32_bound_r_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5873 1.1 christos { CRISV32F_INSN_BOUND_CB, model_crisv32_bound_cb, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5874 1.1 christos { CRISV32F_INSN_BOUND_CW, model_crisv32_bound_cw, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5875 1.1 christos { CRISV32F_INSN_BOUND_CD, model_crisv32_bound_cd, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5876 1.1 christos { CRISV32F_INSN_SCC, model_crisv32_scc, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5877 1.1 christos { CRISV32F_INSN_LZ, model_crisv32_lz, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5878 1.1 christos { CRISV32F_INSN_ADDOQ, model_crisv32_addoq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5879 1.1 christos { CRISV32F_INSN_ADDO_M_B_M, model_crisv32_addo_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5880 1.1 christos { CRISV32F_INSN_ADDO_M_W_M, model_crisv32_addo_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5881 1.1 christos { CRISV32F_INSN_ADDO_M_D_M, model_crisv32_addo_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5882 1.1 christos { CRISV32F_INSN_ADDO_CB, model_crisv32_addo_cb, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5883 1.1 christos { CRISV32F_INSN_ADDO_CW, model_crisv32_addo_cw, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5884 1.1 christos { CRISV32F_INSN_ADDO_CD, model_crisv32_addo_cd, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5885 1.1 christos { CRISV32F_INSN_ADDI_ACR_B_R, model_crisv32_addi_acr_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5886 1.1 christos { CRISV32F_INSN_ADDI_ACR_W_R, model_crisv32_addi_acr_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5887 1.1 christos { CRISV32F_INSN_ADDI_ACR_D_R, model_crisv32_addi_acr_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5888 1.1 christos { CRISV32F_INSN_FIDXI, model_crisv32_fidxi, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5889 1.1 christos { CRISV32F_INSN_FTAGI, model_crisv32_ftagi, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5890 1.1 christos { CRISV32F_INSN_FIDXD, model_crisv32_fidxd, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5891 1.1 christos { CRISV32F_INSN_FTAGD, model_crisv32_ftagd, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5892 1.1 christos };
5893 1.1 christos
5894 1.1 christos #endif /* WITH_PROFILE_MODEL_P */
5895 1.1 christos
5896 1.1 christos static void
5897 1.1 christos crisv32_model_init (SIM_CPU *cpu)
5898 1.1 christos {
5899 1.1 christos CPU_MODEL_DATA (cpu) = (void *) zalloc (sizeof (MODEL_CRISV32_DATA));
5900 1.1 christos }
5901 1.1 christos
5902 1.1 christos #if WITH_PROFILE_MODEL_P
5903 1.1 christos #define TIMING_DATA(td) td
5904 1.1 christos #else
5905 1.1 christos #define TIMING_DATA(td) 0
5906 1.1 christos #endif
5907 1.1 christos
5908 1.6 christos static const SIM_MODEL crisv32_models[] =
5909 1.1 christos {
5910 1.1 christos { "crisv32", & crisv32_mach, MODEL_CRISV32, TIMING_DATA (& crisv32_timing[0]), crisv32_model_init },
5911 1.1 christos { 0 }
5912 1.1 christos };
5913 1.1 christos
5914 1.1 christos /* The properties of this cpu's implementation. */
5915 1.1 christos
5916 1.6 christos static const SIM_MACH_IMP_PROPERTIES crisv32f_imp_properties =
5917 1.1 christos {
5918 1.1 christos sizeof (SIM_CPU),
5919 1.1 christos #if WITH_SCACHE
5920 1.1 christos sizeof (SCACHE)
5921 1.1 christos #else
5922 1.1 christos 0
5923 1.1 christos #endif
5924 1.1 christos };
5925 1.1 christos
5926 1.1 christos
5927 1.1 christos static void
5928 1.1 christos crisv32f_prepare_run (SIM_CPU *cpu)
5929 1.1 christos {
5930 1.1 christos if (CPU_IDESC (cpu) == NULL)
5931 1.1 christos crisv32f_init_idesc_table (cpu);
5932 1.1 christos }
5933 1.1 christos
5934 1.1 christos static const CGEN_INSN *
5935 1.1 christos crisv32f_get_idata (SIM_CPU *cpu, int inum)
5936 1.1 christos {
5937 1.1 christos return CPU_IDESC (cpu) [inum].idata;
5938 1.1 christos }
5939 1.1 christos
5940 1.1 christos static void
5941 1.1 christos crisv32_init_cpu (SIM_CPU *cpu)
5942 1.1 christos {
5943 1.1 christos CPU_REG_FETCH (cpu) = crisv32f_fetch_register;
5944 1.1 christos CPU_REG_STORE (cpu) = crisv32f_store_register;
5945 1.1 christos CPU_PC_FETCH (cpu) = crisv32f_h_pc_get;
5946 1.1 christos CPU_PC_STORE (cpu) = crisv32f_h_pc_set;
5947 1.1 christos CPU_GET_IDATA (cpu) = crisv32f_get_idata;
5948 1.1 christos CPU_MAX_INSNS (cpu) = CRISV32F_INSN__MAX;
5949 1.1 christos CPU_INSN_NAME (cpu) = cgen_insn_name;
5950 1.1 christos CPU_FULL_ENGINE_FN (cpu) = crisv32f_engine_run_full;
5951 1.1 christos #if WITH_FAST
5952 1.1 christos CPU_FAST_ENGINE_FN (cpu) = crisv32f_engine_run_fast;
5953 1.1 christos #else
5954 1.1 christos CPU_FAST_ENGINE_FN (cpu) = crisv32f_engine_run_full;
5955 1.1 christos #endif
5956 1.1 christos }
5957 1.1 christos
5958 1.6 christos const SIM_MACH crisv32_mach =
5959 1.1 christos {
5960 1.1 christos "crisv32", "crisv32", MACH_CRISV32,
5961 1.1 christos 32, 32, & crisv32_models[0], & crisv32f_imp_properties,
5962 1.1 christos crisv32_init_cpu,
5963 1.1 christos crisv32f_prepare_run
5964 1.1 christos };
5965 1.1 christos
5966