1 /* frv simulator fr500 dependent profiling code.
3 Copyright (C) 1998-2019 Free Software Foundation, Inc.
6 This file is part of the GNU simulators.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #define WANT_CPU_FRVBF
28 #if WITH_PROFILE_MODEL_P
31 #include "profile-fr500.h"
33 /* Initialize cycle counting for an insn.
34 FIRST_P is non-zero if this is the first insn in a set of parallel
37 fr500_model_insn_before (SIM_CPU
*cpu
, int first_p
)
41 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
42 FRV_PROFILE_STATE
*ps
= CPU_PROFILE_STATE (cpu
);
43 ps
->cur_gr_complex
= ps
->prev_gr_complex
;
44 d
->cur_fpop
= d
->prev_fpop
;
45 d
->cur_media
= d
->prev_media
;
46 d
->cur_cc_complex
= d
->prev_cc_complex
;
50 /* Record the cycles computed for an insn.
51 LAST_P is non-zero if this is the last insn in a set of parallel insns,
52 and we update the total cycle count.
53 CYCLES is the cycle count of the insn. */
55 fr500_model_insn_after (SIM_CPU
*cpu
, int last_p
, int cycles
)
59 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
60 FRV_PROFILE_STATE
*ps
= CPU_PROFILE_STATE (cpu
);
61 ps
->prev_gr_complex
= ps
->cur_gr_complex
;
62 d
->prev_fpop
= d
->cur_fpop
;
63 d
->prev_media
= d
->cur_media
;
64 d
->prev_cc_complex
= d
->cur_cc_complex
;
69 set_use_is_fpop (SIM_CPU
*cpu
, INT fr
)
71 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
72 fr500_reset_fr_flags (cpu
, (fr
));
73 d
->cur_fpop
|= (((DI
)1) << (fr
));
77 set_use_not_fpop (SIM_CPU
*cpu
, INT fr
)
79 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
80 d
->cur_fpop
&= ~(((DI
)1) << (fr
));
84 use_is_fpop (SIM_CPU
*cpu
, INT fr
)
86 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
87 return d
->prev_fpop
& (((DI
)1) << (fr
));
91 set_use_is_media ( SIM_CPU
*cpu
, INT fr
)
93 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
94 fr500_reset_fr_flags (cpu
, (fr
));
95 d
->cur_media
|= (((DI
)1) << (fr
));
99 set_use_not_media (SIM_CPU
*cpu
, INT fr
)
101 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
102 d
->cur_media
&= ~(((DI
)1) << (fr
));
106 use_is_media (SIM_CPU
*cpu
, INT fr
)
108 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
109 return d
->prev_media
& (((DI
)1) << (fr
));
113 set_use_is_cc_complex (SIM_CPU
*cpu
, INT cc
)
115 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
116 fr500_reset_cc_flags (cpu
, cc
);
117 d
->cur_cc_complex
|= (((DI
)1) << (cc
));
121 set_use_not_cc_complex (SIM_CPU
*cpu
, INT cc
)
123 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
124 d
->cur_cc_complex
&= ~(((DI
)1) << (cc
));
128 use_is_cc_complex (SIM_CPU
*cpu
, INT cc
)
130 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
131 return d
->prev_cc_complex
& (((DI
)1) << (cc
));
135 fr500_reset_fr_flags (SIM_CPU
*cpu
, INT fr
)
137 set_use_not_fpop (cpu
, fr
);
138 set_use_not_media (cpu
, fr
);
142 fr500_reset_cc_flags (SIM_CPU
*cpu
, INT cc
)
144 set_use_not_cc_complex (cpu
, cc
);
147 /* Latency of floating point registers may be less than recorded when followed
148 by another floating point insn. */
150 adjust_float_register_busy (SIM_CPU
*cpu
, INT in_FRi
, INT in_FRj
, INT out_FRk
,
153 /* If the registers were previously used in a floating point op,
154 then their latency will be less than previously recorded.
155 See Table 13-13 in the LSI. */
157 if (use_is_fpop (cpu
, in_FRi
))
158 decrease_FR_busy (cpu
, in_FRi
, cycles
);
160 enforce_full_fr_latency (cpu
, in_FRi
);
162 if (in_FRj
>= 0 && in_FRj
!= in_FRi
)
163 if (use_is_fpop (cpu
, in_FRj
))
164 decrease_FR_busy (cpu
, in_FRj
, cycles
);
166 enforce_full_fr_latency (cpu
, in_FRj
);
168 if (out_FRk
>= 0 && out_FRk
!= in_FRi
&& out_FRk
!= in_FRj
)
169 if (use_is_fpop (cpu
, out_FRk
))
170 decrease_FR_busy (cpu
, out_FRk
, cycles
);
172 enforce_full_fr_latency (cpu
, out_FRk
);
175 /* Latency of floating point registers may be less than recorded when followed
176 by another floating point insn. */
178 adjust_double_register_busy (SIM_CPU
*cpu
, INT in_FRi
, INT in_FRj
, INT out_FRk
,
181 /* If the registers were previously used in a floating point op,
182 then their latency will be less than previously recorded.
183 See Table 13-13 in the LSI. */
184 adjust_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, cycles
);
185 if (in_FRi
>= 0) ++in_FRi
;
186 if (in_FRj
>= 0) ++in_FRj
;
187 if (out_FRk
>= 0) ++out_FRk
;
188 adjust_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, cycles
);
191 /* Latency of floating point registers is less than recorded when followed
192 by another floating point insn. */
194 restore_float_register_busy (SIM_CPU
*cpu
, INT in_FRi
, INT in_FRj
, INT out_FRk
,
197 /* If the registers were previously used in a floating point op,
198 then their latency will be less than previously recorded.
199 See Table 13-13 in the LSI. */
200 if (in_FRi
>= 0 && use_is_fpop (cpu
, in_FRi
))
201 increase_FR_busy (cpu
, in_FRi
, cycles
);
202 if (in_FRj
!= in_FRi
&& use_is_fpop (cpu
, in_FRj
))
203 increase_FR_busy (cpu
, in_FRj
, cycles
);
204 if (out_FRk
!= in_FRi
&& out_FRk
!= in_FRj
&& use_is_fpop (cpu
, out_FRk
))
205 increase_FR_busy (cpu
, out_FRk
, cycles
);
208 /* Latency of floating point registers is less than recorded when followed
209 by another floating point insn. */
211 restore_double_register_busy (SIM_CPU
*cpu
, INT in_FRi
, INT in_FRj
, INT out_FRk
,
214 /* If the registers were previously used in a floating point op,
215 then their latency will be less than previously recorded.
216 See Table 13-13 in the LSI. */
217 restore_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, cycles
);
218 if (in_FRi
>= 0) ++in_FRi
;
219 if (in_FRj
>= 0) ++in_FRj
;
220 if (out_FRk
>= 0) ++out_FRk
;
221 restore_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, cycles
);
225 frvbf_model_fr500_u_exec (SIM_CPU
*cpu
, const IDESC
*idesc
,
226 int unit_num
, int referenced
)
228 return idesc
->timing
->units
[unit_num
].done
;
232 frvbf_model_fr500_u_integer (SIM_CPU
*cpu
, const IDESC
*idesc
,
233 int unit_num
, int referenced
,
234 INT in_GRi
, INT in_GRj
, INT out_GRk
,
239 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
241 /* icc0-icc4 are the upper 4 fields of the CCR. */
245 /* The entire VLIW insn must wait if there is a dependency on a register
246 which is not ready yet.
247 The latency of the registers may be less than previously recorded,
248 depending on how they were used previously.
249 See Table 13-8 in the LSI. */
250 if (in_GRi
!= out_GRk
&& in_GRi
>= 0)
252 if (use_is_gr_complex (cpu
, in_GRi
))
253 decrease_GR_busy (cpu
, in_GRi
, 1);
255 if (in_GRj
!= out_GRk
&& in_GRj
!= in_GRi
&& in_GRj
>= 0)
257 if (use_is_gr_complex (cpu
, in_GRj
))
258 decrease_GR_busy (cpu
, in_GRj
, 1);
260 vliw_wait_for_GR (cpu
, in_GRi
);
261 vliw_wait_for_GR (cpu
, in_GRj
);
262 vliw_wait_for_GR (cpu
, out_GRk
);
263 vliw_wait_for_CCR (cpu
, out_ICCi_1
);
264 handle_resource_wait (cpu
);
265 load_wait_for_GR (cpu
, in_GRi
);
266 load_wait_for_GR (cpu
, in_GRj
);
267 load_wait_for_GR (cpu
, out_GRk
);
268 trace_vliw_wait_cycles (cpu
);
272 /* GRk is available immediately to the next VLIW insn as is ICCi_1. */
273 cycles
= idesc
->timing
->units
[unit_num
].done
;
278 frvbf_model_fr500_u_imul (SIM_CPU
*cpu
, const IDESC
*idesc
,
279 int unit_num
, int referenced
,
280 INT in_GRi
, INT in_GRj
, INT out_GRk
, INT out_ICCi_1
)
283 /* icc0-icc4 are the upper 4 fields of the CCR. */
287 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
289 /* The entire VLIW insn must wait if there is a dependency on a register
290 which is not ready yet.
291 The latency of the registers may be less than previously recorded,
292 depending on how they were used previously.
293 See Table 13-8 in the LSI. */
294 if (in_GRi
!= out_GRk
&& in_GRi
>= 0)
296 if (use_is_gr_complex (cpu
, in_GRi
))
297 decrease_GR_busy (cpu
, in_GRi
, 1);
299 if (in_GRj
!= out_GRk
&& in_GRj
!= in_GRi
&& in_GRj
>= 0)
301 if (use_is_gr_complex (cpu
, in_GRj
))
302 decrease_GR_busy (cpu
, in_GRj
, 1);
304 vliw_wait_for_GR (cpu
, in_GRi
);
305 vliw_wait_for_GR (cpu
, in_GRj
);
306 vliw_wait_for_GRdouble (cpu
, out_GRk
);
307 vliw_wait_for_CCR (cpu
, out_ICCi_1
);
308 handle_resource_wait (cpu
);
309 load_wait_for_GR (cpu
, in_GRi
);
310 load_wait_for_GR (cpu
, in_GRj
);
311 load_wait_for_GRdouble (cpu
, out_GRk
);
312 trace_vliw_wait_cycles (cpu
);
316 /* GRk has a latency of 2 cycles. */
317 cycles
= idesc
->timing
->units
[unit_num
].done
;
318 update_GRdouble_latency (cpu
, out_GRk
, cycles
+ 2);
319 set_use_is_gr_complex (cpu
, out_GRk
);
320 set_use_is_gr_complex (cpu
, out_GRk
+ 1);
322 /* ICCi_1 has a latency of 1 cycle. */
323 update_CCR_latency (cpu
, out_ICCi_1
, cycles
+ 1);
329 frvbf_model_fr500_u_idiv (SIM_CPU
*cpu
, const IDESC
*idesc
,
330 int unit_num
, int referenced
,
331 INT in_GRi
, INT in_GRj
, INT out_GRk
, INT out_ICCi_1
)
337 /* icc0-icc4 are the upper 4 fields of the CCR. */
341 vliw
= CPU_VLIW (cpu
);
342 slot
= vliw
->next_slot
- 1;
343 slot
= (*vliw
->current_vliw
)[slot
] - UNIT_I0
;
345 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
347 /* The entire VLIW insn must wait if there is a dependency on a register
348 which is not ready yet.
349 The latency of the registers may be less than previously recorded,
350 depending on how they were used previously.
351 See Table 13-8 in the LSI. */
352 if (in_GRi
!= out_GRk
&& in_GRi
>= 0)
354 if (use_is_gr_complex (cpu
, in_GRi
))
355 decrease_GR_busy (cpu
, in_GRi
, 1);
357 if (in_GRj
!= out_GRk
&& in_GRj
!= in_GRi
&& in_GRj
>= 0)
359 if (use_is_gr_complex (cpu
, in_GRj
))
360 decrease_GR_busy (cpu
, in_GRj
, 1);
362 vliw_wait_for_GR (cpu
, in_GRi
);
363 vliw_wait_for_GR (cpu
, in_GRj
);
364 vliw_wait_for_GR (cpu
, out_GRk
);
365 vliw_wait_for_CCR (cpu
, out_ICCi_1
);
366 vliw_wait_for_idiv_resource (cpu
, slot
);
367 handle_resource_wait (cpu
);
368 load_wait_for_GR (cpu
, in_GRi
);
369 load_wait_for_GR (cpu
, in_GRj
);
370 load_wait_for_GR (cpu
, out_GRk
);
371 trace_vliw_wait_cycles (cpu
);
375 /* GRk has a latency of 19 cycles! */
376 cycles
= idesc
->timing
->units
[unit_num
].done
;
377 update_GR_latency (cpu
, out_GRk
, cycles
+ 19);
378 set_use_is_gr_complex (cpu
, out_GRk
);
380 /* ICCi_1 has a latency of 19 cycles. */
381 update_CCR_latency (cpu
, out_ICCi_1
, cycles
+ 19);
382 set_use_is_cc_complex (cpu
, out_ICCi_1
);
384 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
386 /* GNER has a latency of 18 cycles. */
387 update_SPR_latency (cpu
, GNER_FOR_GR (out_GRk
), cycles
+ 18);
390 /* the idiv resource has a latency of 18 cycles! */
391 update_idiv_resource_latency (cpu
, slot
, cycles
+ 18);
397 frvbf_model_fr500_u_branch (SIM_CPU
*cpu
, const IDESC
*idesc
,
398 int unit_num
, int referenced
,
399 INT in_GRi
, INT in_GRj
,
400 INT in_ICCi_2
, INT in_FCCi_2
)
403 FRV_PROFILE_STATE
*ps
;
405 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
407 /* icc0-icc4 are the upper 4 fields of the CCR. */
411 /* The entire VLIW insn must wait if there is a dependency on a register
412 which is not ready yet.
413 The latency of the registers may be less than previously recorded,
414 depending on how they were used previously.
415 See Table 13-8 in the LSI. */
418 if (use_is_gr_complex (cpu
, in_GRi
))
419 decrease_GR_busy (cpu
, in_GRi
, 1);
421 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
423 if (use_is_gr_complex (cpu
, in_GRj
))
424 decrease_GR_busy (cpu
, in_GRj
, 1);
426 vliw_wait_for_GR (cpu
, in_GRi
);
427 vliw_wait_for_GR (cpu
, in_GRj
);
428 vliw_wait_for_CCR (cpu
, in_ICCi_2
);
429 vliw_wait_for_CCR (cpu
, in_FCCi_2
);
430 handle_resource_wait (cpu
);
431 load_wait_for_GR (cpu
, in_GRi
);
432 load_wait_for_GR (cpu
, in_GRj
);
433 trace_vliw_wait_cycles (cpu
);
437 /* When counting branches taken or not taken, don't consider branches after
438 the first taken branch in a vliw insn. */
439 ps
= CPU_PROFILE_STATE (cpu
);
440 if (! ps
->vliw_branch_taken
)
442 /* (1 << 4): The pc is the 5th element in inputs, outputs.
443 ??? can be cleaned up */
444 PROFILE_DATA
*p
= CPU_PROFILE_DATA (cpu
);
445 int taken
= (referenced
& (1 << 4)) != 0;
448 ++PROFILE_MODEL_TAKEN_COUNT (p
);
449 ps
->vliw_branch_taken
= 1;
452 ++PROFILE_MODEL_UNTAKEN_COUNT (p
);
455 cycles
= idesc
->timing
->units
[unit_num
].done
;
460 frvbf_model_fr500_u_trap (SIM_CPU
*cpu
, const IDESC
*idesc
,
461 int unit_num
, int referenced
,
462 INT in_GRi
, INT in_GRj
,
463 INT in_ICCi_2
, INT in_FCCi_2
)
467 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
469 /* icc0-icc4 are the upper 4 fields of the CCR. */
473 /* The entire VLIW insn must wait if there is a dependency on a register
474 which is not ready yet.
475 The latency of the registers may be less than previously recorded,
476 depending on how they were used previously.
477 See Table 13-8 in the LSI. */
480 if (use_is_gr_complex (cpu
, in_GRi
))
481 decrease_GR_busy (cpu
, in_GRi
, 1);
483 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
485 if (use_is_gr_complex (cpu
, in_GRj
))
486 decrease_GR_busy (cpu
, in_GRj
, 1);
488 vliw_wait_for_GR (cpu
, in_GRi
);
489 vliw_wait_for_GR (cpu
, in_GRj
);
490 vliw_wait_for_CCR (cpu
, in_ICCi_2
);
491 vliw_wait_for_CCR (cpu
, in_FCCi_2
);
492 handle_resource_wait (cpu
);
493 load_wait_for_GR (cpu
, in_GRi
);
494 load_wait_for_GR (cpu
, in_GRj
);
495 trace_vliw_wait_cycles (cpu
);
499 cycles
= idesc
->timing
->units
[unit_num
].done
;
504 frvbf_model_fr500_u_check (SIM_CPU
*cpu
, const IDESC
*idesc
,
505 int unit_num
, int referenced
,
506 INT in_ICCi_3
, INT in_FCCi_3
)
510 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
512 /* icc0-icc4 are the upper 4 fields of the CCR. */
516 /* The entire VLIW insn must wait if there is a dependency on a register
517 which is not ready yet. */
518 vliw_wait_for_CCR (cpu
, in_ICCi_3
);
519 vliw_wait_for_CCR (cpu
, in_FCCi_3
);
520 handle_resource_wait (cpu
);
521 trace_vliw_wait_cycles (cpu
);
525 cycles
= idesc
->timing
->units
[unit_num
].done
;
530 frvbf_model_fr500_u_clrgr (SIM_CPU
*cpu
, const IDESC
*idesc
,
531 int unit_num
, int referenced
,
536 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
538 /* Wait for both GNER registers or just the one specified. */
541 vliw_wait_for_SPR (cpu
, H_SPR_GNER0
);
542 vliw_wait_for_SPR (cpu
, H_SPR_GNER1
);
545 vliw_wait_for_SPR (cpu
, GNER_FOR_GR (in_GRk
));
546 handle_resource_wait (cpu
);
547 trace_vliw_wait_cycles (cpu
);
551 cycles
= idesc
->timing
->units
[unit_num
].done
;
556 frvbf_model_fr500_u_clrfr (SIM_CPU
*cpu
, const IDESC
*idesc
,
557 int unit_num
, int referenced
,
562 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
564 /* Wait for both GNER registers or just the one specified. */
567 vliw_wait_for_SPR (cpu
, H_SPR_FNER0
);
568 vliw_wait_for_SPR (cpu
, H_SPR_FNER1
);
571 vliw_wait_for_SPR (cpu
, FNER_FOR_FR (in_FRk
));
572 handle_resource_wait (cpu
);
573 trace_vliw_wait_cycles (cpu
);
577 cycles
= idesc
->timing
->units
[unit_num
].done
;
582 frvbf_model_fr500_u_commit (SIM_CPU
*cpu
, const IDESC
*idesc
,
583 int unit_num
, int referenced
,
584 INT in_GRk
, INT in_FRk
)
588 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
590 /* If GR is specified, then FR is not and vice-versa. If neither is
591 then it's a commitga or commitfa. Check the insn attribute to
594 vliw_wait_for_SPR (cpu
, GNER_FOR_GR (in_GRk
));
595 else if (in_FRk
!= -1)
596 vliw_wait_for_SPR (cpu
, FNER_FOR_FR (in_FRk
));
597 else if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_FR_ACCESS
))
599 vliw_wait_for_SPR (cpu
, H_SPR_FNER0
);
600 vliw_wait_for_SPR (cpu
, H_SPR_FNER1
);
604 vliw_wait_for_SPR (cpu
, H_SPR_GNER0
);
605 vliw_wait_for_SPR (cpu
, H_SPR_GNER1
);
607 handle_resource_wait (cpu
);
608 trace_vliw_wait_cycles (cpu
);
612 cycles
= idesc
->timing
->units
[unit_num
].done
;
617 frvbf_model_fr500_u_set_hilo (SIM_CPU
*cpu
, const IDESC
*idesc
,
618 int unit_num
, int referenced
,
619 INT out_GRkhi
, INT out_GRklo
)
623 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
625 /* The entire VLIW insn must wait if there is a dependency on a GR
626 which is not ready yet. */
627 vliw_wait_for_GR (cpu
, out_GRkhi
);
628 vliw_wait_for_GR (cpu
, out_GRklo
);
629 handle_resource_wait (cpu
);
630 load_wait_for_GR (cpu
, out_GRkhi
);
631 load_wait_for_GR (cpu
, out_GRklo
);
632 trace_vliw_wait_cycles (cpu
);
636 /* GRk is available immediately to the next VLIW insn. */
637 cycles
= idesc
->timing
->units
[unit_num
].done
;
639 set_use_not_gr_complex (cpu
, out_GRkhi
);
640 set_use_not_gr_complex (cpu
, out_GRklo
);
646 frvbf_model_fr500_u_gr_load (SIM_CPU
*cpu
, const IDESC
*idesc
,
647 int unit_num
, int referenced
,
648 INT in_GRi
, INT in_GRj
,
649 INT out_GRk
, INT out_GRdoublek
)
653 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
655 /* The entire VLIW insn must wait if there is a dependency on a register
656 which is not ready yet.
657 The latency of the registers may be less than previously recorded,
658 depending on how they were used previously.
659 See Table 13-8 in the LSI. */
660 if (in_GRi
!= out_GRk
&& in_GRi
!= out_GRdoublek
661 && in_GRi
!= out_GRdoublek
+ 1 && in_GRi
>= 0)
663 if (use_is_gr_complex (cpu
, in_GRi
))
664 decrease_GR_busy (cpu
, in_GRi
, 1);
666 if (in_GRj
!= in_GRi
&& in_GRj
!= out_GRk
&& in_GRj
!= out_GRdoublek
667 && in_GRj
!= out_GRdoublek
+ 1 && in_GRj
>= 0)
670 if (use_is_gr_complex (cpu
, in_GRj
))
671 decrease_GR_busy (cpu
, in_GRj
, 1);
673 vliw_wait_for_GR (cpu
, in_GRi
);
674 vliw_wait_for_GR (cpu
, in_GRj
);
675 vliw_wait_for_GR (cpu
, out_GRk
);
676 vliw_wait_for_GRdouble (cpu
, out_GRdoublek
);
677 handle_resource_wait (cpu
);
678 load_wait_for_GR (cpu
, in_GRi
);
679 load_wait_for_GR (cpu
, in_GRj
);
680 load_wait_for_GR (cpu
, out_GRk
);
681 load_wait_for_GRdouble (cpu
, out_GRdoublek
);
682 trace_vliw_wait_cycles (cpu
);
686 cycles
= idesc
->timing
->units
[unit_num
].done
;
688 /* The latency of GRk for a load will depend on how long it takes to retrieve
689 the the data from the cache or memory. */
690 update_GR_latency_for_load (cpu
, out_GRk
, cycles
);
691 update_GRdouble_latency_for_load (cpu
, out_GRdoublek
, cycles
);
693 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
695 /* GNER has a latency of 2 cycles. */
696 update_SPR_latency (cpu
, GNER_FOR_GR (out_GRk
), cycles
+ 2);
697 update_SPR_latency (cpu
, GNER_FOR_GR (out_GRdoublek
), cycles
+ 2);
701 set_use_is_gr_complex (cpu
, out_GRk
);
702 if (out_GRdoublek
!= -1)
704 set_use_is_gr_complex (cpu
, out_GRdoublek
);
705 set_use_is_gr_complex (cpu
, out_GRdoublek
+ 1);
712 frvbf_model_fr500_u_gr_store (SIM_CPU
*cpu
, const IDESC
*idesc
,
713 int unit_num
, int referenced
,
714 INT in_GRi
, INT in_GRj
,
715 INT in_GRk
, INT in_GRdoublek
)
719 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
721 /* The entire VLIW insn must wait if there is a dependency on a register
722 which is not ready yet.
723 The latency of the registers may be less than previously recorded,
724 depending on how they were used previously.
725 See Table 13-8 in the LSI. */
728 if (use_is_gr_complex (cpu
, in_GRi
))
729 decrease_GR_busy (cpu
, in_GRi
, 1);
731 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
733 if (use_is_gr_complex (cpu
, in_GRj
))
734 decrease_GR_busy (cpu
, in_GRj
, 1);
736 if (in_GRk
!= in_GRi
&& in_GRk
!= in_GRj
&& in_GRk
>= 0)
738 if (use_is_gr_complex (cpu
, in_GRk
))
739 decrease_GR_busy (cpu
, in_GRk
, 1);
741 if (in_GRdoublek
!= in_GRi
&& in_GRdoublek
!= in_GRj
742 && in_GRdoublek
+ 1 != in_GRi
&& in_GRdoublek
+ 1 != in_GRj
743 && in_GRdoublek
>= 0)
745 if (use_is_gr_complex (cpu
, in_GRdoublek
))
746 decrease_GR_busy (cpu
, in_GRdoublek
, 1);
747 if (use_is_gr_complex (cpu
, in_GRdoublek
+ 1))
748 decrease_GR_busy (cpu
, in_GRdoublek
+ 1, 1);
750 vliw_wait_for_GR (cpu
, in_GRi
);
751 vliw_wait_for_GR (cpu
, in_GRj
);
752 vliw_wait_for_GR (cpu
, in_GRk
);
753 vliw_wait_for_GRdouble (cpu
, in_GRdoublek
);
754 handle_resource_wait (cpu
);
755 load_wait_for_GR (cpu
, in_GRi
);
756 load_wait_for_GR (cpu
, in_GRj
);
757 load_wait_for_GR (cpu
, in_GRk
);
758 load_wait_for_GRdouble (cpu
, in_GRdoublek
);
759 trace_vliw_wait_cycles (cpu
);
763 cycles
= idesc
->timing
->units
[unit_num
].done
;
769 frvbf_model_fr500_u_gr_r_store (SIM_CPU
*cpu
, const IDESC
*idesc
,
770 int unit_num
, int referenced
,
771 INT in_GRi
, INT in_GRj
,
772 INT in_GRk
, INT in_GRdoublek
)
774 int cycles
= frvbf_model_fr500_u_gr_store (cpu
, idesc
, unit_num
, referenced
,
775 in_GRi
, in_GRj
, in_GRk
,
778 if (model_insn
== FRV_INSN_MODEL_PASS_2
)
780 if (CPU_RSTR_INVALIDATE(cpu
))
781 request_cache_invalidate (cpu
, CPU_DATA_CACHE (cpu
), cycles
);
788 frvbf_model_fr500_u_fr_load (SIM_CPU
*cpu
, const IDESC
*idesc
,
789 int unit_num
, int referenced
,
790 INT in_GRi
, INT in_GRj
,
791 INT out_FRk
, INT out_FRdoublek
)
795 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
797 /* The entire VLIW insn must wait if there is a dependency on a register
798 which is not ready yet.
799 The latency of the registers may be less than previously recorded,
800 depending on how they were used previously.
801 See Table 13-8 in the LSI. */
804 if (use_is_gr_complex (cpu
, in_GRi
))
805 decrease_GR_busy (cpu
, in_GRi
, 1);
807 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
809 if (use_is_gr_complex (cpu
, in_GRj
))
810 decrease_GR_busy (cpu
, in_GRj
, 1);
814 if (use_is_media (cpu
, out_FRk
))
815 decrease_FR_busy (cpu
, out_FRk
, 1);
817 adjust_float_register_busy (cpu
, -1, -1, out_FRk
, 1);
819 if (out_FRdoublek
>= 0)
821 if (use_is_media (cpu
, out_FRdoublek
))
822 decrease_FR_busy (cpu
, out_FRdoublek
, 1);
824 adjust_float_register_busy (cpu
, -1, -1, out_FRdoublek
, 1);
825 if (use_is_media (cpu
, out_FRdoublek
+ 1))
826 decrease_FR_busy (cpu
, out_FRdoublek
+ 1, 1);
828 adjust_float_register_busy (cpu
, -1, -1, out_FRdoublek
+ 1, 1);
830 vliw_wait_for_GR (cpu
, in_GRi
);
831 vliw_wait_for_GR (cpu
, in_GRj
);
832 vliw_wait_for_FR (cpu
, out_FRk
);
833 vliw_wait_for_FRdouble (cpu
, out_FRdoublek
);
834 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
836 vliw_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRk
));
837 vliw_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRdoublek
));
839 handle_resource_wait (cpu
);
840 load_wait_for_GR (cpu
, in_GRi
);
841 load_wait_for_GR (cpu
, in_GRj
);
842 load_wait_for_FR (cpu
, out_FRk
);
843 load_wait_for_FRdouble (cpu
, out_FRdoublek
);
844 trace_vliw_wait_cycles (cpu
);
848 cycles
= idesc
->timing
->units
[unit_num
].done
;
850 /* The latency of FRk for a load will depend on how long it takes to retrieve
851 the the data from the cache or memory. */
852 update_FR_latency_for_load (cpu
, out_FRk
, cycles
);
853 update_FRdouble_latency_for_load (cpu
, out_FRdoublek
, cycles
);
855 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
857 /* FNER has a latency of 3 cycles. */
858 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRk
), cycles
+ 3);
859 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRdoublek
), cycles
+ 3);
862 fr500_reset_fr_flags (cpu
, out_FRk
);
868 frvbf_model_fr500_u_fr_store (SIM_CPU
*cpu
, const IDESC
*idesc
,
869 int unit_num
, int referenced
,
870 INT in_GRi
, INT in_GRj
,
871 INT in_FRk
, INT in_FRdoublek
)
875 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
877 /* The entire VLIW insn must wait if there is a dependency on a register
878 which is not ready yet.
879 The latency of the registers may be less than previously recorded,
880 depending on how they were used previously.
881 See Table 13-8 in the LSI. */
884 if (use_is_gr_complex (cpu
, in_GRi
))
885 decrease_GR_busy (cpu
, in_GRi
, 1);
887 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
889 if (use_is_gr_complex (cpu
, in_GRj
))
890 decrease_GR_busy (cpu
, in_GRj
, 1);
894 if (use_is_media (cpu
, in_FRk
))
895 decrease_FR_busy (cpu
, in_FRk
, 1);
897 adjust_float_register_busy (cpu
, -1, -1, in_FRk
, 1);
899 if (in_FRdoublek
>= 0)
901 if (use_is_media (cpu
, in_FRdoublek
))
902 decrease_FR_busy (cpu
, in_FRdoublek
, 1);
904 adjust_float_register_busy (cpu
, -1, -1, in_FRdoublek
, 1);
905 if (use_is_media (cpu
, in_FRdoublek
+ 1))
906 decrease_FR_busy (cpu
, in_FRdoublek
+ 1, 1);
908 adjust_float_register_busy (cpu
, -1, -1, in_FRdoublek
+ 1, 1);
910 vliw_wait_for_GR (cpu
, in_GRi
);
911 vliw_wait_for_GR (cpu
, in_GRj
);
912 vliw_wait_for_FR (cpu
, in_FRk
);
913 vliw_wait_for_FRdouble (cpu
, in_FRdoublek
);
914 handle_resource_wait (cpu
);
915 load_wait_for_GR (cpu
, in_GRi
);
916 load_wait_for_GR (cpu
, in_GRj
);
917 load_wait_for_FR (cpu
, in_FRk
);
918 load_wait_for_FRdouble (cpu
, in_FRdoublek
);
919 trace_vliw_wait_cycles (cpu
);
923 cycles
= idesc
->timing
->units
[unit_num
].done
;
929 frvbf_model_fr500_u_fr_r_store (SIM_CPU
*cpu
, const IDESC
*idesc
,
930 int unit_num
, int referenced
,
931 INT in_GRi
, INT in_GRj
,
932 INT in_FRk
, INT in_FRdoublek
)
934 int cycles
= frvbf_model_fr500_u_fr_store (cpu
, idesc
, unit_num
, referenced
,
935 in_GRi
, in_GRj
, in_FRk
,
938 if (model_insn
== FRV_INSN_MODEL_PASS_2
)
940 if (CPU_RSTR_INVALIDATE(cpu
))
941 request_cache_invalidate (cpu
, CPU_DATA_CACHE (cpu
), cycles
);
948 frvbf_model_fr500_u_swap (SIM_CPU
*cpu
, const IDESC
*idesc
,
949 int unit_num
, int referenced
,
950 INT in_GRi
, INT in_GRj
, INT out_GRk
)
954 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
956 /* The entire VLIW insn must wait if there is a dependency on a register
957 which is not ready yet.
958 The latency of the registers may be less than previously recorded,
959 depending on how they were used previously.
960 See Table 13-8 in the LSI. */
961 if (in_GRi
!= out_GRk
&& in_GRi
>= 0)
963 if (use_is_gr_complex (cpu
, in_GRi
))
964 decrease_GR_busy (cpu
, in_GRi
, 1);
966 if (in_GRj
!= out_GRk
&& in_GRj
!= in_GRi
&& in_GRj
>= 0)
968 if (use_is_gr_complex (cpu
, in_GRj
))
969 decrease_GR_busy (cpu
, in_GRj
, 1);
971 vliw_wait_for_GR (cpu
, in_GRi
);
972 vliw_wait_for_GR (cpu
, in_GRj
);
973 vliw_wait_for_GR (cpu
, out_GRk
);
974 handle_resource_wait (cpu
);
975 load_wait_for_GR (cpu
, in_GRi
);
976 load_wait_for_GR (cpu
, in_GRj
);
977 load_wait_for_GR (cpu
, out_GRk
);
978 trace_vliw_wait_cycles (cpu
);
982 cycles
= idesc
->timing
->units
[unit_num
].done
;
984 /* The latency of GRk will depend on how long it takes to swap
985 the the data from the cache or memory. */
986 update_GR_latency_for_swap (cpu
, out_GRk
, cycles
);
987 set_use_is_gr_complex (cpu
, out_GRk
);
993 frvbf_model_fr500_u_fr2fr (SIM_CPU
*cpu
, const IDESC
*idesc
,
994 int unit_num
, int referenced
,
995 INT in_FRj
, INT out_FRk
)
999 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1001 /* The entire VLIW insn must wait if there is a dependency on a register
1002 which is not ready yet. */
1005 if (use_is_media (cpu
, in_FRj
))
1006 decrease_FR_busy (cpu
, in_FRj
, 1);
1008 adjust_float_register_busy (cpu
, -1, in_FRj
, -1, 1);
1010 if (out_FRk
>= 0 && out_FRk
!= in_FRj
)
1012 if (use_is_media (cpu
, out_FRk
))
1013 decrease_FR_busy (cpu
, out_FRk
, 1);
1015 adjust_float_register_busy (cpu
, -1, -1, out_FRk
, 1);
1017 vliw_wait_for_FR (cpu
, in_FRj
);
1018 vliw_wait_for_FR (cpu
, out_FRk
);
1019 handle_resource_wait (cpu
);
1020 load_wait_for_FR (cpu
, in_FRj
);
1021 load_wait_for_FR (cpu
, out_FRk
);
1022 trace_vliw_wait_cycles (cpu
);
1026 /* The latency of FRj is 3 cycles. */
1027 cycles
= idesc
->timing
->units
[unit_num
].done
;
1028 update_FR_latency (cpu
, out_FRk
, cycles
+ 3);
1034 frvbf_model_fr500_u_fr2gr (SIM_CPU
*cpu
, const IDESC
*idesc
,
1035 int unit_num
, int referenced
,
1036 INT in_FRk
, INT out_GRj
)
1040 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1042 /* The entire VLIW insn must wait if there is a dependency on a register
1043 which is not ready yet. */
1046 if (use_is_media (cpu
, in_FRk
))
1047 decrease_FR_busy (cpu
, in_FRk
, 1);
1049 adjust_float_register_busy (cpu
, -1, in_FRk
, -1, 1);
1051 vliw_wait_for_FR (cpu
, in_FRk
);
1052 vliw_wait_for_GR (cpu
, out_GRj
);
1053 handle_resource_wait (cpu
);
1054 load_wait_for_FR (cpu
, in_FRk
);
1055 load_wait_for_GR (cpu
, out_GRj
);
1056 trace_vliw_wait_cycles (cpu
);
1060 /* The latency of GRj is 2 cycles. */
1061 cycles
= idesc
->timing
->units
[unit_num
].done
;
1062 update_GR_latency (cpu
, out_GRj
, cycles
+ 2);
1063 set_use_is_gr_complex (cpu
, out_GRj
);
1069 frvbf_model_fr500_u_spr2gr (SIM_CPU
*cpu
, const IDESC
*idesc
,
1070 int unit_num
, int referenced
,
1071 INT in_spr
, INT out_GRj
)
1075 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1077 /* The entire VLIW insn must wait if there is a dependency on a register
1078 which is not ready yet. */
1079 vliw_wait_for_SPR (cpu
, in_spr
);
1080 vliw_wait_for_GR (cpu
, out_GRj
);
1081 handle_resource_wait (cpu
);
1082 load_wait_for_GR (cpu
, out_GRj
);
1083 trace_vliw_wait_cycles (cpu
);
1087 cycles
= idesc
->timing
->units
[unit_num
].done
;
1089 #if 0 /* no latency? */
1090 /* The latency of GRj is 2 cycles. */
1091 update_GR_latency (cpu
, out_GRj
, cycles
+ 2);
1098 frvbf_model_fr500_u_gr2fr (SIM_CPU
*cpu
, const IDESC
*idesc
,
1099 int unit_num
, int referenced
,
1100 INT in_GRj
, INT out_FRk
)
1104 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1106 /* The entire VLIW insn must wait if there is a dependency on a register
1107 which is not ready yet.
1108 The latency of the registers may be less than previously recorded,
1109 depending on how they were used previously.
1110 See Table 13-8 in the LSI. */
1113 if (use_is_gr_complex (cpu
, in_GRj
))
1114 decrease_GR_busy (cpu
, in_GRj
, 1);
1118 if (use_is_media (cpu
, out_FRk
))
1119 decrease_FR_busy (cpu
, out_FRk
, 1);
1121 adjust_float_register_busy (cpu
, -1, -1, out_FRk
, 1);
1123 vliw_wait_for_GR (cpu
, in_GRj
);
1124 vliw_wait_for_FR (cpu
, out_FRk
);
1125 handle_resource_wait (cpu
);
1126 load_wait_for_GR (cpu
, in_GRj
);
1127 load_wait_for_FR (cpu
, out_FRk
);
1128 trace_vliw_wait_cycles (cpu
);
1132 /* The latency of FRk is 2 cycles. */
1133 cycles
= idesc
->timing
->units
[unit_num
].done
;
1134 update_FR_latency (cpu
, out_FRk
, cycles
+ 2);
1136 /* Mark this use of the register as NOT a floating point op. */
1137 fr500_reset_fr_flags (cpu
, out_FRk
);
1143 frvbf_model_fr500_u_gr2spr (SIM_CPU
*cpu
, const IDESC
*idesc
,
1144 int unit_num
, int referenced
,
1145 INT in_GRj
, INT out_spr
)
1149 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1151 /* The entire VLIW insn must wait if there is a dependency on a register
1152 which is not ready yet.
1153 The latency of the registers may be less than previously recorded,
1154 depending on how they were used previously.
1155 See Table 13-8 in the LSI. */
1158 if (use_is_gr_complex (cpu
, in_GRj
))
1159 decrease_GR_busy (cpu
, in_GRj
, 1);
1161 vliw_wait_for_GR (cpu
, in_GRj
);
1162 vliw_wait_for_SPR (cpu
, out_spr
);
1163 handle_resource_wait (cpu
);
1164 load_wait_for_GR (cpu
, in_GRj
);
1165 trace_vliw_wait_cycles (cpu
);
1169 cycles
= idesc
->timing
->units
[unit_num
].done
;
1172 /* The latency of spr is ? cycles. */
1173 update_SPR_latency (cpu
, out_spr
, cycles
+ ?);
1180 frvbf_model_fr500_u_ici (SIM_CPU
*cpu
, const IDESC
*idesc
,
1181 int unit_num
, int referenced
,
1182 INT in_GRi
, INT in_GRj
)
1186 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1188 /* The entire VLIW insn must wait if there is a dependency on a register
1189 which is not ready yet.
1190 The latency of the registers may be less than previously recorded,
1191 depending on how they were used previously.
1192 See Table 13-8 in the LSI. */
1195 if (use_is_gr_complex (cpu
, in_GRi
))
1196 decrease_GR_busy (cpu
, in_GRi
, 1);
1198 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
1200 if (use_is_gr_complex (cpu
, in_GRj
))
1201 decrease_GR_busy (cpu
, in_GRj
, 1);
1203 vliw_wait_for_GR (cpu
, in_GRi
);
1204 vliw_wait_for_GR (cpu
, in_GRj
);
1205 handle_resource_wait (cpu
);
1206 load_wait_for_GR (cpu
, in_GRi
);
1207 load_wait_for_GR (cpu
, in_GRj
);
1208 trace_vliw_wait_cycles (cpu
);
1212 cycles
= idesc
->timing
->units
[unit_num
].done
;
1213 request_cache_invalidate (cpu
, CPU_INSN_CACHE (cpu
), cycles
);
1218 frvbf_model_fr500_u_dci (SIM_CPU
*cpu
, const IDESC
*idesc
,
1219 int unit_num
, int referenced
,
1220 INT in_GRi
, INT in_GRj
)
1224 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1226 /* The entire VLIW insn must wait if there is a dependency on a register
1227 which is not ready yet.
1228 The latency of the registers may be less than previously recorded,
1229 depending on how they were used previously.
1230 See Table 13-8 in the LSI. */
1233 if (use_is_gr_complex (cpu
, in_GRi
))
1234 decrease_GR_busy (cpu
, in_GRi
, 1);
1236 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
1238 if (use_is_gr_complex (cpu
, in_GRj
))
1239 decrease_GR_busy (cpu
, in_GRj
, 1);
1241 vliw_wait_for_GR (cpu
, in_GRi
);
1242 vliw_wait_for_GR (cpu
, in_GRj
);
1243 handle_resource_wait (cpu
);
1244 load_wait_for_GR (cpu
, in_GRi
);
1245 load_wait_for_GR (cpu
, in_GRj
);
1246 trace_vliw_wait_cycles (cpu
);
1250 cycles
= idesc
->timing
->units
[unit_num
].done
;
1251 request_cache_invalidate (cpu
, CPU_DATA_CACHE (cpu
), cycles
);
1256 frvbf_model_fr500_u_dcf (SIM_CPU
*cpu
, const IDESC
*idesc
,
1257 int unit_num
, int referenced
,
1258 INT in_GRi
, INT in_GRj
)
1262 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1264 /* The entire VLIW insn must wait if there is a dependency on a register
1265 which is not ready yet.
1266 The latency of the registers may be less than previously recorded,
1267 depending on how they were used previously.
1268 See Table 13-8 in the LSI. */
1271 if (use_is_gr_complex (cpu
, in_GRi
))
1272 decrease_GR_busy (cpu
, in_GRi
, 1);
1274 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
1276 if (use_is_gr_complex (cpu
, in_GRj
))
1277 decrease_GR_busy (cpu
, in_GRj
, 1);
1279 vliw_wait_for_GR (cpu
, in_GRi
);
1280 vliw_wait_for_GR (cpu
, in_GRj
);
1281 handle_resource_wait (cpu
);
1282 load_wait_for_GR (cpu
, in_GRi
);
1283 load_wait_for_GR (cpu
, in_GRj
);
1284 trace_vliw_wait_cycles (cpu
);
1288 cycles
= idesc
->timing
->units
[unit_num
].done
;
1289 request_cache_flush (cpu
, CPU_DATA_CACHE (cpu
), cycles
);
1294 frvbf_model_fr500_u_icpl (SIM_CPU
*cpu
, const IDESC
*idesc
,
1295 int unit_num
, int referenced
,
1296 INT in_GRi
, INT in_GRj
)
1300 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1302 /* The entire VLIW insn must wait if there is a dependency on a register
1303 which is not ready yet.
1304 The latency of the registers may be less than previously recorded,
1305 depending on how they were used previously.
1306 See Table 13-8 in the LSI. */
1309 if (use_is_gr_complex (cpu
, in_GRi
))
1310 decrease_GR_busy (cpu
, in_GRi
, 1);
1312 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
1314 if (use_is_gr_complex (cpu
, in_GRj
))
1315 decrease_GR_busy (cpu
, in_GRj
, 1);
1317 vliw_wait_for_GR (cpu
, in_GRi
);
1318 vliw_wait_for_GR (cpu
, in_GRj
);
1319 handle_resource_wait (cpu
);
1320 load_wait_for_GR (cpu
, in_GRi
);
1321 load_wait_for_GR (cpu
, in_GRj
);
1322 trace_vliw_wait_cycles (cpu
);
1326 cycles
= idesc
->timing
->units
[unit_num
].done
;
1327 request_cache_preload (cpu
, CPU_INSN_CACHE (cpu
), cycles
);
1332 frvbf_model_fr500_u_dcpl (SIM_CPU
*cpu
, const IDESC
*idesc
,
1333 int unit_num
, int referenced
,
1334 INT in_GRi
, INT in_GRj
)
1338 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1340 /* The entire VLIW insn must wait if there is a dependency on a register
1341 which is not ready yet.
1342 The latency of the registers may be less than previously recorded,
1343 depending on how they were used previously.
1344 See Table 13-8 in the LSI. */
1347 if (use_is_gr_complex (cpu
, in_GRi
))
1348 decrease_GR_busy (cpu
, in_GRi
, 1);
1350 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
1352 if (use_is_gr_complex (cpu
, in_GRj
))
1353 decrease_GR_busy (cpu
, in_GRj
, 1);
1355 vliw_wait_for_GR (cpu
, in_GRi
);
1356 vliw_wait_for_GR (cpu
, in_GRj
);
1357 handle_resource_wait (cpu
);
1358 load_wait_for_GR (cpu
, in_GRi
);
1359 load_wait_for_GR (cpu
, in_GRj
);
1360 trace_vliw_wait_cycles (cpu
);
1364 cycles
= idesc
->timing
->units
[unit_num
].done
;
1365 request_cache_preload (cpu
, CPU_DATA_CACHE (cpu
), cycles
);
1370 frvbf_model_fr500_u_icul (SIM_CPU
*cpu
, const IDESC
*idesc
,
1371 int unit_num
, int referenced
,
1372 INT in_GRi
, INT in_GRj
)
1376 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1378 /* The entire VLIW insn must wait if there is a dependency on a register
1379 which is not ready yet.
1380 The latency of the registers may be less than previously recorded,
1381 depending on how they were used previously.
1382 See Table 13-8 in the LSI. */
1385 if (use_is_gr_complex (cpu
, in_GRi
))
1386 decrease_GR_busy (cpu
, in_GRi
, 1);
1388 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
1390 if (use_is_gr_complex (cpu
, in_GRj
))
1391 decrease_GR_busy (cpu
, in_GRj
, 1);
1393 vliw_wait_for_GR (cpu
, in_GRi
);
1394 vliw_wait_for_GR (cpu
, in_GRj
);
1395 handle_resource_wait (cpu
);
1396 load_wait_for_GR (cpu
, in_GRi
);
1397 load_wait_for_GR (cpu
, in_GRj
);
1398 trace_vliw_wait_cycles (cpu
);
1402 cycles
= idesc
->timing
->units
[unit_num
].done
;
1403 request_cache_unlock (cpu
, CPU_INSN_CACHE (cpu
), cycles
);
1408 frvbf_model_fr500_u_dcul (SIM_CPU
*cpu
, const IDESC
*idesc
,
1409 int unit_num
, int referenced
,
1410 INT in_GRi
, INT in_GRj
)
1414 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1416 /* The entire VLIW insn must wait if there is a dependency on a register
1417 which is not ready yet.
1418 The latency of the registers may be less than previously recorded,
1419 depending on how they were used previously.
1420 See Table 13-8 in the LSI. */
1423 if (use_is_gr_complex (cpu
, in_GRi
))
1424 decrease_GR_busy (cpu
, in_GRi
, 1);
1426 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
1428 if (use_is_gr_complex (cpu
, in_GRj
))
1429 decrease_GR_busy (cpu
, in_GRj
, 1);
1431 vliw_wait_for_GR (cpu
, in_GRi
);
1432 vliw_wait_for_GR (cpu
, in_GRj
);
1433 handle_resource_wait (cpu
);
1434 load_wait_for_GR (cpu
, in_GRi
);
1435 load_wait_for_GR (cpu
, in_GRj
);
1436 trace_vliw_wait_cycles (cpu
);
1440 cycles
= idesc
->timing
->units
[unit_num
].done
;
1441 request_cache_unlock (cpu
, CPU_DATA_CACHE (cpu
), cycles
);
1446 frvbf_model_fr500_u_float_arith (SIM_CPU
*cpu
, const IDESC
*idesc
,
1447 int unit_num
, int referenced
,
1448 INT in_FRi
, INT in_FRj
,
1449 INT in_FRdoublei
, INT in_FRdoublej
,
1450 INT out_FRk
, INT out_FRdoublek
)
1453 FRV_PROFILE_STATE
*ps
;
1455 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1458 /* The preprocessing can execute right away. */
1459 cycles
= idesc
->timing
->units
[unit_num
].done
;
1461 /* The post processing must wait if there is a dependency on a FR
1462 which is not ready yet. */
1463 adjust_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, 1);
1464 adjust_double_register_busy (cpu
, in_FRdoublei
, in_FRdoublej
, out_FRdoublek
,
1466 ps
= CPU_PROFILE_STATE (cpu
);
1467 ps
->post_wait
= cycles
;
1468 post_wait_for_FR (cpu
, in_FRi
);
1469 post_wait_for_FR (cpu
, in_FRj
);
1470 post_wait_for_FR (cpu
, out_FRk
);
1471 post_wait_for_FRdouble (cpu
, in_FRdoublei
);
1472 post_wait_for_FRdouble (cpu
, in_FRdoublej
);
1473 post_wait_for_FRdouble (cpu
, out_FRdoublek
);
1474 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1476 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRk
));
1477 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRdoublek
));
1479 restore_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, 1);
1480 restore_double_register_busy (cpu
, in_FRdoublei
, in_FRdoublej
, out_FRdoublek
,
1483 /* The latency of FRk will be at least the latency of the other inputs. */
1484 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
1485 update_FRdouble_latency (cpu
, out_FRdoublek
, ps
->post_wait
);
1487 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1489 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRk
), ps
->post_wait
);
1490 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRdoublek
), ps
->post_wait
);
1493 /* Once initiated, post-processing will take 3 cycles. */
1494 update_FR_ptime (cpu
, out_FRk
, 3);
1495 update_FRdouble_ptime (cpu
, out_FRdoublek
, 3);
1497 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1499 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRk
), 3);
1500 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRdoublek
), 3);
1503 /* Mark this use of the register as a floating point op. */
1505 set_use_is_fpop (cpu
, out_FRk
);
1506 if (out_FRdoublek
>= 0)
1508 set_use_is_fpop (cpu
, out_FRdoublek
);
1509 if (out_FRdoublek
< 63)
1510 set_use_is_fpop (cpu
, out_FRdoublek
+ 1);
1517 frvbf_model_fr500_u_float_dual_arith (SIM_CPU
*cpu
, const IDESC
*idesc
,
1518 int unit_num
, int referenced
,
1519 INT in_FRi
, INT in_FRj
,
1520 INT in_FRdoublei
, INT in_FRdoublej
,
1521 INT out_FRk
, INT out_FRdoublek
)
1530 FRV_PROFILE_STATE
*ps
;
1532 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1535 /* The preprocessing can execute right away. */
1536 cycles
= idesc
->timing
->units
[unit_num
].done
;
1538 /* The post processing must wait if there is a dependency on a FR
1539 which is not ready yet. */
1540 dual_FRi
= DUAL_REG (in_FRi
);
1541 dual_FRj
= DUAL_REG (in_FRj
);
1542 dual_FRk
= DUAL_REG (out_FRk
);
1543 dual_FRdoublei
= DUAL_DOUBLE (in_FRdoublei
);
1544 dual_FRdoublej
= DUAL_DOUBLE (in_FRdoublej
);
1545 dual_FRdoublek
= DUAL_DOUBLE (out_FRdoublek
);
1547 adjust_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, 1);
1548 adjust_float_register_busy (cpu
, dual_FRi
, dual_FRj
, dual_FRk
, 1);
1549 adjust_double_register_busy (cpu
, in_FRdoublei
, in_FRdoublej
, out_FRdoublek
,
1551 adjust_double_register_busy (cpu
, dual_FRdoublei
, dual_FRdoublej
,
1553 ps
= CPU_PROFILE_STATE (cpu
);
1554 ps
->post_wait
= cycles
;
1555 post_wait_for_FR (cpu
, in_FRi
);
1556 post_wait_for_FR (cpu
, in_FRj
);
1557 post_wait_for_FR (cpu
, out_FRk
);
1558 post_wait_for_FR (cpu
, dual_FRi
);
1559 post_wait_for_FR (cpu
, dual_FRj
);
1560 post_wait_for_FR (cpu
, dual_FRk
);
1561 post_wait_for_FRdouble (cpu
, in_FRdoublei
);
1562 post_wait_for_FRdouble (cpu
, in_FRdoublej
);
1563 post_wait_for_FRdouble (cpu
, out_FRdoublek
);
1564 post_wait_for_FRdouble (cpu
, dual_FRdoublei
);
1565 post_wait_for_FRdouble (cpu
, dual_FRdoublej
);
1566 post_wait_for_FRdouble (cpu
, dual_FRdoublek
);
1567 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1569 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRk
));
1570 post_wait_for_SPR (cpu
, FNER_FOR_FR (dual_FRk
));
1571 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRdoublek
));
1572 post_wait_for_SPR (cpu
, FNER_FOR_FR (dual_FRdoublek
));
1574 restore_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, 1);
1575 restore_float_register_busy (cpu
, dual_FRi
, dual_FRj
, dual_FRk
, 1);
1576 restore_double_register_busy (cpu
, in_FRdoublei
, in_FRdoublej
, out_FRdoublek
,
1578 restore_double_register_busy (cpu
, dual_FRdoublei
, dual_FRdoublej
,
1581 /* The latency of FRk will be at least the latency of the other inputs. */
1582 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
1583 update_FR_latency (cpu
, dual_FRk
, ps
->post_wait
);
1584 update_FRdouble_latency (cpu
, out_FRdoublek
, ps
->post_wait
);
1585 update_FRdouble_latency (cpu
, dual_FRdoublek
, ps
->post_wait
);
1587 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1589 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRk
), ps
->post_wait
);
1590 update_SPR_latency (cpu
, FNER_FOR_FR (dual_FRk
), ps
->post_wait
);
1591 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRdoublek
), ps
->post_wait
);
1592 update_SPR_latency (cpu
, FNER_FOR_FR (dual_FRdoublek
), ps
->post_wait
);
1595 /* Once initiated, post-processing will take 3 cycles. */
1596 update_FR_ptime (cpu
, out_FRk
, 3);
1597 update_FR_ptime (cpu
, dual_FRk
, 3);
1598 update_FRdouble_ptime (cpu
, out_FRdoublek
, 3);
1599 update_FRdouble_ptime (cpu
, dual_FRdoublek
, 3);
1601 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1603 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRk
), 3);
1604 update_SPR_ptime (cpu
, FNER_FOR_FR (dual_FRk
), 3);
1605 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRdoublek
), 3);
1606 update_SPR_ptime (cpu
, FNER_FOR_FR (dual_FRdoublek
), 3);
1609 /* Mark this use of the register as a floating point op. */
1611 set_use_is_fpop (cpu
, out_FRk
);
1613 set_use_is_fpop (cpu
, dual_FRk
);
1614 if (out_FRdoublek
>= 0)
1616 set_use_is_fpop (cpu
, out_FRdoublek
);
1617 if (out_FRdoublek
< 63)
1618 set_use_is_fpop (cpu
, out_FRdoublek
+ 1);
1620 if (dual_FRdoublek
>= 0)
1622 set_use_is_fpop (cpu
, dual_FRdoublek
);
1623 if (dual_FRdoublek
< 63)
1624 set_use_is_fpop (cpu
, dual_FRdoublek
+ 1);
1631 frvbf_model_fr500_u_float_div (SIM_CPU
*cpu
, const IDESC
*idesc
,
1632 int unit_num
, int referenced
,
1633 INT in_FRi
, INT in_FRj
, INT out_FRk
)
1638 FRV_PROFILE_STATE
*ps
;
1640 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1643 cycles
= idesc
->timing
->units
[unit_num
].done
;
1645 /* The post processing must wait if there is a dependency on a FR
1646 which is not ready yet. */
1647 adjust_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, 1);
1648 ps
= CPU_PROFILE_STATE (cpu
);
1649 ps
->post_wait
= cycles
;
1650 post_wait_for_FR (cpu
, in_FRi
);
1651 post_wait_for_FR (cpu
, in_FRj
);
1652 post_wait_for_FR (cpu
, out_FRk
);
1653 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1654 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRk
));
1655 vliw
= CPU_VLIW (cpu
);
1656 slot
= vliw
->next_slot
- 1;
1657 slot
= (*vliw
->current_vliw
)[slot
] - UNIT_FM0
;
1658 post_wait_for_fdiv (cpu
, slot
);
1659 restore_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, 1);
1661 /* The latency of FRk will be at least the latency of the other inputs. */
1662 /* Once initiated, post-processing will take 10 cycles. */
1663 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
1664 update_FR_ptime (cpu
, out_FRk
, 10);
1666 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1668 /* FNER has a latency of 10 cycles. */
1669 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRk
), ps
->post_wait
);
1670 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRk
), 10);
1673 /* The latency of the fdiv unit will be at least the latency of the other
1674 inputs. Once initiated, post-processing will take 9 cycles. */
1675 update_fdiv_resource_latency (cpu
, slot
, ps
->post_wait
+ 9);
1677 /* Mark this use of the register as a floating point op. */
1678 set_use_is_fpop (cpu
, out_FRk
);
1684 frvbf_model_fr500_u_float_sqrt (SIM_CPU
*cpu
, const IDESC
*idesc
,
1685 int unit_num
, int referenced
,
1686 INT in_FRj
, INT in_FRdoublej
,
1687 INT out_FRk
, INT out_FRdoublek
)
1692 FRV_PROFILE_STATE
*ps
;
1694 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1697 cycles
= idesc
->timing
->units
[unit_num
].done
;
1699 /* The post processing must wait if there is a dependency on a FR
1700 which is not ready yet. */
1701 adjust_float_register_busy (cpu
, -1, in_FRj
, out_FRk
, 1);
1702 adjust_double_register_busy (cpu
, -1, in_FRdoublej
, out_FRdoublek
, 1);
1703 ps
= CPU_PROFILE_STATE (cpu
);
1704 ps
->post_wait
= cycles
;
1705 post_wait_for_FR (cpu
, in_FRj
);
1706 post_wait_for_FR (cpu
, out_FRk
);
1707 post_wait_for_FRdouble (cpu
, in_FRdoublej
);
1708 post_wait_for_FRdouble (cpu
, out_FRdoublek
);
1709 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1710 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRk
));
1711 vliw
= CPU_VLIW (cpu
);
1712 slot
= vliw
->next_slot
- 1;
1713 slot
= (*vliw
->current_vliw
)[slot
] - UNIT_FM0
;
1714 post_wait_for_fsqrt (cpu
, slot
);
1715 restore_float_register_busy (cpu
, -1, in_FRj
, out_FRk
, 1);
1716 restore_double_register_busy (cpu
, -1, in_FRdoublej
, out_FRdoublek
, 1);
1718 /* The latency of FRk will be at least the latency of the other inputs. */
1719 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
1720 update_FRdouble_latency (cpu
, out_FRdoublek
, ps
->post_wait
);
1721 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1722 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRk
), ps
->post_wait
);
1724 /* Once initiated, post-processing will take 15 cycles. */
1725 update_FR_ptime (cpu
, out_FRk
, 15);
1726 update_FRdouble_ptime (cpu
, out_FRdoublek
, 15);
1728 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1729 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRk
), 15);
1731 /* The latency of the sqrt unit will be the latency of the other
1732 inputs plus 14 cycles. */
1733 update_fsqrt_resource_latency (cpu
, slot
, ps
->post_wait
+ 14);
1735 /* Mark this use of the register as a floating point op. */
1737 set_use_is_fpop (cpu
, out_FRk
);
1738 if (out_FRdoublek
>= 0)
1740 set_use_is_fpop (cpu
, out_FRdoublek
);
1741 if (out_FRdoublek
< 63)
1742 set_use_is_fpop (cpu
, out_FRdoublek
+ 1);
1749 frvbf_model_fr500_u_float_dual_sqrt (SIM_CPU
*cpu
, const IDESC
*idesc
,
1750 int unit_num
, int referenced
,
1751 INT in_FRj
, INT out_FRk
)
1758 FRV_PROFILE_STATE
*ps
;
1760 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1763 cycles
= idesc
->timing
->units
[unit_num
].done
;
1765 /* The post processing must wait if there is a dependency on a FR
1766 which is not ready yet. */
1767 dual_FRj
= DUAL_REG (in_FRj
);
1768 dual_FRk
= DUAL_REG (out_FRk
);
1769 adjust_float_register_busy (cpu
, -1, in_FRj
, out_FRk
, 1);
1770 adjust_float_register_busy (cpu
, -1, dual_FRj
, dual_FRk
, 1);
1771 ps
= CPU_PROFILE_STATE (cpu
);
1772 ps
->post_wait
= cycles
;
1773 post_wait_for_FR (cpu
, in_FRj
);
1774 post_wait_for_FR (cpu
, out_FRk
);
1775 post_wait_for_FR (cpu
, dual_FRj
);
1776 post_wait_for_FR (cpu
, dual_FRk
);
1778 vliw
= CPU_VLIW (cpu
);
1779 slot
= vliw
->next_slot
- 1;
1780 slot
= (*vliw
->current_vliw
)[slot
] - UNIT_FM0
;
1781 post_wait_for_fsqrt (cpu
, slot
);
1782 restore_float_register_busy (cpu
, -1, in_FRj
, out_FRk
, 1);
1783 restore_float_register_busy (cpu
, -1, dual_FRj
, dual_FRk
, 1);
1785 /* The latency of FRk will be at least the latency of the other inputs. */
1786 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
1787 update_FR_latency (cpu
, dual_FRk
, ps
->post_wait
);
1789 /* Once initiated, post-processing will take 15 cycles. */
1790 update_FR_ptime (cpu
, out_FRk
, 15);
1791 update_FR_ptime (cpu
, dual_FRk
, 15);
1793 /* The latency of the sqrt unit will be at least the latency of the other
1795 update_fsqrt_resource_latency (cpu
, slot
, ps
->post_wait
+ 14);
1797 /* Mark this use of the register as a floating point op. */
1799 set_use_is_fpop (cpu
, out_FRk
);
1801 set_use_is_fpop (cpu
, dual_FRk
);
1807 frvbf_model_fr500_u_float_compare (SIM_CPU
*cpu
, const IDESC
*idesc
,
1808 int unit_num
, int referenced
,
1809 INT in_FRi
, INT in_FRj
,
1810 INT in_FRdoublei
, INT in_FRdoublej
,
1814 FRV_PROFILE_STATE
*ps
;
1816 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1819 /* The preprocessing can execute right away. */
1820 cycles
= idesc
->timing
->units
[unit_num
].done
;
1822 /* The post processing must wait if there is a dependency on a FR
1823 which is not ready yet. */
1824 adjust_double_register_busy (cpu
, in_FRdoublei
, in_FRdoublej
, -1, 1);
1825 ps
= CPU_PROFILE_STATE (cpu
);
1826 ps
->post_wait
= cycles
;
1827 post_wait_for_FR (cpu
, in_FRi
);
1828 post_wait_for_FR (cpu
, in_FRj
);
1829 post_wait_for_FRdouble (cpu
, in_FRdoublei
);
1830 post_wait_for_FRdouble (cpu
, in_FRdoublej
);
1831 post_wait_for_CCR (cpu
, out_FCCi_2
);
1832 restore_double_register_busy (cpu
, in_FRdoublei
, in_FRdoublej
, -1, 1);
1834 /* The latency of FCCi_2 will be the latency of the other inputs plus 3
1836 update_CCR_latency (cpu
, out_FCCi_2
, ps
->post_wait
+ 3);
1842 frvbf_model_fr500_u_float_dual_compare (SIM_CPU
*cpu
, const IDESC
*idesc
,
1843 int unit_num
, int referenced
,
1844 INT in_FRi
, INT in_FRj
,
1851 FRV_PROFILE_STATE
*ps
;
1853 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1856 /* The preprocessing can execute right away. */
1857 cycles
= idesc
->timing
->units
[unit_num
].done
;
1859 /* The post processing must wait if there is a dependency on a FR
1860 which is not ready yet. */
1861 ps
= CPU_PROFILE_STATE (cpu
);
1862 ps
->post_wait
= cycles
;
1863 dual_FRi
= DUAL_REG (in_FRi
);
1864 dual_FRj
= DUAL_REG (in_FRj
);
1865 dual_FCCi_2
= out_FCCi_2
+ 1;
1866 adjust_float_register_busy (cpu
, in_FRi
, in_FRj
, -1, 1);
1867 adjust_float_register_busy (cpu
, dual_FRi
, dual_FRj
, -1, 1);
1868 post_wait_for_FR (cpu
, in_FRi
);
1869 post_wait_for_FR (cpu
, in_FRj
);
1870 post_wait_for_FR (cpu
, dual_FRi
);
1871 post_wait_for_FR (cpu
, dual_FRj
);
1872 post_wait_for_CCR (cpu
, out_FCCi_2
);
1873 post_wait_for_CCR (cpu
, dual_FCCi_2
);
1874 restore_float_register_busy (cpu
, in_FRi
, in_FRj
, -1, 1);
1875 restore_float_register_busy (cpu
, dual_FRi
, dual_FRj
, -1, 1);
1877 /* The latency of FCCi_2 will be the latency of the other inputs plus 3
1879 update_CCR_latency (cpu
, out_FCCi_2
, ps
->post_wait
+ 3);
1880 update_CCR_latency (cpu
, dual_FCCi_2
, ps
->post_wait
+ 3);
1886 frvbf_model_fr500_u_float_convert (SIM_CPU
*cpu
, const IDESC
*idesc
,
1887 int unit_num
, int referenced
,
1888 INT in_FRj
, INT in_FRintj
, INT in_FRdoublej
,
1889 INT out_FRk
, INT out_FRintk
,
1893 FRV_PROFILE_STATE
*ps
;
1895 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1898 /* The preprocessing can execute right away. */
1899 cycles
= idesc
->timing
->units
[unit_num
].done
;
1901 /* The post processing must wait if there is a dependency on a FR
1902 which is not ready yet. */
1903 ps
= CPU_PROFILE_STATE (cpu
);
1904 ps
->post_wait
= cycles
;
1905 adjust_float_register_busy (cpu
, -1, in_FRj
, out_FRk
, 1);
1906 adjust_float_register_busy (cpu
, -1, in_FRintj
, out_FRintk
, 1);
1907 adjust_double_register_busy (cpu
, -1, in_FRdoublej
, out_FRdoublek
, 1);
1908 post_wait_for_FR (cpu
, in_FRj
);
1909 post_wait_for_FR (cpu
, in_FRintj
);
1910 post_wait_for_FRdouble (cpu
, in_FRdoublej
);
1911 post_wait_for_FR (cpu
, out_FRk
);
1912 post_wait_for_FR (cpu
, out_FRintk
);
1913 post_wait_for_FRdouble (cpu
, out_FRdoublek
);
1914 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1916 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRk
));
1917 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRintk
));
1918 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRdoublek
));
1920 restore_float_register_busy (cpu
, -1, in_FRj
, out_FRk
, 1);
1921 restore_float_register_busy (cpu
, -1, in_FRintj
, out_FRintk
, 1);
1922 restore_double_register_busy (cpu
, -1, in_FRdoublej
, out_FRdoublek
, 1);
1924 /* The latency of FRk will be at least the latency of the other inputs. */
1925 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
1926 update_FR_latency (cpu
, out_FRintk
, ps
->post_wait
);
1927 update_FRdouble_latency (cpu
, out_FRdoublek
, ps
->post_wait
);
1929 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1931 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRk
), ps
->post_wait
);
1932 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRintk
), ps
->post_wait
);
1933 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRdoublek
), ps
->post_wait
);
1936 /* Once initiated, post-processing will take 3 cycles. */
1937 update_FR_ptime (cpu
, out_FRk
, 3);
1938 update_FR_ptime (cpu
, out_FRintk
, 3);
1939 update_FRdouble_ptime (cpu
, out_FRdoublek
, 3);
1941 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1943 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRk
), 3);
1944 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRintk
), 3);
1945 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRdoublek
), 3);
1948 /* Mark this use of the register as a floating point op. */
1950 set_use_is_fpop (cpu
, out_FRk
);
1951 if (out_FRintk
>= 0)
1952 set_use_is_fpop (cpu
, out_FRintk
);
1953 if (out_FRdoublek
>= 0)
1955 set_use_is_fpop (cpu
, out_FRdoublek
);
1956 set_use_is_fpop (cpu
, out_FRdoublek
+ 1);
1963 frvbf_model_fr500_u_float_dual_convert (SIM_CPU
*cpu
, const IDESC
*idesc
,
1964 int unit_num
, int referenced
,
1965 INT in_FRj
, INT in_FRintj
,
1966 INT out_FRk
, INT out_FRintk
)
1973 FRV_PROFILE_STATE
*ps
;
1975 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1978 /* The preprocessing can execute right away. */
1979 cycles
= idesc
->timing
->units
[unit_num
].done
;
1981 /* The post processing must wait if there is a dependency on a FR
1982 which is not ready yet. */
1983 ps
= CPU_PROFILE_STATE (cpu
);
1984 ps
->post_wait
= cycles
;
1985 dual_FRj
= DUAL_REG (in_FRj
);
1986 dual_FRintj
= DUAL_REG (in_FRintj
);
1987 dual_FRk
= DUAL_REG (out_FRk
);
1988 dual_FRintk
= DUAL_REG (out_FRintk
);
1989 adjust_float_register_busy (cpu
, -1, in_FRj
, out_FRk
, 1);
1990 adjust_float_register_busy (cpu
, -1, dual_FRj
, dual_FRk
, 1);
1991 adjust_float_register_busy (cpu
, -1, in_FRintj
, out_FRintk
, 1);
1992 adjust_float_register_busy (cpu
, -1, dual_FRintj
, dual_FRintk
, 1);
1993 post_wait_for_FR (cpu
, in_FRj
);
1994 post_wait_for_FR (cpu
, in_FRintj
);
1995 post_wait_for_FR (cpu
, out_FRk
);
1996 post_wait_for_FR (cpu
, out_FRintk
);
1997 post_wait_for_FR (cpu
, dual_FRj
);
1998 post_wait_for_FR (cpu
, dual_FRintj
);
1999 post_wait_for_FR (cpu
, dual_FRk
);
2000 post_wait_for_FR (cpu
, dual_FRintk
);
2001 restore_float_register_busy (cpu
, -1, in_FRj
, out_FRk
, 1);
2002 restore_float_register_busy (cpu
, -1, dual_FRj
, dual_FRk
, 1);
2003 restore_float_register_busy (cpu
, -1, in_FRintj
, out_FRintk
, 1);
2004 restore_float_register_busy (cpu
, -1, dual_FRintj
, dual_FRintk
, 1);
2006 /* The latency of FRk will be at least the latency of the other inputs. */
2007 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
2008 update_FR_latency (cpu
, out_FRintk
, ps
->post_wait
);
2009 update_FR_latency (cpu
, dual_FRk
, ps
->post_wait
);
2010 update_FR_latency (cpu
, dual_FRintk
, ps
->post_wait
);
2012 /* Once initiated, post-processing will take 3 cycles. */
2013 update_FR_ptime (cpu
, out_FRk
, 3);
2014 update_FR_ptime (cpu
, out_FRintk
, 3);
2015 update_FR_ptime (cpu
, dual_FRk
, 3);
2016 update_FR_ptime (cpu
, dual_FRintk
, 3);
2018 /* Mark this use of the register as a floating point op. */
2020 set_use_is_fpop (cpu
, out_FRk
);
2021 if (out_FRintk
>= 0)
2022 set_use_is_fpop (cpu
, out_FRintk
);
2028 frvbf_model_fr500_u_media (SIM_CPU
*cpu
, const IDESC
*idesc
,
2029 int unit_num
, int referenced
,
2030 INT in_FRi
, INT in_FRj
, INT in_ACC40Si
, INT in_ACCGi
,
2032 INT out_ACC40Sk
, INT out_ACC40Uk
, INT out_ACCGk
)
2035 FRV_PROFILE_STATE
*ps
;
2036 const CGEN_INSN
*insn
;
2039 int busy_adjustment
[] = {0, 0, 0};
2043 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2046 /* The preprocessing can execute right away. */
2047 cycles
= idesc
->timing
->units
[unit_num
].done
;
2049 ps
= CPU_PROFILE_STATE (cpu
);
2050 insn
= idesc
->idata
;
2052 /* If the previous use of the registers was a media op,
2053 then their latency will be less than previously recorded.
2054 See Table 13-13 in the LSI. */
2057 if (use_is_media (cpu
, in_FRi
))
2059 busy_adjustment
[0] = 2;
2060 decrease_FR_busy (cpu
, in_FRi
, busy_adjustment
[0]);
2063 enforce_full_fr_latency (cpu
, in_FRi
);
2065 if (in_FRj
>= 0 && in_FRj
!= in_FRi
)
2067 if (use_is_media (cpu
, in_FRj
))
2069 busy_adjustment
[1] = 2;
2070 decrease_FR_busy (cpu
, in_FRj
, busy_adjustment
[1]);
2073 enforce_full_fr_latency (cpu
, in_FRj
);
2075 if (out_FRk
>= 0 && out_FRk
!= in_FRi
&& out_FRk
!= in_FRj
)
2077 if (use_is_media (cpu
, out_FRk
))
2079 busy_adjustment
[2] = 2;
2080 decrease_FR_busy (cpu
, out_FRk
, busy_adjustment
[2]);
2083 enforce_full_fr_latency (cpu
, out_FRk
);
2086 /* The post processing must wait if there is a dependency on a FR
2087 which is not ready yet. */
2088 ps
->post_wait
= cycles
;
2089 post_wait_for_FR (cpu
, in_FRi
);
2090 post_wait_for_FR (cpu
, in_FRj
);
2091 post_wait_for_FR (cpu
, out_FRk
);
2092 post_wait_for_ACC (cpu
, in_ACC40Si
);
2093 post_wait_for_ACC (cpu
, in_ACCGi
);
2094 post_wait_for_ACC (cpu
, out_ACC40Sk
);
2095 post_wait_for_ACC (cpu
, out_ACC40Uk
);
2096 post_wait_for_ACC (cpu
, out_ACCGk
);
2098 /* Restore the busy cycles of the registers we used. */
2101 fr
[in_FRi
] += busy_adjustment
[0];
2103 fr
[in_FRj
] += busy_adjustment
[1];
2105 fr
[out_FRk
] += busy_adjustment
[2];
2107 /* The latency of tht output register will be at least the latency of the
2108 other inputs. Once initiated, post-processing will take 3 cycles. */
2111 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
2112 update_FR_ptime (cpu
, out_FRk
, 3);
2113 /* Mark this use of the register as a media op. */
2114 set_use_is_media (cpu
, out_FRk
);
2116 /* The latency of tht output accumulator will be at least the latency of the
2117 other inputs. Once initiated, post-processing will take 1 cycle. */
2118 if (out_ACC40Sk
>= 0)
2119 update_ACC_latency (cpu
, out_ACC40Sk
, ps
->post_wait
+ 1);
2120 if (out_ACC40Uk
>= 0)
2121 update_ACC_latency (cpu
, out_ACC40Uk
, ps
->post_wait
+ 1);
2123 update_ACC_latency (cpu
, out_ACCGk
, ps
->post_wait
+ 1);
2129 frvbf_model_fr500_u_media_quad_arith (SIM_CPU
*cpu
, const IDESC
*idesc
,
2130 int unit_num
, int referenced
,
2131 INT in_FRi
, INT in_FRj
,
2138 FRV_PROFILE_STATE
*ps
;
2139 int busy_adjustment
[] = {0, 0, 0, 0, 0, 0};
2142 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2145 /* The preprocessing can execute right away. */
2146 cycles
= idesc
->timing
->units
[unit_num
].done
;
2148 ps
= CPU_PROFILE_STATE (cpu
);
2149 dual_FRi
= DUAL_REG (in_FRi
);
2150 dual_FRj
= DUAL_REG (in_FRj
);
2151 dual_FRk
= DUAL_REG (out_FRk
);
2153 /* If the previous use of the registers was a media op,
2154 then their latency will be less than previously recorded.
2155 See Table 13-13 in the LSI. */
2156 if (use_is_media (cpu
, in_FRi
))
2158 busy_adjustment
[0] = 2;
2159 decrease_FR_busy (cpu
, in_FRi
, busy_adjustment
[0]);
2162 enforce_full_fr_latency (cpu
, in_FRi
);
2163 if (dual_FRi
>= 0 && use_is_media (cpu
, dual_FRi
))
2165 busy_adjustment
[1] = 2;
2166 decrease_FR_busy (cpu
, dual_FRi
, busy_adjustment
[1]);
2169 enforce_full_fr_latency (cpu
, dual_FRi
);
2170 if (in_FRj
!= in_FRi
)
2172 if (use_is_media (cpu
, in_FRj
))
2174 busy_adjustment
[2] = 2;
2175 decrease_FR_busy (cpu
, in_FRj
, busy_adjustment
[2]);
2178 enforce_full_fr_latency (cpu
, in_FRj
);
2179 if (dual_FRj
>= 0 && use_is_media (cpu
, dual_FRj
))
2181 busy_adjustment
[3] = 2;
2182 decrease_FR_busy (cpu
, dual_FRj
, busy_adjustment
[3]);
2185 enforce_full_fr_latency (cpu
, dual_FRj
+ 1);
2187 if (out_FRk
!= in_FRi
&& out_FRk
!= in_FRj
)
2189 if (use_is_media (cpu
, out_FRk
))
2191 busy_adjustment
[4] = 2;
2192 decrease_FR_busy (cpu
, out_FRk
, busy_adjustment
[4]);
2195 enforce_full_fr_latency (cpu
, out_FRk
);
2196 if (dual_FRk
>= 0 && use_is_media (cpu
, dual_FRk
))
2198 busy_adjustment
[5] = 2;
2199 decrease_FR_busy (cpu
, dual_FRk
, busy_adjustment
[5]);
2202 enforce_full_fr_latency (cpu
, dual_FRk
);
2205 /* The post processing must wait if there is a dependency on a FR
2206 which is not ready yet. */
2207 ps
->post_wait
= cycles
;
2208 post_wait_for_FR (cpu
, in_FRi
);
2209 post_wait_for_FR (cpu
, dual_FRi
);
2210 post_wait_for_FR (cpu
, in_FRj
);
2211 post_wait_for_FR (cpu
, dual_FRj
);
2212 post_wait_for_FR (cpu
, out_FRk
);
2213 post_wait_for_FR (cpu
, dual_FRk
);
2215 /* Restore the busy cycles of the registers we used. */
2217 fr
[in_FRi
] += busy_adjustment
[0];
2219 fr
[dual_FRi
] += busy_adjustment
[1];
2220 fr
[in_FRj
] += busy_adjustment
[2];
2222 fr
[dual_FRj
] += busy_adjustment
[3];
2223 fr
[out_FRk
] += busy_adjustment
[4];
2225 fr
[dual_FRk
] += busy_adjustment
[5];
2227 /* The latency of tht output register will be at least the latency of the
2229 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
2231 /* Once initiated, post-processing will take 3 cycles. */
2232 update_FR_ptime (cpu
, out_FRk
, 3);
2234 /* Mark this use of the register as a media op. */
2235 set_use_is_media (cpu
, out_FRk
);
2238 update_FR_latency (cpu
, dual_FRk
, ps
->post_wait
);
2239 update_FR_ptime (cpu
, dual_FRk
, 3);
2240 /* Mark this use of the register as a media op. */
2241 set_use_is_media (cpu
, dual_FRk
);
2248 frvbf_model_fr500_u_media_dual_mul (SIM_CPU
*cpu
, const IDESC
*idesc
,
2249 int unit_num
, int referenced
,
2250 INT in_FRi
, INT in_FRj
,
2251 INT out_ACC40Sk
, INT out_ACC40Uk
)
2256 FRV_PROFILE_STATE
*ps
;
2257 int busy_adjustment
[] = {0, 0, 0, 0, 0, 0};
2261 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2264 /* The preprocessing can execute right away. */
2265 cycles
= idesc
->timing
->units
[unit_num
].done
;
2267 ps
= CPU_PROFILE_STATE (cpu
);
2268 dual_ACC40Sk
= DUAL_REG (out_ACC40Sk
);
2269 dual_ACC40Uk
= DUAL_REG (out_ACC40Uk
);
2271 /* If the previous use of the registers was a media op,
2272 then their latency will be less than previously recorded.
2273 See Table 13-13 in the LSI. */
2274 if (use_is_media (cpu
, in_FRi
))
2276 busy_adjustment
[0] = 2;
2277 decrease_FR_busy (cpu
, in_FRi
, busy_adjustment
[0]);
2280 enforce_full_fr_latency (cpu
, in_FRi
);
2281 if (in_FRj
!= in_FRi
)
2283 if (use_is_media (cpu
, in_FRj
))
2285 busy_adjustment
[1] = 2;
2286 decrease_FR_busy (cpu
, in_FRj
, busy_adjustment
[1]);
2289 enforce_full_fr_latency (cpu
, in_FRj
);
2291 if (out_ACC40Sk
>= 0)
2293 busy_adjustment
[2] = 1;
2294 decrease_ACC_busy (cpu
, out_ACC40Sk
, busy_adjustment
[2]);
2296 if (dual_ACC40Sk
>= 0)
2298 busy_adjustment
[3] = 1;
2299 decrease_ACC_busy (cpu
, dual_ACC40Sk
, busy_adjustment
[3]);
2301 if (out_ACC40Uk
>= 0)
2303 busy_adjustment
[4] = 1;
2304 decrease_ACC_busy (cpu
, out_ACC40Uk
, busy_adjustment
[4]);
2306 if (dual_ACC40Uk
>= 0)
2308 busy_adjustment
[5] = 1;
2309 decrease_ACC_busy (cpu
, dual_ACC40Uk
, busy_adjustment
[5]);
2312 /* The post processing must wait if there is a dependency on a FR
2313 which is not ready yet. */
2314 ps
->post_wait
= cycles
;
2315 post_wait_for_FR (cpu
, in_FRi
);
2316 post_wait_for_FR (cpu
, in_FRj
);
2317 post_wait_for_ACC (cpu
, out_ACC40Sk
);
2318 post_wait_for_ACC (cpu
, dual_ACC40Sk
);
2319 post_wait_for_ACC (cpu
, out_ACC40Uk
);
2320 post_wait_for_ACC (cpu
, dual_ACC40Uk
);
2322 /* Restore the busy cycles of the registers we used. */
2325 fr
[in_FRi
] += busy_adjustment
[0];
2326 fr
[in_FRj
] += busy_adjustment
[1];
2327 if (out_ACC40Sk
>= 0)
2328 acc
[out_ACC40Sk
] += busy_adjustment
[2];
2329 if (dual_ACC40Sk
>= 0)
2330 acc
[dual_ACC40Sk
] += busy_adjustment
[3];
2331 if (out_ACC40Uk
>= 0)
2332 acc
[out_ACC40Uk
] += busy_adjustment
[4];
2333 if (dual_ACC40Uk
>= 0)
2334 acc
[dual_ACC40Uk
] += busy_adjustment
[5];
2336 /* The latency of tht output register will be at least the latency of the
2337 other inputs. Once initiated, post-processing will take 1 cycle. */
2338 if (out_ACC40Sk
>= 0)
2339 update_ACC_latency (cpu
, out_ACC40Sk
, ps
->post_wait
+ 1);
2340 if (dual_ACC40Sk
>= 0)
2341 update_ACC_latency (cpu
, dual_ACC40Sk
, ps
->post_wait
+ 1);
2342 if (out_ACC40Uk
>= 0)
2343 update_ACC_latency (cpu
, out_ACC40Uk
, ps
->post_wait
+ 1);
2344 if (dual_ACC40Uk
>= 0)
2345 update_ACC_latency (cpu
, dual_ACC40Uk
, ps
->post_wait
+ 1);
2351 frvbf_model_fr500_u_media_quad_mul (SIM_CPU
*cpu
, const IDESC
*idesc
,
2352 int unit_num
, int referenced
,
2353 INT in_FRi
, INT in_FRj
,
2354 INT out_ACC40Sk
, INT out_ACC40Uk
)
2365 FRV_PROFILE_STATE
*ps
;
2366 int busy_adjustment
[] = {0, 0, 0, 0, 0, 0, 0 ,0};
2370 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2373 /* The preprocessing can execute right away. */
2374 cycles
= idesc
->timing
->units
[unit_num
].done
;
2376 FRi_1
= DUAL_REG (in_FRi
);
2377 FRj_1
= DUAL_REG (in_FRj
);
2378 ACC40Sk_1
= DUAL_REG (out_ACC40Sk
);
2379 ACC40Sk_2
= DUAL_REG (ACC40Sk_1
);
2380 ACC40Sk_3
= DUAL_REG (ACC40Sk_2
);
2381 ACC40Uk_1
= DUAL_REG (out_ACC40Uk
);
2382 ACC40Uk_2
= DUAL_REG (ACC40Uk_1
);
2383 ACC40Uk_3
= DUAL_REG (ACC40Uk_2
);
2385 /* If the previous use of the registers was a media op,
2386 then their latency will be less than previously recorded.
2387 See Table 13-13 in the LSI. */
2388 ps
= CPU_PROFILE_STATE (cpu
);
2389 if (use_is_media (cpu
, in_FRi
))
2391 busy_adjustment
[0] = 2;
2392 decrease_FR_busy (cpu
, in_FRi
, busy_adjustment
[0]);
2395 enforce_full_fr_latency (cpu
, in_FRi
);
2398 if (use_is_media (cpu
, FRi_1
))
2400 busy_adjustment
[1] = 2;
2401 decrease_FR_busy (cpu
, FRi_1
, busy_adjustment
[1]);
2404 enforce_full_fr_latency (cpu
, FRi_1
);
2406 if (in_FRj
!= in_FRi
)
2408 if (use_is_media (cpu
, in_FRj
))
2410 busy_adjustment
[2] = 2;
2411 decrease_FR_busy (cpu
, in_FRj
, busy_adjustment
[2]);
2414 enforce_full_fr_latency (cpu
, in_FRj
);
2417 if (use_is_media (cpu
, FRj_1
))
2419 busy_adjustment
[3] = 2;
2420 decrease_FR_busy (cpu
, FRj_1
, busy_adjustment
[3]);
2423 enforce_full_fr_latency (cpu
, FRj_1
);
2426 if (out_ACC40Sk
>= 0)
2428 busy_adjustment
[4] = 1;
2429 decrease_ACC_busy (cpu
, out_ACC40Sk
, busy_adjustment
[4]);
2433 busy_adjustment
[5] = 1;
2434 decrease_ACC_busy (cpu
, ACC40Sk_1
, busy_adjustment
[5]);
2438 busy_adjustment
[6] = 1;
2439 decrease_ACC_busy (cpu
, ACC40Sk_2
, busy_adjustment
[6]);
2443 busy_adjustment
[7] = 1;
2444 decrease_ACC_busy (cpu
, ACC40Sk_3
, busy_adjustment
[7]);
2447 else if (out_ACC40Uk
>= 0)
2449 busy_adjustment
[4] = 1;
2450 decrease_ACC_busy (cpu
, out_ACC40Uk
, busy_adjustment
[4]);
2454 busy_adjustment
[5] = 1;
2455 decrease_ACC_busy (cpu
, ACC40Uk_1
, busy_adjustment
[5]);
2459 busy_adjustment
[6] = 1;
2460 decrease_ACC_busy (cpu
, ACC40Uk_2
, busy_adjustment
[6]);
2464 busy_adjustment
[7] = 1;
2465 decrease_ACC_busy (cpu
, ACC40Uk_3
, busy_adjustment
[7]);
2469 /* The post processing must wait if there is a dependency on a FR
2470 which is not ready yet. */
2471 ps
->post_wait
= cycles
;
2472 post_wait_for_FR (cpu
, in_FRi
);
2473 post_wait_for_FR (cpu
, FRi_1
);
2474 post_wait_for_FR (cpu
, in_FRj
);
2475 post_wait_for_FR (cpu
, FRj_1
);
2476 post_wait_for_ACC (cpu
, out_ACC40Sk
);
2477 post_wait_for_ACC (cpu
, ACC40Sk_1
);
2478 post_wait_for_ACC (cpu
, ACC40Sk_2
);
2479 post_wait_for_ACC (cpu
, ACC40Sk_3
);
2480 post_wait_for_ACC (cpu
, out_ACC40Uk
);
2481 post_wait_for_ACC (cpu
, ACC40Uk_1
);
2482 post_wait_for_ACC (cpu
, ACC40Uk_2
);
2483 post_wait_for_ACC (cpu
, ACC40Uk_3
);
2485 /* Restore the busy cycles of the registers we used. */
2488 fr
[in_FRi
] += busy_adjustment
[0];
2490 fr
[FRi_1
] += busy_adjustment
[1];
2491 fr
[in_FRj
] += busy_adjustment
[2];
2493 fr
[FRj_1
] += busy_adjustment
[3];
2494 if (out_ACC40Sk
>= 0)
2496 acc
[out_ACC40Sk
] += busy_adjustment
[4];
2498 acc
[ACC40Sk_1
] += busy_adjustment
[5];
2500 acc
[ACC40Sk_2
] += busy_adjustment
[6];
2502 acc
[ACC40Sk_3
] += busy_adjustment
[7];
2504 else if (out_ACC40Uk
>= 0)
2506 acc
[out_ACC40Uk
] += busy_adjustment
[4];
2508 acc
[ACC40Uk_1
] += busy_adjustment
[5];
2510 acc
[ACC40Uk_2
] += busy_adjustment
[6];
2512 acc
[ACC40Uk_3
] += busy_adjustment
[7];
2515 /* The latency of tht output register will be at least the latency of the
2516 other inputs. Once initiated, post-processing will take 1 cycle. */
2517 if (out_ACC40Sk
>= 0)
2519 update_ACC_latency (cpu
, out_ACC40Sk
, ps
->post_wait
+ 1);
2521 update_ACC_latency (cpu
, ACC40Sk_1
, ps
->post_wait
+ 1);
2523 update_ACC_latency (cpu
, ACC40Sk_2
, ps
->post_wait
+ 1);
2525 update_ACC_latency (cpu
, ACC40Sk_3
, ps
->post_wait
+ 1);
2527 else if (out_ACC40Uk
>= 0)
2529 update_ACC_latency (cpu
, out_ACC40Uk
, ps
->post_wait
+ 1);
2531 update_ACC_latency (cpu
, ACC40Uk_1
, ps
->post_wait
+ 1);
2533 update_ACC_latency (cpu
, ACC40Uk_2
, ps
->post_wait
+ 1);
2535 update_ACC_latency (cpu
, ACC40Uk_3
, ps
->post_wait
+ 1);
2542 frvbf_model_fr500_u_media_quad_complex (SIM_CPU
*cpu
, const IDESC
*idesc
,
2543 int unit_num
, int referenced
,
2544 INT in_FRi
, INT in_FRj
,
2551 FRV_PROFILE_STATE
*ps
;
2552 int busy_adjustment
[] = {0, 0, 0, 0, 0, 0};
2556 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2559 /* The preprocessing can execute right away. */
2560 cycles
= idesc
->timing
->units
[unit_num
].done
;
2562 FRi_1
= DUAL_REG (in_FRi
);
2563 FRj_1
= DUAL_REG (in_FRj
);
2564 ACC40Sk_1
= DUAL_REG (out_ACC40Sk
);
2566 /* If the previous use of the registers was a media op,
2567 then their latency will be less than previously recorded.
2568 See Table 13-13 in the LSI. */
2569 ps
= CPU_PROFILE_STATE (cpu
);
2570 if (use_is_media (cpu
, in_FRi
))
2572 busy_adjustment
[0] = 2;
2573 decrease_FR_busy (cpu
, in_FRi
, busy_adjustment
[0]);
2576 enforce_full_fr_latency (cpu
, in_FRi
);
2579 if (use_is_media (cpu
, FRi_1
))
2581 busy_adjustment
[1] = 2;
2582 decrease_FR_busy (cpu
, FRi_1
, busy_adjustment
[1]);
2585 enforce_full_fr_latency (cpu
, FRi_1
);
2587 if (in_FRj
!= in_FRi
)
2589 if (use_is_media (cpu
, in_FRj
))
2591 busy_adjustment
[2] = 2;
2592 decrease_FR_busy (cpu
, in_FRj
, busy_adjustment
[2]);
2595 enforce_full_fr_latency (cpu
, in_FRj
);
2598 if (use_is_media (cpu
, FRj_1
))
2600 busy_adjustment
[3] = 2;
2601 decrease_FR_busy (cpu
, FRj_1
, busy_adjustment
[3]);
2604 enforce_full_fr_latency (cpu
, FRj_1
);
2607 if (out_ACC40Sk
>= 0)
2609 busy_adjustment
[4] = 1;
2610 decrease_ACC_busy (cpu
, out_ACC40Sk
, busy_adjustment
[4]);
2614 busy_adjustment
[5] = 1;
2615 decrease_ACC_busy (cpu
, ACC40Sk_1
, busy_adjustment
[5]);
2619 /* The post processing must wait if there is a dependency on a FR
2620 which is not ready yet. */
2621 ps
->post_wait
= cycles
;
2622 post_wait_for_FR (cpu
, in_FRi
);
2623 post_wait_for_FR (cpu
, FRi_1
);
2624 post_wait_for_FR (cpu
, in_FRj
);
2625 post_wait_for_FR (cpu
, FRj_1
);
2626 post_wait_for_ACC (cpu
, out_ACC40Sk
);
2627 post_wait_for_ACC (cpu
, ACC40Sk_1
);
2629 /* Restore the busy cycles of the registers we used. */
2632 fr
[in_FRi
] += busy_adjustment
[0];
2634 fr
[FRi_1
] += busy_adjustment
[1];
2635 fr
[in_FRj
] += busy_adjustment
[2];
2637 fr
[FRj_1
] += busy_adjustment
[3];
2638 if (out_ACC40Sk
>= 0)
2640 acc
[out_ACC40Sk
] += busy_adjustment
[4];
2642 acc
[ACC40Sk_1
] += busy_adjustment
[5];
2645 /* The latency of tht output register will be at least the latency of the
2646 other inputs. Once initiated, post-processing will take 1 cycle. */
2647 if (out_ACC40Sk
>= 0)
2649 update_ACC_latency (cpu
, out_ACC40Sk
, ps
->post_wait
+ 1);
2651 update_ACC_latency (cpu
, ACC40Sk_1
, ps
->post_wait
+ 1);
2658 frvbf_model_fr500_u_media_dual_expand (SIM_CPU
*cpu
, const IDESC
*idesc
,
2659 int unit_num
, int referenced
,
2665 FRV_PROFILE_STATE
*ps
;
2666 int busy_adjustment
[] = {0, 0, 0};
2669 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2672 /* The preprocessing can execute right away. */
2673 cycles
= idesc
->timing
->units
[unit_num
].done
;
2675 /* If the previous use of the registers was a media op,
2676 then their latency will be less than previously recorded.
2677 See Table 13-13 in the LSI. */
2678 dual_FRk
= DUAL_REG (out_FRk
);
2679 ps
= CPU_PROFILE_STATE (cpu
);
2680 if (use_is_media (cpu
, in_FRi
))
2682 busy_adjustment
[0] = 2;
2683 decrease_FR_busy (cpu
, in_FRi
, busy_adjustment
[0]);
2686 enforce_full_fr_latency (cpu
, in_FRi
);
2687 if (out_FRk
!= in_FRi
)
2689 if (use_is_media (cpu
, out_FRk
))
2691 busy_adjustment
[1] = 2;
2692 decrease_FR_busy (cpu
, out_FRk
, busy_adjustment
[1]);
2695 enforce_full_fr_latency (cpu
, out_FRk
);
2697 if (dual_FRk
>= 0 && dual_FRk
!= in_FRi
)
2699 if (use_is_media (cpu
, dual_FRk
))
2701 busy_adjustment
[2] = 2;
2702 decrease_FR_busy (cpu
, dual_FRk
, busy_adjustment
[2]);
2705 enforce_full_fr_latency (cpu
, dual_FRk
);
2708 /* The post processing must wait if there is a dependency on a FR
2709 which is not ready yet. */
2710 ps
->post_wait
= cycles
;
2711 post_wait_for_FR (cpu
, in_FRi
);
2712 post_wait_for_FR (cpu
, out_FRk
);
2713 post_wait_for_FR (cpu
, dual_FRk
);
2715 /* Restore the busy cycles of the registers we used. */
2717 fr
[in_FRi
] += busy_adjustment
[0];
2718 fr
[out_FRk
] += busy_adjustment
[1];
2720 fr
[dual_FRk
] += busy_adjustment
[2];
2722 /* The latency of the output register will be at least the latency of the
2723 other inputs. Once initiated, post-processing will take 3 cycles. */
2724 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
2725 update_FR_ptime (cpu
, out_FRk
, 3);
2727 /* Mark this use of the register as a media op. */
2728 set_use_is_media (cpu
, out_FRk
);
2731 update_FR_latency (cpu
, dual_FRk
, ps
->post_wait
);
2732 update_FR_ptime (cpu
, dual_FRk
, 3);
2734 /* Mark this use of the register as a media op. */
2735 set_use_is_media (cpu
, dual_FRk
);
2742 frvbf_model_fr500_u_media_dual_unpack (SIM_CPU
*cpu
, const IDESC
*idesc
,
2743 int unit_num
, int referenced
,
2752 FRV_PROFILE_STATE
*ps
;
2753 int busy_adjustment
[] = {0, 0, 0, 0, 0, 0};
2756 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2759 /* The preprocessing can execute right away. */
2760 cycles
= idesc
->timing
->units
[unit_num
].done
;
2762 FRi_1
= DUAL_REG (in_FRi
);
2763 FRk_1
= DUAL_REG (out_FRk
);
2764 FRk_2
= DUAL_REG (FRk_1
);
2765 FRk_3
= DUAL_REG (FRk_2
);
2767 /* If the previous use of the registers was a media op,
2768 then their latency will be less than previously recorded.
2769 See Table 13-13 in the LSI. */
2770 ps
= CPU_PROFILE_STATE (cpu
);
2771 if (use_is_media (cpu
, in_FRi
))
2773 busy_adjustment
[0] = 2;
2774 decrease_FR_busy (cpu
, in_FRi
, busy_adjustment
[0]);
2777 enforce_full_fr_latency (cpu
, in_FRi
);
2778 if (FRi_1
>= 0 && use_is_media (cpu
, FRi_1
))
2780 busy_adjustment
[1] = 2;
2781 decrease_FR_busy (cpu
, FRi_1
, busy_adjustment
[1]);
2784 enforce_full_fr_latency (cpu
, FRi_1
);
2785 if (out_FRk
!= in_FRi
)
2787 if (use_is_media (cpu
, out_FRk
))
2789 busy_adjustment
[2] = 2;
2790 decrease_FR_busy (cpu
, out_FRk
, busy_adjustment
[2]);
2793 enforce_full_fr_latency (cpu
, out_FRk
);
2794 if (FRk_1
>= 0 && FRk_1
!= in_FRi
)
2796 if (use_is_media (cpu
, FRk_1
))
2798 busy_adjustment
[3] = 2;
2799 decrease_FR_busy (cpu
, FRk_1
, busy_adjustment
[3]);
2802 enforce_full_fr_latency (cpu
, FRk_1
);
2804 if (FRk_2
>= 0 && FRk_2
!= in_FRi
)
2806 if (use_is_media (cpu
, FRk_2
))
2808 busy_adjustment
[4] = 2;
2809 decrease_FR_busy (cpu
, FRk_2
, busy_adjustment
[4]);
2812 enforce_full_fr_latency (cpu
, FRk_2
);
2814 if (FRk_3
>= 0 && FRk_3
!= in_FRi
)
2816 if (use_is_media (cpu
, FRk_3
))
2818 busy_adjustment
[5] = 2;
2819 decrease_FR_busy (cpu
, FRk_3
, busy_adjustment
[5]);
2822 enforce_full_fr_latency (cpu
, FRk_3
);
2826 /* The post processing must wait if there is a dependency on a FR
2827 which is not ready yet. */
2828 ps
->post_wait
= cycles
;
2829 post_wait_for_FR (cpu
, in_FRi
);
2830 post_wait_for_FR (cpu
, FRi_1
);
2831 post_wait_for_FR (cpu
, out_FRk
);
2832 post_wait_for_FR (cpu
, FRk_1
);
2833 post_wait_for_FR (cpu
, FRk_2
);
2834 post_wait_for_FR (cpu
, FRk_3
);
2836 /* Restore the busy cycles of the registers we used. */
2838 fr
[in_FRi
] += busy_adjustment
[0];
2840 fr
[FRi_1
] += busy_adjustment
[1];
2841 fr
[out_FRk
] += busy_adjustment
[2];
2843 fr
[FRk_1
] += busy_adjustment
[3];
2845 fr
[FRk_2
] += busy_adjustment
[4];
2847 fr
[FRk_3
] += busy_adjustment
[5];
2849 /* The latency of tht output register will be at least the latency of the
2850 other inputs. Once initiated, post-processing will take 3 cycles. */
2851 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
2852 update_FR_ptime (cpu
, out_FRk
, 3);
2854 /* Mark this use of the register as a media op. */
2855 set_use_is_media (cpu
, out_FRk
);
2858 update_FR_latency (cpu
, FRk_1
, ps
->post_wait
);
2859 update_FR_ptime (cpu
, FRk_1
, 3);
2861 /* Mark this use of the register as a media op. */
2862 set_use_is_media (cpu
, FRk_1
);
2866 update_FR_latency (cpu
, FRk_2
, ps
->post_wait
);
2867 update_FR_ptime (cpu
, FRk_2
, 3);
2869 /* Mark this use of the register as a media op. */
2870 set_use_is_media (cpu
, FRk_2
);
2874 update_FR_latency (cpu
, FRk_3
, ps
->post_wait
);
2875 update_FR_ptime (cpu
, FRk_3
, 3);
2877 /* Mark this use of the register as a media op. */
2878 set_use_is_media (cpu
, FRk_3
);
2885 frvbf_model_fr500_u_media_dual_btoh (SIM_CPU
*cpu
, const IDESC
*idesc
,
2886 int unit_num
, int referenced
,
2890 return frvbf_model_fr500_u_media_dual_expand (cpu
, idesc
, unit_num
,
2891 referenced
, in_FRj
, out_FRk
);
2895 frvbf_model_fr500_u_media_dual_htob (SIM_CPU
*cpu
, const IDESC
*idesc
,
2896 int unit_num
, int referenced
,
2902 FRV_PROFILE_STATE
*ps
;
2903 int busy_adjustment
[] = {0, 0, 0};
2906 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2909 /* The preprocessing can execute right away. */
2910 cycles
= idesc
->timing
->units
[unit_num
].done
;
2912 /* If the previous use of the registers was a media op,
2913 then their latency will be less than previously recorded.
2914 See Table 13-13 in the LSI. */
2915 dual_FRj
= DUAL_REG (in_FRj
);
2916 ps
= CPU_PROFILE_STATE (cpu
);
2917 if (use_is_media (cpu
, in_FRj
))
2919 busy_adjustment
[0] = 2;
2920 decrease_FR_busy (cpu
, in_FRj
, busy_adjustment
[0]);
2923 enforce_full_fr_latency (cpu
, in_FRj
);
2926 if (use_is_media (cpu
, dual_FRj
))
2928 busy_adjustment
[1] = 2;
2929 decrease_FR_busy (cpu
, dual_FRj
, busy_adjustment
[1]);
2932 enforce_full_fr_latency (cpu
, dual_FRj
);
2934 if (out_FRk
!= in_FRj
)
2936 if (use_is_media (cpu
, out_FRk
))
2938 busy_adjustment
[2] = 2;
2939 decrease_FR_busy (cpu
, out_FRk
, busy_adjustment
[2]);
2942 enforce_full_fr_latency (cpu
, out_FRk
);
2945 /* The post processing must wait if there is a dependency on a FR
2946 which is not ready yet. */
2947 ps
->post_wait
= cycles
;
2948 post_wait_for_FR (cpu
, in_FRj
);
2949 post_wait_for_FR (cpu
, dual_FRj
);
2950 post_wait_for_FR (cpu
, out_FRk
);
2952 /* Restore the busy cycles of the registers we used. */
2954 fr
[in_FRj
] += busy_adjustment
[0];
2956 fr
[dual_FRj
] += busy_adjustment
[1];
2957 fr
[out_FRk
] += busy_adjustment
[2];
2959 /* The latency of tht output register will be at least the latency of the
2961 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
2963 /* Once initiated, post-processing will take 3 cycles. */
2964 update_FR_ptime (cpu
, out_FRk
, 3);
2966 /* Mark this use of the register as a media op. */
2967 set_use_is_media (cpu
, out_FRk
);
2973 frvbf_model_fr500_u_media_dual_btohe (SIM_CPU
*cpu
, const IDESC
*idesc
,
2974 int unit_num
, int referenced
,
2982 FRV_PROFILE_STATE
*ps
;
2983 int busy_adjustment
[] = {0, 0, 0, 0, 0};
2986 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2989 /* The preprocessing can execute right away. */
2990 cycles
= idesc
->timing
->units
[unit_num
].done
;
2992 FRk_1
= DUAL_REG (out_FRk
);
2993 FRk_2
= DUAL_REG (FRk_1
);
2994 FRk_3
= DUAL_REG (FRk_2
);
2996 /* If the previous use of the registers was a media op,
2997 then their latency will be less than previously recorded.
2998 See Table 13-13 in the LSI. */
2999 ps
= CPU_PROFILE_STATE (cpu
);
3000 if (use_is_media (cpu
, in_FRj
))
3002 busy_adjustment
[0] = 2;
3003 decrease_FR_busy (cpu
, in_FRj
, busy_adjustment
[0]);
3006 enforce_full_fr_latency (cpu
, in_FRj
);
3007 if (out_FRk
!= in_FRj
)
3009 if (use_is_media (cpu
, out_FRk
))
3011 busy_adjustment
[1] = 2;
3012 decrease_FR_busy (cpu
, out_FRk
, busy_adjustment
[1]);
3015 enforce_full_fr_latency (cpu
, out_FRk
);
3016 if (FRk_1
>= 0 && FRk_1
!= in_FRj
)
3018 if (use_is_media (cpu
, FRk_1
))
3020 busy_adjustment
[2] = 2;
3021 decrease_FR_busy (cpu
, FRk_1
, busy_adjustment
[2]);
3024 enforce_full_fr_latency (cpu
, FRk_1
);
3026 if (FRk_2
>= 0 && FRk_2
!= in_FRj
)
3028 if (use_is_media (cpu
, FRk_2
))
3030 busy_adjustment
[3] = 2;
3031 decrease_FR_busy (cpu
, FRk_2
, busy_adjustment
[3]);
3034 enforce_full_fr_latency (cpu
, FRk_2
);
3036 if (FRk_3
>= 0 && FRk_3
!= in_FRj
)
3038 if (use_is_media (cpu
, FRk_3
))
3040 busy_adjustment
[4] = 2;
3041 decrease_FR_busy (cpu
, FRk_3
, busy_adjustment
[4]);
3044 enforce_full_fr_latency (cpu
, FRk_3
);
3048 /* The post processing must wait if there is a dependency on a FR
3049 which is not ready yet. */
3050 ps
->post_wait
= cycles
;
3051 post_wait_for_FR (cpu
, in_FRj
);
3052 post_wait_for_FR (cpu
, out_FRk
);
3053 post_wait_for_FR (cpu
, FRk_1
);
3054 post_wait_for_FR (cpu
, FRk_2
);
3055 post_wait_for_FR (cpu
, FRk_3
);
3057 /* Restore the busy cycles of the registers we used. */
3059 fr
[in_FRj
] += busy_adjustment
[0];
3060 fr
[out_FRk
] += busy_adjustment
[1];
3062 fr
[FRk_1
] += busy_adjustment
[2];
3064 fr
[FRk_2
] += busy_adjustment
[3];
3066 fr
[FRk_3
] += busy_adjustment
[4];
3068 /* The latency of tht output register will be at least the latency of the
3069 other inputs. Once initiated, post-processing will take 3 cycles. */
3070 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
3071 update_FR_ptime (cpu
, out_FRk
, 3);
3073 /* Mark this use of the register as a media op. */
3074 set_use_is_media (cpu
, out_FRk
);
3077 update_FR_latency (cpu
, FRk_1
, ps
->post_wait
);
3078 update_FR_ptime (cpu
, FRk_1
, 3);
3080 /* Mark this use of the register as a media op. */
3081 set_use_is_media (cpu
, FRk_1
);
3085 update_FR_latency (cpu
, FRk_2
, ps
->post_wait
);
3086 update_FR_ptime (cpu
, FRk_2
, 3);
3088 /* Mark this use of the register as a media op. */
3089 set_use_is_media (cpu
, FRk_2
);
3093 update_FR_latency (cpu
, FRk_3
, ps
->post_wait
);
3094 update_FR_ptime (cpu
, FRk_3
, 3);
3096 /* Mark this use of the register as a media op. */
3097 set_use_is_media (cpu
, FRk_3
);
3104 frvbf_model_fr500_u_barrier (SIM_CPU
*cpu
, const IDESC
*idesc
,
3105 int unit_num
, int referenced
)
3108 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
3111 /* Wait for ALL resources. */
3112 for (i
= 0; i
< 64; ++i
)
3114 enforce_full_fr_latency (cpu
, i
);
3115 vliw_wait_for_GR (cpu
, i
);
3116 vliw_wait_for_FR (cpu
, i
);
3117 vliw_wait_for_ACC (cpu
, i
);
3119 for (i
= 0; i
< 8; ++i
)
3120 vliw_wait_for_CCR (cpu
, i
);
3121 for (i
= 0; i
< 2; ++i
)
3123 vliw_wait_for_idiv_resource (cpu
, i
);
3124 vliw_wait_for_fdiv_resource (cpu
, i
);
3125 vliw_wait_for_fsqrt_resource (cpu
, i
);
3127 handle_resource_wait (cpu
);
3128 for (i
= 0; i
< 64; ++i
)
3130 load_wait_for_GR (cpu
, i
);
3131 load_wait_for_FR (cpu
, i
);
3133 trace_vliw_wait_cycles (cpu
);
3137 cycles
= idesc
->timing
->units
[unit_num
].done
;
3142 frvbf_model_fr500_u_membar (SIM_CPU
*cpu
, const IDESC
*idesc
,
3143 int unit_num
, int referenced
)
3146 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
3149 /* Wait for ALL resources, except GR and ICC. */
3150 for (i
= 0; i
< 64; ++i
)
3152 enforce_full_fr_latency (cpu
, i
);
3153 vliw_wait_for_FR (cpu
, i
);
3154 vliw_wait_for_ACC (cpu
, i
);
3156 for (i
= 0; i
< 4; ++i
)
3157 vliw_wait_for_CCR (cpu
, i
);
3158 for (i
= 0; i
< 2; ++i
)
3160 vliw_wait_for_idiv_resource (cpu
, i
);
3161 vliw_wait_for_fdiv_resource (cpu
, i
);
3162 vliw_wait_for_fsqrt_resource (cpu
, i
);
3164 handle_resource_wait (cpu
);
3165 for (i
= 0; i
< 64; ++i
)
3167 load_wait_for_FR (cpu
, i
);
3169 trace_vliw_wait_cycles (cpu
);
3173 cycles
= idesc
->timing
->units
[unit_num
].done
;
3177 /* The frv machine is a fictional implementation of the fr500 which implements
3178 all frv architectural features. */
3180 frvbf_model_frv_u_exec (SIM_CPU
*cpu
, const IDESC
*idesc
,
3181 int unit_num
, int referenced
)
3183 return idesc
->timing
->units
[unit_num
].done
;
3186 /* The simple machine is a fictional implementation of the fr500 which
3187 implements limited frv architectural features. */
3189 frvbf_model_simple_u_exec (SIM_CPU
*cpu
, const IDESC
*idesc
,
3190 int unit_num
, int referenced
)
3192 return idesc
->timing
->units
[unit_num
].done
;
3195 /* The tomcat machine is models a prototype fr500 machine which had a few
3196 bugs and restrictions to work around. */
3198 frvbf_model_tomcat_u_exec (SIM_CPU
*cpu
, const IDESC
*idesc
,
3199 int unit_num
, int referenced
)
3201 return idesc
->timing
->units
[unit_num
].done
;
3204 #endif /* WITH_PROFILE_MODEL_P */