From 1425c41dcd68350d9be9670910c547cc7ab91e0e Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Thu, 27 Apr 2017 02:13:21 +0100 Subject: [PATCH] MIPS16/GAS: Rename the LONG_BRANCH relaxation flag Following commit 177b4a6ad004 ("infinite loop in mips16 assembler relaxation"), the LONG_BRANCH flag used in MIPS16 relaxation has lost its use for branches. Complement commit 88a7ef168927 ("MIPS16/GAS: Restore unsupported relocation diagnostics") then, which has removed the remains of code deactivated by the former commit, and rename the flag to ALWAYS_EXTENDED, more accurately reflecting its current use to select the extended form of PC-relative ADDIU, DADDIU, LD and LW instructions. gas/ * config/tc-mips.c (RELAX_MIPS16_LONG_BRANCH): Rename to... (RELAX_MIPS16_ALWAYS_EXTENDED): ... this. (RELAX_MIPS16_MARK_LONG_BRANCH): Rename to... (RELAX_MIPS16_MARK_ALWAYS_EXTENDED): ... this. (RELAX_MIPS16_CLEAR_LONG_BRANCH): Rename to... (RELAX_MIPS16_CLEAR_ALWAYS_EXTENDED): ... this. (mips16_extended_frag): Adjust accordingly. --- gas/ChangeLog | 10 ++++++++++ gas/config/tc-mips.c | 12 ++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index d88f003a2ca..a980370bcee 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,13 @@ +2017-04-27 Maciej W. Rozycki + + * config/tc-mips.c (RELAX_MIPS16_LONG_BRANCH): Rename to... + (RELAX_MIPS16_ALWAYS_EXTENDED): ... this. + (RELAX_MIPS16_MARK_LONG_BRANCH): Rename to... + (RELAX_MIPS16_MARK_ALWAYS_EXTENDED): ... this. + (RELAX_MIPS16_CLEAR_LONG_BRANCH): Rename to... + (RELAX_MIPS16_CLEAR_ALWAYS_EXTENDED): ... this. + (mips16_extended_frag): Adjust accordingly. + 2017-04-27 Alan Modra * symbols.c (S_FORCE_RELOC): Separate section and symbol tests. diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 1df1f86ebea..a18dbccd43c 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -1146,9 +1146,9 @@ static bfd_boolean mips_ignore_branch_isa; #define RELAX_MIPS16_EXTENDED(i) (((i) & 0x1000) != 0) #define RELAX_MIPS16_MARK_EXTENDED(i) ((i) | 0x1000) #define RELAX_MIPS16_CLEAR_EXTENDED(i) ((i) &~ 0x1000) -#define RELAX_MIPS16_LONG_BRANCH(i) (((i) & 0x2000) != 0) -#define RELAX_MIPS16_MARK_LONG_BRANCH(i) ((i) | 0x2000) -#define RELAX_MIPS16_CLEAR_LONG_BRANCH(i) ((i) &~ 0x2000) +#define RELAX_MIPS16_ALWAYS_EXTENDED(i) (((i) & 0x2000) != 0) +#define RELAX_MIPS16_MARK_ALWAYS_EXTENDED(i) ((i) | 0x2000) +#define RELAX_MIPS16_CLEAR_ALWAYS_EXTENDED(i) ((i) & ~0x2000) /* For microMIPS code, we use relaxation similar to one we use for MIPS16 code. Some instructions that take immediate values support @@ -17216,7 +17216,7 @@ mips16_extended_frag (fragS *fragp, asection *sec, long stretch) addressT addr; offsetT maxtiny; - if (RELAX_MIPS16_LONG_BRANCH (fragp->fr_subtype)) + if (RELAX_MIPS16_ALWAYS_EXTENDED (fragp->fr_subtype)) return 1; pcrel_op = (const struct mips_pcrel_operand *) operand; @@ -17289,7 +17289,7 @@ mips16_extended_frag (fragS *fragp, asection *sec, long stretch) if ((val & ((1 << operand->shift) - 1)) != 0) { fragp->fr_subtype = - RELAX_MIPS16_MARK_LONG_BRANCH (fragp->fr_subtype); + RELAX_MIPS16_MARK_ALWAYS_EXTENDED (fragp->fr_subtype); return 1; } @@ -17310,7 +17310,7 @@ mips16_extended_frag (fragS *fragp, asection *sec, long stretch) && ! RELAX_MIPS16_EXTENDED (fragp->fr_subtype)) { fragp->fr_subtype = - RELAX_MIPS16_MARK_LONG_BRANCH (fragp->fr_subtype); + RELAX_MIPS16_MARK_ALWAYS_EXTENDED (fragp->fr_subtype); return 1; } } -- 2.30.2