Various fixes for the Z80 support.
[deliverable/binutils-gdb.git] / gas / config / xtensa-istack.h
CommitLineData
88da6820 1/* Declarations for stacks of tokenized Xtensa instructions.
b3adc24a 2 Copyright (C) 2003-2020 Free Software Foundation, Inc.
88da6820
NC
3
4 This file is part of GAS, the GNU Assembler.
5
6 GAS is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
ec2655a6 8 the Free Software Foundation; either version 3, or (at your option)
88da6820
NC
9 any later version.
10
11 GAS is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GAS; see the file COPYING. If not, write to the Free
4b4da160
NC
18 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
19 02110-1301, USA. */
88da6820
NC
20
21#ifndef XTENSA_ISTACK_H
22#define XTENSA_ISTACK_H
23
24#include "xtensa-isa.h"
25
26#define MAX_ISTACK 12
c22a967f 27#define MAX_INSN_ARGS 64
88da6820
NC
28
29enum itype_enum
30{
31 ITYPE_INSN,
32 ITYPE_LITERAL,
33 ITYPE_LABEL
34};
35
36
37/* Literals have 1 token and no opcode.
38 Labels have 1 token and no opcode. */
39
40typedef struct tinsn_struct
41{
42 enum itype_enum insn_type;
43cd72b9 43
88da6820 44 xtensa_opcode opcode; /* Literals have an invalid opcode. */
c138bc38
BW
45 bfd_boolean is_specific_opcode;
46 bfd_boolean keep_wide;
88da6820
NC
47 int ntok;
48 expressionS tok[MAX_INSN_ARGS];
b224e962
BW
49 bfd_boolean loc_directive_seen;
50 struct dwarf2_line_info debug_line;
43cd72b9 51
19e8f41a
BW
52 /* This field is used for two types of special pseudo ops:
53 1. TLS-related operations. Eg: callx8.tls
54 2. j.l label, a2
55
56 For the tls-related operations, it will hold a tls-related opcode
57 and info to be used in a fixup. For j.l it will hold a
58 register to be used during relaxation. */
59 expressionS extra_arg;
28dbbc02 60
43cd72b9 61 /* Filled out by relaxation_requirements: */
43cd72b9
BW
62 enum xtensa_relax_statesE subtype;
63 int literal_space;
19e8f41a 64
43cd72b9
BW
65 /* Filled out by vinsn_to_insnbuf: */
66 symbolS *symbol;
43cd72b9
BW
67 offsetT offset;
68 fragS *literal_frag;
88da6820
NC
69} TInsn;
70
71
72/* tinsn_stack: This is a stack of instructions to be placed. */
73
74typedef struct tinsn_stack
75{
76 int ninsn;
77 TInsn insn[MAX_ISTACK];
78} IStack;
79
80
7fa3d080
BW
81void istack_init (IStack *);
82bfd_boolean istack_empty (IStack *);
83bfd_boolean istack_full (IStack *);
84TInsn *istack_top (IStack *);
85void istack_push (IStack *, TInsn *);
c138bc38 86TInsn *istack_push_space (IStack *);
7fa3d080 87void istack_pop (IStack *);
88da6820
NC
88
89/* TInsn utilities. */
7fa3d080 90void tinsn_init (TInsn *);
43cd72b9
BW
91
92
93/* vliw_insn: bundles of TInsns. */
94
95typedef struct vliw_insn
96{
97 xtensa_format format;
43cd72b9
BW
98 int num_slots;
99 unsigned int inside_bundle;
100 TInsn slots[MAX_SLOTS];
65738a7d 101 xtensa_insnbuf insnbuf;
43cd72b9
BW
102 xtensa_insnbuf slotbuf[MAX_SLOTS];
103} vliw_insn;
88da6820
NC
104
105#endif /* !XTENSA_ISTACK_H */
This page took 0.717062 seconds and 4 git commands to generate.