tc-mep.h revision 214571
165116Sn_hibma/* tc-mep.h -- Header file for tc-mep.c.
261560Sn_hibma   Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
361560Sn_hibma
461560Sn_hibma   This file is part of GAS, the GNU Assembler.
561560Sn_hibma
661560Sn_hibma   GAS is free software; you can redistribute it and/or modify
761560Sn_hibma   it under the terms of the GNU General Public License as published by
861560Sn_hibma   the Free Software Foundation; either version 2, or (at your option)
961560Sn_hibma   any later version.
1061560Sn_hibma
1161560Sn_hibma   GAS is distributed in the hope that it will be useful,
1261560Sn_hibma   but WITHOUT ANY WARRANTY; without even the implied warranty of
1361560Sn_hibma   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1461560Sn_hibma   GNU General Public License for more details.
1561560Sn_hibma
1661560Sn_hibma   You should have received a copy of the GNU General Public License
1761560Sn_hibma   along with GAS; see the file COPYING.  If not, write to
1861560Sn_hibma   the Free Software Foundation, 51 Franklin Street, Fifth Floor,
1961560Sn_hibma   Boston, MA 02110-1301, USA. */
2061560Sn_hibma
2161560Sn_hibma#define TC_MEP
2261560Sn_hibma
2361560Sn_hibma/* Support computed relocations.  */
2461560Sn_hibma#define OBJ_COMPLEX_RELC
2561560Sn_hibma
2661560Sn_hibma/* Support many operands per instruction.  */
2761560Sn_hibma#define GAS_CGEN_MAX_FIXUPS 10
2861560Sn_hibma
2961560Sn_hibma#define LISTING_HEADER "MEP GAS "
3061560Sn_hibma
3161560Sn_hibma/* The target BFD architecture.  */
3261560Sn_hibma#define TARGET_ARCH bfd_arch_mep
3361560Sn_hibma
3461560Sn_hibma#define TARGET_FORMAT (target_big_endian ? "elf32-mep" : "elf32-mep-little")
3561560Sn_hibma
3661560Sn_hibma/* This is the default.  */
3761560Sn_hibma#define TARGET_BYTES_BIG_ENDIAN 1
3867217Sn_hibma
3961560Sn_hibma/* Permit temporary numeric labels. */
4061560Sn_hibma#define LOCAL_LABELS_FB 1
4161560Sn_hibma
4261560Sn_hibma/* .-foo gets turned into PC relative relocs.  */
4361560Sn_hibma#define DIFF_EXPR_OK
4461560Sn_hibma
4561560Sn_hibma/* We don't need to handle .word strangely.  */
4661560Sn_hibma#define WORKING_DOT_WORD
4761560Sn_hibma
4861560Sn_hibma/* Values passed to md_apply_fix don't include the symbol value.  */
4961560Sn_hibma#define MD_APPLY_SYM_VALUE(FIX) 0
5061560Sn_hibma
5161560Sn_hibma#define MD_APPLY_FIX
5261560Sn_hibma#define md_apply_fix mep_apply_fix
5361560Sn_hibmaextern void mep_apply_fix (struct fix *, valueT *, segT);
5461560Sn_hibma
5561560Sn_hibma/* Call md_pcrel_from_section(), not md_pcrel_from().  */
5661560Sn_hibma#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
5761560Sn_hibmaextern long md_pcrel_from_section (struct fix *, segT);
5861560Sn_hibma
5961560Sn_hibma#define tc_frob_file() mep_frob_file ()
6061560Sn_hibmaextern void mep_frob_file (void);
6161560Sn_hibma
6261560Sn_hibma#define tc_fix_adjustable(fixP) mep_fix_adjustable (fixP)
6361560Sn_hibmaextern bfd_boolean mep_fix_adjustable (struct fix *);
6461560Sn_hibma
6561560Sn_hibma/* After creating a fixup for an instruction operand, we need
6661560Sn_hibma   to check for HI16 relocs and queue them up for later sorting.  */
6761560Sn_hibma#define md_cgen_record_fixup_exp  mep_cgen_record_fixup_exp
6861560Sn_hibma
6961560Sn_hibma/* When relaxing, we need to emit various relocs we otherwise wouldn't.  */
7061560Sn_hibma#define TC_FORCE_RELOCATION(fix) mep_force_relocation (fix)
7161560Sn_hibmaextern int mep_force_relocation (struct fix *);
7261560Sn_hibma
7361560Sn_hibma#define tc_gen_reloc gas_cgen_tc_gen_reloc
7461560Sn_hibma
7565116Sn_hibmaextern void gas_cgen_md_operand (expressionS *);
7661560Sn_hibma#define md_operand(x) gas_cgen_md_operand (x)
7761560Sn_hibma
7861560Sn_hibma#define md_flush_pending_output() mep_flush_pending_output()
7961560Sn_hibmaextern int mep_flush_pending_output(void);
8067217Sn_hibma
8161560Sn_hibmaextern const struct relax_type md_relax_table[];
8261560Sn_hibma#define TC_GENERIC_RELAX_TABLE md_relax_table
8361560Sn_hibma
8461560Sn_hibma/* Account for inserting a jmp after the insn.  */
8561560Sn_hibma#define TC_CGEN_MAX_RELAX(insn, len) ((len) + 4)
8661560Sn_hibma
8767217Sn_hibmaextern void mep_prepare_relax_scan (fragS *, offsetT *, relax_substateT);
8861560Sn_hibma#define md_prepare_relax_scan(FRAGP, ADDR, AIM, STATE, TYPE) \
8961560Sn_hibma	mep_prepare_relax_scan (FRAGP, &AIM, STATE)
9061560Sn_hibma
9161560Sn_hibma#define skip_whitespace(str) while (*(str) == ' ') ++(str)
9261560Sn_hibma
9361560Sn_hibma/* Support for core/vliw mode switching.  */
9461560Sn_hibma#define CORE 0
9561560Sn_hibma#define VLIW 1
9661560Sn_hibma#define MAX_PARALLEL_INSNS 56 /* From email from Toshiba.  */
9761560Sn_hibma#define VTEXT_SECTION_NAME ".vtext"
98
99/* Needed to process pending instructions when a label is encountered.  */
100#define TC_START_LABEL(ch, ptr)    ((ch == ':') && mep_flush_pending_output ())
101
102#define tc_unrecognized_line(c) mep_unrecognized_line (c)
103extern int mep_unrecognized_line (int);
104#define md_cleanup mep_cleanup
105extern void mep_cleanup (void);
106
107#define md_elf_section_letter		mep_elf_section_letter
108extern int mep_elf_section_letter (int, char **);
109#define md_elf_section_flags		mep_elf_section_flags
110extern flagword mep_elf_section_flags  (flagword, int, int);
111
112#define ELF_TC_SPECIAL_SECTIONS \
113  { VTEXT_SECTION_NAME, SHT_PROGBITS, SHF_ALLOC|SHF_EXECINSTR|SHF_MEP_VLIW },
114
115/* The values of the following enum are for use with parinsnum, which
116   is a variable in md_assemble that keeps track of whether or not the
117   next instruction is expected to be the first or second instrucion in
118   a parallelization group.  */
119typedef enum exp_par_insn_{FIRST, SECOND} EXP_PAR_INSN;
120