gdb/
[deliverable/binutils-gdb.git] / gas / config / tc-tic6x.h
CommitLineData
40b36596
JM
1/* Definitions for TI C6X assembler.
2 Copyright 2010
3 Free Software Foundation, Inc.
4
5 This file is part of GAS, the GNU Assembler.
6
7 GAS is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
11
12 GAS is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GAS; see the file COPYING. If not, write to the Free
19 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
20 02110-1301, USA. */
21
22#define TC_TIC6X 1
23#define TARGET_BYTES_BIG_ENDIAN 0
24#define WORKING_DOT_WORD
25#define DOUBLEBAR_PARALLEL
26#define DWARF2_LINE_MIN_INSN_LENGTH 2
27#define MD_APPLY_SYM_VALUE(FIX) 0
28#define TC_PREDICATE_START_CHAR '['
29#define TC_PREDICATE_END_CHAR ']'
30/* For TI C6X, we keep spaces in what the preprocessor considers
31 operands as they may separate functional unit specifiers from
32 operands. */
33#define TC_KEEP_OPERAND_SPACES 1
34
35#define TARGET_ARCH bfd_arch_tic6x
36#define TARGET_FORMAT (target_big_endian \
37 ? "elf32-tic6x-be" \
38 : "elf32-tic6x-le")
39
d99e5b39 40typedef struct tic6x_label_list
40b36596 41{
d99e5b39
JM
42 struct tic6x_label_list *next;
43 symbolS *label;
44} tic6x_label_list;
40b36596 45
1bce6bd8
PB
46/* Must be consistent with the enum in tc-tic6x.c. */
47#define TIC6X_NUM_UNWIND_REGS 13
48
49/* Unwinding information state. */
50typedef struct tic6x_unwind_info {
51 int personality_index;
52 symbolS *personality_routine;
53 symbolS *function_start;
54 segT saved_seg;
55 subsegT saved_subseg;
56 /* NULL if table entry is inline. */
57 symbolS *table_entry;
58 char *frag_start;
59 valueT data;
60 /* 0 before .cfi_startproc
61 -1 between .cfi_startproc and .handlerdata
62 >0 between .handlerdata and .endp */
63 int data_bytes;
64
65 offsetT reg_offset[TIC6X_NUM_UNWIND_REGS];
66 bfd_boolean reg_saved[TIC6X_NUM_UNWIND_REGS];
67 int cfa_reg;
68 int return_reg;
69 unsigned safe_mask;
70 unsigned compact_mask;
71 unsigned reg_saved_mask;
72 offsetT cfa_offset;
73 bfd_boolean pop_rts;
74 /* Only valid for UNWIND_OP_POP_REG */
75 int saved_reg_count;
76} tic6x_unwind_info;
77
d99e5b39
JM
78typedef struct
79{
80 /* Any labels seen since the last instruction or data. If not NULL,
81 a following instruction may not have parallel bars, but must
82 start a new execute packet. */
83 tic6x_label_list *label_list;
40b36596
JM
84
85 /* Whether compact instructions are forbidden here. */
86 bfd_boolean nocmp;
87
d99e5b39
JM
88 /* If there is a current execute packet, the frag being used for
89 that execute packet. */
90 fragS *execute_packet_frag;
91
40b36596
JM
92 /* If there is a current execute packet, a pointer to the
93 least-significant byte of the last instruction in it (for setting
94 the p-bit). */
95 char *last_insn_lsb;
96
97 /* If there has been an SPMASK instruction in the current execute
98 packet, a pointer to the first byte in it (for processing
99 ||^); otherwise NULL. */
100 char *spmask_addr;
101
38bd8d09
JM
102 /* The functional units used in the current execute packet, recorded
103 by setting the same bits as would be set in the 32-bit SPMASK
104 instruction. */
105 unsigned int func_units_used;
106
40b36596
JM
107 /* If an SPLOOP-family instruction has been seen, and a following
108 SPKERNEL-family instruction has not yet been seen, the ii value
109 from the SPLOOP instruction (in the range 1 to 14); otherwise
110 0. */
111 int sploop_ii;
1bce6bd8
PB
112
113 /* Bit N indicates that an R_C6000_NONE relocation has been output for
114 __c6xabi_unwind_cpp_prN already if set. This enables dependencies to be
115 emitted only once per section, to save unnecessary bloat. */
116 unsigned int marked_pr_dependency;
117
118 tic6x_unwind_info *unwind;
119 tic6x_unwind_info *text_unwind;
40b36596
JM
120} tic6x_segment_info_type;
121#define TC_SEGMENT_INFO_TYPE tic6x_segment_info_type
122
d99e5b39
JM
123typedef struct
124{
125 /* Whether this machine-dependent frag is used for instructions (as
126 opposed to code alignment). */
127 bfd_boolean is_insns;
128
129 /* For a frag used for instructions, whether it is may cross a fetch
130 packet boundary (subject to alignment requirements). */
131 bfd_boolean can_cross_fp_boundary;
132} tic6x_frag_info;
133#define TC_FRAG_TYPE tic6x_frag_info
134#define TC_FRAG_INIT(fragP) tic6x_frag_init (fragP)
135extern void tic6x_frag_init (fragS *fragp);
136
40b36596
JM
137typedef struct
138{
139 /* Whether this fix was for an ADDA instruction. If so, a constant
140 resulting from resolving the fix should be implicitly shifted
141 left (it represents a value to be encoded literally in the
142 instruction, whereas a non-constant represents a DP-relative
143 value counting in the appropriate units). */
144 bfd_boolean fix_adda;
145} tic6x_fix_info;
146#define TC_FIX_TYPE tic6x_fix_info
147#define TC_INIT_FIX_DATA(fixP) tic6x_init_fix_data (fixP)
148struct fix;
149extern void tic6x_init_fix_data (struct fix *fixP);
150
151#define md_after_parse_args() tic6x_after_parse_args ()
152extern void tic6x_after_parse_args (void);
153
154#define md_cleanup() tic6x_cleanup ()
155extern void tic6x_cleanup (void);
156
157#define md_cons_align(n) tic6x_cons_align (n)
158extern void tic6x_cons_align (int n);
159
d99e5b39
JM
160#define md_do_align(n, fill, len, max, label) \
161 do { \
162 if (tic6x_do_align (n, fill, len, max)) \
163 goto label; \
164 } while (0)
165extern bfd_boolean tic6x_do_align (int n, char *fill, int len, int max);
166
59e6276b
JM
167#define CONVERT_SYMBOLIC_ATTRIBUTE(name) \
168 tic6x_convert_symbolic_attribute (name)
169extern int tic6x_convert_symbolic_attribute (const char *);
170
d99e5b39
JM
171#define md_end() tic6x_end ();
172extern void tic6x_end (void);
173
40b36596
JM
174#define md_parse_name(name, exprP, mode, nextcharP) \
175 tic6x_parse_name (name, exprP, mode, nextcharP)
176extern int tic6x_parse_name (const char *name, expressionS *exprP,
177 enum expr_mode mode, char *nextchar);
178
41820509
JM
179#define MD_PCREL_FROM_SECTION(FIX, SEC) tic6x_pcrel_from_section (FIX, SEC)
180extern long tic6x_pcrel_from_section (struct fix *fixp, segT sec);
181
40b36596
JM
182#define md_start_line_hook() tic6x_start_line_hook ()
183extern void tic6x_start_line_hook (void);
184
185#define TC_CONS_FIX_NEW(frag, where, size, exp) \
186 tic6x_cons_fix_new (frag, where, size, exp)
187extern void tic6x_cons_fix_new (fragS *frag, int where, int size,
188 expressionS *exp);
189
43bb514a
BS
190#define tc_fix_adjustable(FIX) tic6x_fix_adjustable (FIX)
191extern bfd_boolean tic6x_fix_adjustable (struct fix *);
192
40b36596
JM
193#define tc_frob_label(sym) tic6x_frob_label (sym)
194extern void tic6x_frob_label (symbolS *sym);
195
41820509
JM
196#define tc_init_after_args() tic6x_init_after_args ()
197extern void tic6x_init_after_args (void);
198
40b36596
JM
199#define tc_unrecognized_line(c) tic6x_unrecognized_line (c)
200extern int tic6x_unrecognized_line (int c);
1bce6bd8
PB
201
202/* We want .cfi_* pseudo-ops for generating unwind info. */
203#define TARGET_USE_CFIPOP 1
204
205/* CFI hooks. */
206#define tc_regname_to_dw2regnum tic6x_regname_to_dw2regnum
207int tic6x_regname_to_dw2regnum (char *regname);
208
209#define tc_cfi_frame_initial_instructions tic6x_frame_initial_instructions
210void tic6x_frame_initial_instructions (void);
211
212/* The return register is B3. */
213#define DWARF2_DEFAULT_RETURN_COLUMN (16 + 3)
214
215/* Registers are generally saved at negative offsets to the CFA. */
216#define DWARF2_CIE_DATA_ALIGNMENT (-4)
217
218#define tc_cfi_startproc tic6x_cfi_startproc
219void tic6x_cfi_startproc (void);
220
221#define tc_cfi_endproc tic6x_cfi_endproc
222struct fde_entry;
223void tic6x_cfi_endproc (struct fde_entry *fde);
224
225#define tc_cfi_section_name ".c6xabi.exidx"
This page took 0.089477 seconds and 4 git commands to generate.