diff -Burb gcc-3.2.3/gcc/config/mips/mips.h gcc/gcc/config/mips/mips.h --- gcc-3.2.3/gcc/config/mips/mips.h 2003-02-12 18:25:48.000000000 +0300 +++ gcc/gcc/config/mips/mips.h 2004-04-01 00:46:50.000000000 +0400 @@ -232,6 +232,7 @@ consts in rodata */ #define MASK_NO_FUSED_MADD 0x01000000 /* Don't generate floating point multiply-add operations. */ +#define MASK_NO_4710A0 0x02000000 /* WA_BCM4710A0: Don't work-around BCM4710A0 CPU bugs */ /* Debug switches, not documented */ #define MASK_DEBUG 0 /* unused */ @@ -327,6 +328,13 @@ #define TARGET_NO_CHECK_ZERO_DIV (target_flags & MASK_NO_CHECK_ZERO_DIV) #define TARGET_CHECK_RANGE_DIV (target_flags & MASK_CHECK_RANGE_DIV) +/* WA_BCM4710A0 */ +#if BCM4710A0 +#define TARGET_4710A0 !(target_flags & MASK_NO_4710A0) +#else +#define TARGET_4710A0 0 +#endif + /* This is true if we must enable the assembly language file switching code. */ @@ -460,6 +468,12 @@ N_("Work around early 4300 hardware bug")}, \ {"no-fix4300", -MASK_4300_MUL_FIX, \ N_("Don't work around early 4300 hardware bug")}, \ + {"4710a0", -MASK_NO_4710A0, \ + N_("Work around BCM4710A0 hardware bugs")}, \ + {"no-4710a0", MASK_NO_4710A0, \ + N_("Don't work around BCM4710A0 hardware bugs")}, \ + {"4710a0kern", MASK_NO_4710A0, \ + N_("Don't work around BCM4710A0 hardware bugs")}, \ {"3900", 0, \ N_("Optimize for 3900")}, \ {"4650", 0, \ @@ -636,6 +650,7 @@ /* Disable branchlikely for tx39 until compare rewrite. They haven't been generated up to this point. */ #define ISA_HAS_BRANCHLIKELY (mips_isa != 1 \ + && !TARGET_4710A0 \ /* || TARGET_MIPS3900 */) /* ISA has the conditional move instructions introduced in mips4. */ @@ -847,7 +862,7 @@ /* GAS_ASM_SPEC is passed when using gas, rather than the MIPS assembler. */ -#define GAS_ASM_SPEC "%{march=*} %{mtune=*} %{mcpu=*} %{m4650} %{mmad:-m4650} %{m3900} %{v} %{mgp32} %{mgp64} %(abi_gas_asm_spec) %{mabi=32:%{!mips*:-mips1}}" +#define GAS_ASM_SPEC "%{march=*} %{mtune=*} %{mcpu=*} %{m4650} %{m4710a0} %{mno-4710a0:-no-m4710a0} %{m4710a0kern} %{mmad:-m4650} %{m3900} %{v} %{mgp32} %{mgp64} %(abi_gas_asm_spec) %{mabi=32:%{!mips*:-mips1}}" extern int mips_abi; diff -Burb gcc-3.2.3/gcc/config.gcc gcc/gcc/config.gcc --- gcc-3.2.3/gcc/config.gcc 2003-02-28 21:38:19.000000000 +0300 +++ gcc/gcc/config.gcc 2004-04-01 00:46:44.000000000 +0400 @@ -2216,7 +2216,7 @@ # fi ;; mips-wrs-vxworks) - tm_file="mips/elf.h mips/vxworks.h" + tm_file="mips/elf.h mips/vxmips.h" tmake_file=mips/t-ecoff gas=yes gnu_ld=yes diff -Burb gcc-3.2.3/gcc/config.in gcc/gcc/config.in --- gcc-3.2.3/gcc/config.in 2003-04-22 10:56:18.000000000 +0400 +++ gcc/gcc/config.in 2004-04-01 00:46:44.000000000 +0400 @@ -572,3 +572,6 @@ #define const #endif #endif + +/* Define to 1 for BCM4710A0 compiler workarounds */ +#undef BCM4710A0 diff -Burb gcc-3.2.3/gcc/configure.in gcc/gcc/configure.in --- gcc-3.2.3/gcc/configure.in 2003-02-04 03:17:41.000000000 +0300 +++ gcc/gcc/configure.in 2004-04-01 00:46:44.000000000 +0400 @@ -136,6 +136,13 @@ elf="$with_elf", elf=no) +# With BCM4710A0 compiler workarounds +AC_ARG_WITH(bcm4710a0, +[ --with-bcm4710a0 enable BCM4710A0 compiler workarounds], +[case "${withval}" in + yes) AC_DEFINE(BCM4710A0, 1, [BCM4710A0 support?]) ;; +esac]) + # Specify the local prefix local_prefix= AC_ARG_WITH(local-prefix, diff -Burb gcc-3.2.3/gcc/version.c gcc/gcc/version.c --- gcc-3.2.3/gcc/version.c 2003-04-22 10:16:03.000000000 +0400 +++ gcc/gcc/version.c 2004-04-01 00:46:45.000000000 +0400 @@ -1,4 +1,4 @@ #include "ansidecl.h" #include "version.h" -const char *const version_string = "3.2.3"; +const char *const version_string = "3.2.3 with Broadcom modifications"; diff -BurbN gcc-3.2.3/gcc/config/mips/vxmips.h gcc/gcc/config/mips/vxmips.h --- gcc-3.2.3/gcc/config/mips/vxmips.h 1970-01-01 03:00:00.000000000 +0300 +++ gcc/gcc/config/mips/vxmips.h 2004-04-01 00:46:50.000000000 +0400 @@ -0,0 +1,44 @@ +/* Definitions of target machine for GNU compiler. VxWorks MIPS version. + Copyright (C) 1996,2001 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC 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, or (at your option) +any later version. + +GNU CC 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 GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + + +#undef SUBTARGET_CPP_SPEC +#define SUBTARGET_CPP_SPEC "%{!DCPU=*: \ + %{!mips1: %{!mips2: %{!mips3: %{!mips4: -DCPU=MIPS32}}}} \ + %{mips1: -DCPU=MIPS32} \ + %{mips2: -DCPU=MIPS32} \ + %{mips3: -DCPU=MIPS64} \ + %{mips4: -DCPU=MIPS64}} -D__CPU__=CPU" + +#undef CPP_PREDEFINES +#define CPP_PREDEFINES "-D__vxworks -D__mips__ -D__MIPSEB__ -Asystem(vxworks)" + +/* There is no OS support for this, yet. */ +#undef MIPS_DEFAULT_GVALUE +#define MIPS_DEFAULT_GVALUE 0 + +/* VxWorks uses object files, not loadable images. make linker just + combine objects. */ +#undef LINK_SPEC +#define LINK_SPEC "-r" + + /* Use GNU soft FP naming conventions */ +#undef INIT_SUBTARGET_OPTABS +#define INIT_SUBTARGET_OPTABS