1 /* frv simulator fr500 dependent profiling code.
3 Copyright (C) 1998, 1999, 2000, 2001, 2003 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 2, or (at your option)
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 along
19 with this program; if not, write to the Free Software Foundation, Inc.,
20 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #define WANT_CPU_FRVBF
29 #if WITH_PROFILE_MODEL_P
32 #include "profile-fr500.h"
34 /* Initialize cycle counting for an insn.
35 FIRST_P is non-zero if this is the first insn in a set of parallel
38 fr500_model_insn_before (SIM_CPU
*cpu
, int first_p
)
42 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
43 FRV_PROFILE_STATE
*ps
= CPU_PROFILE_STATE (cpu
);
44 ps
->cur_gr_complex
= ps
->prev_gr_complex
;
45 d
->cur_fpop
= d
->prev_fpop
;
46 d
->cur_media
= d
->prev_media
;
47 d
->cur_cc_complex
= d
->prev_cc_complex
;
51 /* Record the cycles computed for an insn.
52 LAST_P is non-zero if this is the last insn in a set of parallel insns,
53 and we update the total cycle count.
54 CYCLES is the cycle count of the insn. */
56 fr500_model_insn_after (SIM_CPU
*cpu
, int last_p
, int cycles
)
60 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
61 FRV_PROFILE_STATE
*ps
= CPU_PROFILE_STATE (cpu
);
62 ps
->prev_gr_complex
= ps
->cur_gr_complex
;
63 d
->prev_fpop
= d
->cur_fpop
;
64 d
->prev_media
= d
->cur_media
;
65 d
->prev_cc_complex
= d
->cur_cc_complex
;
70 set_use_is_fpop (SIM_CPU
*cpu
, INT fr
)
72 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
73 fr500_reset_fr_flags (cpu
, (fr
));
74 d
->cur_fpop
|= (((DI
)1) << (fr
));
78 set_use_not_fpop (SIM_CPU
*cpu
, INT fr
)
80 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
81 d
->cur_fpop
&= ~(((DI
)1) << (fr
));
85 use_is_fpop (SIM_CPU
*cpu
, INT fr
)
87 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
88 return d
->prev_fpop
& (((DI
)1) << (fr
));
92 set_use_is_media ( SIM_CPU
*cpu
, INT fr
)
94 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
95 fr500_reset_fr_flags (cpu
, (fr
));
96 d
->cur_media
|= (((DI
)1) << (fr
));
100 set_use_not_media (SIM_CPU
*cpu
, INT fr
)
102 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
103 d
->cur_media
&= ~(((DI
)1) << (fr
));
107 use_is_media (SIM_CPU
*cpu
, INT fr
)
109 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
110 return d
->prev_media
& (((DI
)1) << (fr
));
114 set_use_is_cc_complex (SIM_CPU
*cpu
, INT cc
)
116 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
117 fr500_reset_cc_flags (cpu
, cc
);
118 d
->cur_cc_complex
|= (((DI
)1) << (cc
));
122 set_use_not_cc_complex (SIM_CPU
*cpu
, INT cc
)
124 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
125 d
->cur_cc_complex
&= ~(((DI
)1) << (cc
));
129 use_is_cc_complex (SIM_CPU
*cpu
, INT cc
)
131 MODEL_FR500_DATA
*d
= CPU_MODEL_DATA (cpu
);
132 return d
->prev_cc_complex
& (((DI
)1) << (cc
));
136 fr500_reset_fr_flags (SIM_CPU
*cpu
, INT fr
)
138 set_use_not_fpop (cpu
, fr
);
139 set_use_not_media (cpu
, fr
);
143 fr500_reset_cc_flags (SIM_CPU
*cpu
, INT cc
)
145 set_use_not_cc_complex (cpu
, cc
);
148 /* Latency of floating point registers may be less than recorded when followed
149 by another floating point insn. */
151 adjust_float_register_busy (SIM_CPU
*cpu
, INT in_FRi
, INT in_FRj
, INT out_FRk
,
154 /* If the registers were previously used in a floating point op,
155 then their latency will be less than previously recorded.
156 See Table 13-13 in the LSI. */
158 if (use_is_fpop (cpu
, in_FRi
))
159 decrease_FR_busy (cpu
, in_FRi
, cycles
);
161 enforce_full_fr_latency (cpu
, in_FRi
);
163 if (in_FRj
>= 0 && in_FRj
!= in_FRi
)
164 if (use_is_fpop (cpu
, in_FRj
))
165 decrease_FR_busy (cpu
, in_FRj
, cycles
);
167 enforce_full_fr_latency (cpu
, in_FRj
);
169 if (out_FRk
>= 0 && out_FRk
!= in_FRi
&& out_FRk
!= in_FRj
)
170 if (use_is_fpop (cpu
, out_FRk
))
171 decrease_FR_busy (cpu
, out_FRk
, cycles
);
173 enforce_full_fr_latency (cpu
, out_FRk
);
176 /* Latency of floating point registers may be less than recorded when followed
177 by another floating point insn. */
179 adjust_double_register_busy (SIM_CPU
*cpu
, INT in_FRi
, INT in_FRj
, INT out_FRk
,
182 /* If the registers were previously used in a floating point op,
183 then their latency will be less than previously recorded.
184 See Table 13-13 in the LSI. */
185 adjust_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, cycles
);
186 if (in_FRi
>= 0) ++in_FRi
;
187 if (in_FRj
>= 0) ++in_FRj
;
188 if (out_FRk
>= 0) ++out_FRk
;
189 adjust_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, cycles
);
192 /* Latency of floating point registers is less than recorded when followed
193 by another floating point insn. */
195 restore_float_register_busy (SIM_CPU
*cpu
, INT in_FRi
, INT in_FRj
, INT out_FRk
,
198 /* If the registers were previously used in a floating point op,
199 then their latency will be less than previously recorded.
200 See Table 13-13 in the LSI. */
201 if (in_FRi
>= 0 && use_is_fpop (cpu
, in_FRi
))
202 increase_FR_busy (cpu
, in_FRi
, cycles
);
203 if (in_FRj
!= in_FRi
&& use_is_fpop (cpu
, in_FRj
))
204 increase_FR_busy (cpu
, in_FRj
, cycles
);
205 if (out_FRk
!= in_FRi
&& out_FRk
!= in_FRj
&& use_is_fpop (cpu
, out_FRk
))
206 increase_FR_busy (cpu
, out_FRk
, cycles
);
209 /* Latency of floating point registers is less than recorded when followed
210 by another floating point insn. */
212 restore_double_register_busy (SIM_CPU
*cpu
, INT in_FRi
, INT in_FRj
, INT out_FRk
,
215 /* If the registers were previously used in a floating point op,
216 then their latency will be less than previously recorded.
217 See Table 13-13 in the LSI. */
218 restore_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, cycles
);
219 if (in_FRi
>= 0) ++in_FRi
;
220 if (in_FRj
>= 0) ++in_FRj
;
221 if (out_FRk
>= 0) ++out_FRk
;
222 restore_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, cycles
);
226 frvbf_model_fr500_u_exec (SIM_CPU
*cpu
, const IDESC
*idesc
,
227 int unit_num
, int referenced
)
229 return idesc
->timing
->units
[unit_num
].done
;
233 frvbf_model_fr500_u_integer (SIM_CPU
*cpu
, const IDESC
*idesc
,
234 int unit_num
, int referenced
,
235 INT in_GRi
, INT in_GRj
, INT out_GRk
,
240 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
242 /* icc0-icc4 are the upper 4 fields of the CCR. */
246 /* The entire VLIW insn must wait if there is a dependency on a register
247 which is not ready yet.
248 The latency of the registers may be less than previously recorded,
249 depending on how they were used previously.
250 See Table 13-8 in the LSI. */
251 if (in_GRi
!= out_GRk
&& in_GRi
>= 0)
253 if (use_is_gr_complex (cpu
, in_GRi
))
254 decrease_GR_busy (cpu
, in_GRi
, 1);
256 if (in_GRj
!= out_GRk
&& in_GRj
!= in_GRi
&& in_GRj
>= 0)
258 if (use_is_gr_complex (cpu
, in_GRj
))
259 decrease_GR_busy (cpu
, in_GRj
, 1);
261 vliw_wait_for_GR (cpu
, in_GRi
);
262 vliw_wait_for_GR (cpu
, in_GRj
);
263 vliw_wait_for_GR (cpu
, out_GRk
);
264 vliw_wait_for_CCR (cpu
, out_ICCi_1
);
265 handle_resource_wait (cpu
);
266 load_wait_for_GR (cpu
, in_GRi
);
267 load_wait_for_GR (cpu
, in_GRj
);
268 load_wait_for_GR (cpu
, out_GRk
);
269 trace_vliw_wait_cycles (cpu
);
273 /* GRk is available immediately to the next VLIW insn as is ICCi_1. */
274 cycles
= idesc
->timing
->units
[unit_num
].done
;
279 frvbf_model_fr500_u_imul (SIM_CPU
*cpu
, const IDESC
*idesc
,
280 int unit_num
, int referenced
,
281 INT in_GRi
, INT in_GRj
, INT out_GRk
, INT out_ICCi_1
)
284 /* icc0-icc4 are the upper 4 fields of the CCR. */
288 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
290 /* The entire VLIW insn must wait if there is a dependency on a register
291 which is not ready yet.
292 The latency of the registers may be less than previously recorded,
293 depending on how they were used previously.
294 See Table 13-8 in the LSI. */
295 if (in_GRi
!= out_GRk
&& in_GRi
>= 0)
297 if (use_is_gr_complex (cpu
, in_GRi
))
298 decrease_GR_busy (cpu
, in_GRi
, 1);
300 if (in_GRj
!= out_GRk
&& in_GRj
!= in_GRi
&& in_GRj
>= 0)
302 if (use_is_gr_complex (cpu
, in_GRj
))
303 decrease_GR_busy (cpu
, in_GRj
, 1);
305 vliw_wait_for_GR (cpu
, in_GRi
);
306 vliw_wait_for_GR (cpu
, in_GRj
);
307 vliw_wait_for_GRdouble (cpu
, out_GRk
);
308 vliw_wait_for_CCR (cpu
, out_ICCi_1
);
309 handle_resource_wait (cpu
);
310 load_wait_for_GR (cpu
, in_GRi
);
311 load_wait_for_GR (cpu
, in_GRj
);
312 load_wait_for_GRdouble (cpu
, out_GRk
);
313 trace_vliw_wait_cycles (cpu
);
317 /* GRk has a latency of 2 cycles. */
318 cycles
= idesc
->timing
->units
[unit_num
].done
;
319 update_GRdouble_latency (cpu
, out_GRk
, cycles
+ 2);
320 set_use_is_gr_complex (cpu
, out_GRk
);
321 set_use_is_gr_complex (cpu
, out_GRk
+ 1);
323 /* ICCi_1 has a latency of 1 cycle. */
324 update_CCR_latency (cpu
, out_ICCi_1
, cycles
+ 1);
330 frvbf_model_fr500_u_idiv (SIM_CPU
*cpu
, const IDESC
*idesc
,
331 int unit_num
, int referenced
,
332 INT in_GRi
, INT in_GRj
, INT out_GRk
, INT out_ICCi_1
)
338 /* icc0-icc4 are the upper 4 fields of the CCR. */
342 vliw
= CPU_VLIW (cpu
);
343 slot
= vliw
->next_slot
- 1;
344 slot
= (*vliw
->current_vliw
)[slot
] - UNIT_I0
;
346 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
348 /* The entire VLIW insn must wait if there is a dependency on a register
349 which is not ready yet.
350 The latency of the registers may be less than previously recorded,
351 depending on how they were used previously.
352 See Table 13-8 in the LSI. */
353 if (in_GRi
!= out_GRk
&& in_GRi
>= 0)
355 if (use_is_gr_complex (cpu
, in_GRi
))
356 decrease_GR_busy (cpu
, in_GRi
, 1);
358 if (in_GRj
!= out_GRk
&& in_GRj
!= in_GRi
&& in_GRj
>= 0)
360 if (use_is_gr_complex (cpu
, in_GRj
))
361 decrease_GR_busy (cpu
, in_GRj
, 1);
363 vliw_wait_for_GR (cpu
, in_GRi
);
364 vliw_wait_for_GR (cpu
, in_GRj
);
365 vliw_wait_for_GR (cpu
, out_GRk
);
366 vliw_wait_for_CCR (cpu
, out_ICCi_1
);
367 vliw_wait_for_idiv_resource (cpu
, slot
);
368 handle_resource_wait (cpu
);
369 load_wait_for_GR (cpu
, in_GRi
);
370 load_wait_for_GR (cpu
, in_GRj
);
371 load_wait_for_GR (cpu
, out_GRk
);
372 trace_vliw_wait_cycles (cpu
);
376 /* GRk has a latency of 19 cycles! */
377 cycles
= idesc
->timing
->units
[unit_num
].done
;
378 update_GR_latency (cpu
, out_GRk
, cycles
+ 19);
379 set_use_is_gr_complex (cpu
, out_GRk
);
381 /* ICCi_1 has a latency of 19 cycles. */
382 update_CCR_latency (cpu
, out_ICCi_1
, cycles
+ 19);
383 set_use_is_cc_complex (cpu
, out_ICCi_1
);
385 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
387 /* GNER has a latency of 18 cycles. */
388 update_SPR_latency (cpu
, GNER_FOR_GR (out_GRk
), cycles
+ 18);
391 /* the idiv resource has a latency of 18 cycles! */
392 update_idiv_resource_latency (cpu
, slot
, cycles
+ 18);
398 frvbf_model_fr500_u_branch (SIM_CPU
*cpu
, const IDESC
*idesc
,
399 int unit_num
, int referenced
,
400 INT in_GRi
, INT in_GRj
,
401 INT in_ICCi_2
, INT in_FCCi_2
)
404 FRV_PROFILE_STATE
*ps
;
406 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
408 /* icc0-icc4 are the upper 4 fields of the CCR. */
412 /* The entire VLIW insn must wait if there is a dependency on a register
413 which is not ready yet.
414 The latency of the registers may be less than previously recorded,
415 depending on how they were used previously.
416 See Table 13-8 in the LSI. */
419 if (use_is_gr_complex (cpu
, in_GRi
))
420 decrease_GR_busy (cpu
, in_GRi
, 1);
422 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
424 if (use_is_gr_complex (cpu
, in_GRj
))
425 decrease_GR_busy (cpu
, in_GRj
, 1);
427 vliw_wait_for_GR (cpu
, in_GRi
);
428 vliw_wait_for_GR (cpu
, in_GRj
);
429 vliw_wait_for_CCR (cpu
, in_ICCi_2
);
430 vliw_wait_for_CCR (cpu
, in_FCCi_2
);
431 handle_resource_wait (cpu
);
432 load_wait_for_GR (cpu
, in_GRi
);
433 load_wait_for_GR (cpu
, in_GRj
);
434 trace_vliw_wait_cycles (cpu
);
438 /* When counting branches taken or not taken, don't consider branches after
439 the first taken branch in a vliw insn. */
440 ps
= CPU_PROFILE_STATE (cpu
);
441 if (! ps
->vliw_branch_taken
)
443 /* (1 << 4): The pc is the 5th element in inputs, outputs.
444 ??? can be cleaned up */
445 PROFILE_DATA
*p
= CPU_PROFILE_DATA (cpu
);
446 int taken
= (referenced
& (1 << 4)) != 0;
449 ++PROFILE_MODEL_TAKEN_COUNT (p
);
450 ps
->vliw_branch_taken
= 1;
453 ++PROFILE_MODEL_UNTAKEN_COUNT (p
);
456 cycles
= idesc
->timing
->units
[unit_num
].done
;
461 frvbf_model_fr500_u_trap (SIM_CPU
*cpu
, const IDESC
*idesc
,
462 int unit_num
, int referenced
,
463 INT in_GRi
, INT in_GRj
,
464 INT in_ICCi_2
, INT in_FCCi_2
)
468 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
470 /* icc0-icc4 are the upper 4 fields of the CCR. */
474 /* The entire VLIW insn must wait if there is a dependency on a register
475 which is not ready yet.
476 The latency of the registers may be less than previously recorded,
477 depending on how they were used previously.
478 See Table 13-8 in the LSI. */
481 if (use_is_gr_complex (cpu
, in_GRi
))
482 decrease_GR_busy (cpu
, in_GRi
, 1);
484 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
486 if (use_is_gr_complex (cpu
, in_GRj
))
487 decrease_GR_busy (cpu
, in_GRj
, 1);
489 vliw_wait_for_GR (cpu
, in_GRi
);
490 vliw_wait_for_GR (cpu
, in_GRj
);
491 vliw_wait_for_CCR (cpu
, in_ICCi_2
);
492 vliw_wait_for_CCR (cpu
, in_FCCi_2
);
493 handle_resource_wait (cpu
);
494 load_wait_for_GR (cpu
, in_GRi
);
495 load_wait_for_GR (cpu
, in_GRj
);
496 trace_vliw_wait_cycles (cpu
);
500 cycles
= idesc
->timing
->units
[unit_num
].done
;
505 frvbf_model_fr500_u_check (SIM_CPU
*cpu
, const IDESC
*idesc
,
506 int unit_num
, int referenced
,
507 INT in_ICCi_3
, INT in_FCCi_3
)
511 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
513 /* icc0-icc4 are the upper 4 fields of the CCR. */
517 /* The entire VLIW insn must wait if there is a dependency on a register
518 which is not ready yet. */
519 vliw_wait_for_CCR (cpu
, in_ICCi_3
);
520 vliw_wait_for_CCR (cpu
, in_FCCi_3
);
521 handle_resource_wait (cpu
);
522 trace_vliw_wait_cycles (cpu
);
526 cycles
= idesc
->timing
->units
[unit_num
].done
;
531 frvbf_model_fr500_u_clrgr (SIM_CPU
*cpu
, const IDESC
*idesc
,
532 int unit_num
, int referenced
,
537 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
539 /* Wait for both GNER registers or just the one specified. */
542 vliw_wait_for_SPR (cpu
, H_SPR_GNER0
);
543 vliw_wait_for_SPR (cpu
, H_SPR_GNER1
);
546 vliw_wait_for_SPR (cpu
, GNER_FOR_GR (in_GRk
));
547 handle_resource_wait (cpu
);
548 trace_vliw_wait_cycles (cpu
);
552 cycles
= idesc
->timing
->units
[unit_num
].done
;
557 frvbf_model_fr500_u_clrfr (SIM_CPU
*cpu
, const IDESC
*idesc
,
558 int unit_num
, int referenced
,
563 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
565 /* Wait for both GNER registers or just the one specified. */
568 vliw_wait_for_SPR (cpu
, H_SPR_FNER0
);
569 vliw_wait_for_SPR (cpu
, H_SPR_FNER1
);
572 vliw_wait_for_SPR (cpu
, FNER_FOR_FR (in_FRk
));
573 handle_resource_wait (cpu
);
574 trace_vliw_wait_cycles (cpu
);
578 cycles
= idesc
->timing
->units
[unit_num
].done
;
583 frvbf_model_fr500_u_commit (SIM_CPU
*cpu
, const IDESC
*idesc
,
584 int unit_num
, int referenced
,
585 INT in_GRk
, INT in_FRk
)
589 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
591 /* If GR is specified, then FR is not and vice-versa. If neither is
592 then it's a commitga or commitfa. Check the insn attribute to
595 vliw_wait_for_SPR (cpu
, GNER_FOR_GR (in_GRk
));
596 else if (in_FRk
!= -1)
597 vliw_wait_for_SPR (cpu
, FNER_FOR_FR (in_FRk
));
598 else if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_FR_ACCESS
))
600 vliw_wait_for_SPR (cpu
, H_SPR_FNER0
);
601 vliw_wait_for_SPR (cpu
, H_SPR_FNER1
);
605 vliw_wait_for_SPR (cpu
, H_SPR_GNER0
);
606 vliw_wait_for_SPR (cpu
, H_SPR_GNER1
);
608 handle_resource_wait (cpu
);
609 trace_vliw_wait_cycles (cpu
);
613 cycles
= idesc
->timing
->units
[unit_num
].done
;
618 frvbf_model_fr500_u_set_hilo (SIM_CPU
*cpu
, const IDESC
*idesc
,
619 int unit_num
, int referenced
,
620 INT out_GRkhi
, INT out_GRklo
)
624 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
626 /* The entire VLIW insn must wait if there is a dependency on a GR
627 which is not ready yet. */
628 vliw_wait_for_GR (cpu
, out_GRkhi
);
629 vliw_wait_for_GR (cpu
, out_GRklo
);
630 handle_resource_wait (cpu
);
631 load_wait_for_GR (cpu
, out_GRkhi
);
632 load_wait_for_GR (cpu
, out_GRklo
);
633 trace_vliw_wait_cycles (cpu
);
637 /* GRk is available immediately to the next VLIW insn. */
638 cycles
= idesc
->timing
->units
[unit_num
].done
;
640 set_use_not_gr_complex (cpu
, out_GRkhi
);
641 set_use_not_gr_complex (cpu
, out_GRklo
);
647 frvbf_model_fr500_u_gr_load (SIM_CPU
*cpu
, const IDESC
*idesc
,
648 int unit_num
, int referenced
,
649 INT in_GRi
, INT in_GRj
,
650 INT out_GRk
, INT out_GRdoublek
)
654 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
656 /* The entire VLIW insn must wait if there is a dependency on a register
657 which is not ready yet.
658 The latency of the registers may be less than previously recorded,
659 depending on how they were used previously.
660 See Table 13-8 in the LSI. */
661 if (in_GRi
!= out_GRk
&& in_GRi
!= out_GRdoublek
662 && in_GRi
!= out_GRdoublek
+ 1 && in_GRi
>= 0)
664 if (use_is_gr_complex (cpu
, in_GRi
))
665 decrease_GR_busy (cpu
, in_GRi
, 1);
667 if (in_GRj
!= in_GRi
&& in_GRj
!= out_GRk
&& in_GRj
!= out_GRdoublek
668 && in_GRj
!= out_GRdoublek
+ 1 && in_GRj
>= 0)
671 if (use_is_gr_complex (cpu
, in_GRj
))
672 decrease_GR_busy (cpu
, in_GRj
, 1);
674 vliw_wait_for_GR (cpu
, in_GRi
);
675 vliw_wait_for_GR (cpu
, in_GRj
);
676 vliw_wait_for_GR (cpu
, out_GRk
);
677 vliw_wait_for_GRdouble (cpu
, out_GRdoublek
);
678 handle_resource_wait (cpu
);
679 load_wait_for_GR (cpu
, in_GRi
);
680 load_wait_for_GR (cpu
, in_GRj
);
681 load_wait_for_GR (cpu
, out_GRk
);
682 load_wait_for_GRdouble (cpu
, out_GRdoublek
);
683 trace_vliw_wait_cycles (cpu
);
687 cycles
= idesc
->timing
->units
[unit_num
].done
;
689 /* The latency of GRk for a load will depend on how long it takes to retrieve
690 the the data from the cache or memory. */
691 update_GR_latency_for_load (cpu
, out_GRk
, cycles
);
692 update_GRdouble_latency_for_load (cpu
, out_GRdoublek
, cycles
);
694 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
696 /* GNER has a latency of 2 cycles. */
697 update_SPR_latency (cpu
, GNER_FOR_GR (out_GRk
), cycles
+ 2);
698 update_SPR_latency (cpu
, GNER_FOR_GR (out_GRdoublek
), cycles
+ 2);
702 set_use_is_gr_complex (cpu
, out_GRk
);
703 if (out_GRdoublek
!= -1)
705 set_use_is_gr_complex (cpu
, out_GRdoublek
);
706 set_use_is_gr_complex (cpu
, out_GRdoublek
+ 1);
713 frvbf_model_fr500_u_gr_store (SIM_CPU
*cpu
, const IDESC
*idesc
,
714 int unit_num
, int referenced
,
715 INT in_GRi
, INT in_GRj
,
716 INT in_GRk
, INT in_GRdoublek
)
720 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
722 /* The entire VLIW insn must wait if there is a dependency on a register
723 which is not ready yet.
724 The latency of the registers may be less than previously recorded,
725 depending on how they were used previously.
726 See Table 13-8 in the LSI. */
729 if (use_is_gr_complex (cpu
, in_GRi
))
730 decrease_GR_busy (cpu
, in_GRi
, 1);
732 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
734 if (use_is_gr_complex (cpu
, in_GRj
))
735 decrease_GR_busy (cpu
, in_GRj
, 1);
737 if (in_GRk
!= in_GRi
&& in_GRk
!= in_GRj
&& in_GRk
>= 0)
739 if (use_is_gr_complex (cpu
, in_GRk
))
740 decrease_GR_busy (cpu
, in_GRk
, 1);
742 if (in_GRdoublek
!= in_GRi
&& in_GRdoublek
!= in_GRj
743 && in_GRdoublek
+ 1 != in_GRi
&& in_GRdoublek
+ 1 != in_GRj
744 && in_GRdoublek
>= 0)
746 if (use_is_gr_complex (cpu
, in_GRdoublek
))
747 decrease_GR_busy (cpu
, in_GRdoublek
, 1);
748 if (use_is_gr_complex (cpu
, in_GRdoublek
+ 1))
749 decrease_GR_busy (cpu
, in_GRdoublek
+ 1, 1);
751 vliw_wait_for_GR (cpu
, in_GRi
);
752 vliw_wait_for_GR (cpu
, in_GRj
);
753 vliw_wait_for_GR (cpu
, in_GRk
);
754 vliw_wait_for_GRdouble (cpu
, in_GRdoublek
);
755 handle_resource_wait (cpu
);
756 load_wait_for_GR (cpu
, in_GRi
);
757 load_wait_for_GR (cpu
, in_GRj
);
758 load_wait_for_GR (cpu
, in_GRk
);
759 load_wait_for_GRdouble (cpu
, in_GRdoublek
);
760 trace_vliw_wait_cycles (cpu
);
764 cycles
= idesc
->timing
->units
[unit_num
].done
;
770 frvbf_model_fr500_u_gr_r_store (SIM_CPU
*cpu
, const IDESC
*idesc
,
771 int unit_num
, int referenced
,
772 INT in_GRi
, INT in_GRj
,
773 INT in_GRk
, INT in_GRdoublek
)
775 int cycles
= frvbf_model_fr500_u_gr_store (cpu
, idesc
, unit_num
, referenced
,
776 in_GRi
, in_GRj
, in_GRk
,
779 if (model_insn
== FRV_INSN_MODEL_PASS_2
)
781 if (CPU_RSTR_INVALIDATE(cpu
))
782 request_cache_invalidate (cpu
, CPU_DATA_CACHE (cpu
), cycles
);
789 frvbf_model_fr500_u_fr_load (SIM_CPU
*cpu
, const IDESC
*idesc
,
790 int unit_num
, int referenced
,
791 INT in_GRi
, INT in_GRj
,
792 INT out_FRk
, INT out_FRdoublek
)
796 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
798 /* The entire VLIW insn must wait if there is a dependency on a register
799 which is not ready yet.
800 The latency of the registers may be less than previously recorded,
801 depending on how they were used previously.
802 See Table 13-8 in the LSI. */
805 if (use_is_gr_complex (cpu
, in_GRi
))
806 decrease_GR_busy (cpu
, in_GRi
, 1);
808 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
810 if (use_is_gr_complex (cpu
, in_GRj
))
811 decrease_GR_busy (cpu
, in_GRj
, 1);
815 if (use_is_media (cpu
, out_FRk
))
816 decrease_FR_busy (cpu
, out_FRk
, 1);
818 adjust_float_register_busy (cpu
, -1, -1, out_FRk
, 1);
820 if (out_FRdoublek
>= 0)
822 if (use_is_media (cpu
, out_FRdoublek
))
823 decrease_FR_busy (cpu
, out_FRdoublek
, 1);
825 adjust_float_register_busy (cpu
, -1, -1, out_FRdoublek
, 1);
826 if (use_is_media (cpu
, out_FRdoublek
+ 1))
827 decrease_FR_busy (cpu
, out_FRdoublek
+ 1, 1);
829 adjust_float_register_busy (cpu
, -1, -1, out_FRdoublek
+ 1, 1);
831 vliw_wait_for_GR (cpu
, in_GRi
);
832 vliw_wait_for_GR (cpu
, in_GRj
);
833 vliw_wait_for_FR (cpu
, out_FRk
);
834 vliw_wait_for_FRdouble (cpu
, out_FRdoublek
);
835 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
837 vliw_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRk
));
838 vliw_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRdoublek
));
840 handle_resource_wait (cpu
);
841 load_wait_for_GR (cpu
, in_GRi
);
842 load_wait_for_GR (cpu
, in_GRj
);
843 load_wait_for_FR (cpu
, out_FRk
);
844 load_wait_for_FRdouble (cpu
, out_FRdoublek
);
845 trace_vliw_wait_cycles (cpu
);
849 cycles
= idesc
->timing
->units
[unit_num
].done
;
851 /* The latency of FRk for a load will depend on how long it takes to retrieve
852 the the data from the cache or memory. */
853 update_FR_latency_for_load (cpu
, out_FRk
, cycles
);
854 update_FRdouble_latency_for_load (cpu
, out_FRdoublek
, cycles
);
856 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
858 /* FNER has a latency of 3 cycles. */
859 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRk
), cycles
+ 3);
860 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRdoublek
), cycles
+ 3);
863 fr500_reset_fr_flags (cpu
, out_FRk
);
869 frvbf_model_fr500_u_fr_store (SIM_CPU
*cpu
, const IDESC
*idesc
,
870 int unit_num
, int referenced
,
871 INT in_GRi
, INT in_GRj
,
872 INT in_FRk
, INT in_FRdoublek
)
876 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
878 /* The entire VLIW insn must wait if there is a dependency on a register
879 which is not ready yet.
880 The latency of the registers may be less than previously recorded,
881 depending on how they were used previously.
882 See Table 13-8 in the LSI. */
885 if (use_is_gr_complex (cpu
, in_GRi
))
886 decrease_GR_busy (cpu
, in_GRi
, 1);
888 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
890 if (use_is_gr_complex (cpu
, in_GRj
))
891 decrease_GR_busy (cpu
, in_GRj
, 1);
895 if (use_is_media (cpu
, in_FRk
))
896 decrease_FR_busy (cpu
, in_FRk
, 1);
898 adjust_float_register_busy (cpu
, -1, -1, in_FRk
, 1);
900 if (in_FRdoublek
>= 0)
902 if (use_is_media (cpu
, in_FRdoublek
))
903 decrease_FR_busy (cpu
, in_FRdoublek
, 1);
905 adjust_float_register_busy (cpu
, -1, -1, in_FRdoublek
, 1);
906 if (use_is_media (cpu
, in_FRdoublek
+ 1))
907 decrease_FR_busy (cpu
, in_FRdoublek
+ 1, 1);
909 adjust_float_register_busy (cpu
, -1, -1, in_FRdoublek
+ 1, 1);
911 vliw_wait_for_GR (cpu
, in_GRi
);
912 vliw_wait_for_GR (cpu
, in_GRj
);
913 vliw_wait_for_FR (cpu
, in_FRk
);
914 vliw_wait_for_FRdouble (cpu
, in_FRdoublek
);
915 handle_resource_wait (cpu
);
916 load_wait_for_GR (cpu
, in_GRi
);
917 load_wait_for_GR (cpu
, in_GRj
);
918 load_wait_for_FR (cpu
, in_FRk
);
919 load_wait_for_FRdouble (cpu
, in_FRdoublek
);
920 trace_vliw_wait_cycles (cpu
);
924 cycles
= idesc
->timing
->units
[unit_num
].done
;
930 frvbf_model_fr500_u_fr_r_store (SIM_CPU
*cpu
, const IDESC
*idesc
,
931 int unit_num
, int referenced
,
932 INT in_GRi
, INT in_GRj
,
933 INT in_FRk
, INT in_FRdoublek
)
935 int cycles
= frvbf_model_fr500_u_fr_store (cpu
, idesc
, unit_num
, referenced
,
936 in_GRi
, in_GRj
, in_FRk
,
939 if (model_insn
== FRV_INSN_MODEL_PASS_2
)
941 if (CPU_RSTR_INVALIDATE(cpu
))
942 request_cache_invalidate (cpu
, CPU_DATA_CACHE (cpu
), cycles
);
949 frvbf_model_fr500_u_swap (SIM_CPU
*cpu
, const IDESC
*idesc
,
950 int unit_num
, int referenced
,
951 INT in_GRi
, INT in_GRj
, INT out_GRk
)
955 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
957 /* The entire VLIW insn must wait if there is a dependency on a register
958 which is not ready yet.
959 The latency of the registers may be less than previously recorded,
960 depending on how they were used previously.
961 See Table 13-8 in the LSI. */
962 if (in_GRi
!= out_GRk
&& in_GRi
>= 0)
964 if (use_is_gr_complex (cpu
, in_GRi
))
965 decrease_GR_busy (cpu
, in_GRi
, 1);
967 if (in_GRj
!= out_GRk
&& in_GRj
!= in_GRi
&& in_GRj
>= 0)
969 if (use_is_gr_complex (cpu
, in_GRj
))
970 decrease_GR_busy (cpu
, in_GRj
, 1);
972 vliw_wait_for_GR (cpu
, in_GRi
);
973 vliw_wait_for_GR (cpu
, in_GRj
);
974 vliw_wait_for_GR (cpu
, out_GRk
);
975 handle_resource_wait (cpu
);
976 load_wait_for_GR (cpu
, in_GRi
);
977 load_wait_for_GR (cpu
, in_GRj
);
978 load_wait_for_GR (cpu
, out_GRk
);
979 trace_vliw_wait_cycles (cpu
);
983 cycles
= idesc
->timing
->units
[unit_num
].done
;
985 /* The latency of GRk will depend on how long it takes to swap
986 the the data from the cache or memory. */
987 update_GR_latency_for_swap (cpu
, out_GRk
, cycles
);
988 set_use_is_gr_complex (cpu
, out_GRk
);
994 frvbf_model_fr500_u_fr2fr (SIM_CPU
*cpu
, const IDESC
*idesc
,
995 int unit_num
, int referenced
,
996 INT in_FRj
, INT out_FRk
)
1000 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1002 /* The entire VLIW insn must wait if there is a dependency on a register
1003 which is not ready yet. */
1006 if (use_is_media (cpu
, in_FRj
))
1007 decrease_FR_busy (cpu
, in_FRj
, 1);
1009 adjust_float_register_busy (cpu
, -1, in_FRj
, -1, 1);
1011 if (out_FRk
>= 0 && out_FRk
!= in_FRj
)
1013 if (use_is_media (cpu
, out_FRk
))
1014 decrease_FR_busy (cpu
, out_FRk
, 1);
1016 adjust_float_register_busy (cpu
, -1, -1, out_FRk
, 1);
1018 vliw_wait_for_FR (cpu
, in_FRj
);
1019 vliw_wait_for_FR (cpu
, out_FRk
);
1020 handle_resource_wait (cpu
);
1021 load_wait_for_FR (cpu
, in_FRj
);
1022 load_wait_for_FR (cpu
, out_FRk
);
1023 trace_vliw_wait_cycles (cpu
);
1027 /* The latency of FRj is 3 cycles. */
1028 cycles
= idesc
->timing
->units
[unit_num
].done
;
1029 update_FR_latency (cpu
, out_FRk
, cycles
+ 3);
1035 frvbf_model_fr500_u_fr2gr (SIM_CPU
*cpu
, const IDESC
*idesc
,
1036 int unit_num
, int referenced
,
1037 INT in_FRk
, INT out_GRj
)
1041 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1043 /* The entire VLIW insn must wait if there is a dependency on a register
1044 which is not ready yet. */
1047 if (use_is_media (cpu
, in_FRk
))
1048 decrease_FR_busy (cpu
, in_FRk
, 1);
1050 adjust_float_register_busy (cpu
, -1, in_FRk
, -1, 1);
1052 vliw_wait_for_FR (cpu
, in_FRk
);
1053 vliw_wait_for_GR (cpu
, out_GRj
);
1054 handle_resource_wait (cpu
);
1055 load_wait_for_FR (cpu
, in_FRk
);
1056 load_wait_for_GR (cpu
, out_GRj
);
1057 trace_vliw_wait_cycles (cpu
);
1061 /* The latency of GRj is 2 cycles. */
1062 cycles
= idesc
->timing
->units
[unit_num
].done
;
1063 update_GR_latency (cpu
, out_GRj
, cycles
+ 2);
1064 set_use_is_gr_complex (cpu
, out_GRj
);
1070 frvbf_model_fr500_u_spr2gr (SIM_CPU
*cpu
, const IDESC
*idesc
,
1071 int unit_num
, int referenced
,
1072 INT in_spr
, INT out_GRj
)
1076 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1078 /* The entire VLIW insn must wait if there is a dependency on a register
1079 which is not ready yet. */
1080 vliw_wait_for_SPR (cpu
, in_spr
);
1081 vliw_wait_for_GR (cpu
, out_GRj
);
1082 handle_resource_wait (cpu
);
1083 load_wait_for_GR (cpu
, out_GRj
);
1084 trace_vliw_wait_cycles (cpu
);
1088 cycles
= idesc
->timing
->units
[unit_num
].done
;
1090 #if 0 /* no latency? */
1091 /* The latency of GRj is 2 cycles. */
1092 update_GR_latency (cpu
, out_GRj
, cycles
+ 2);
1099 frvbf_model_fr500_u_gr2fr (SIM_CPU
*cpu
, const IDESC
*idesc
,
1100 int unit_num
, int referenced
,
1101 INT in_GRj
, INT out_FRk
)
1105 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1107 /* The entire VLIW insn must wait if there is a dependency on a register
1108 which is not ready yet.
1109 The latency of the registers may be less than previously recorded,
1110 depending on how they were used previously.
1111 See Table 13-8 in the LSI. */
1114 if (use_is_gr_complex (cpu
, in_GRj
))
1115 decrease_GR_busy (cpu
, in_GRj
, 1);
1119 if (use_is_media (cpu
, out_FRk
))
1120 decrease_FR_busy (cpu
, out_FRk
, 1);
1122 adjust_float_register_busy (cpu
, -1, -1, out_FRk
, 1);
1124 vliw_wait_for_GR (cpu
, in_GRj
);
1125 vliw_wait_for_FR (cpu
, out_FRk
);
1126 handle_resource_wait (cpu
);
1127 load_wait_for_GR (cpu
, in_GRj
);
1128 load_wait_for_FR (cpu
, out_FRk
);
1129 trace_vliw_wait_cycles (cpu
);
1133 /* The latency of FRk is 2 cycles. */
1134 cycles
= idesc
->timing
->units
[unit_num
].done
;
1135 update_FR_latency (cpu
, out_FRk
, cycles
+ 2);
1137 /* Mark this use of the register as NOT a floating point op. */
1138 fr500_reset_fr_flags (cpu
, out_FRk
);
1144 frvbf_model_fr500_u_gr2spr (SIM_CPU
*cpu
, const IDESC
*idesc
,
1145 int unit_num
, int referenced
,
1146 INT in_GRj
, INT out_spr
)
1150 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1152 /* The entire VLIW insn must wait if there is a dependency on a register
1153 which is not ready yet.
1154 The latency of the registers may be less than previously recorded,
1155 depending on how they were used previously.
1156 See Table 13-8 in the LSI. */
1159 if (use_is_gr_complex (cpu
, in_GRj
))
1160 decrease_GR_busy (cpu
, in_GRj
, 1);
1162 vliw_wait_for_GR (cpu
, in_GRj
);
1163 vliw_wait_for_SPR (cpu
, out_spr
);
1164 handle_resource_wait (cpu
);
1165 load_wait_for_GR (cpu
, in_GRj
);
1166 trace_vliw_wait_cycles (cpu
);
1170 cycles
= idesc
->timing
->units
[unit_num
].done
;
1173 /* The latency of spr is ? cycles. */
1174 update_SPR_latency (cpu
, out_spr
, cycles
+ ?);
1181 frvbf_model_fr500_u_ici (SIM_CPU
*cpu
, const IDESC
*idesc
,
1182 int unit_num
, int referenced
,
1183 INT in_GRi
, INT in_GRj
)
1187 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1189 /* The entire VLIW insn must wait if there is a dependency on a register
1190 which is not ready yet.
1191 The latency of the registers may be less than previously recorded,
1192 depending on how they were used previously.
1193 See Table 13-8 in the LSI. */
1196 if (use_is_gr_complex (cpu
, in_GRi
))
1197 decrease_GR_busy (cpu
, in_GRi
, 1);
1199 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
1201 if (use_is_gr_complex (cpu
, in_GRj
))
1202 decrease_GR_busy (cpu
, in_GRj
, 1);
1204 vliw_wait_for_GR (cpu
, in_GRi
);
1205 vliw_wait_for_GR (cpu
, in_GRj
);
1206 handle_resource_wait (cpu
);
1207 load_wait_for_GR (cpu
, in_GRi
);
1208 load_wait_for_GR (cpu
, in_GRj
);
1209 trace_vliw_wait_cycles (cpu
);
1213 cycles
= idesc
->timing
->units
[unit_num
].done
;
1214 request_cache_invalidate (cpu
, CPU_INSN_CACHE (cpu
), cycles
);
1219 frvbf_model_fr500_u_dci (SIM_CPU
*cpu
, const IDESC
*idesc
,
1220 int unit_num
, int referenced
,
1221 INT in_GRi
, INT in_GRj
)
1225 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1227 /* The entire VLIW insn must wait if there is a dependency on a register
1228 which is not ready yet.
1229 The latency of the registers may be less than previously recorded,
1230 depending on how they were used previously.
1231 See Table 13-8 in the LSI. */
1234 if (use_is_gr_complex (cpu
, in_GRi
))
1235 decrease_GR_busy (cpu
, in_GRi
, 1);
1237 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
1239 if (use_is_gr_complex (cpu
, in_GRj
))
1240 decrease_GR_busy (cpu
, in_GRj
, 1);
1242 vliw_wait_for_GR (cpu
, in_GRi
);
1243 vliw_wait_for_GR (cpu
, in_GRj
);
1244 handle_resource_wait (cpu
);
1245 load_wait_for_GR (cpu
, in_GRi
);
1246 load_wait_for_GR (cpu
, in_GRj
);
1247 trace_vliw_wait_cycles (cpu
);
1251 cycles
= idesc
->timing
->units
[unit_num
].done
;
1252 request_cache_invalidate (cpu
, CPU_DATA_CACHE (cpu
), cycles
);
1257 frvbf_model_fr500_u_dcf (SIM_CPU
*cpu
, const IDESC
*idesc
,
1258 int unit_num
, int referenced
,
1259 INT in_GRi
, INT in_GRj
)
1263 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1265 /* The entire VLIW insn must wait if there is a dependency on a register
1266 which is not ready yet.
1267 The latency of the registers may be less than previously recorded,
1268 depending on how they were used previously.
1269 See Table 13-8 in the LSI. */
1272 if (use_is_gr_complex (cpu
, in_GRi
))
1273 decrease_GR_busy (cpu
, in_GRi
, 1);
1275 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
1277 if (use_is_gr_complex (cpu
, in_GRj
))
1278 decrease_GR_busy (cpu
, in_GRj
, 1);
1280 vliw_wait_for_GR (cpu
, in_GRi
);
1281 vliw_wait_for_GR (cpu
, in_GRj
);
1282 handle_resource_wait (cpu
);
1283 load_wait_for_GR (cpu
, in_GRi
);
1284 load_wait_for_GR (cpu
, in_GRj
);
1285 trace_vliw_wait_cycles (cpu
);
1289 cycles
= idesc
->timing
->units
[unit_num
].done
;
1290 request_cache_flush (cpu
, CPU_DATA_CACHE (cpu
), cycles
);
1295 frvbf_model_fr500_u_icpl (SIM_CPU
*cpu
, const IDESC
*idesc
,
1296 int unit_num
, int referenced
,
1297 INT in_GRi
, INT in_GRj
)
1301 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1303 /* The entire VLIW insn must wait if there is a dependency on a register
1304 which is not ready yet.
1305 The latency of the registers may be less than previously recorded,
1306 depending on how they were used previously.
1307 See Table 13-8 in the LSI. */
1310 if (use_is_gr_complex (cpu
, in_GRi
))
1311 decrease_GR_busy (cpu
, in_GRi
, 1);
1313 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
1315 if (use_is_gr_complex (cpu
, in_GRj
))
1316 decrease_GR_busy (cpu
, in_GRj
, 1);
1318 vliw_wait_for_GR (cpu
, in_GRi
);
1319 vliw_wait_for_GR (cpu
, in_GRj
);
1320 handle_resource_wait (cpu
);
1321 load_wait_for_GR (cpu
, in_GRi
);
1322 load_wait_for_GR (cpu
, in_GRj
);
1323 trace_vliw_wait_cycles (cpu
);
1327 cycles
= idesc
->timing
->units
[unit_num
].done
;
1328 request_cache_preload (cpu
, CPU_INSN_CACHE (cpu
), cycles
);
1333 frvbf_model_fr500_u_dcpl (SIM_CPU
*cpu
, const IDESC
*idesc
,
1334 int unit_num
, int referenced
,
1335 INT in_GRi
, INT in_GRj
)
1339 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1341 /* The entire VLIW insn must wait if there is a dependency on a register
1342 which is not ready yet.
1343 The latency of the registers may be less than previously recorded,
1344 depending on how they were used previously.
1345 See Table 13-8 in the LSI. */
1348 if (use_is_gr_complex (cpu
, in_GRi
))
1349 decrease_GR_busy (cpu
, in_GRi
, 1);
1351 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
1353 if (use_is_gr_complex (cpu
, in_GRj
))
1354 decrease_GR_busy (cpu
, in_GRj
, 1);
1356 vliw_wait_for_GR (cpu
, in_GRi
);
1357 vliw_wait_for_GR (cpu
, in_GRj
);
1358 handle_resource_wait (cpu
);
1359 load_wait_for_GR (cpu
, in_GRi
);
1360 load_wait_for_GR (cpu
, in_GRj
);
1361 trace_vliw_wait_cycles (cpu
);
1365 cycles
= idesc
->timing
->units
[unit_num
].done
;
1366 request_cache_preload (cpu
, CPU_DATA_CACHE (cpu
), cycles
);
1371 frvbf_model_fr500_u_icul (SIM_CPU
*cpu
, const IDESC
*idesc
,
1372 int unit_num
, int referenced
,
1373 INT in_GRi
, INT in_GRj
)
1377 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1379 /* The entire VLIW insn must wait if there is a dependency on a register
1380 which is not ready yet.
1381 The latency of the registers may be less than previously recorded,
1382 depending on how they were used previously.
1383 See Table 13-8 in the LSI. */
1386 if (use_is_gr_complex (cpu
, in_GRi
))
1387 decrease_GR_busy (cpu
, in_GRi
, 1);
1389 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
1391 if (use_is_gr_complex (cpu
, in_GRj
))
1392 decrease_GR_busy (cpu
, in_GRj
, 1);
1394 vliw_wait_for_GR (cpu
, in_GRi
);
1395 vliw_wait_for_GR (cpu
, in_GRj
);
1396 handle_resource_wait (cpu
);
1397 load_wait_for_GR (cpu
, in_GRi
);
1398 load_wait_for_GR (cpu
, in_GRj
);
1399 trace_vliw_wait_cycles (cpu
);
1403 cycles
= idesc
->timing
->units
[unit_num
].done
;
1404 request_cache_unlock (cpu
, CPU_INSN_CACHE (cpu
), cycles
);
1409 frvbf_model_fr500_u_dcul (SIM_CPU
*cpu
, const IDESC
*idesc
,
1410 int unit_num
, int referenced
,
1411 INT in_GRi
, INT in_GRj
)
1415 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1417 /* The entire VLIW insn must wait if there is a dependency on a register
1418 which is not ready yet.
1419 The latency of the registers may be less than previously recorded,
1420 depending on how they were used previously.
1421 See Table 13-8 in the LSI. */
1424 if (use_is_gr_complex (cpu
, in_GRi
))
1425 decrease_GR_busy (cpu
, in_GRi
, 1);
1427 if (in_GRj
!= in_GRi
&& in_GRj
>= 0)
1429 if (use_is_gr_complex (cpu
, in_GRj
))
1430 decrease_GR_busy (cpu
, in_GRj
, 1);
1432 vliw_wait_for_GR (cpu
, in_GRi
);
1433 vliw_wait_for_GR (cpu
, in_GRj
);
1434 handle_resource_wait (cpu
);
1435 load_wait_for_GR (cpu
, in_GRi
);
1436 load_wait_for_GR (cpu
, in_GRj
);
1437 trace_vliw_wait_cycles (cpu
);
1441 cycles
= idesc
->timing
->units
[unit_num
].done
;
1442 request_cache_unlock (cpu
, CPU_DATA_CACHE (cpu
), cycles
);
1447 frvbf_model_fr500_u_float_arith (SIM_CPU
*cpu
, const IDESC
*idesc
,
1448 int unit_num
, int referenced
,
1449 INT in_FRi
, INT in_FRj
,
1450 INT in_FRdoublei
, INT in_FRdoublej
,
1451 INT out_FRk
, INT out_FRdoublek
)
1454 FRV_PROFILE_STATE
*ps
;
1456 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1459 /* The preprocessing can execute right away. */
1460 cycles
= idesc
->timing
->units
[unit_num
].done
;
1462 /* The post processing must wait if there is a dependency on a FR
1463 which is not ready yet. */
1464 adjust_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, 1);
1465 adjust_double_register_busy (cpu
, in_FRdoublei
, in_FRdoublej
, out_FRdoublek
,
1467 ps
= CPU_PROFILE_STATE (cpu
);
1468 ps
->post_wait
= cycles
;
1469 post_wait_for_FR (cpu
, in_FRi
);
1470 post_wait_for_FR (cpu
, in_FRj
);
1471 post_wait_for_FR (cpu
, out_FRk
);
1472 post_wait_for_FRdouble (cpu
, in_FRdoublei
);
1473 post_wait_for_FRdouble (cpu
, in_FRdoublej
);
1474 post_wait_for_FRdouble (cpu
, out_FRdoublek
);
1475 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1477 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRk
));
1478 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRdoublek
));
1480 restore_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, 1);
1481 restore_double_register_busy (cpu
, in_FRdoublei
, in_FRdoublej
, out_FRdoublek
,
1484 /* The latency of FRk will be at least the latency of the other inputs. */
1485 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
1486 update_FRdouble_latency (cpu
, out_FRdoublek
, ps
->post_wait
);
1488 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1490 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRk
), ps
->post_wait
);
1491 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRdoublek
), ps
->post_wait
);
1494 /* Once initiated, post-processing will take 3 cycles. */
1495 update_FR_ptime (cpu
, out_FRk
, 3);
1496 update_FRdouble_ptime (cpu
, out_FRdoublek
, 3);
1498 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1500 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRk
), 3);
1501 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRdoublek
), 3);
1504 /* Mark this use of the register as a floating point op. */
1506 set_use_is_fpop (cpu
, out_FRk
);
1507 if (out_FRdoublek
>= 0)
1509 set_use_is_fpop (cpu
, out_FRdoublek
);
1510 if (out_FRdoublek
< 63)
1511 set_use_is_fpop (cpu
, out_FRdoublek
+ 1);
1518 frvbf_model_fr500_u_float_dual_arith (SIM_CPU
*cpu
, const IDESC
*idesc
,
1519 int unit_num
, int referenced
,
1520 INT in_FRi
, INT in_FRj
,
1521 INT in_FRdoublei
, INT in_FRdoublej
,
1522 INT out_FRk
, INT out_FRdoublek
)
1531 FRV_PROFILE_STATE
*ps
;
1533 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1536 /* The preprocessing can execute right away. */
1537 cycles
= idesc
->timing
->units
[unit_num
].done
;
1539 /* The post processing must wait if there is a dependency on a FR
1540 which is not ready yet. */
1541 dual_FRi
= DUAL_REG (in_FRi
);
1542 dual_FRj
= DUAL_REG (in_FRj
);
1543 dual_FRk
= DUAL_REG (out_FRk
);
1544 dual_FRdoublei
= DUAL_DOUBLE (in_FRdoublei
);
1545 dual_FRdoublej
= DUAL_DOUBLE (in_FRdoublej
);
1546 dual_FRdoublek
= DUAL_DOUBLE (out_FRdoublek
);
1548 adjust_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, 1);
1549 adjust_float_register_busy (cpu
, dual_FRi
, dual_FRj
, dual_FRk
, 1);
1550 adjust_double_register_busy (cpu
, in_FRdoublei
, in_FRdoublej
, out_FRdoublek
,
1552 adjust_double_register_busy (cpu
, dual_FRdoublei
, dual_FRdoublej
,
1554 ps
= CPU_PROFILE_STATE (cpu
);
1555 ps
->post_wait
= cycles
;
1556 post_wait_for_FR (cpu
, in_FRi
);
1557 post_wait_for_FR (cpu
, in_FRj
);
1558 post_wait_for_FR (cpu
, out_FRk
);
1559 post_wait_for_FR (cpu
, dual_FRi
);
1560 post_wait_for_FR (cpu
, dual_FRj
);
1561 post_wait_for_FR (cpu
, dual_FRk
);
1562 post_wait_for_FRdouble (cpu
, in_FRdoublei
);
1563 post_wait_for_FRdouble (cpu
, in_FRdoublej
);
1564 post_wait_for_FRdouble (cpu
, out_FRdoublek
);
1565 post_wait_for_FRdouble (cpu
, dual_FRdoublei
);
1566 post_wait_for_FRdouble (cpu
, dual_FRdoublej
);
1567 post_wait_for_FRdouble (cpu
, dual_FRdoublek
);
1568 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1570 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRk
));
1571 post_wait_for_SPR (cpu
, FNER_FOR_FR (dual_FRk
));
1572 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRdoublek
));
1573 post_wait_for_SPR (cpu
, FNER_FOR_FR (dual_FRdoublek
));
1575 restore_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, 1);
1576 restore_float_register_busy (cpu
, dual_FRi
, dual_FRj
, dual_FRk
, 1);
1577 restore_double_register_busy (cpu
, in_FRdoublei
, in_FRdoublej
, out_FRdoublek
,
1579 restore_double_register_busy (cpu
, dual_FRdoublei
, dual_FRdoublej
,
1582 /* The latency of FRk will be at least the latency of the other inputs. */
1583 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
1584 update_FR_latency (cpu
, dual_FRk
, ps
->post_wait
);
1585 update_FRdouble_latency (cpu
, out_FRdoublek
, ps
->post_wait
);
1586 update_FRdouble_latency (cpu
, dual_FRdoublek
, ps
->post_wait
);
1588 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1590 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRk
), ps
->post_wait
);
1591 update_SPR_latency (cpu
, FNER_FOR_FR (dual_FRk
), ps
->post_wait
);
1592 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRdoublek
), ps
->post_wait
);
1593 update_SPR_latency (cpu
, FNER_FOR_FR (dual_FRdoublek
), ps
->post_wait
);
1596 /* Once initiated, post-processing will take 3 cycles. */
1597 update_FR_ptime (cpu
, out_FRk
, 3);
1598 update_FR_ptime (cpu
, dual_FRk
, 3);
1599 update_FRdouble_ptime (cpu
, out_FRdoublek
, 3);
1600 update_FRdouble_ptime (cpu
, dual_FRdoublek
, 3);
1602 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1604 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRk
), 3);
1605 update_SPR_ptime (cpu
, FNER_FOR_FR (dual_FRk
), 3);
1606 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRdoublek
), 3);
1607 update_SPR_ptime (cpu
, FNER_FOR_FR (dual_FRdoublek
), 3);
1610 /* Mark this use of the register as a floating point op. */
1612 set_use_is_fpop (cpu
, out_FRk
);
1614 set_use_is_fpop (cpu
, dual_FRk
);
1615 if (out_FRdoublek
>= 0)
1617 set_use_is_fpop (cpu
, out_FRdoublek
);
1618 if (out_FRdoublek
< 63)
1619 set_use_is_fpop (cpu
, out_FRdoublek
+ 1);
1621 if (dual_FRdoublek
>= 0)
1623 set_use_is_fpop (cpu
, dual_FRdoublek
);
1624 if (dual_FRdoublek
< 63)
1625 set_use_is_fpop (cpu
, dual_FRdoublek
+ 1);
1632 frvbf_model_fr500_u_float_div (SIM_CPU
*cpu
, const IDESC
*idesc
,
1633 int unit_num
, int referenced
,
1634 INT in_FRi
, INT in_FRj
, INT out_FRk
)
1639 FRV_PROFILE_STATE
*ps
;
1641 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1644 cycles
= idesc
->timing
->units
[unit_num
].done
;
1646 /* The post processing must wait if there is a dependency on a FR
1647 which is not ready yet. */
1648 adjust_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, 1);
1649 ps
= CPU_PROFILE_STATE (cpu
);
1650 ps
->post_wait
= cycles
;
1651 post_wait_for_FR (cpu
, in_FRi
);
1652 post_wait_for_FR (cpu
, in_FRj
);
1653 post_wait_for_FR (cpu
, out_FRk
);
1654 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1655 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRk
));
1656 vliw
= CPU_VLIW (cpu
);
1657 slot
= vliw
->next_slot
- 1;
1658 slot
= (*vliw
->current_vliw
)[slot
] - UNIT_FM0
;
1659 post_wait_for_fdiv (cpu
, slot
);
1660 restore_float_register_busy (cpu
, in_FRi
, in_FRj
, out_FRk
, 1);
1662 /* The latency of FRk will be at least the latency of the other inputs. */
1663 /* Once initiated, post-processing will take 10 cycles. */
1664 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
1665 update_FR_ptime (cpu
, out_FRk
, 10);
1667 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1669 /* FNER has a latency of 10 cycles. */
1670 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRk
), ps
->post_wait
);
1671 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRk
), 10);
1674 /* The latency of the fdiv unit will be at least the latency of the other
1675 inputs. Once initiated, post-processing will take 9 cycles. */
1676 update_fdiv_resource_latency (cpu
, slot
, ps
->post_wait
+ 9);
1678 /* Mark this use of the register as a floating point op. */
1679 set_use_is_fpop (cpu
, out_FRk
);
1685 frvbf_model_fr500_u_float_sqrt (SIM_CPU
*cpu
, const IDESC
*idesc
,
1686 int unit_num
, int referenced
,
1687 INT in_FRj
, INT in_FRdoublej
,
1688 INT out_FRk
, INT out_FRdoublek
)
1693 FRV_PROFILE_STATE
*ps
;
1695 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1698 cycles
= idesc
->timing
->units
[unit_num
].done
;
1700 /* The post processing must wait if there is a dependency on a FR
1701 which is not ready yet. */
1702 adjust_float_register_busy (cpu
, -1, in_FRj
, out_FRk
, 1);
1703 adjust_double_register_busy (cpu
, -1, in_FRdoublej
, out_FRdoublek
, 1);
1704 ps
= CPU_PROFILE_STATE (cpu
);
1705 ps
->post_wait
= cycles
;
1706 post_wait_for_FR (cpu
, in_FRj
);
1707 post_wait_for_FR (cpu
, out_FRk
);
1708 post_wait_for_FRdouble (cpu
, in_FRdoublej
);
1709 post_wait_for_FRdouble (cpu
, out_FRdoublek
);
1710 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1711 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRk
));
1712 vliw
= CPU_VLIW (cpu
);
1713 slot
= vliw
->next_slot
- 1;
1714 slot
= (*vliw
->current_vliw
)[slot
] - UNIT_FM0
;
1715 post_wait_for_fsqrt (cpu
, slot
);
1716 restore_float_register_busy (cpu
, -1, in_FRj
, out_FRk
, 1);
1717 restore_double_register_busy (cpu
, -1, in_FRdoublej
, out_FRdoublek
, 1);
1719 /* The latency of FRk will be at least the latency of the other inputs. */
1720 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
1721 update_FRdouble_latency (cpu
, out_FRdoublek
, ps
->post_wait
);
1722 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1723 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRk
), ps
->post_wait
);
1725 /* Once initiated, post-processing will take 15 cycles. */
1726 update_FR_ptime (cpu
, out_FRk
, 15);
1727 update_FRdouble_ptime (cpu
, out_FRdoublek
, 15);
1729 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1730 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRk
), 15);
1732 /* The latency of the sqrt unit will be the latency of the other
1733 inputs plus 14 cycles. */
1734 update_fsqrt_resource_latency (cpu
, slot
, ps
->post_wait
+ 14);
1736 /* Mark this use of the register as a floating point op. */
1738 set_use_is_fpop (cpu
, out_FRk
);
1739 if (out_FRdoublek
>= 0)
1741 set_use_is_fpop (cpu
, out_FRdoublek
);
1742 if (out_FRdoublek
< 63)
1743 set_use_is_fpop (cpu
, out_FRdoublek
+ 1);
1750 frvbf_model_fr500_u_float_dual_sqrt (SIM_CPU
*cpu
, const IDESC
*idesc
,
1751 int unit_num
, int referenced
,
1752 INT in_FRj
, INT out_FRk
)
1759 FRV_PROFILE_STATE
*ps
;
1761 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1764 cycles
= idesc
->timing
->units
[unit_num
].done
;
1766 /* The post processing must wait if there is a dependency on a FR
1767 which is not ready yet. */
1768 dual_FRj
= DUAL_REG (in_FRj
);
1769 dual_FRk
= DUAL_REG (out_FRk
);
1770 adjust_float_register_busy (cpu
, -1, in_FRj
, out_FRk
, 1);
1771 adjust_float_register_busy (cpu
, -1, dual_FRj
, dual_FRk
, 1);
1772 ps
= CPU_PROFILE_STATE (cpu
);
1773 ps
->post_wait
= cycles
;
1774 post_wait_for_FR (cpu
, in_FRj
);
1775 post_wait_for_FR (cpu
, out_FRk
);
1776 post_wait_for_FR (cpu
, dual_FRj
);
1777 post_wait_for_FR (cpu
, dual_FRk
);
1779 vliw
= CPU_VLIW (cpu
);
1780 slot
= vliw
->next_slot
- 1;
1781 slot
= (*vliw
->current_vliw
)[slot
] - UNIT_FM0
;
1782 post_wait_for_fsqrt (cpu
, slot
);
1783 restore_float_register_busy (cpu
, -1, in_FRj
, out_FRk
, 1);
1784 restore_float_register_busy (cpu
, -1, dual_FRj
, dual_FRk
, 1);
1786 /* The latency of FRk will be at least the latency of the other inputs. */
1787 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
1788 update_FR_latency (cpu
, dual_FRk
, ps
->post_wait
);
1790 /* Once initiated, post-processing will take 15 cycles. */
1791 update_FR_ptime (cpu
, out_FRk
, 15);
1792 update_FR_ptime (cpu
, dual_FRk
, 15);
1794 /* The latency of the sqrt unit will be at least the latency of the other
1796 update_fsqrt_resource_latency (cpu
, slot
, ps
->post_wait
+ 14);
1798 /* Mark this use of the register as a floating point op. */
1800 set_use_is_fpop (cpu
, out_FRk
);
1802 set_use_is_fpop (cpu
, dual_FRk
);
1808 frvbf_model_fr500_u_float_compare (SIM_CPU
*cpu
, const IDESC
*idesc
,
1809 int unit_num
, int referenced
,
1810 INT in_FRi
, INT in_FRj
,
1811 INT in_FRdoublei
, INT in_FRdoublej
,
1815 FRV_PROFILE_STATE
*ps
;
1817 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1820 /* The preprocessing can execute right away. */
1821 cycles
= idesc
->timing
->units
[unit_num
].done
;
1823 /* The post processing must wait if there is a dependency on a FR
1824 which is not ready yet. */
1825 adjust_double_register_busy (cpu
, in_FRdoublei
, in_FRdoublej
, -1, 1);
1826 ps
= CPU_PROFILE_STATE (cpu
);
1827 ps
->post_wait
= cycles
;
1828 post_wait_for_FR (cpu
, in_FRi
);
1829 post_wait_for_FR (cpu
, in_FRj
);
1830 post_wait_for_FRdouble (cpu
, in_FRdoublei
);
1831 post_wait_for_FRdouble (cpu
, in_FRdoublej
);
1832 post_wait_for_CCR (cpu
, out_FCCi_2
);
1833 restore_double_register_busy (cpu
, in_FRdoublei
, in_FRdoublej
, -1, 1);
1835 /* The latency of FCCi_2 will be the latency of the other inputs plus 3
1837 update_CCR_latency (cpu
, out_FCCi_2
, ps
->post_wait
+ 3);
1843 frvbf_model_fr500_u_float_dual_compare (SIM_CPU
*cpu
, const IDESC
*idesc
,
1844 int unit_num
, int referenced
,
1845 INT in_FRi
, INT in_FRj
,
1852 FRV_PROFILE_STATE
*ps
;
1854 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1857 /* The preprocessing can execute right away. */
1858 cycles
= idesc
->timing
->units
[unit_num
].done
;
1860 /* The post processing must wait if there is a dependency on a FR
1861 which is not ready yet. */
1862 ps
= CPU_PROFILE_STATE (cpu
);
1863 ps
->post_wait
= cycles
;
1864 dual_FRi
= DUAL_REG (in_FRi
);
1865 dual_FRj
= DUAL_REG (in_FRj
);
1866 dual_FCCi_2
= out_FCCi_2
+ 1;
1867 adjust_float_register_busy (cpu
, in_FRi
, in_FRj
, -1, 1);
1868 adjust_float_register_busy (cpu
, dual_FRi
, dual_FRj
, -1, 1);
1869 post_wait_for_FR (cpu
, in_FRi
);
1870 post_wait_for_FR (cpu
, in_FRj
);
1871 post_wait_for_FR (cpu
, dual_FRi
);
1872 post_wait_for_FR (cpu
, dual_FRj
);
1873 post_wait_for_CCR (cpu
, out_FCCi_2
);
1874 post_wait_for_CCR (cpu
, dual_FCCi_2
);
1875 restore_float_register_busy (cpu
, in_FRi
, in_FRj
, -1, 1);
1876 restore_float_register_busy (cpu
, dual_FRi
, dual_FRj
, -1, 1);
1878 /* The latency of FCCi_2 will be the latency of the other inputs plus 3
1880 update_CCR_latency (cpu
, out_FCCi_2
, ps
->post_wait
+ 3);
1881 update_CCR_latency (cpu
, dual_FCCi_2
, ps
->post_wait
+ 3);
1887 frvbf_model_fr500_u_float_convert (SIM_CPU
*cpu
, const IDESC
*idesc
,
1888 int unit_num
, int referenced
,
1889 INT in_FRj
, INT in_FRintj
, INT in_FRdoublej
,
1890 INT out_FRk
, INT out_FRintk
,
1894 FRV_PROFILE_STATE
*ps
;
1896 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1899 /* The preprocessing can execute right away. */
1900 cycles
= idesc
->timing
->units
[unit_num
].done
;
1902 /* The post processing must wait if there is a dependency on a FR
1903 which is not ready yet. */
1904 ps
= CPU_PROFILE_STATE (cpu
);
1905 ps
->post_wait
= cycles
;
1906 adjust_float_register_busy (cpu
, -1, in_FRj
, out_FRk
, 1);
1907 adjust_float_register_busy (cpu
, -1, in_FRintj
, out_FRintk
, 1);
1908 adjust_double_register_busy (cpu
, -1, in_FRdoublej
, out_FRdoublek
, 1);
1909 post_wait_for_FR (cpu
, in_FRj
);
1910 post_wait_for_FR (cpu
, in_FRintj
);
1911 post_wait_for_FRdouble (cpu
, in_FRdoublej
);
1912 post_wait_for_FR (cpu
, out_FRk
);
1913 post_wait_for_FR (cpu
, out_FRintk
);
1914 post_wait_for_FRdouble (cpu
, out_FRdoublek
);
1915 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1917 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRk
));
1918 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRintk
));
1919 post_wait_for_SPR (cpu
, FNER_FOR_FR (out_FRdoublek
));
1921 restore_float_register_busy (cpu
, -1, in_FRj
, out_FRk
, 1);
1922 restore_float_register_busy (cpu
, -1, in_FRintj
, out_FRintk
, 1);
1923 restore_double_register_busy (cpu
, -1, in_FRdoublej
, out_FRdoublek
, 1);
1925 /* The latency of FRk will be at least the latency of the other inputs. */
1926 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
1927 update_FR_latency (cpu
, out_FRintk
, ps
->post_wait
);
1928 update_FRdouble_latency (cpu
, out_FRdoublek
, ps
->post_wait
);
1930 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1932 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRk
), ps
->post_wait
);
1933 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRintk
), ps
->post_wait
);
1934 update_SPR_latency (cpu
, FNER_FOR_FR (out_FRdoublek
), ps
->post_wait
);
1937 /* Once initiated, post-processing will take 3 cycles. */
1938 update_FR_ptime (cpu
, out_FRk
, 3);
1939 update_FR_ptime (cpu
, out_FRintk
, 3);
1940 update_FRdouble_ptime (cpu
, out_FRdoublek
, 3);
1942 if (CGEN_ATTR_VALUE(idesc
, idesc
->attrs
, CGEN_INSN_NON_EXCEPTING
))
1944 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRk
), 3);
1945 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRintk
), 3);
1946 update_SPR_ptime (cpu
, FNER_FOR_FR (out_FRdoublek
), 3);
1949 /* Mark this use of the register as a floating point op. */
1951 set_use_is_fpop (cpu
, out_FRk
);
1952 if (out_FRintk
>= 0)
1953 set_use_is_fpop (cpu
, out_FRintk
);
1954 if (out_FRdoublek
>= 0)
1956 set_use_is_fpop (cpu
, out_FRdoublek
);
1957 set_use_is_fpop (cpu
, out_FRdoublek
+ 1);
1964 frvbf_model_fr500_u_float_dual_convert (SIM_CPU
*cpu
, const IDESC
*idesc
,
1965 int unit_num
, int referenced
,
1966 INT in_FRj
, INT in_FRintj
,
1967 INT out_FRk
, INT out_FRintk
)
1974 FRV_PROFILE_STATE
*ps
;
1976 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
1979 /* The preprocessing can execute right away. */
1980 cycles
= idesc
->timing
->units
[unit_num
].done
;
1982 /* The post processing must wait if there is a dependency on a FR
1983 which is not ready yet. */
1984 ps
= CPU_PROFILE_STATE (cpu
);
1985 ps
->post_wait
= cycles
;
1986 dual_FRj
= DUAL_REG (in_FRj
);
1987 dual_FRintj
= DUAL_REG (in_FRintj
);
1988 dual_FRk
= DUAL_REG (out_FRk
);
1989 dual_FRintk
= DUAL_REG (out_FRintk
);
1990 adjust_float_register_busy (cpu
, -1, in_FRj
, out_FRk
, 1);
1991 adjust_float_register_busy (cpu
, -1, dual_FRj
, dual_FRk
, 1);
1992 adjust_float_register_busy (cpu
, -1, in_FRintj
, out_FRintk
, 1);
1993 adjust_float_register_busy (cpu
, -1, dual_FRintj
, dual_FRintk
, 1);
1994 post_wait_for_FR (cpu
, in_FRj
);
1995 post_wait_for_FR (cpu
, in_FRintj
);
1996 post_wait_for_FR (cpu
, out_FRk
);
1997 post_wait_for_FR (cpu
, out_FRintk
);
1998 post_wait_for_FR (cpu
, dual_FRj
);
1999 post_wait_for_FR (cpu
, dual_FRintj
);
2000 post_wait_for_FR (cpu
, dual_FRk
);
2001 post_wait_for_FR (cpu
, dual_FRintk
);
2002 restore_float_register_busy (cpu
, -1, in_FRj
, out_FRk
, 1);
2003 restore_float_register_busy (cpu
, -1, dual_FRj
, dual_FRk
, 1);
2004 restore_float_register_busy (cpu
, -1, in_FRintj
, out_FRintk
, 1);
2005 restore_float_register_busy (cpu
, -1, dual_FRintj
, dual_FRintk
, 1);
2007 /* The latency of FRk will be at least the latency of the other inputs. */
2008 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
2009 update_FR_latency (cpu
, out_FRintk
, ps
->post_wait
);
2010 update_FR_latency (cpu
, dual_FRk
, ps
->post_wait
);
2011 update_FR_latency (cpu
, dual_FRintk
, ps
->post_wait
);
2013 /* Once initiated, post-processing will take 3 cycles. */
2014 update_FR_ptime (cpu
, out_FRk
, 3);
2015 update_FR_ptime (cpu
, out_FRintk
, 3);
2016 update_FR_ptime (cpu
, dual_FRk
, 3);
2017 update_FR_ptime (cpu
, dual_FRintk
, 3);
2019 /* Mark this use of the register as a floating point op. */
2021 set_use_is_fpop (cpu
, out_FRk
);
2022 if (out_FRintk
>= 0)
2023 set_use_is_fpop (cpu
, out_FRintk
);
2029 frvbf_model_fr500_u_media (SIM_CPU
*cpu
, const IDESC
*idesc
,
2030 int unit_num
, int referenced
,
2031 INT in_FRi
, INT in_FRj
, INT in_ACC40Si
, INT in_ACCGi
,
2033 INT out_ACC40Sk
, INT out_ACC40Uk
, INT out_ACCGk
)
2036 FRV_PROFILE_STATE
*ps
;
2037 const CGEN_INSN
*insn
;
2040 int busy_adjustment
[] = {0, 0, 0};
2044 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2047 /* The preprocessing can execute right away. */
2048 cycles
= idesc
->timing
->units
[unit_num
].done
;
2050 ps
= CPU_PROFILE_STATE (cpu
);
2051 insn
= idesc
->idata
;
2053 /* If the previous use of the registers was a media op,
2054 then their latency will be less than previously recorded.
2055 See Table 13-13 in the LSI. */
2058 if (use_is_media (cpu
, in_FRi
))
2060 busy_adjustment
[0] = 2;
2061 decrease_FR_busy (cpu
, in_FRi
, busy_adjustment
[0]);
2064 enforce_full_fr_latency (cpu
, in_FRi
);
2066 if (in_FRj
>= 0 && in_FRj
!= in_FRi
)
2068 if (use_is_media (cpu
, in_FRj
))
2070 busy_adjustment
[1] = 2;
2071 decrease_FR_busy (cpu
, in_FRj
, busy_adjustment
[1]);
2074 enforce_full_fr_latency (cpu
, in_FRj
);
2076 if (out_FRk
>= 0 && out_FRk
!= in_FRi
&& out_FRk
!= in_FRj
)
2078 if (use_is_media (cpu
, out_FRk
))
2080 busy_adjustment
[2] = 2;
2081 decrease_FR_busy (cpu
, out_FRk
, busy_adjustment
[2]);
2084 enforce_full_fr_latency (cpu
, out_FRk
);
2087 /* The post processing must wait if there is a dependency on a FR
2088 which is not ready yet. */
2089 ps
->post_wait
= cycles
;
2090 post_wait_for_FR (cpu
, in_FRi
);
2091 post_wait_for_FR (cpu
, in_FRj
);
2092 post_wait_for_FR (cpu
, out_FRk
);
2093 post_wait_for_ACC (cpu
, in_ACC40Si
);
2094 post_wait_for_ACC (cpu
, in_ACCGi
);
2095 post_wait_for_ACC (cpu
, out_ACC40Sk
);
2096 post_wait_for_ACC (cpu
, out_ACC40Uk
);
2097 post_wait_for_ACC (cpu
, out_ACCGk
);
2099 /* Restore the busy cycles of the registers we used. */
2102 fr
[in_FRi
] += busy_adjustment
[0];
2104 fr
[in_FRj
] += busy_adjustment
[1];
2106 fr
[out_FRk
] += busy_adjustment
[2];
2108 /* The latency of tht output register will be at least the latency of the
2109 other inputs. Once initiated, post-processing will take 3 cycles. */
2112 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
2113 update_FR_ptime (cpu
, out_FRk
, 3);
2114 /* Mark this use of the register as a media op. */
2115 set_use_is_media (cpu
, out_FRk
);
2117 /* The latency of tht output accumulator will be at least the latency of the
2118 other inputs. Once initiated, post-processing will take 1 cycle. */
2119 if (out_ACC40Sk
>= 0)
2120 update_ACC_latency (cpu
, out_ACC40Sk
, ps
->post_wait
+ 1);
2121 if (out_ACC40Uk
>= 0)
2122 update_ACC_latency (cpu
, out_ACC40Uk
, ps
->post_wait
+ 1);
2124 update_ACC_latency (cpu
, out_ACCGk
, ps
->post_wait
+ 1);
2130 frvbf_model_fr500_u_media_quad_arith (SIM_CPU
*cpu
, const IDESC
*idesc
,
2131 int unit_num
, int referenced
,
2132 INT in_FRi
, INT in_FRj
,
2139 FRV_PROFILE_STATE
*ps
;
2140 int busy_adjustment
[] = {0, 0, 0, 0, 0, 0};
2143 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2146 /* The preprocessing can execute right away. */
2147 cycles
= idesc
->timing
->units
[unit_num
].done
;
2149 ps
= CPU_PROFILE_STATE (cpu
);
2150 dual_FRi
= DUAL_REG (in_FRi
);
2151 dual_FRj
= DUAL_REG (in_FRj
);
2152 dual_FRk
= DUAL_REG (out_FRk
);
2154 /* If the previous use of the registers was a media op,
2155 then their latency will be less than previously recorded.
2156 See Table 13-13 in the LSI. */
2157 if (use_is_media (cpu
, in_FRi
))
2159 busy_adjustment
[0] = 2;
2160 decrease_FR_busy (cpu
, in_FRi
, busy_adjustment
[0]);
2163 enforce_full_fr_latency (cpu
, in_FRi
);
2164 if (dual_FRi
>= 0 && use_is_media (cpu
, dual_FRi
))
2166 busy_adjustment
[1] = 2;
2167 decrease_FR_busy (cpu
, dual_FRi
, busy_adjustment
[1]);
2170 enforce_full_fr_latency (cpu
, dual_FRi
);
2171 if (in_FRj
!= in_FRi
)
2173 if (use_is_media (cpu
, in_FRj
))
2175 busy_adjustment
[2] = 2;
2176 decrease_FR_busy (cpu
, in_FRj
, busy_adjustment
[2]);
2179 enforce_full_fr_latency (cpu
, in_FRj
);
2180 if (dual_FRj
>= 0 && use_is_media (cpu
, dual_FRj
))
2182 busy_adjustment
[3] = 2;
2183 decrease_FR_busy (cpu
, dual_FRj
, busy_adjustment
[3]);
2186 enforce_full_fr_latency (cpu
, dual_FRj
+ 1);
2188 if (out_FRk
!= in_FRi
&& out_FRk
!= in_FRj
)
2190 if (use_is_media (cpu
, out_FRk
))
2192 busy_adjustment
[4] = 2;
2193 decrease_FR_busy (cpu
, out_FRk
, busy_adjustment
[4]);
2196 enforce_full_fr_latency (cpu
, out_FRk
);
2197 if (dual_FRk
>= 0 && use_is_media (cpu
, dual_FRk
))
2199 busy_adjustment
[5] = 2;
2200 decrease_FR_busy (cpu
, dual_FRk
, busy_adjustment
[5]);
2203 enforce_full_fr_latency (cpu
, dual_FRk
);
2206 /* The post processing must wait if there is a dependency on a FR
2207 which is not ready yet. */
2208 ps
->post_wait
= cycles
;
2209 post_wait_for_FR (cpu
, in_FRi
);
2210 post_wait_for_FR (cpu
, dual_FRi
);
2211 post_wait_for_FR (cpu
, in_FRj
);
2212 post_wait_for_FR (cpu
, dual_FRj
);
2213 post_wait_for_FR (cpu
, out_FRk
);
2214 post_wait_for_FR (cpu
, dual_FRk
);
2216 /* Restore the busy cycles of the registers we used. */
2218 fr
[in_FRi
] += busy_adjustment
[0];
2220 fr
[dual_FRi
] += busy_adjustment
[1];
2221 fr
[in_FRj
] += busy_adjustment
[2];
2223 fr
[dual_FRj
] += busy_adjustment
[3];
2224 fr
[out_FRk
] += busy_adjustment
[4];
2226 fr
[dual_FRk
] += busy_adjustment
[5];
2228 /* The latency of tht output register will be at least the latency of the
2230 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
2232 /* Once initiated, post-processing will take 3 cycles. */
2233 update_FR_ptime (cpu
, out_FRk
, 3);
2235 /* Mark this use of the register as a media op. */
2236 set_use_is_media (cpu
, out_FRk
);
2239 update_FR_latency (cpu
, dual_FRk
, ps
->post_wait
);
2240 update_FR_ptime (cpu
, dual_FRk
, 3);
2241 /* Mark this use of the register as a media op. */
2242 set_use_is_media (cpu
, dual_FRk
);
2249 frvbf_model_fr500_u_media_dual_mul (SIM_CPU
*cpu
, const IDESC
*idesc
,
2250 int unit_num
, int referenced
,
2251 INT in_FRi
, INT in_FRj
,
2252 INT out_ACC40Sk
, INT out_ACC40Uk
)
2257 FRV_PROFILE_STATE
*ps
;
2258 int busy_adjustment
[] = {0, 0, 0, 0, 0, 0};
2262 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2265 /* The preprocessing can execute right away. */
2266 cycles
= idesc
->timing
->units
[unit_num
].done
;
2268 ps
= CPU_PROFILE_STATE (cpu
);
2269 dual_ACC40Sk
= DUAL_REG (out_ACC40Sk
);
2270 dual_ACC40Uk
= DUAL_REG (out_ACC40Uk
);
2272 /* If the previous use of the registers was a media op,
2273 then their latency will be less than previously recorded.
2274 See Table 13-13 in the LSI. */
2275 if (use_is_media (cpu
, in_FRi
))
2277 busy_adjustment
[0] = 2;
2278 decrease_FR_busy (cpu
, in_FRi
, busy_adjustment
[0]);
2281 enforce_full_fr_latency (cpu
, in_FRi
);
2282 if (in_FRj
!= in_FRi
)
2284 if (use_is_media (cpu
, in_FRj
))
2286 busy_adjustment
[1] = 2;
2287 decrease_FR_busy (cpu
, in_FRj
, busy_adjustment
[1]);
2290 enforce_full_fr_latency (cpu
, in_FRj
);
2292 if (out_ACC40Sk
>= 0)
2294 busy_adjustment
[2] = 1;
2295 decrease_ACC_busy (cpu
, out_ACC40Sk
, busy_adjustment
[2]);
2297 if (dual_ACC40Sk
>= 0)
2299 busy_adjustment
[3] = 1;
2300 decrease_ACC_busy (cpu
, dual_ACC40Sk
, busy_adjustment
[3]);
2302 if (out_ACC40Uk
>= 0)
2304 busy_adjustment
[4] = 1;
2305 decrease_ACC_busy (cpu
, out_ACC40Uk
, busy_adjustment
[4]);
2307 if (dual_ACC40Uk
>= 0)
2309 busy_adjustment
[5] = 1;
2310 decrease_ACC_busy (cpu
, dual_ACC40Uk
, busy_adjustment
[5]);
2313 /* The post processing must wait if there is a dependency on a FR
2314 which is not ready yet. */
2315 ps
->post_wait
= cycles
;
2316 post_wait_for_FR (cpu
, in_FRi
);
2317 post_wait_for_FR (cpu
, in_FRj
);
2318 post_wait_for_ACC (cpu
, out_ACC40Sk
);
2319 post_wait_for_ACC (cpu
, dual_ACC40Sk
);
2320 post_wait_for_ACC (cpu
, out_ACC40Uk
);
2321 post_wait_for_ACC (cpu
, dual_ACC40Uk
);
2323 /* Restore the busy cycles of the registers we used. */
2326 fr
[in_FRi
] += busy_adjustment
[0];
2327 fr
[in_FRj
] += busy_adjustment
[1];
2328 if (out_ACC40Sk
>= 0)
2329 acc
[out_ACC40Sk
] += busy_adjustment
[2];
2330 if (dual_ACC40Sk
>= 0)
2331 acc
[dual_ACC40Sk
] += busy_adjustment
[3];
2332 if (out_ACC40Uk
>= 0)
2333 acc
[out_ACC40Uk
] += busy_adjustment
[4];
2334 if (dual_ACC40Uk
>= 0)
2335 acc
[dual_ACC40Uk
] += busy_adjustment
[5];
2337 /* The latency of tht output register will be at least the latency of the
2338 other inputs. Once initiated, post-processing will take 1 cycle. */
2339 if (out_ACC40Sk
>= 0)
2340 update_ACC_latency (cpu
, out_ACC40Sk
, ps
->post_wait
+ 1);
2341 if (dual_ACC40Sk
>= 0)
2342 update_ACC_latency (cpu
, dual_ACC40Sk
, ps
->post_wait
+ 1);
2343 if (out_ACC40Uk
>= 0)
2344 update_ACC_latency (cpu
, out_ACC40Uk
, ps
->post_wait
+ 1);
2345 if (dual_ACC40Uk
>= 0)
2346 update_ACC_latency (cpu
, dual_ACC40Uk
, ps
->post_wait
+ 1);
2352 frvbf_model_fr500_u_media_quad_mul (SIM_CPU
*cpu
, const IDESC
*idesc
,
2353 int unit_num
, int referenced
,
2354 INT in_FRi
, INT in_FRj
,
2355 INT out_ACC40Sk
, INT out_ACC40Uk
)
2366 FRV_PROFILE_STATE
*ps
;
2367 int busy_adjustment
[] = {0, 0, 0, 0, 0, 0, 0 ,0};
2371 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2374 /* The preprocessing can execute right away. */
2375 cycles
= idesc
->timing
->units
[unit_num
].done
;
2377 FRi_1
= DUAL_REG (in_FRi
);
2378 FRj_1
= DUAL_REG (in_FRj
);
2379 ACC40Sk_1
= DUAL_REG (out_ACC40Sk
);
2380 ACC40Sk_2
= DUAL_REG (ACC40Sk_1
);
2381 ACC40Sk_3
= DUAL_REG (ACC40Sk_2
);
2382 ACC40Uk_1
= DUAL_REG (out_ACC40Uk
);
2383 ACC40Uk_2
= DUAL_REG (ACC40Uk_1
);
2384 ACC40Uk_3
= DUAL_REG (ACC40Uk_2
);
2386 /* If the previous use of the registers was a media op,
2387 then their latency will be less than previously recorded.
2388 See Table 13-13 in the LSI. */
2389 ps
= CPU_PROFILE_STATE (cpu
);
2390 if (use_is_media (cpu
, in_FRi
))
2392 busy_adjustment
[0] = 2;
2393 decrease_FR_busy (cpu
, in_FRi
, busy_adjustment
[0]);
2396 enforce_full_fr_latency (cpu
, in_FRi
);
2399 if (use_is_media (cpu
, FRi_1
))
2401 busy_adjustment
[1] = 2;
2402 decrease_FR_busy (cpu
, FRi_1
, busy_adjustment
[1]);
2405 enforce_full_fr_latency (cpu
, FRi_1
);
2407 if (in_FRj
!= in_FRi
)
2409 if (use_is_media (cpu
, in_FRj
))
2411 busy_adjustment
[2] = 2;
2412 decrease_FR_busy (cpu
, in_FRj
, busy_adjustment
[2]);
2415 enforce_full_fr_latency (cpu
, in_FRj
);
2418 if (use_is_media (cpu
, FRj_1
))
2420 busy_adjustment
[3] = 2;
2421 decrease_FR_busy (cpu
, FRj_1
, busy_adjustment
[3]);
2424 enforce_full_fr_latency (cpu
, FRj_1
);
2427 if (out_ACC40Sk
>= 0)
2429 busy_adjustment
[4] = 1;
2430 decrease_ACC_busy (cpu
, out_ACC40Sk
, busy_adjustment
[4]);
2434 busy_adjustment
[5] = 1;
2435 decrease_ACC_busy (cpu
, ACC40Sk_1
, busy_adjustment
[5]);
2439 busy_adjustment
[6] = 1;
2440 decrease_ACC_busy (cpu
, ACC40Sk_2
, busy_adjustment
[6]);
2444 busy_adjustment
[7] = 1;
2445 decrease_ACC_busy (cpu
, ACC40Sk_3
, busy_adjustment
[7]);
2448 else if (out_ACC40Uk
>= 0)
2450 busy_adjustment
[4] = 1;
2451 decrease_ACC_busy (cpu
, out_ACC40Uk
, busy_adjustment
[4]);
2455 busy_adjustment
[5] = 1;
2456 decrease_ACC_busy (cpu
, ACC40Uk_1
, busy_adjustment
[5]);
2460 busy_adjustment
[6] = 1;
2461 decrease_ACC_busy (cpu
, ACC40Uk_2
, busy_adjustment
[6]);
2465 busy_adjustment
[7] = 1;
2466 decrease_ACC_busy (cpu
, ACC40Uk_3
, busy_adjustment
[7]);
2470 /* The post processing must wait if there is a dependency on a FR
2471 which is not ready yet. */
2472 ps
->post_wait
= cycles
;
2473 post_wait_for_FR (cpu
, in_FRi
);
2474 post_wait_for_FR (cpu
, FRi_1
);
2475 post_wait_for_FR (cpu
, in_FRj
);
2476 post_wait_for_FR (cpu
, FRj_1
);
2477 post_wait_for_ACC (cpu
, out_ACC40Sk
);
2478 post_wait_for_ACC (cpu
, ACC40Sk_1
);
2479 post_wait_for_ACC (cpu
, ACC40Sk_2
);
2480 post_wait_for_ACC (cpu
, ACC40Sk_3
);
2481 post_wait_for_ACC (cpu
, out_ACC40Uk
);
2482 post_wait_for_ACC (cpu
, ACC40Uk_1
);
2483 post_wait_for_ACC (cpu
, ACC40Uk_2
);
2484 post_wait_for_ACC (cpu
, ACC40Uk_3
);
2486 /* Restore the busy cycles of the registers we used. */
2489 fr
[in_FRi
] += busy_adjustment
[0];
2491 fr
[FRi_1
] += busy_adjustment
[1];
2492 fr
[in_FRj
] += busy_adjustment
[2];
2494 fr
[FRj_1
] += busy_adjustment
[3];
2495 if (out_ACC40Sk
>= 0)
2497 acc
[out_ACC40Sk
] += busy_adjustment
[4];
2499 acc
[ACC40Sk_1
] += busy_adjustment
[5];
2501 acc
[ACC40Sk_2
] += busy_adjustment
[6];
2503 acc
[ACC40Sk_3
] += busy_adjustment
[7];
2505 else if (out_ACC40Uk
>= 0)
2507 acc
[out_ACC40Uk
] += busy_adjustment
[4];
2509 acc
[ACC40Uk_1
] += busy_adjustment
[5];
2511 acc
[ACC40Uk_2
] += busy_adjustment
[6];
2513 acc
[ACC40Uk_3
] += busy_adjustment
[7];
2516 /* The latency of tht output register will be at least the latency of the
2517 other inputs. Once initiated, post-processing will take 1 cycle. */
2518 if (out_ACC40Sk
>= 0)
2520 update_ACC_latency (cpu
, out_ACC40Sk
, ps
->post_wait
+ 1);
2522 update_ACC_latency (cpu
, ACC40Sk_1
, ps
->post_wait
+ 1);
2524 update_ACC_latency (cpu
, ACC40Sk_2
, ps
->post_wait
+ 1);
2526 update_ACC_latency (cpu
, ACC40Sk_3
, ps
->post_wait
+ 1);
2528 else if (out_ACC40Uk
>= 0)
2530 update_ACC_latency (cpu
, out_ACC40Uk
, ps
->post_wait
+ 1);
2532 update_ACC_latency (cpu
, ACC40Uk_1
, ps
->post_wait
+ 1);
2534 update_ACC_latency (cpu
, ACC40Uk_2
, ps
->post_wait
+ 1);
2536 update_ACC_latency (cpu
, ACC40Uk_3
, ps
->post_wait
+ 1);
2543 frvbf_model_fr500_u_media_quad_complex (SIM_CPU
*cpu
, const IDESC
*idesc
,
2544 int unit_num
, int referenced
,
2545 INT in_FRi
, INT in_FRj
,
2552 FRV_PROFILE_STATE
*ps
;
2553 int busy_adjustment
[] = {0, 0, 0, 0, 0, 0};
2557 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2560 /* The preprocessing can execute right away. */
2561 cycles
= idesc
->timing
->units
[unit_num
].done
;
2563 FRi_1
= DUAL_REG (in_FRi
);
2564 FRj_1
= DUAL_REG (in_FRj
);
2565 ACC40Sk_1
= DUAL_REG (out_ACC40Sk
);
2567 /* If the previous use of the registers was a media op,
2568 then their latency will be less than previously recorded.
2569 See Table 13-13 in the LSI. */
2570 ps
= CPU_PROFILE_STATE (cpu
);
2571 if (use_is_media (cpu
, in_FRi
))
2573 busy_adjustment
[0] = 2;
2574 decrease_FR_busy (cpu
, in_FRi
, busy_adjustment
[0]);
2577 enforce_full_fr_latency (cpu
, in_FRi
);
2580 if (use_is_media (cpu
, FRi_1
))
2582 busy_adjustment
[1] = 2;
2583 decrease_FR_busy (cpu
, FRi_1
, busy_adjustment
[1]);
2586 enforce_full_fr_latency (cpu
, FRi_1
);
2588 if (in_FRj
!= in_FRi
)
2590 if (use_is_media (cpu
, in_FRj
))
2592 busy_adjustment
[2] = 2;
2593 decrease_FR_busy (cpu
, in_FRj
, busy_adjustment
[2]);
2596 enforce_full_fr_latency (cpu
, in_FRj
);
2599 if (use_is_media (cpu
, FRj_1
))
2601 busy_adjustment
[3] = 2;
2602 decrease_FR_busy (cpu
, FRj_1
, busy_adjustment
[3]);
2605 enforce_full_fr_latency (cpu
, FRj_1
);
2608 if (out_ACC40Sk
>= 0)
2610 busy_adjustment
[4] = 1;
2611 decrease_ACC_busy (cpu
, out_ACC40Sk
, busy_adjustment
[4]);
2615 busy_adjustment
[5] = 1;
2616 decrease_ACC_busy (cpu
, ACC40Sk_1
, busy_adjustment
[5]);
2620 /* The post processing must wait if there is a dependency on a FR
2621 which is not ready yet. */
2622 ps
->post_wait
= cycles
;
2623 post_wait_for_FR (cpu
, in_FRi
);
2624 post_wait_for_FR (cpu
, FRi_1
);
2625 post_wait_for_FR (cpu
, in_FRj
);
2626 post_wait_for_FR (cpu
, FRj_1
);
2627 post_wait_for_ACC (cpu
, out_ACC40Sk
);
2628 post_wait_for_ACC (cpu
, ACC40Sk_1
);
2630 /* Restore the busy cycles of the registers we used. */
2633 fr
[in_FRi
] += busy_adjustment
[0];
2635 fr
[FRi_1
] += busy_adjustment
[1];
2636 fr
[in_FRj
] += busy_adjustment
[2];
2638 fr
[FRj_1
] += busy_adjustment
[3];
2639 if (out_ACC40Sk
>= 0)
2641 acc
[out_ACC40Sk
] += busy_adjustment
[4];
2643 acc
[ACC40Sk_1
] += busy_adjustment
[5];
2646 /* The latency of tht output register will be at least the latency of the
2647 other inputs. Once initiated, post-processing will take 1 cycle. */
2648 if (out_ACC40Sk
>= 0)
2650 update_ACC_latency (cpu
, out_ACC40Sk
, ps
->post_wait
+ 1);
2652 update_ACC_latency (cpu
, ACC40Sk_1
, ps
->post_wait
+ 1);
2659 frvbf_model_fr500_u_media_dual_expand (SIM_CPU
*cpu
, const IDESC
*idesc
,
2660 int unit_num
, int referenced
,
2666 FRV_PROFILE_STATE
*ps
;
2667 int busy_adjustment
[] = {0, 0, 0};
2670 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2673 /* The preprocessing can execute right away. */
2674 cycles
= idesc
->timing
->units
[unit_num
].done
;
2676 /* If the previous use of the registers was a media op,
2677 then their latency will be less than previously recorded.
2678 See Table 13-13 in the LSI. */
2679 dual_FRk
= DUAL_REG (out_FRk
);
2680 ps
= CPU_PROFILE_STATE (cpu
);
2681 if (use_is_media (cpu
, in_FRi
))
2683 busy_adjustment
[0] = 2;
2684 decrease_FR_busy (cpu
, in_FRi
, busy_adjustment
[0]);
2687 enforce_full_fr_latency (cpu
, in_FRi
);
2688 if (out_FRk
!= in_FRi
)
2690 if (use_is_media (cpu
, out_FRk
))
2692 busy_adjustment
[1] = 2;
2693 decrease_FR_busy (cpu
, out_FRk
, busy_adjustment
[1]);
2696 enforce_full_fr_latency (cpu
, out_FRk
);
2698 if (dual_FRk
>= 0 && dual_FRk
!= in_FRi
)
2700 if (use_is_media (cpu
, dual_FRk
))
2702 busy_adjustment
[2] = 2;
2703 decrease_FR_busy (cpu
, dual_FRk
, busy_adjustment
[2]);
2706 enforce_full_fr_latency (cpu
, dual_FRk
);
2709 /* The post processing must wait if there is a dependency on a FR
2710 which is not ready yet. */
2711 ps
->post_wait
= cycles
;
2712 post_wait_for_FR (cpu
, in_FRi
);
2713 post_wait_for_FR (cpu
, out_FRk
);
2714 post_wait_for_FR (cpu
, dual_FRk
);
2716 /* Restore the busy cycles of the registers we used. */
2718 fr
[in_FRi
] += busy_adjustment
[0];
2719 fr
[out_FRk
] += busy_adjustment
[1];
2721 fr
[dual_FRk
] += busy_adjustment
[2];
2723 /* The latency of the output register will be at least the latency of the
2724 other inputs. Once initiated, post-processing will take 3 cycles. */
2725 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
2726 update_FR_ptime (cpu
, out_FRk
, 3);
2728 /* Mark this use of the register as a media op. */
2729 set_use_is_media (cpu
, out_FRk
);
2732 update_FR_latency (cpu
, dual_FRk
, ps
->post_wait
);
2733 update_FR_ptime (cpu
, dual_FRk
, 3);
2735 /* Mark this use of the register as a media op. */
2736 set_use_is_media (cpu
, dual_FRk
);
2743 frvbf_model_fr500_u_media_dual_unpack (SIM_CPU
*cpu
, const IDESC
*idesc
,
2744 int unit_num
, int referenced
,
2753 FRV_PROFILE_STATE
*ps
;
2754 int busy_adjustment
[] = {0, 0, 0, 0, 0, 0};
2757 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2760 /* The preprocessing can execute right away. */
2761 cycles
= idesc
->timing
->units
[unit_num
].done
;
2763 FRi_1
= DUAL_REG (in_FRi
);
2764 FRk_1
= DUAL_REG (out_FRk
);
2765 FRk_2
= DUAL_REG (FRk_1
);
2766 FRk_3
= DUAL_REG (FRk_2
);
2768 /* If the previous use of the registers was a media op,
2769 then their latency will be less than previously recorded.
2770 See Table 13-13 in the LSI. */
2771 ps
= CPU_PROFILE_STATE (cpu
);
2772 if (use_is_media (cpu
, in_FRi
))
2774 busy_adjustment
[0] = 2;
2775 decrease_FR_busy (cpu
, in_FRi
, busy_adjustment
[0]);
2778 enforce_full_fr_latency (cpu
, in_FRi
);
2779 if (FRi_1
>= 0 && use_is_media (cpu
, FRi_1
))
2781 busy_adjustment
[1] = 2;
2782 decrease_FR_busy (cpu
, FRi_1
, busy_adjustment
[1]);
2785 enforce_full_fr_latency (cpu
, FRi_1
);
2786 if (out_FRk
!= in_FRi
)
2788 if (use_is_media (cpu
, out_FRk
))
2790 busy_adjustment
[2] = 2;
2791 decrease_FR_busy (cpu
, out_FRk
, busy_adjustment
[2]);
2794 enforce_full_fr_latency (cpu
, out_FRk
);
2795 if (FRk_1
>= 0 && FRk_1
!= in_FRi
)
2797 if (use_is_media (cpu
, FRk_1
))
2799 busy_adjustment
[3] = 2;
2800 decrease_FR_busy (cpu
, FRk_1
, busy_adjustment
[3]);
2803 enforce_full_fr_latency (cpu
, FRk_1
);
2805 if (FRk_2
>= 0 && FRk_2
!= in_FRi
)
2807 if (use_is_media (cpu
, FRk_2
))
2809 busy_adjustment
[4] = 2;
2810 decrease_FR_busy (cpu
, FRk_2
, busy_adjustment
[4]);
2813 enforce_full_fr_latency (cpu
, FRk_2
);
2815 if (FRk_3
>= 0 && FRk_3
!= in_FRi
)
2817 if (use_is_media (cpu
, FRk_3
))
2819 busy_adjustment
[5] = 2;
2820 decrease_FR_busy (cpu
, FRk_3
, busy_adjustment
[5]);
2823 enforce_full_fr_latency (cpu
, FRk_3
);
2827 /* The post processing must wait if there is a dependency on a FR
2828 which is not ready yet. */
2829 ps
->post_wait
= cycles
;
2830 post_wait_for_FR (cpu
, in_FRi
);
2831 post_wait_for_FR (cpu
, FRi_1
);
2832 post_wait_for_FR (cpu
, out_FRk
);
2833 post_wait_for_FR (cpu
, FRk_1
);
2834 post_wait_for_FR (cpu
, FRk_2
);
2835 post_wait_for_FR (cpu
, FRk_3
);
2837 /* Restore the busy cycles of the registers we used. */
2839 fr
[in_FRi
] += busy_adjustment
[0];
2841 fr
[FRi_1
] += busy_adjustment
[1];
2842 fr
[out_FRk
] += busy_adjustment
[2];
2844 fr
[FRk_1
] += busy_adjustment
[3];
2846 fr
[FRk_2
] += busy_adjustment
[4];
2848 fr
[FRk_3
] += busy_adjustment
[5];
2850 /* The latency of tht output register will be at least the latency of the
2851 other inputs. Once initiated, post-processing will take 3 cycles. */
2852 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
2853 update_FR_ptime (cpu
, out_FRk
, 3);
2855 /* Mark this use of the register as a media op. */
2856 set_use_is_media (cpu
, out_FRk
);
2859 update_FR_latency (cpu
, FRk_1
, ps
->post_wait
);
2860 update_FR_ptime (cpu
, FRk_1
, 3);
2862 /* Mark this use of the register as a media op. */
2863 set_use_is_media (cpu
, FRk_1
);
2867 update_FR_latency (cpu
, FRk_2
, ps
->post_wait
);
2868 update_FR_ptime (cpu
, FRk_2
, 3);
2870 /* Mark this use of the register as a media op. */
2871 set_use_is_media (cpu
, FRk_2
);
2875 update_FR_latency (cpu
, FRk_3
, ps
->post_wait
);
2876 update_FR_ptime (cpu
, FRk_3
, 3);
2878 /* Mark this use of the register as a media op. */
2879 set_use_is_media (cpu
, FRk_3
);
2886 frvbf_model_fr500_u_media_dual_btoh (SIM_CPU
*cpu
, const IDESC
*idesc
,
2887 int unit_num
, int referenced
,
2891 return frvbf_model_fr500_u_media_dual_expand (cpu
, idesc
, unit_num
,
2892 referenced
, in_FRj
, out_FRk
);
2896 frvbf_model_fr500_u_media_dual_htob (SIM_CPU
*cpu
, const IDESC
*idesc
,
2897 int unit_num
, int referenced
,
2903 FRV_PROFILE_STATE
*ps
;
2904 int busy_adjustment
[] = {0, 0, 0};
2907 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2910 /* The preprocessing can execute right away. */
2911 cycles
= idesc
->timing
->units
[unit_num
].done
;
2913 /* If the previous use of the registers was a media op,
2914 then their latency will be less than previously recorded.
2915 See Table 13-13 in the LSI. */
2916 dual_FRj
= DUAL_REG (in_FRj
);
2917 ps
= CPU_PROFILE_STATE (cpu
);
2918 if (use_is_media (cpu
, in_FRj
))
2920 busy_adjustment
[0] = 2;
2921 decrease_FR_busy (cpu
, in_FRj
, busy_adjustment
[0]);
2924 enforce_full_fr_latency (cpu
, in_FRj
);
2927 if (use_is_media (cpu
, dual_FRj
))
2929 busy_adjustment
[1] = 2;
2930 decrease_FR_busy (cpu
, dual_FRj
, busy_adjustment
[1]);
2933 enforce_full_fr_latency (cpu
, dual_FRj
);
2935 if (out_FRk
!= in_FRj
)
2937 if (use_is_media (cpu
, out_FRk
))
2939 busy_adjustment
[2] = 2;
2940 decrease_FR_busy (cpu
, out_FRk
, busy_adjustment
[2]);
2943 enforce_full_fr_latency (cpu
, out_FRk
);
2946 /* The post processing must wait if there is a dependency on a FR
2947 which is not ready yet. */
2948 ps
->post_wait
= cycles
;
2949 post_wait_for_FR (cpu
, in_FRj
);
2950 post_wait_for_FR (cpu
, dual_FRj
);
2951 post_wait_for_FR (cpu
, out_FRk
);
2953 /* Restore the busy cycles of the registers we used. */
2955 fr
[in_FRj
] += busy_adjustment
[0];
2957 fr
[dual_FRj
] += busy_adjustment
[1];
2958 fr
[out_FRk
] += busy_adjustment
[2];
2960 /* The latency of tht output register will be at least the latency of the
2962 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
2964 /* Once initiated, post-processing will take 3 cycles. */
2965 update_FR_ptime (cpu
, out_FRk
, 3);
2967 /* Mark this use of the register as a media op. */
2968 set_use_is_media (cpu
, out_FRk
);
2974 frvbf_model_fr500_u_media_dual_btohe (SIM_CPU
*cpu
, const IDESC
*idesc
,
2975 int unit_num
, int referenced
,
2983 FRV_PROFILE_STATE
*ps
;
2984 int busy_adjustment
[] = {0, 0, 0, 0, 0};
2987 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
2990 /* The preprocessing can execute right away. */
2991 cycles
= idesc
->timing
->units
[unit_num
].done
;
2993 FRk_1
= DUAL_REG (out_FRk
);
2994 FRk_2
= DUAL_REG (FRk_1
);
2995 FRk_3
= DUAL_REG (FRk_2
);
2997 /* If the previous use of the registers was a media op,
2998 then their latency will be less than previously recorded.
2999 See Table 13-13 in the LSI. */
3000 ps
= CPU_PROFILE_STATE (cpu
);
3001 if (use_is_media (cpu
, in_FRj
))
3003 busy_adjustment
[0] = 2;
3004 decrease_FR_busy (cpu
, in_FRj
, busy_adjustment
[0]);
3007 enforce_full_fr_latency (cpu
, in_FRj
);
3008 if (out_FRk
!= in_FRj
)
3010 if (use_is_media (cpu
, out_FRk
))
3012 busy_adjustment
[1] = 2;
3013 decrease_FR_busy (cpu
, out_FRk
, busy_adjustment
[1]);
3016 enforce_full_fr_latency (cpu
, out_FRk
);
3017 if (FRk_1
>= 0 && FRk_1
!= in_FRj
)
3019 if (use_is_media (cpu
, FRk_1
))
3021 busy_adjustment
[2] = 2;
3022 decrease_FR_busy (cpu
, FRk_1
, busy_adjustment
[2]);
3025 enforce_full_fr_latency (cpu
, FRk_1
);
3027 if (FRk_2
>= 0 && FRk_2
!= in_FRj
)
3029 if (use_is_media (cpu
, FRk_2
))
3031 busy_adjustment
[3] = 2;
3032 decrease_FR_busy (cpu
, FRk_2
, busy_adjustment
[3]);
3035 enforce_full_fr_latency (cpu
, FRk_2
);
3037 if (FRk_3
>= 0 && FRk_3
!= in_FRj
)
3039 if (use_is_media (cpu
, FRk_3
))
3041 busy_adjustment
[4] = 2;
3042 decrease_FR_busy (cpu
, FRk_3
, busy_adjustment
[4]);
3045 enforce_full_fr_latency (cpu
, FRk_3
);
3049 /* The post processing must wait if there is a dependency on a FR
3050 which is not ready yet. */
3051 ps
->post_wait
= cycles
;
3052 post_wait_for_FR (cpu
, in_FRj
);
3053 post_wait_for_FR (cpu
, out_FRk
);
3054 post_wait_for_FR (cpu
, FRk_1
);
3055 post_wait_for_FR (cpu
, FRk_2
);
3056 post_wait_for_FR (cpu
, FRk_3
);
3058 /* Restore the busy cycles of the registers we used. */
3060 fr
[in_FRj
] += busy_adjustment
[0];
3061 fr
[out_FRk
] += busy_adjustment
[1];
3063 fr
[FRk_1
] += busy_adjustment
[2];
3065 fr
[FRk_2
] += busy_adjustment
[3];
3067 fr
[FRk_3
] += busy_adjustment
[4];
3069 /* The latency of tht output register will be at least the latency of the
3070 other inputs. Once initiated, post-processing will take 3 cycles. */
3071 update_FR_latency (cpu
, out_FRk
, ps
->post_wait
);
3072 update_FR_ptime (cpu
, out_FRk
, 3);
3074 /* Mark this use of the register as a media op. */
3075 set_use_is_media (cpu
, out_FRk
);
3078 update_FR_latency (cpu
, FRk_1
, ps
->post_wait
);
3079 update_FR_ptime (cpu
, FRk_1
, 3);
3081 /* Mark this use of the register as a media op. */
3082 set_use_is_media (cpu
, FRk_1
);
3086 update_FR_latency (cpu
, FRk_2
, ps
->post_wait
);
3087 update_FR_ptime (cpu
, FRk_2
, 3);
3089 /* Mark this use of the register as a media op. */
3090 set_use_is_media (cpu
, FRk_2
);
3094 update_FR_latency (cpu
, FRk_3
, ps
->post_wait
);
3095 update_FR_ptime (cpu
, FRk_3
, 3);
3097 /* Mark this use of the register as a media op. */
3098 set_use_is_media (cpu
, FRk_3
);
3105 frvbf_model_fr500_u_barrier (SIM_CPU
*cpu
, const IDESC
*idesc
,
3106 int unit_num
, int referenced
)
3109 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
3112 /* Wait for ALL resources. */
3113 for (i
= 0; i
< 64; ++i
)
3115 enforce_full_fr_latency (cpu
, i
);
3116 vliw_wait_for_GR (cpu
, i
);
3117 vliw_wait_for_FR (cpu
, i
);
3118 vliw_wait_for_ACC (cpu
, i
);
3120 for (i
= 0; i
< 8; ++i
)
3121 vliw_wait_for_CCR (cpu
, i
);
3122 for (i
= 0; i
< 2; ++i
)
3124 vliw_wait_for_idiv_resource (cpu
, i
);
3125 vliw_wait_for_fdiv_resource (cpu
, i
);
3126 vliw_wait_for_fsqrt_resource (cpu
, i
);
3128 handle_resource_wait (cpu
);
3129 for (i
= 0; i
< 64; ++i
)
3131 load_wait_for_GR (cpu
, i
);
3132 load_wait_for_FR (cpu
, i
);
3134 trace_vliw_wait_cycles (cpu
);
3138 cycles
= idesc
->timing
->units
[unit_num
].done
;
3143 frvbf_model_fr500_u_membar (SIM_CPU
*cpu
, const IDESC
*idesc
,
3144 int unit_num
, int referenced
)
3147 if (model_insn
== FRV_INSN_MODEL_PASS_1
)
3150 /* Wait for ALL resources, except GR and ICC. */
3151 for (i
= 0; i
< 64; ++i
)
3153 enforce_full_fr_latency (cpu
, i
);
3154 vliw_wait_for_FR (cpu
, i
);
3155 vliw_wait_for_ACC (cpu
, i
);
3157 for (i
= 0; i
< 4; ++i
)
3158 vliw_wait_for_CCR (cpu
, i
);
3159 for (i
= 0; i
< 2; ++i
)
3161 vliw_wait_for_idiv_resource (cpu
, i
);
3162 vliw_wait_for_fdiv_resource (cpu
, i
);
3163 vliw_wait_for_fsqrt_resource (cpu
, i
);
3165 handle_resource_wait (cpu
);
3166 for (i
= 0; i
< 64; ++i
)
3168 load_wait_for_FR (cpu
, i
);
3170 trace_vliw_wait_cycles (cpu
);
3174 cycles
= idesc
->timing
->units
[unit_num
].done
;
3178 /* The frv machine is a fictional implementation of the fr500 which implements
3179 all frv architectural features. */
3181 frvbf_model_frv_u_exec (SIM_CPU
*cpu
, const IDESC
*idesc
,
3182 int unit_num
, int referenced
)
3184 return idesc
->timing
->units
[unit_num
].done
;
3187 /* The simple machine is a fictional implementation of the fr500 which
3188 implements limited frv architectural features. */
3190 frvbf_model_simple_u_exec (SIM_CPU
*cpu
, const IDESC
*idesc
,
3191 int unit_num
, int referenced
)
3193 return idesc
->timing
->units
[unit_num
].done
;
3196 /* The tomcat machine is models a prototype fr500 machine which had a few
3197 bugs and restrictions to work around. */
3199 frvbf_model_tomcat_u_exec (SIM_CPU
*cpu
, const IDESC
*idesc
,
3200 int unit_num
, int referenced
)
3202 return idesc
->timing
->units
[unit_num
].done
;
3205 #endif /* WITH_PROFILE_MODEL_P */
This page took 0.094625 seconds and 4 git commands to generate.