2 Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
3 Contributed by Red Hat.
5 This file is part of the GNU simulators.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
21 #define WANT_CPU frvbf
22 #define WANT_CPU_FRVBF
26 /* Simulator specific vliw related functions. Additional vliw related
27 code used by both the simulator and the assembler is in frv.opc. */
29 int insns_in_slot
[UNIT_NUM_UNITS
] = {0};
32 frv_vliw_setup_insn (SIM_CPU
*current_cpu
, const CGEN_INSN
*insn
)
37 /* Always clear the NE index which indicates the target register
38 of a non excepting insn. This will be reset by the insn if
40 frv_interrupt_state
.ne_index
= NE_NOFLAG
;
42 vliw
= CPU_VLIW (current_cpu
);
43 index
= vliw
->next_slot
- 1;
44 if (frv_is_float_insn (insn
))
46 /* If the insn is to be added and is a floating point insn and
47 it is the first floating point insn in the vliw, then clear
50 for (i
= 0; i
< index
; ++i
)
51 if (frv_is_float_major (vliw
->major
[i
], vliw
->mach
))
52 break; /* found float insn. */
55 SI fsr0
= GET_FSR (0);
56 SET_FSR_FTT (fsr0
, FTT_NONE
);
60 else if (frv_is_media_insn (insn
))
62 /* Clear the appropriate MSR fields depending on which slot
64 CGEN_ATTR_VALUE_ENUM_TYPE preserve_ovf
;
65 SI msr0
= GET_MSR (0);
67 preserve_ovf
= CGEN_INSN_ATTR_VALUE (insn
, CGEN_INSN_PRESERVE_OVF
);
68 if ((*vliw
->current_vliw
)[index
] == UNIT_FM0
)
72 /* Clear MSR0.OVF and MSR0.SIE. */
81 /* Clear MSR1.OVF and MSR1.SIE. */
82 SI msr1
= GET_MSR (1);
89 } /* Insn is a media insns. */
90 COUNT_INSNS_IN_SLOT ((*vliw
->current_vliw
)[index
]);