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)
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
39 TransitionList
**table
; /* Possible transitions for each opcode. */
42 struct transition_list
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
;
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. */
82 OpType typ
; /* CONSTANT: op_data is a constant.
83 OPERAND: operand op_num must equal op_data.
84 Cannot be LITERAL or LABEL. */
88 typedef struct build_op BuildOp
;
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. */
105 typedef struct build_instr BuildInstr
;
106 typedef enum instr_type InstrType
;
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. */
125 struct transition_rule
127 xtensa_opcode opcode
;
128 PreconditionList
*conditions
;
129 BuildInstr
*to_instr
;
132 extern TransitionTable
*xg_build_simplify_table
134 extern TransitionTable
*xg_build_widen_table
137 extern bfd_boolean xg_has_userdef_op_fn
139 extern long xg_apply_userdef_op_fn
140 PARAMS ((OpType
, long));
142 #endif /* !XTENSA_RELAX_H */