1 /* Declarations for stacks of tokenized Xtensa instructions. 2 Copyright (C) 2003 Free Software Foundation, Inc. 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 8 the Free Software Foundation; either version 2, or (at your option) 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 18 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 19 02111-1307, USA. */ 20 21 #ifndef XTENSA_ISTACK_H 22 #define XTENSA_ISTACK_H 23 24 #include "xtensa-isa.h" 25 26 #define MAX_ISTACK 12 27 #define MAX_INSN_ARGS 6 28 29 enum 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 40 typedef struct tinsn_struct 41 { 42 enum itype_enum insn_type; 43 44 bfd_boolean is_specific_opcode; 45 xtensa_opcode opcode; /* Literals have an invalid opcode. */ 46 int ntok; 47 expressionS tok[MAX_INSN_ARGS]; 48 } TInsn; 49 50 51 /* tinsn_stack: This is a stack of instructions to be placed. */ 52 53 typedef struct tinsn_stack 54 { 55 int ninsn; 56 TInsn insn[MAX_ISTACK]; 57 } IStack; 58 59 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 *)); 67 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)); 72 73 #endif /* !XTENSA_ISTACK_H */ 74