public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [committed] MIPS16/GAS: Rename the LONG_BRANCH relaxation flag
@ 2017-04-27 11:24 Maciej W. Rozycki
  0 siblings, 0 replies; only message in thread
From: Maciej W. Rozycki @ 2017-04-27 11:24 UTC (permalink / raw)
  To: binutils

Following commit 177b4a6ad004 ("infinite loop in mips16 assembler 
relaxation"), <https://sourceware.org/ml/binutils/2002-03/msg00345.html> 
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.
---
binutils-mips16-gas-relax-always-extended.diff
Index: binutils/gas/config/tc-mips.c
===================================================================
--- binutils.orig/gas/config/tc-mips.c	2017-04-27 00:55:57.000000000 +0100
+++ binutils/gas/config/tc-mips.c	2017-04-27 00:58:05.626309837 +0100
@@ -1146,9 +1146,9 @@ static bfd_boolean mips_ignore_branch_is
 #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, asec
       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, asec
       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, asec
 	  && ! 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;
 	}
     }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-27 11:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27 11:24 [committed] MIPS16/GAS: Rename the LONG_BRANCH relaxation flag Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).