binutils-gdb/bfd/cpu-mips.c

135 lines
4.8 KiB
C
Raw Normal View History

1999-05-03 09:29:11 +02:00
/* bfd back-end for mips support
Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001,
2002, 2003, 2004, 2007 Free Software Foundation, Inc.
1999-05-03 09:29:11 +02:00
Written by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
1999-05-03 09:29:11 +02:00
#include "sysdep.h"
#include "bfd.h"
1999-05-03 09:29:11 +02:00
#include "libbfd.h"
* linker.c (link_action): Ignore duplicate warning syms. (_bfd_generic_link_write_global_symbol): Follow warning symbol link. * elflink.h (elf_adjust_dynstr_offsets): Likewise. (elf_adjust_dynamic_symbol): Likewise. (elf_export_symbol): Likewise. (elf_link_find_version_dependencies): Likewise. (elf_link_assign_sym_version): Likewise. (elf_link_sec_merge_syms): Likewise. (elf_link_output_extsym): Likewise. (elf_gc_sweep_symbol): Likewise. (elf_gc_propagate_vtable_entries_used): Likewise. (elf_gc_smash_unused_vtentry_relocs): Likewise. (elf_gc_allocate_got_offsets): Likewise. (elf_collect_hash_codes): Likewise. * elflink.c (elf_link_renumber_hash_table_dynsyms): Likewise. * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): Likewise. (elf_hppa_remark_useless_dynamic_symbols): Likewise. * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise. * elf32-arm.h (elf32_arm_discard_copies): Likewise. * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Likewise. (elf_cris_discard_excess_dso_dynamics): Likewise. * elf32-hppa.c (clobber_millicode_symbols): Likewise. (mark_PIC_calls): Likewise. (allocate_plt_static): Likewise. (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf32-i386.c (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf32-i370.c (i370_elf_adjust_dynindx): Likewise. * elf32-m68k.c (elf_m68k_discard_copies): Likewise. * elf32-mips.c (mips_elf_output_extsym): Likewise. (mips_elf_sort_hash_table_f): Likewise. (mips_elf_check_mips16_stubs): Likewise. * elf32-s390.c (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf32-sh.c (sh_elf_discard_copies): Likewise. * elf32-xstormy16.c (xstormy16_relax_plt_check): Likewise. (xstormy16_relax_plt_realloc): Likewise. * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Likewise. (elf64_alpha_output_extsym): Likewise. * elf64-hppa.c (elf64_hppa_mark_exported_functions): Likewise. * elf64-mips.c (mips_elf64_sort_hash_table_f): Likewise. (mips_elf64_check_mips16_stubs): Likewise. (mips_elf64_output_extsym): Likewise. * elf64-ppc.c (func_desc_adjust): Likewise. (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf64-s390.c (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf64-sh64.c (sh64_elf64_discard_copies): Likewise. * elf64-x86-64.c (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elfxx-ia64.c (elfNN_ia64_global_dyn_sym_thunk): Likewise. * aoutx.h (aout_link_write_other_symbol): Likewise. * cofflink.c (_bfd_coff_write_task_globals): Likewise. (_bfd_coff_write_global_sym): Likewise. * i386linux.c (linux_tally_symbols): Likewise. * m68klinux.c (linux_tally_symbols): Likewise. * sparclinux.c (linux_tally_symbols): Likewise. * pdp11.c (aout_link_write_other_symbol): Likewise. * sunos.c (sunos_scan_dynamic_symbol): Likewise. * xcofflink.c (xcoff_build_ldsyms): Likewise. (xcoff_write_global_symbol): Likewise. * cofflink.c (_bfd_coff_final_link): Formatting. * cpu-mips.c (mips_compatible): Make static, prototype. * elf32-i386.c (elf_i386_check_relocs): Formatting. * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise. * elf64-alpha.c (elf64_alpha_output_extsym): Likewise. * elf64-mips.c (mips_elf64_sort_hash_table): Likewise. (mips_elf64_final_link): Likewise. * elflink.h (elf_link_find_version_dependencies): Remove duplicate prototype.
2002-03-28 04:27:46 +01:00
static const bfd_arch_info_type *mips_compatible
(const bfd_arch_info_type *, const bfd_arch_info_type *);
* linker.c (link_action): Ignore duplicate warning syms. (_bfd_generic_link_write_global_symbol): Follow warning symbol link. * elflink.h (elf_adjust_dynstr_offsets): Likewise. (elf_adjust_dynamic_symbol): Likewise. (elf_export_symbol): Likewise. (elf_link_find_version_dependencies): Likewise. (elf_link_assign_sym_version): Likewise. (elf_link_sec_merge_syms): Likewise. (elf_link_output_extsym): Likewise. (elf_gc_sweep_symbol): Likewise. (elf_gc_propagate_vtable_entries_used): Likewise. (elf_gc_smash_unused_vtentry_relocs): Likewise. (elf_gc_allocate_got_offsets): Likewise. (elf_collect_hash_codes): Likewise. * elflink.c (elf_link_renumber_hash_table_dynsyms): Likewise. * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): Likewise. (elf_hppa_remark_useless_dynamic_symbols): Likewise. * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise. * elf32-arm.h (elf32_arm_discard_copies): Likewise. * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Likewise. (elf_cris_discard_excess_dso_dynamics): Likewise. * elf32-hppa.c (clobber_millicode_symbols): Likewise. (mark_PIC_calls): Likewise. (allocate_plt_static): Likewise. (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf32-i386.c (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf32-i370.c (i370_elf_adjust_dynindx): Likewise. * elf32-m68k.c (elf_m68k_discard_copies): Likewise. * elf32-mips.c (mips_elf_output_extsym): Likewise. (mips_elf_sort_hash_table_f): Likewise. (mips_elf_check_mips16_stubs): Likewise. * elf32-s390.c (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf32-sh.c (sh_elf_discard_copies): Likewise. * elf32-xstormy16.c (xstormy16_relax_plt_check): Likewise. (xstormy16_relax_plt_realloc): Likewise. * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Likewise. (elf64_alpha_output_extsym): Likewise. * elf64-hppa.c (elf64_hppa_mark_exported_functions): Likewise. * elf64-mips.c (mips_elf64_sort_hash_table_f): Likewise. (mips_elf64_check_mips16_stubs): Likewise. (mips_elf64_output_extsym): Likewise. * elf64-ppc.c (func_desc_adjust): Likewise. (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf64-s390.c (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf64-sh64.c (sh64_elf64_discard_copies): Likewise. * elf64-x86-64.c (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elfxx-ia64.c (elfNN_ia64_global_dyn_sym_thunk): Likewise. * aoutx.h (aout_link_write_other_symbol): Likewise. * cofflink.c (_bfd_coff_write_task_globals): Likewise. (_bfd_coff_write_global_sym): Likewise. * i386linux.c (linux_tally_symbols): Likewise. * m68klinux.c (linux_tally_symbols): Likewise. * sparclinux.c (linux_tally_symbols): Likewise. * pdp11.c (aout_link_write_other_symbol): Likewise. * sunos.c (sunos_scan_dynamic_symbol): Likewise. * xcofflink.c (xcoff_build_ldsyms): Likewise. (xcoff_write_global_symbol): Likewise. * cofflink.c (_bfd_coff_final_link): Formatting. * cpu-mips.c (mips_compatible): Make static, prototype. * elf32-i386.c (elf_i386_check_relocs): Formatting. * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise. * elf64-alpha.c (elf64_alpha_output_extsym): Likewise. * elf64-mips.c (mips_elf64_sort_hash_table): Likewise. (mips_elf64_final_link): Likewise. * elflink.h (elf_link_find_version_dependencies): Remove duplicate prototype.
2002-03-28 04:27:46 +01:00
/* The default routine tests bits_per_word, which is wrong on mips as
mips word size doesn't correlate with reloc size. */
* linker.c (link_action): Ignore duplicate warning syms. (_bfd_generic_link_write_global_symbol): Follow warning symbol link. * elflink.h (elf_adjust_dynstr_offsets): Likewise. (elf_adjust_dynamic_symbol): Likewise. (elf_export_symbol): Likewise. (elf_link_find_version_dependencies): Likewise. (elf_link_assign_sym_version): Likewise. (elf_link_sec_merge_syms): Likewise. (elf_link_output_extsym): Likewise. (elf_gc_sweep_symbol): Likewise. (elf_gc_propagate_vtable_entries_used): Likewise. (elf_gc_smash_unused_vtentry_relocs): Likewise. (elf_gc_allocate_got_offsets): Likewise. (elf_collect_hash_codes): Likewise. * elflink.c (elf_link_renumber_hash_table_dynsyms): Likewise. * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): Likewise. (elf_hppa_remark_useless_dynamic_symbols): Likewise. * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise. * elf32-arm.h (elf32_arm_discard_copies): Likewise. * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Likewise. (elf_cris_discard_excess_dso_dynamics): Likewise. * elf32-hppa.c (clobber_millicode_symbols): Likewise. (mark_PIC_calls): Likewise. (allocate_plt_static): Likewise. (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf32-i386.c (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf32-i370.c (i370_elf_adjust_dynindx): Likewise. * elf32-m68k.c (elf_m68k_discard_copies): Likewise. * elf32-mips.c (mips_elf_output_extsym): Likewise. (mips_elf_sort_hash_table_f): Likewise. (mips_elf_check_mips16_stubs): Likewise. * elf32-s390.c (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf32-sh.c (sh_elf_discard_copies): Likewise. * elf32-xstormy16.c (xstormy16_relax_plt_check): Likewise. (xstormy16_relax_plt_realloc): Likewise. * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Likewise. (elf64_alpha_output_extsym): Likewise. * elf64-hppa.c (elf64_hppa_mark_exported_functions): Likewise. * elf64-mips.c (mips_elf64_sort_hash_table_f): Likewise. (mips_elf64_check_mips16_stubs): Likewise. (mips_elf64_output_extsym): Likewise. * elf64-ppc.c (func_desc_adjust): Likewise. (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf64-s390.c (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf64-sh64.c (sh64_elf64_discard_copies): Likewise. * elf64-x86-64.c (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elfxx-ia64.c (elfNN_ia64_global_dyn_sym_thunk): Likewise. * aoutx.h (aout_link_write_other_symbol): Likewise. * cofflink.c (_bfd_coff_write_task_globals): Likewise. (_bfd_coff_write_global_sym): Likewise. * i386linux.c (linux_tally_symbols): Likewise. * m68klinux.c (linux_tally_symbols): Likewise. * sparclinux.c (linux_tally_symbols): Likewise. * pdp11.c (aout_link_write_other_symbol): Likewise. * sunos.c (sunos_scan_dynamic_symbol): Likewise. * xcofflink.c (xcoff_build_ldsyms): Likewise. (xcoff_write_global_symbol): Likewise. * cofflink.c (_bfd_coff_final_link): Formatting. * cpu-mips.c (mips_compatible): Make static, prototype. * elf32-i386.c (elf_i386_check_relocs): Formatting. * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise. * elf64-alpha.c (elf64_alpha_output_extsym): Likewise. * elf64-mips.c (mips_elf64_sort_hash_table): Likewise. (mips_elf64_final_link): Likewise. * elflink.h (elf_link_find_version_dependencies): Remove duplicate prototype.
2002-03-28 04:27:46 +01:00
static const bfd_arch_info_type *
mips_compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b)
{
if (a->arch != b->arch)
return NULL;
/* Machine compatibility is checked in
_bfd_mips_elf_merge_private_bfd_data. */
return a;
}
1999-05-03 09:29:11 +02:00
#define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT) \
{ \
BITS_WORD, /* bits in a word */ \
BITS_ADDR, /* bits in an address */ \
8, /* 8 bits in a byte */ \
bfd_arch_mips, \
NUMBER, \
"mips", \
PRINT, \
3, \
DEFAULT, \
mips_compatible, \
1999-05-03 09:29:11 +02:00
bfd_default_scan, \
NEXT, \
}
enum
{
I_mips3000,
I_mips3900,
I_mips4000,
I_mips4010,
I_mips4100,
I_mips4111,
I_mips4120,
I_mips4300,
I_mips4400,
I_mips4600,
I_mips4650,
I_mips5000,
I_mips5400,
I_mips5500,
I_mips6000,
I_mips7000,
I_mips8000,
I_mips9000,
I_mips10000,
2001-05-23 19:26:40 +02:00
I_mips12000,
I_mips16,
2000-12-02 01:55:22 +01:00
I_mips5,
I_mipsisa32,
[ bfd/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * aoutx.h (NAME(aout,machine_type)): Add bfd_mach_mipsisa32r2 case. * archures.c (bfd_mach_mipsisa32r2): New define. * bfd-in2.h: Regenerate. * cpu-mips.c (I_mipsisa32r2): New enum value. (arch_info_struct): Add entry for I_mipsisa32r2. * elfxx-mips.c (elf_mips_isa, _bfd_elf_mips_mach) (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_32R2. (_bfd_mips_elf_final_write_processing): Add bfd_mach_mipsisa32r2 case. (_bfd_mips_elf_merge_private_bfd_data): Handle merging of binaries marked as using MIPS32 Release 2. [ binutils/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * doc/binutils.texi (objdump): Note MIPS HWR (Hardware Register) changes in MIPS -M options. [ gas/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * configure.in: Recognize mipsisa32r2, mipsisa32r2el, and CPU variants. * configure: Regenerate. * config/tc-mips.c (ISA_HAS_DROR, ISA_HAS_ROR): New defines. (macro_build): Handle "K" operand. (macro2): Use ISA_HAS_DROR and ISA_HAS_ROR in the places where CPU_HAS_DROR and CPU_HAS_ROR are currently used. (mips_ip): New variable "lastpos", and implement "+A", "+B", and "+C" operands for MIPS32 Release 2 ins/ext instructions. Implement "K" operand for MIPS32 Release 2 rdhwr instruction. (validate_mips_insn): Implement "+" as a way to extend the allowed operands, and implement "K", "+A", "+B", and "+C" operands. (OPTION_MIPS32R2): New define. (md_longopts): Add entry for OPTION_MIPS32R2. (OPTION_ELF_BASE): Adjust to accomodate OPTIONS_MIPS32R2. (md_parse_option): Handle OPTION_MIPS32R2. (s_mipsset): Reimplement handling of ".set mipsN" options and add support for ".set mips32r2". (mips_cpu_info_table): Add entry for "mips32r2" (MIPS32 Release 2). (md_show_usage): Document "-mips32r2" option. * doc/as.texinfo: Document "-mips32r2" option. * doc/c-mips.texi: Likewise. [ gas/testsuite/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * gas/mips/cp0-names-mips32r2.d: New test. * gas/mips/hwr-names-mips32r2.d: New test. * gas/mips/hwr-names-numeric.d: New test. * gas/mips/hwr-names.s: New test source file. * gas/mips/mips32r2.d: New test. * gas/mips/mips32r2.s: New test source file. * gas/mips/mips32r2-ill.l: New test. * gas/mips/mips32r2-ill.s: New test source file. * gas/mips/mips.exp: Add mips32r2 architecture data array entry. Run new tests mentioned above. [ include/elf/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * mips.h (E_MIPS_ARCH_32R2): New define. [ include/opcode/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * mips.h: Document "+" as the start of two-character operand type names, and add new "K", "+A", "+B", and "+C" operand types. (OP_MASK_INSMSB, OP_SH_INSMSB, OP_MASK_EXTMSB) (OP_SH_EXTMSB, INSN_ISA32R2, ISA_MIPS32R2, CPU_MIPS32R2): New defines. [ opcodes/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * mips-dis.c (mips_cp0_names_mips3264r2, mips_hwr_names_numeric) (mips_hwr_names_mips3264r2): New arrays. (mips_arch_choice): New "hwr_names" member. (mips_arch_choices): Adjust for structure change, and add a new entry for "mips32r2" ISA. (mips_hwr_names): New variable. (set_default_mips_dis_options): Set mips_hwr_names. (parse_mips_dis_option): New "hwr-names" option which sets mips_hwr_names, and adjust "reg-names=ARCH" to set mips_hwr_names. (print_insn_arg): Change return type to "int" and use that to indicate number of characters consumed. Add support for "+" operand extension character, "+A", "+B", "+C", and "K" operands. (print_insn_mips): Adjust for changes to print_insn_arg. (print_mips_disassembler_options): Adjust for "hwr-names" addition and "reg-names" change. * mips-opc (I33): New define (shorthand for INSN_ISA32R2). (mips_builtin_opcodes): Note that "nop" and "ssnop" are special forms of "sll". Add new MIPS32 Release 2 instructions: ehb, di, ei, ext, ins, jr.hb, jalr.hb, mfhc1, mfhc2, mthc1, mthc2, rdhwr, rdpgpr, seb, seh, synci, wrpgpr, wsbh. Note that hardware rotate instructions (ror, rorv) can be used on MIPS32 Release 2, and add the official mnemonics for them (rotr, rotrv) and the similar "rotl" mnemonic for left-rotate.
2002-12-31 08:29:29 +01:00
I_mipsisa32r2,
I_mipsisa64,
[ bfd/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * archures.c (bfd_mach_mipsisa64r2): New define. * bfd-in2.h: Regenerate. * aoutx.h (NAME(aout,machine_type)): Handle bfd_mach_mipsisa64r2. * cpu-mips.c (I_mipsisa64r2): New enum value. (arch_info_struct): Add entry for I_mipsisa64r2. * elfxx-mips.c (_bfd_elf_mips_mach) (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_64R2. (mips_set_isa_flags): Add bfd_mach_mipsisa64r2 case. (mips_mach_extensions): Add entry for bfd_mach_mipsisa64r2. [ binutils/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * readelf.c (get_machine_flags): Handle E_MIPS_ARCH_64R2. [ gas/Changelog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * configure.in (mipsisa64r2, mipsisa64r2el, mipsisa64r2*): New CPUs. * configure: Regenerate. * config/tc-mips.c (imm2_expr): New variable. (md_assemble, mips16_ip): Initialize imm2_expr. (ISA_HAS_64BIT_REGS, ISA_HAS_DROR, ISA_HAS_ROR): Add ISA_MIPS64R2. (macro_build): Handle +A, +B, +C, +E, +F, +G, and +H format operands. (macro): Handle M_DEXT and M_DINS. (validate_mips_insn): Handle +E, +F, +G, +H, and +I format operands. (mips_ip): Likewise. (OPTION_MIPS64R2): New define. (md_longopts): New entry for -mips64r2 (OPTION_MIPS64R2). OPTION_ASE_BASE): Increase to compensate for OPTION_MIPS64R2. (md_parse_option): Handle OPTION_MIPS64R2. (s_mipsset): Handle setting "mips64r2" ISA. (mips_cpu_info_table): Add mips64r2. (md_show_usage): Document -mips64r2 option. * doc/as.texinfo: Docuemnt -mips64r2 option. * doc/c-mips.texi: Likewise. [ gas/testsuite/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * gas/mips/cp0-names-mips64r2.d: New file. * gas/mips/cp0sel-names-mips64r2.d: New file. * gas/mips/elf_arch_mips64r2.d: New file. * gas/mips/hwr-names-mips64r2.d: New file. * gas/mips/mips32r2-ill-fp64.l: New file. * gas/mips/mips32r2-ill-fp64.s: New file. * gas/mips/mips64r2-ill.l: New file. * gas/mips/mips64r2-ill.s: New file. * gas/mips/mips64r2.d: New file. * gas/mips/mips64r2.s: New file. * gas/mips/mips.exp: Define "mips64r2" arch, and run new tests. [ include/elf/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * mips.h (E_MIPS_ARCH_64R2): New define. [ include/opcode/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * mips.h: Document +E, +F, +G, +H, and +I operand types. Update documentation of I, +B and +C operand types. (INSN_ISA64R2, ISA_MIPS64R2, CPU_MIPS64R2): New defines. (M_DEXT, M_DINS): New enum values. [ ld/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * ldmain.c (get_emulation): Ignore "-mips64r2". [ ld/testsuite/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * ld-mips-elf/mips-elf-flags.exp: Add tests for combinations with MIPS64r2. [ opcodes/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * mips-dis.c (mips_arch_choices): Add entry for "mips64r2" (print_insn_args): Add handing for +E, +F, +G, and +H. * mips-opc.c (I65): New define for MIPS64r2. (mips_builtin_opcodes): Add "dext", "dextm", "dextu", "dins", "dinsm", "dinsu", "drotl", "drotr", "drotr32", "drotrv", "dsbh", and "dshd" for MIPS64r2. Adjust "dror", "dror32", and "drorv" to be supported on MIPS64r2.
2003-09-30 18:17:15 +02:00
I_mipsisa64r2,
2000-12-02 02:10:33 +01:00
I_sb1,
2007-11-29 13:23:44 +01:00
I_loongson_2e,
I_loongson_2f
1999-05-03 09:29:11 +02:00
};
#define NN(index) (&arch_info_struct[(index) + 1])
1999-05-03 09:29:11 +02:00
static const bfd_arch_info_type arch_info_struct[] =
1999-05-03 09:29:11 +02:00
{
N (32, 32, bfd_mach_mips3000, "mips:3000", FALSE, NN(I_mips3000)),
N (32, 32, bfd_mach_mips3900, "mips:3900", FALSE, NN(I_mips3900)),
N (64, 64, bfd_mach_mips4000, "mips:4000", FALSE, NN(I_mips4000)),
N (64, 64, bfd_mach_mips4010, "mips:4010", FALSE, NN(I_mips4010)),
N (64, 64, bfd_mach_mips4100, "mips:4100", FALSE, NN(I_mips4100)),
N (64, 64, bfd_mach_mips4111, "mips:4111", FALSE, NN(I_mips4111)),
N (64, 64, bfd_mach_mips4120, "mips:4120", FALSE, NN(I_mips4120)),
N (64, 64, bfd_mach_mips4300, "mips:4300", FALSE, NN(I_mips4300)),
N (64, 64, bfd_mach_mips4400, "mips:4400", FALSE, NN(I_mips4400)),
N (64, 64, bfd_mach_mips4600, "mips:4600", FALSE, NN(I_mips4600)),
N (64, 64, bfd_mach_mips4650, "mips:4650", FALSE, NN(I_mips4650)),
N (64, 64, bfd_mach_mips5000, "mips:5000", FALSE, NN(I_mips5000)),
N (64, 64, bfd_mach_mips5400, "mips:5400", FALSE, NN(I_mips5400)),
N (64, 64, bfd_mach_mips5500, "mips:5500", FALSE, NN(I_mips5500)),
N (32, 32, bfd_mach_mips6000, "mips:6000", FALSE, NN(I_mips6000)),
N (64, 64, bfd_mach_mips7000, "mips:7000", FALSE, NN(I_mips7000)),
N (64, 64, bfd_mach_mips8000, "mips:8000", FALSE, NN(I_mips8000)),
N (64, 64, bfd_mach_mips9000, "mips:9000", FALSE, NN(I_mips9000)),
N (64, 64, bfd_mach_mips10000,"mips:10000", FALSE, NN(I_mips10000)),
N (64, 64, bfd_mach_mips12000,"mips:12000", FALSE, NN(I_mips12000)),
N (64, 64, bfd_mach_mips16, "mips:16", FALSE, NN(I_mips16)),
N (64, 64, bfd_mach_mips5, "mips:mips5", FALSE, NN(I_mips5)),
N (32, 32, bfd_mach_mipsisa32, "mips:isa32", FALSE, NN(I_mipsisa32)),
[ bfd/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * aoutx.h (NAME(aout,machine_type)): Add bfd_mach_mipsisa32r2 case. * archures.c (bfd_mach_mipsisa32r2): New define. * bfd-in2.h: Regenerate. * cpu-mips.c (I_mipsisa32r2): New enum value. (arch_info_struct): Add entry for I_mipsisa32r2. * elfxx-mips.c (elf_mips_isa, _bfd_elf_mips_mach) (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_32R2. (_bfd_mips_elf_final_write_processing): Add bfd_mach_mipsisa32r2 case. (_bfd_mips_elf_merge_private_bfd_data): Handle merging of binaries marked as using MIPS32 Release 2. [ binutils/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * doc/binutils.texi (objdump): Note MIPS HWR (Hardware Register) changes in MIPS -M options. [ gas/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * configure.in: Recognize mipsisa32r2, mipsisa32r2el, and CPU variants. * configure: Regenerate. * config/tc-mips.c (ISA_HAS_DROR, ISA_HAS_ROR): New defines. (macro_build): Handle "K" operand. (macro2): Use ISA_HAS_DROR and ISA_HAS_ROR in the places where CPU_HAS_DROR and CPU_HAS_ROR are currently used. (mips_ip): New variable "lastpos", and implement "+A", "+B", and "+C" operands for MIPS32 Release 2 ins/ext instructions. Implement "K" operand for MIPS32 Release 2 rdhwr instruction. (validate_mips_insn): Implement "+" as a way to extend the allowed operands, and implement "K", "+A", "+B", and "+C" operands. (OPTION_MIPS32R2): New define. (md_longopts): Add entry for OPTION_MIPS32R2. (OPTION_ELF_BASE): Adjust to accomodate OPTIONS_MIPS32R2. (md_parse_option): Handle OPTION_MIPS32R2. (s_mipsset): Reimplement handling of ".set mipsN" options and add support for ".set mips32r2". (mips_cpu_info_table): Add entry for "mips32r2" (MIPS32 Release 2). (md_show_usage): Document "-mips32r2" option. * doc/as.texinfo: Document "-mips32r2" option. * doc/c-mips.texi: Likewise. [ gas/testsuite/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * gas/mips/cp0-names-mips32r2.d: New test. * gas/mips/hwr-names-mips32r2.d: New test. * gas/mips/hwr-names-numeric.d: New test. * gas/mips/hwr-names.s: New test source file. * gas/mips/mips32r2.d: New test. * gas/mips/mips32r2.s: New test source file. * gas/mips/mips32r2-ill.l: New test. * gas/mips/mips32r2-ill.s: New test source file. * gas/mips/mips.exp: Add mips32r2 architecture data array entry. Run new tests mentioned above. [ include/elf/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * mips.h (E_MIPS_ARCH_32R2): New define. [ include/opcode/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * mips.h: Document "+" as the start of two-character operand type names, and add new "K", "+A", "+B", and "+C" operand types. (OP_MASK_INSMSB, OP_SH_INSMSB, OP_MASK_EXTMSB) (OP_SH_EXTMSB, INSN_ISA32R2, ISA_MIPS32R2, CPU_MIPS32R2): New defines. [ opcodes/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * mips-dis.c (mips_cp0_names_mips3264r2, mips_hwr_names_numeric) (mips_hwr_names_mips3264r2): New arrays. (mips_arch_choice): New "hwr_names" member. (mips_arch_choices): Adjust for structure change, and add a new entry for "mips32r2" ISA. (mips_hwr_names): New variable. (set_default_mips_dis_options): Set mips_hwr_names. (parse_mips_dis_option): New "hwr-names" option which sets mips_hwr_names, and adjust "reg-names=ARCH" to set mips_hwr_names. (print_insn_arg): Change return type to "int" and use that to indicate number of characters consumed. Add support for "+" operand extension character, "+A", "+B", "+C", and "K" operands. (print_insn_mips): Adjust for changes to print_insn_arg. (print_mips_disassembler_options): Adjust for "hwr-names" addition and "reg-names" change. * mips-opc (I33): New define (shorthand for INSN_ISA32R2). (mips_builtin_opcodes): Note that "nop" and "ssnop" are special forms of "sll". Add new MIPS32 Release 2 instructions: ehb, di, ei, ext, ins, jr.hb, jalr.hb, mfhc1, mfhc2, mthc1, mthc2, rdhwr, rdpgpr, seb, seh, synci, wrpgpr, wsbh. Note that hardware rotate instructions (ror, rorv) can be used on MIPS32 Release 2, and add the official mnemonics for them (rotr, rotrv) and the similar "rotl" mnemonic for left-rotate.
2002-12-31 08:29:29 +01:00
N (32, 32, bfd_mach_mipsisa32r2,"mips:isa32r2", FALSE, NN(I_mipsisa32r2)),
N (64, 64, bfd_mach_mipsisa64, "mips:isa64", FALSE, NN(I_mipsisa64)),
[ bfd/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * archures.c (bfd_mach_mipsisa64r2): New define. * bfd-in2.h: Regenerate. * aoutx.h (NAME(aout,machine_type)): Handle bfd_mach_mipsisa64r2. * cpu-mips.c (I_mipsisa64r2): New enum value. (arch_info_struct): Add entry for I_mipsisa64r2. * elfxx-mips.c (_bfd_elf_mips_mach) (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_64R2. (mips_set_isa_flags): Add bfd_mach_mipsisa64r2 case. (mips_mach_extensions): Add entry for bfd_mach_mipsisa64r2. [ binutils/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * readelf.c (get_machine_flags): Handle E_MIPS_ARCH_64R2. [ gas/Changelog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * configure.in (mipsisa64r2, mipsisa64r2el, mipsisa64r2*): New CPUs. * configure: Regenerate. * config/tc-mips.c (imm2_expr): New variable. (md_assemble, mips16_ip): Initialize imm2_expr. (ISA_HAS_64BIT_REGS, ISA_HAS_DROR, ISA_HAS_ROR): Add ISA_MIPS64R2. (macro_build): Handle +A, +B, +C, +E, +F, +G, and +H format operands. (macro): Handle M_DEXT and M_DINS. (validate_mips_insn): Handle +E, +F, +G, +H, and +I format operands. (mips_ip): Likewise. (OPTION_MIPS64R2): New define. (md_longopts): New entry for -mips64r2 (OPTION_MIPS64R2). OPTION_ASE_BASE): Increase to compensate for OPTION_MIPS64R2. (md_parse_option): Handle OPTION_MIPS64R2. (s_mipsset): Handle setting "mips64r2" ISA. (mips_cpu_info_table): Add mips64r2. (md_show_usage): Document -mips64r2 option. * doc/as.texinfo: Docuemnt -mips64r2 option. * doc/c-mips.texi: Likewise. [ gas/testsuite/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * gas/mips/cp0-names-mips64r2.d: New file. * gas/mips/cp0sel-names-mips64r2.d: New file. * gas/mips/elf_arch_mips64r2.d: New file. * gas/mips/hwr-names-mips64r2.d: New file. * gas/mips/mips32r2-ill-fp64.l: New file. * gas/mips/mips32r2-ill-fp64.s: New file. * gas/mips/mips64r2-ill.l: New file. * gas/mips/mips64r2-ill.s: New file. * gas/mips/mips64r2.d: New file. * gas/mips/mips64r2.s: New file. * gas/mips/mips.exp: Define "mips64r2" arch, and run new tests. [ include/elf/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * mips.h (E_MIPS_ARCH_64R2): New define. [ include/opcode/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * mips.h: Document +E, +F, +G, +H, and +I operand types. Update documentation of I, +B and +C operand types. (INSN_ISA64R2, ISA_MIPS64R2, CPU_MIPS64R2): New defines. (M_DEXT, M_DINS): New enum values. [ ld/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * ldmain.c (get_emulation): Ignore "-mips64r2". [ ld/testsuite/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * ld-mips-elf/mips-elf-flags.exp: Add tests for combinations with MIPS64r2. [ opcodes/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * mips-dis.c (mips_arch_choices): Add entry for "mips64r2" (print_insn_args): Add handing for +E, +F, +G, and +H. * mips-opc.c (I65): New define for MIPS64r2. (mips_builtin_opcodes): Add "dext", "dextm", "dextu", "dins", "dinsm", "dinsu", "drotl", "drotr", "drotr32", "drotrv", "dsbh", and "dshd" for MIPS64r2. Adjust "dror", "dror32", and "drorv" to be supported on MIPS64r2.
2003-09-30 18:17:15 +02:00
N (64, 64, bfd_mach_mipsisa64r2,"mips:isa64r2", FALSE, NN(I_mipsisa64r2)),
2007-11-29 13:23:44 +01:00
N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, NN(I_sb1)),
N (64, 64, bfd_mach_mips_loongson_2e, "mips:loongson_2e", FALSE, NN(I_loongson_2e)),
N (64, 64, bfd_mach_mips_loongson_2f, "mips:loongson_2f", FALSE, 0)
1999-05-03 09:29:11 +02:00
};
/* The default architecture is mips:3000, but with a machine number of
zero. This lets the linker distinguish between a default setting
of mips, and an explicit setting of mips:3000. */
const bfd_arch_info_type bfd_mips_arch =
N (32, 32, 0, "mips", TRUE, &arch_info_struct[0]);