* elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Fix PT_DYNAMIC
[binutils.git] / gas / config / xtensa-relax.h
blob99bf77bfd8e92f49fe46f551c2b578a4e5bec7fc
1 /* Table of relaxations for Xtensa assembly.
2 Copyright 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)
9 any later version.
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
18 the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
19 MA 02111-1307, USA. */
21 #ifndef XTENSA_RELAX_H
22 #define XTENSA_RELAX_H
24 #include "xtensa-isa.h"
27 /* Data structures for the table-driven relaxations for Xtensa processors.
28 See xtensa-relax.c for details. */
30 typedef struct transition_list TransitionList;
31 typedef struct transition_table TransitionTable;
32 typedef struct transition_rule TransitionRule;
33 typedef struct precondition_list PreconditionList;
34 typedef struct precondition Precondition;
36 struct transition_table
38 int num_opcodes;
39 TransitionList **table; /* Possible transitions for each opcode. */
42 struct transition_list
44 TransitionRule *rule;
45 TransitionList *next;
48 struct precondition_list
50 Precondition *precond;
51 PreconditionList *next;
55 /* Operand types and constraints on operands: */
57 typedef enum op_type OpType;
58 typedef enum cmp_op CmpOp;
60 enum op_type
62 OP_CONSTANT,
63 OP_OPERAND,
64 OP_OPERAND_LOW8, /* Sign-extended low 8 bits of immed. */
65 OP_OPERAND_HI24S, /* high 24 bits of immed,
66 plus 0x100 if low 8 bits are signed. */
67 OP_OPERAND_F32MINUS, /* 32 - immed. */
68 OP_LITERAL,
69 OP_LABEL
72 enum cmp_op
74 OP_EQUAL,
75 OP_NOTEQUAL,
78 struct precondition
80 CmpOp cmp;
81 int op_num;
82 OpType typ; /* CONSTANT: op_data is a constant.
83 OPERAND: operand op_num must equal op_data.
84 Cannot be LITERAL or LABEL. */
85 int op_data;
88 typedef struct build_op BuildOp;
90 struct build_op
92 int op_num;
93 OpType typ;
94 unsigned op_data; /* CONSTANT: op_data is the value to encode.
95 OPERAND: op_data is the field in the
96 source instruction to take the value from
97 and encode in the op_num field here.
98 LITERAL or LABEL: op_data is the ordinal
99 that identifies the appropriate one, i.e.,
100 there can be more than one literal or
101 label in an expansion. */
102 BuildOp *next;
105 typedef struct build_instr BuildInstr;
106 typedef enum instr_type InstrType;
108 enum instr_type
110 INSTR_INSTR,
111 INSTR_LITERAL_DEF,
112 INSTR_LABEL_DEF
115 struct build_instr
117 InstrType typ;
118 unsigned id; /* LITERAL_DEF or LABEL_DEF: an ordinal to
119 identify which one. */
120 xtensa_opcode opcode; /* unused for LITERAL_DEF or LABEL_DEF. */
121 BuildOp *ops;
122 BuildInstr *next;
125 struct transition_rule
127 xtensa_opcode opcode;
128 PreconditionList *conditions;
129 BuildInstr *to_instr;
132 extern TransitionTable *xg_build_simplify_table
133 PARAMS ((void));
134 extern TransitionTable *xg_build_widen_table
135 PARAMS ((void));
137 extern bfd_boolean xg_has_userdef_op_fn
138 PARAMS ((OpType));
139 extern long xg_apply_userdef_op_fn
140 PARAMS ((OpType, long));
142 #endif /* !XTENSA_RELAX_H */