2003-01-02 21:31:32 +00:00
|
|
|
# Copyright 2003 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This file 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 2 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
|
2005-05-12 07:32:09 +00:00
|
|
|
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
2003-01-02 21:31:32 +00:00
|
|
|
|
|
|
|
if {![istarget mips*-*-*] || ![is_elf_format]} {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2003-05-07 05:08:02 +00:00
|
|
|
global ldemul
|
|
|
|
if {[istarget mips*-*-irix6*]} {
|
2003-06-28 22:12:26 +00:00
|
|
|
set ldemul "-melf32bsmip"
|
2003-05-07 05:08:02 +00:00
|
|
|
} elseif {[istarget mips*el-*-linux*]} {
|
|
|
|
set ldemul "-melf32ltsmip"
|
|
|
|
} elseif {[istarget mips*-*-linux*]} {
|
|
|
|
set ldemul "-melf32btsmip"
|
|
|
|
} else {
|
|
|
|
set ldemul ""
|
|
|
|
}
|
|
|
|
|
2003-01-02 21:31:32 +00:00
|
|
|
# Assemble jr.s using each of the argument lists in ARGLIST. Return the
|
|
|
|
# list of object files on success and an empty list on failure.
|
|
|
|
proc assemble_for_flags {arglist} {
|
|
|
|
global as srcdir subdir
|
|
|
|
|
|
|
|
set objs {}
|
|
|
|
set index 1
|
|
|
|
|
|
|
|
foreach args $arglist {
|
|
|
|
set obj "tmpdir/mips-flags-${index}.o"
|
|
|
|
if {![ld_assemble $as "$args $srcdir/$subdir/jr.s" $obj]} {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
lappend objs $obj
|
|
|
|
incr index
|
|
|
|
}
|
|
|
|
return $objs
|
|
|
|
}
|
|
|
|
|
|
|
|
# Assemble a file using each set of arguments in ARGLIST. Check that
|
|
|
|
# the objects can be linked together and that the readelf output
|
|
|
|
# includes each flag named in FLAGS.
|
|
|
|
proc good_combination {arglist flags} {
|
2003-05-07 05:08:02 +00:00
|
|
|
global ld ldemul READELF
|
2003-01-02 21:31:32 +00:00
|
|
|
|
|
|
|
set finalobj "tmpdir/mips-flags.o"
|
|
|
|
set testname "MIPS compatible objects: $arglist"
|
|
|
|
set objs [assemble_for_flags $arglist]
|
|
|
|
|
|
|
|
if {$objs == ""} {
|
|
|
|
unresolved $testname
|
2003-05-07 05:08:02 +00:00
|
|
|
} elseif {![ld_simple_link "$ld $ldemul" $finalobj "-r $objs"]} {
|
2003-01-02 21:31:32 +00:00
|
|
|
fail $testname
|
|
|
|
} else {
|
|
|
|
catch "exec $READELF --headers $finalobj" output
|
|
|
|
if {![regexp "Flags: *(\[^\n\]*)" $output full gotflags]} {
|
|
|
|
unresolved $testname
|
|
|
|
} else {
|
|
|
|
set failed 0
|
|
|
|
|
|
|
|
# GOTFLAGS is a list of flags separated by ", ".
|
|
|
|
# Convert it to a tcl list.
|
|
|
|
regsub -all ", " $gotflags "," gotflags
|
|
|
|
set gotflags [split $gotflags ","]
|
|
|
|
|
|
|
|
foreach flag $flags {
|
|
|
|
if {[lsearch -exact $gotflags $flag] < 0} {
|
|
|
|
set failed 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if {$failed} {
|
|
|
|
fail $testname
|
|
|
|
} else {
|
|
|
|
pass $testname
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Like good_combination, but check that the objects can't be linked
|
|
|
|
# together successfully and that the output includes MESSAGE.
|
|
|
|
proc bad_combination {arglist message} {
|
2003-05-07 05:08:02 +00:00
|
|
|
global link_output ld ldemul
|
2003-01-02 21:31:32 +00:00
|
|
|
|
|
|
|
set finalobj "tmpdir/mips-flags.o"
|
|
|
|
set testname "MIPS incompatible objects: $arglist"
|
|
|
|
set objs [assemble_for_flags $arglist]
|
|
|
|
|
|
|
|
if {$objs == ""} {
|
|
|
|
unresolved $testname
|
2003-05-07 05:08:02 +00:00
|
|
|
} elseif {[ld_simple_link "$ld $ldemul" $finalobj "-r $objs"]
|
2003-01-02 21:31:32 +00:00
|
|
|
|| [string first $message $link_output] < 0} {
|
|
|
|
fail $testname
|
|
|
|
} else {
|
|
|
|
pass $testname
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Routines to check for various kinds of incompatibility.
|
|
|
|
|
|
|
|
proc abi_conflict {arglist firstabi secondabi} {
|
|
|
|
bad_combination $arglist \
|
|
|
|
"linking $secondabi module with previous $firstabi modules"
|
|
|
|
}
|
|
|
|
|
|
|
|
proc isa_conflict {arglist firstisa secondisa} {
|
|
|
|
bad_combination $arglist \
|
|
|
|
"linking mips:$secondisa module with previous mips:$firstisa modules"
|
|
|
|
}
|
|
|
|
|
|
|
|
proc regsize_conflict {arglist} {
|
|
|
|
bad_combination $arglist \
|
|
|
|
"linking 32-bit code with 64-bit code"
|
|
|
|
}
|
|
|
|
|
|
|
|
abi_conflict { "-mabi=eabi -mgp32" "-mips4 -mabi=32" } EABI32 O32
|
|
|
|
abi_conflict { "-mips4 -mabi=o64" "-mips3 -mabi=eabi" } O64 EABI64
|
|
|
|
|
2003-05-07 05:08:02 +00:00
|
|
|
isa_conflict { "-march=vr5500 -32" "-march=sb1 -32" } 5500 sb1
|
|
|
|
isa_conflict { "-march=vr5400 -32" "-march=4120 -32" } 5400 4120
|
|
|
|
isa_conflict { "-march=r3900 -32" "-march=r6000 -32" } 3900 6000
|
|
|
|
isa_conflict { "-march=r4010 -32" "-march=r4650 -32" } 4010 4650
|
|
|
|
isa_conflict { "-mips3 -mgp32 -32" "-mips32 -32" } 4000 isa32
|
|
|
|
isa_conflict { "-march=sb1 -mgp32 -32" "-mips32r2 -32" } sb1 isa32r2
|
[ 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 16:17:15 +00:00
|
|
|
isa_conflict { "-march=sb1 -32" "-mips64r2 -32" } sb1 isa64r2
|
2003-01-02 21:31:32 +00:00
|
|
|
|
2003-05-07 05:08:02 +00:00
|
|
|
regsize_conflict { "-mips4 -mgp64 -mabi=o64" "-mips2 -32" }
|
2003-01-02 21:31:32 +00:00
|
|
|
regsize_conflict { "-mips4 -mabi=o64" "-mips4 -mabi=32" }
|
2003-01-03 11:04:26 +00:00
|
|
|
regsize_conflict { "-mips4 -mabi=eabi -mgp32" "-mips4 -mabi=eabi -mgp64" }
|
2003-05-07 05:08:02 +00:00
|
|
|
regsize_conflict { "-march=vr5000 -mgp64 -mabi=o64" "-march=vr5000 -mgp32 -32" }
|
|
|
|
regsize_conflict { "-mips32 -32" "-mips64 -mabi=o64" }
|
|
|
|
regsize_conflict { "-mips32r2 -32" "-mips64 -mabi=o64" }
|
[ 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 16:17:15 +00:00
|
|
|
regsize_conflict { "-mips32r2 -32" "-mips64r2 -mabi=o64" }
|
2003-05-07 05:08:02 +00:00
|
|
|
|
|
|
|
good_combination { "-mips4 -mgp32 -32" "-mips2 -32" } { mips4 o32 }
|
|
|
|
good_combination { "-mips4 -mabi=32" "-mips2 -32" } { mips4 o32 }
|
|
|
|
good_combination { "-mips2 -32" "-mips4 -mabi=32" } { mips4 o32 }
|
|
|
|
good_combination { "-mips2 -mabi=eabi" "-mips4 -mabi=eabi -mgp32" } { mips4 eabi32 }
|
|
|
|
good_combination { "-mips2 -32" "-mips32 -32" "-mips32r2 -32" } { mips32r2 }
|
|
|
|
good_combination { "-mips1 -32" "-mips32r2 -32" "-mips32 -32" } { mips32r2 }
|
|
|
|
|
|
|
|
good_combination { "-march=vr4100 -32" "-march=vr4120 -32" } { 4120 }
|
|
|
|
good_combination { "-march=vr5400 -32" "-march=vr5500 -32" "-mips4 -32" } { 5500 }
|
|
|
|
good_combination { "-mips3 -32" "-mips4 -32" "-march=sb1 -32" "-mips5 -32" } { sb1 }
|
|
|
|
good_combination { "-mips1 -32" "-march=3900 -32" } { 3900 }
|
[ 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 16:17:15 +00:00
|
|
|
good_combination { "-mips3 -32" "-mips64r2 -32" "-mips64 -32" } { mips64r2 }
|
2003-01-02 21:31:32 +00:00
|
|
|
|
|
|
|
good_combination { "-march=vr4120 -mabi=32" "-mips3 -mabi=32" } { 4120 o32 }
|
2003-05-07 05:08:02 +00:00
|
|
|
good_combination { "-march=sb1 -mgp32 -32" "-march=4000 -mgp32 -32" } { sb1 o32 }
|