scsi: move host_status handling into SCSI drivers
[qemu/ar7.git] / target / hexagon / insn.h
blob5756a1d0caaa03d2ebceafe13904acd8b7ed31a0
1 /*
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 #ifndef HEXAGON_INSN_H
19 #define HEXAGON_INSN_H
21 #include "cpu.h"
23 #define INSTRUCTIONS_MAX 7 /* 2 pairs + loopend */
24 #define REG_OPERANDS_MAX 5
25 #define IMMEDS_MAX 2
27 struct Instruction;
28 struct Packet;
29 struct DisasContext;
31 typedef void (*SemanticInsn)(CPUHexagonState *env,
32 struct DisasContext *ctx,
33 struct Instruction *insn,
34 struct Packet *pkt);
36 struct Instruction {
37 SemanticInsn generate; /* pointer to genptr routine */
38 uint8_t regno[REG_OPERANDS_MAX]; /* reg operands including predicates */
39 uint16_t opcode;
41 uint32_t iclass:6;
42 uint32_t slot:3;
43 uint32_t part1:1; /*
44 * cmp-jumps are split into two insns.
45 * set for the compare and clear for the jump
47 uint32_t extension_valid:1; /* Has a constant extender attached */
48 uint32_t which_extended:1; /* If has an extender, which immediate */
49 uint32_t is_endloop:1; /* This is an end of loop */
50 uint32_t new_value_producer_slot:4;
51 int32_t immed[IMMEDS_MAX]; /* immediate field */
54 typedef struct Instruction Insn;
56 struct Packet {
57 uint16_t num_insns;
58 uint16_t encod_pkt_size_in_bytes;
60 /* Pre-decodes about COF */
61 uint32_t pkt_has_cof:1; /* Has any change-of-flow */
62 uint32_t pkt_has_endloop:1;
64 uint32_t pkt_has_dczeroa:1;
66 uint32_t pkt_has_store_s0:1;
67 uint32_t pkt_has_store_s1:1;
69 Insn insn[INSTRUCTIONS_MAX];
72 typedef struct Packet Packet;
74 #endif