1 /* Declarations for stacks of tokenized Xtensa instructions.
2 Copyright (C) 2003 Free Software Foundation, Inc.
4 This file is part of GAS, the GNU Assembler.
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
8 the Free Software Foundation; either version 2, or (at your option)
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.
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
18 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
21 #ifndef XTENSA_ISTACK_H
22 #define XTENSA_ISTACK_H
24 #include "xtensa-isa.h"
27 #define MAX_INSN_ARGS 6
37 /* Literals have 1 token and no opcode.
38 Labels have 1 token and no opcode. */
40 typedef struct tinsn_struct
42 enum itype_enum insn_type
;
44 bfd_boolean is_specific_opcode
;
45 xtensa_opcode opcode
; /* Literals have an invalid opcode. */
47 expressionS tok
[MAX_INSN_ARGS
];
51 /* tinsn_stack: This is a stack of instructions to be placed. */
53 typedef struct tinsn_stack
56 TInsn insn
[MAX_ISTACK
];
60 void istack_init
PARAMS ((IStack
*));
61 bfd_boolean istack_empty
PARAMS ((IStack
*));
62 bfd_boolean istack_full
PARAMS ((IStack
*));
63 TInsn
* istack_top
PARAMS ((IStack
*));
64 void istack_push
PARAMS ((IStack
*, TInsn
*));
65 TInsn
* istack_push_space
PARAMS ((IStack
*));
66 void istack_pop
PARAMS ((IStack
*));
68 /* TInsn utilities. */
69 void tinsn_init
PARAMS ((TInsn
*));
70 void tinsn_copy
PARAMS ((TInsn
*, const TInsn
*));
71 expressionS
*tinsn_get_tok
PARAMS ((TInsn
*, int));
73 #endif /* !XTENSA_ISTACK_H */