tc-mep.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /* tc-mep.h -- Header file for tc-mep.c.
  2. Copyright (C) 2001-2015 Free Software Foundation, Inc.
  3. This file is part of GAS, the GNU Assembler.
  4. GAS is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3, or (at your option)
  7. any later version.
  8. GAS is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GAS; see the file COPYING. If not, write to
  14. the Free Software Foundation, 51 Franklin Street, Fifth Floor,
  15. Boston, MA 02110-1301, USA. */
  16. #define TC_MEP
  17. /* Support computed relocations. */
  18. #define OBJ_COMPLEX_RELC
  19. /* Support many operands per instruction. */
  20. #define GAS_CGEN_MAX_FIXUPS 10
  21. #define LISTING_HEADER "MEP GAS "
  22. /* The target BFD architecture. */
  23. #define TARGET_ARCH bfd_arch_mep
  24. #define TARGET_FORMAT (target_big_endian ? "elf32-mep" : "elf32-mep-little")
  25. /* This is the default. */
  26. #define TARGET_BYTES_BIG_ENDIAN 0
  27. /* Permit temporary numeric labels. */
  28. #define LOCAL_LABELS_FB 1
  29. /* Do not define DIFF_EXPR_OK - the MeP does not have a 32-bit PC-relative reloc. */
  30. /* We don't need to handle .word strangely. */
  31. #define WORKING_DOT_WORD
  32. /* Values passed to md_apply_fix don't include the symbol value. */
  33. #define MD_APPLY_SYM_VALUE(FIX) 0
  34. #define MD_APPLY_FIX
  35. #define md_apply_fix mep_apply_fix
  36. extern void mep_apply_fix (struct fix *, valueT *, segT);
  37. /* Call md_pcrel_from_section(), not md_pcrel_from(). */
  38. #define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
  39. extern long md_pcrel_from_section (struct fix *, segT);
  40. #define tc_frob_file() mep_frob_file ()
  41. extern void mep_frob_file (void);
  42. #define tc_fix_adjustable(fixP) mep_fix_adjustable (fixP)
  43. extern bfd_boolean mep_fix_adjustable (struct fix *);
  44. /* After creating a fixup for an instruction operand, we need
  45. to check for HI16 relocs and queue them up for later sorting. */
  46. #define md_cgen_record_fixup_exp mep_cgen_record_fixup_exp
  47. /* When relaxing, we need to emit various relocs we otherwise wouldn't. */
  48. #define TC_FORCE_RELOCATION(fix) mep_force_relocation (fix)
  49. extern int mep_force_relocation (struct fix *);
  50. #define tc_gen_reloc gas_cgen_tc_gen_reloc
  51. extern void gas_cgen_md_operand (expressionS *);
  52. #define md_operand(x) gas_cgen_md_operand (x)
  53. #define md_flush_pending_output() mep_flush_pending_output()
  54. extern int mep_flush_pending_output(void);
  55. extern const struct relax_type md_relax_table[];
  56. #define TC_GENERIC_RELAX_TABLE md_relax_table
  57. extern long mep_relax_frag (segT, fragS *, long);
  58. #define md_relax_frag mep_relax_frag
  59. /* Account for inserting a jmp after the insn. */
  60. #define TC_CGEN_MAX_RELAX(insn, len) ((len) + 4)
  61. extern void mep_prepare_relax_scan (fragS *, offsetT *, relax_substateT);
  62. #define md_prepare_relax_scan(FRAGP, ADDR, AIM, STATE, TYPE) \
  63. mep_prepare_relax_scan (FRAGP, &AIM, STATE)
  64. /* Support for core/vliw mode switching. */
  65. #define CORE 0
  66. #define VLIW 1
  67. #define MAX_PARALLEL_INSNS 56 /* From email from Toshiba. */
  68. #define VTEXT_SECTION_NAME ".vtext"
  69. /* Needed to process pending instructions when a label is encountered. */
  70. #define TC_START_LABEL(STR, NUL_CHAR, NEXT_CHAR) \
  71. (NEXT_CHAR == ':' && mep_flush_pending_output ())
  72. #define tc_unrecognized_line(c) mep_unrecognized_line (c)
  73. extern int mep_unrecognized_line (int);
  74. #define md_cleanup mep_cleanup
  75. extern void mep_cleanup (void);
  76. #define md_elf_section_letter mep_elf_section_letter
  77. extern bfd_vma mep_elf_section_letter (int, char **);
  78. #define md_elf_section_flags mep_elf_section_flags
  79. extern flagword mep_elf_section_flags (flagword, bfd_vma, int);
  80. #define ELF_TC_SPECIAL_SECTIONS \
  81. { VTEXT_SECTION_NAME, SHT_PROGBITS, SHF_ALLOC|SHF_EXECINSTR|SHF_MEP_VLIW },
  82. /* The values of the following enum are for use with parinsnum, which
  83. is a variable in md_assemble that keeps track of whether or not the
  84. next instruction is expected to be the first or second instrucion in
  85. a parallelization group. */
  86. typedef enum exp_par_insn_{FIRST, SECOND} EXP_PAR_INSN;