This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Canonicalise VR5500 branch-likely check
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 07 May 2004 16:07:56 +0100
- Subject: [committed] Canonicalise VR5500 branch-likely check
Been meaning to do this for a while, but cgd's recent SB-1 patch
finally shamed me into it...
Branch-likely instructions aren't a win on the VR5500, so they're
currently disabled by:
#define ISA_HAS_BRANCHLIKELY (!ISA_MIPS1 \
&& !TARGET_MIPS5500)
But that's daft: the target _does_ have branch likely instructions.
The correct thing to do is key off TUNE_MIPS5500 and disable
GENERATE_BRANCH_LIKELY rather than ISA_HAS_BRANCHLIKELY.
ISA_HAS_CONDMOVE suffers from a similar problem, but there's no
GENERATE_CONDMOVE yet, so I'm afraid that's still on the to-do list.
Tested on mips64vrel-elf, mips-sgi-irix6.5 and mips64el-linux-gnu.
Applied to head.
Richard
* config/mips/mips.h (ISA_HAS_BRANCHLIKELY): Remove TARGET_MIPS5500.
* config/mips/mips.c (override_options): Disable branch likely
instructions if TUNE_MIPS5500.
Index: config/mips/mips.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.h,v
retrieving revision 1.340
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.340 mips.h
--- config/mips/mips.h 6 May 2004 15:27:17 -0000 1.340
+++ config/mips/mips.h 6 May 2004 20:21:15 -0000
@@ -858,8 +858,7 @@ #define ISA_HAS_64BIT_REGS (ISA_MIPS3
/* ISA has branch likely instructions (eg. mips2). */
/* Disable branchlikely for tx39 until compare rewrite. They haven't
been generated up to this point. */
-#define ISA_HAS_BRANCHLIKELY (!ISA_MIPS1 \
- && !TARGET_MIPS5500)
+#define ISA_HAS_BRANCHLIKELY (!ISA_MIPS1)
/* ISA has the conditional move instructions introduced in mips4. */
#define ISA_HAS_CONDMOVE ((ISA_MIPS4 \
Index: config/mips/mips.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.411
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.411 mips.c
--- config/mips/mips.c 6 May 2004 15:27:17 -0000 1.411
+++ config/mips/mips.c 6 May 2004 20:21:17 -0000
@@ -4744,7 +4759,7 @@ override_options (void)
-mbranch-likely. */
if (ISA_HAS_BRANCHLIKELY
&& !(ISA_MIPS32 || ISA_MIPS32R2 || ISA_MIPS64)
- && !(TUNE_SB1))
+ && !(TUNE_MIPS5500 || TUNE_SB1))
target_flags |= MASK_BRANCHLIKELY;
else
target_flags &= ~MASK_BRANCHLIKELY;