Back to index

cell-binutils  2.17cvs20070401
tc-mep.h
Go to the documentation of this file.
00001 /* tc-mep.h -- Header file for tc-mep.c.
00002    Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
00003 
00004    This file is part of GAS, the GNU Assembler.
00005 
00006    GAS is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2, or (at your option)
00009    any later version.
00010 
00011    GAS is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with GAS; see the file COPYING.  If not, write to
00018    the Free Software Foundation, 51 Franklin Street, Fifth Floor,
00019    Boston, MA 02110-1301, USA. */
00020 
00021 #define TC_MEP
00022 
00023 /* Support computed relocations.  */
00024 #define OBJ_COMPLEX_RELC
00025 
00026 /* Support many operands per instruction.  */
00027 #define GAS_CGEN_MAX_FIXUPS 10
00028 
00029 #define LISTING_HEADER "MEP GAS "
00030 
00031 /* The target BFD architecture.  */
00032 #define TARGET_ARCH bfd_arch_mep
00033 
00034 #define TARGET_FORMAT (target_big_endian ? "elf32-mep" : "elf32-mep-little")
00035 
00036 /* This is the default.  */
00037 #define TARGET_BYTES_BIG_ENDIAN 1
00038 
00039 /* Permit temporary numeric labels. */
00040 #define LOCAL_LABELS_FB 1
00041 
00042 /* .-foo gets turned into PC relative relocs.  */
00043 #define DIFF_EXPR_OK
00044 
00045 /* We don't need to handle .word strangely.  */
00046 #define WORKING_DOT_WORD
00047 
00048 /* Values passed to md_apply_fix don't include the symbol value.  */
00049 #define MD_APPLY_SYM_VALUE(FIX) 0
00050 
00051 #define MD_APPLY_FIX
00052 #define md_apply_fix mep_apply_fix
00053 extern void mep_apply_fix (struct fix *, valueT *, segT);
00054 
00055 /* Call md_pcrel_from_section(), not md_pcrel_from().  */
00056 #define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
00057 extern long md_pcrel_from_section (struct fix *, segT);
00058 
00059 #define tc_frob_file() mep_frob_file ()
00060 extern void mep_frob_file (void);
00061 
00062 #define tc_fix_adjustable(fixP) mep_fix_adjustable (fixP)
00063 extern bfd_boolean mep_fix_adjustable (struct fix *);
00064 
00065 /* After creating a fixup for an instruction operand, we need
00066    to check for HI16 relocs and queue them up for later sorting.  */
00067 #define md_cgen_record_fixup_exp  mep_cgen_record_fixup_exp
00068 
00069 /* When relaxing, we need to emit various relocs we otherwise wouldn't.  */
00070 #define TC_FORCE_RELOCATION(fix) mep_force_relocation (fix)
00071 extern int mep_force_relocation (struct fix *);
00072 
00073 #define tc_gen_reloc gas_cgen_tc_gen_reloc
00074 
00075 extern void gas_cgen_md_operand (expressionS *);
00076 #define md_operand(x) gas_cgen_md_operand (x)
00077 
00078 #define md_flush_pending_output() mep_flush_pending_output()
00079 extern int mep_flush_pending_output(void);
00080 
00081 extern const struct relax_type md_relax_table[];
00082 #define TC_GENERIC_RELAX_TABLE md_relax_table
00083 
00084 /* Account for inserting a jmp after the insn.  */
00085 #define TC_CGEN_MAX_RELAX(insn, len) ((len) + 4)
00086 
00087 extern void mep_prepare_relax_scan (fragS *, offsetT *, relax_substateT);
00088 #define md_prepare_relax_scan(FRAGP, ADDR, AIM, STATE, TYPE) \
00089        mep_prepare_relax_scan (FRAGP, &AIM, STATE)
00090 
00091 #define skip_whitespace(str) while (*(str) == ' ') ++(str)
00092 
00093 /* Support for core/vliw mode switching.  */
00094 #define CORE 0
00095 #define VLIW 1
00096 #define MAX_PARALLEL_INSNS 56 /* From email from Toshiba.  */
00097 #define VTEXT_SECTION_NAME ".vtext"
00098 
00099 /* Needed to process pending instructions when a label is encountered.  */
00100 #define TC_START_LABEL(ch, ptr)    ((ch == ':') && mep_flush_pending_output ())
00101 
00102 #define tc_unrecognized_line(c) mep_unrecognized_line (c)
00103 extern int mep_unrecognized_line (int);
00104 #define md_cleanup mep_cleanup
00105 extern void mep_cleanup (void);
00106 
00107 #define md_elf_section_letter             mep_elf_section_letter
00108 extern int mep_elf_section_letter (int, char **);
00109 #define md_elf_section_flags              mep_elf_section_flags
00110 extern flagword mep_elf_section_flags  (flagword, int, int);
00111 
00112 #define ELF_TC_SPECIAL_SECTIONS \
00113   { VTEXT_SECTION_NAME, SHT_PROGBITS, SHF_ALLOC|SHF_EXECINSTR|SHF_MEP_VLIW },
00114 
00115 /* The values of the following enum are for use with parinsnum, which 
00116    is a variable in md_assemble that keeps track of whether or not the
00117    next instruction is expected to be the first or second instrucion in
00118    a parallelization group.  */
00119 typedef enum exp_par_insn_{FIRST, SECOND} EXP_PAR_INSN;