2 * Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 #include "qemu/osdep.h"
21 static const SlotMask iclass_info
[] = {
23 #define DEF_PP_ICLASS32(TYPE, SLOTS, UNITS) \
24 [ICLASS_FROM_TYPE(TYPE)] = SLOTS_##SLOTS,
25 #define DEF_EE_ICLASS32(TYPE, SLOTS, UNITS) \
26 [ICLASS_FROM_TYPE(TYPE)] = SLOTS_##SLOTS,
27 #include "imported/iclass.def"
28 #undef DEF_PP_ICLASS32
29 #undef DEF_EE_ICLASS32
32 SlotMask
find_iclass_slots(Opcode opcode
, int itype
)
34 /* There are some exceptions to what the iclass dictates */
35 if (GET_ATTRIB(opcode
, A_ICOP
)) {
37 } else if (GET_ATTRIB(opcode
, A_RESTRICT_SLOT0ONLY
)) {
39 } else if (GET_ATTRIB(opcode
, A_RESTRICT_SLOT1ONLY
)) {
41 } else if (GET_ATTRIB(opcode
, A_RESTRICT_SLOT2ONLY
)) {
43 } else if (GET_ATTRIB(opcode
, A_RESTRICT_SLOT3ONLY
)) {
45 } else if (GET_ATTRIB(opcode
, A_COF
) &&
46 GET_ATTRIB(opcode
, A_INDIRECT
) &&
47 !GET_ATTRIB(opcode
, A_MEMLIKE
) &&
48 !GET_ATTRIB(opcode
, A_MEMLIKE_PACKET_RULES
)) {
50 } else if (GET_ATTRIB(opcode
, A_RESTRICT_NOSLOT1
)) {
52 } else if ((opcode
== J2_trap0
) ||
53 (opcode
== Y2_isync
) ||
54 (opcode
== J2_pause
) || (opcode
== J4_hintjumpr
)) {
56 } else if ((itype
== ICLASS_V2LDST
) && (GET_ATTRIB(opcode
, A_STORE
))) {
58 } else if ((itype
== ICLASS_V2LDST
) && (!GET_ATTRIB(opcode
, A_STORE
))) {
60 } else if (GET_ATTRIB(opcode
, A_CRSLOT23
)) {
62 } else if (GET_ATTRIB(opcode
, A_RESTRICT_PREFERSLOT0
)) {
64 } else if (GET_ATTRIB(opcode
, A_SUBINSN
)) {
66 } else if (GET_ATTRIB(opcode
, A_CALL
)) {
68 } else if ((opcode
== J4_jumpseti
) || (opcode
== J4_jumpsetr
)) {
71 return iclass_info
[itype
];