1214571Sdim/* tc-mep.h -- Header file for tc-mep.c.
2214571Sdim   Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
3214571Sdim
4214571Sdim   This file is part of GAS, the GNU Assembler.
5214571Sdim
6214571Sdim   GAS is free software; you can redistribute it and/or modify
7214571Sdim   it under the terms of the GNU General Public License as published by
8214571Sdim   the Free Software Foundation; either version 2, or (at your option)
9214571Sdim   any later version.
10214571Sdim
11214571Sdim   GAS is distributed in the hope that it will be useful,
12214571Sdim   but WITHOUT ANY WARRANTY; without even the implied warranty of
13214571Sdim   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14214571Sdim   GNU General Public License for more details.
15214571Sdim
16214571Sdim   You should have received a copy of the GNU General Public License
17214571Sdim   along with GAS; see the file COPYING.  If not, write to
18214571Sdim   the Free Software Foundation, 51 Franklin Street, Fifth Floor,
19214571Sdim   Boston, MA 02110-1301, USA. */
20214571Sdim
21214571Sdim#define TC_MEP
22214571Sdim
23214571Sdim/* Support computed relocations.  */
24214571Sdim#define OBJ_COMPLEX_RELC
25214571Sdim
26214571Sdim/* Support many operands per instruction.  */
27214571Sdim#define GAS_CGEN_MAX_FIXUPS 10
28214571Sdim
29214571Sdim#define LISTING_HEADER "MEP GAS "
30214571Sdim
31214571Sdim/* The target BFD architecture.  */
32214571Sdim#define TARGET_ARCH bfd_arch_mep
33214571Sdim
34214571Sdim#define TARGET_FORMAT (target_big_endian ? "elf32-mep" : "elf32-mep-little")
35214571Sdim
36214571Sdim/* This is the default.  */
37214571Sdim#define TARGET_BYTES_BIG_ENDIAN 1
38214571Sdim
39214571Sdim/* Permit temporary numeric labels. */
40214571Sdim#define LOCAL_LABELS_FB 1
41214571Sdim
42214571Sdim/* .-foo gets turned into PC relative relocs.  */
43214571Sdim#define DIFF_EXPR_OK
44214571Sdim
45214571Sdim/* We don't need to handle .word strangely.  */
46214571Sdim#define WORKING_DOT_WORD
47214571Sdim
48214571Sdim/* Values passed to md_apply_fix don't include the symbol value.  */
49214571Sdim#define MD_APPLY_SYM_VALUE(FIX) 0
50214571Sdim
51214571Sdim#define MD_APPLY_FIX
52214571Sdim#define md_apply_fix mep_apply_fix
53214571Sdimextern void mep_apply_fix (struct fix *, valueT *, segT);
54214571Sdim
55214571Sdim/* Call md_pcrel_from_section(), not md_pcrel_from().  */
56214571Sdim#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
57214571Sdimextern long md_pcrel_from_section (struct fix *, segT);
58214571Sdim
59214571Sdim#define tc_frob_file() mep_frob_file ()
60214571Sdimextern void mep_frob_file (void);
61214571Sdim
62214571Sdim#define tc_fix_adjustable(fixP) mep_fix_adjustable (fixP)
63214571Sdimextern bfd_boolean mep_fix_adjustable (struct fix *);
64214571Sdim
65214571Sdim/* After creating a fixup for an instruction operand, we need
66214571Sdim   to check for HI16 relocs and queue them up for later sorting.  */
67214571Sdim#define md_cgen_record_fixup_exp  mep_cgen_record_fixup_exp
68214571Sdim
69214571Sdim/* When relaxing, we need to emit various relocs we otherwise wouldn't.  */
70214571Sdim#define TC_FORCE_RELOCATION(fix) mep_force_relocation (fix)
71214571Sdimextern int mep_force_relocation (struct fix *);
72214571Sdim
73214571Sdim#define tc_gen_reloc gas_cgen_tc_gen_reloc
74214571Sdim
75214571Sdimextern void gas_cgen_md_operand (expressionS *);
76214571Sdim#define md_operand(x) gas_cgen_md_operand (x)
77214571Sdim
78214571Sdim#define md_flush_pending_output() mep_flush_pending_output()
79214571Sdimextern int mep_flush_pending_output(void);
80214571Sdim
81214571Sdimextern const struct relax_type md_relax_table[];
82214571Sdim#define TC_GENERIC_RELAX_TABLE md_relax_table
83214571Sdim
84214571Sdim/* Account for inserting a jmp after the insn.  */
85214571Sdim#define TC_CGEN_MAX_RELAX(insn, len) ((len) + 4)
86214571Sdim
87214571Sdimextern void mep_prepare_relax_scan (fragS *, offsetT *, relax_substateT);
88214571Sdim#define md_prepare_relax_scan(FRAGP, ADDR, AIM, STATE, TYPE) \
89214571Sdim	mep_prepare_relax_scan (FRAGP, &AIM, STATE)
90214571Sdim
91214571Sdim#define skip_whitespace(str) while (*(str) == ' ') ++(str)
92214571Sdim
93214571Sdim/* Support for core/vliw mode switching.  */
94214571Sdim#define CORE 0
95214571Sdim#define VLIW 1
96214571Sdim#define MAX_PARALLEL_INSNS 56 /* From email from Toshiba.  */
97214571Sdim#define VTEXT_SECTION_NAME ".vtext"
98214571Sdim
99214571Sdim/* Needed to process pending instructions when a label is encountered.  */
100214571Sdim#define TC_START_LABEL(ch, ptr)    ((ch == ':') && mep_flush_pending_output ())
101214571Sdim
102214571Sdim#define tc_unrecognized_line(c) mep_unrecognized_line (c)
103214571Sdimextern int mep_unrecognized_line (int);
104214571Sdim#define md_cleanup mep_cleanup
105214571Sdimextern void mep_cleanup (void);
106214571Sdim
107214571Sdim#define md_elf_section_letter		mep_elf_section_letter
108214571Sdimextern int mep_elf_section_letter (int, char **);
109214571Sdim#define md_elf_section_flags		mep_elf_section_flags
110214571Sdimextern flagword mep_elf_section_flags  (flagword, int, int);
111214571Sdim
112214571Sdim#define ELF_TC_SPECIAL_SECTIONS \
113214571Sdim  { VTEXT_SECTION_NAME, SHT_PROGBITS, SHF_ALLOC|SHF_EXECINSTR|SHF_MEP_VLIW },
114214571Sdim
115214571Sdim/* The values of the following enum are for use with parinsnum, which
116214571Sdim   is a variable in md_assemble that keeps track of whether or not the
117214571Sdim   next instruction is expected to be the first or second instrucion in
118214571Sdim   a parallelization group.  */
119214571Sdimtypedef enum exp_par_insn_{FIRST, SECOND} EXP_PAR_INSN;
120