This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Rename -mfix-vr4122-bugs to -mfix-vr4120.


I'd like to change the name of -mfix-vr4122-bugs to -mfix-vr4120.  Reasons:

  (1) Some of the workarounds selected by -mfix-vr4122-bugs also apply to the
      VR4181 (which, like the VR4122, uses a VR4120 core).

  (2) VR4120 code is selected by -march=vr4120, not -march=vr4122.

  (3) It's more consistent with the options recently added to GCC,
      e.g. -mfix-sb1, -mfix-r4000.

  (4) There are some errata that (AIUI) only apply to the version of the
      VR4120 that's used in the VR4181.  "Some time soon", I'll be submitting
      a patch to cover these errata too.

I think the only obvious argument against is backwards compability.
However, as the documentation says, the option is only really intended
for use with the equivalen gcc option, and since that option was only
recently added to FSF HEAD, there shouldn't really be much problem.

Tested on mips{,64}{,el}-elf, etc.  OK to install?  If so, I have a
follow-on patch to change the gcc side.

Richard


gas/
	* doc/c-mips.texi (-m{no-,}fix-vr4120): Renamed from
	-{no-}mfix-vr4122-bugs.
	* config/tc-mips.c (mips_fix_vr4120): Renamed from mips_fix_4122_bugs.
	(append_insn, mips_emit_delays): Update accordingly.
	(OPTION_FIX_VR4120, OPTION_NO_FIX_VR4120): Renamed from *VR4122.
	(md_longopts): Change -{no-,}mfix-vr4122-bugs to -m{no-,}fix-vr4120.
	(md_parse_option): Update after above changes.
	(md_show_usage): Add -mfix-vr4120.

gas/testsuite/
	* gas/mips/vr4122.[sd]: Change option to -mfix-vr4120.

Index: gas/doc/c-mips.texi
===================================================================
RCS file: /cvs/src/src/gas/doc/c-mips.texi,v
retrieving revision 1.30
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.30 c-mips.texi
--- gas/doc/c-mips.texi	9 Jan 2004 02:34:04 -0000	1.30
+++ gas/doc/c-mips.texi	13 Apr 2004 11:57:10 -0000
@@ -122,11 +122,11 @@ This tells the assembler to accept MDMX 
 Cause nops to be inserted if the read of the destination register
 of an mfhi or mflo instruction occurs in the following two instructions.
 
-@item -mfix-vr4122-bugs
-@itemx -no-mfix-vr4122-bugs
-Insert @samp{nop} instructions to avoid errors in certain versions of
-the vr4122 core.  This option is intended to be used on GCC-generated
-code: it is not designed to catch errors in hand-written assembler code.
+@item -mfix-vr4120
+@itemx -no-mfix-vr4120
+Insert nops to work around certain VR4120 errata.  This option is
+intended to be used on GCC-generated code: it is not designed to catch
+all problems in hand-written assembler code.
 
 @item -m4010
 @itemx -no-m4010
Index: gas/config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.254
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.254 tc-mips.c
--- gas/config/tc-mips.c	26 Feb 2004 21:27:32 -0000	1.254
+++ gas/config/tc-mips.c	13 Apr 2004 11:57:13 -0000
@@ -622,7 +622,7 @@ static const unsigned int mips16_to_32_r
   16, 17, 2, 3, 4, 5, 6, 7
 };
 
-static int mips_fix_4122_bugs;
+static int mips_fix_vr4120;
 
 /* We don't relax branches by default, since this causes us to expand
    `la .l2 - .l1' if there's a branch between .l1 and .l2, because we
@@ -1863,11 +1863,11 @@ #define emit_nop()					\
       if (prev_prev_nop && nops == 0)
 	++nops;
 
-      if (mips_fix_4122_bugs && prev_insn.insn_mo->name)
+      if (mips_fix_vr4120 && prev_insn.insn_mo->name)
 	{
 	  /* We're out of bits in pinfo, so we must resort to string
 	     ops here.  Shortcuts are selected based on opcodes being
-	     limited to the VR4122 instruction set.  */
+	     limited to the VR4120 instruction set.  */
 	  int min_nops = 0;
 	  const char *pn = prev_insn.insn_mo->name;
 	  const char *tn = ip->insn_mo->name;
@@ -2841,7 +2841,7 @@ mips_emit_delays (bfd_boolean insns)
 	    ++nops;
 	}
 
-      if (mips_fix_4122_bugs && prev_insn.insn_mo->name)
+      if (mips_fix_vr4120 && prev_insn.insn_mo->name)
 	{
 	  int min_nops = 0;
 	  const char *pn = prev_insn.insn_mo->name;
@@ -10254,10 +10254,10 @@ #define OPTION_M7000_HILO_FIX (OPTION_FI
 #define OPTION_MNO_7000_HILO_FIX (OPTION_FIX_BASE + 1)
   {"no-fix-7000", no_argument, NULL, OPTION_MNO_7000_HILO_FIX},
   {"mno-fix7000", no_argument, NULL, OPTION_MNO_7000_HILO_FIX},
-#define OPTION_FIX_VR4122 (OPTION_FIX_BASE + 2)
-#define OPTION_NO_FIX_VR4122 (OPTION_FIX_BASE + 3)
-  {"mfix-vr4122-bugs",    no_argument, NULL, OPTION_FIX_VR4122},
-  {"no-mfix-vr4122-bugs", no_argument, NULL, OPTION_NO_FIX_VR4122},
+#define OPTION_FIX_VR4120 (OPTION_FIX_BASE + 2)
+#define OPTION_NO_FIX_VR4120 (OPTION_FIX_BASE + 3)
+  {"mfix-vr4120",    no_argument, NULL, OPTION_FIX_VR4120},
+  {"mno-fix-vr4120", no_argument, NULL, OPTION_NO_FIX_VR4120},
 
   /* Miscellaneous options.  */
 #define OPTION_MISC_BASE (OPTION_FIX_BASE + 4)
@@ -10499,12 +10499,12 @@ md_parse_option (int c, char *arg)
       g_switch_value = 0x7fffffff;
       break;
 
-    case OPTION_FIX_VR4122:
-      mips_fix_4122_bugs = 1;
+    case OPTION_FIX_VR4120:
+      mips_fix_vr4120 = 1;
       break;
 
-    case OPTION_NO_FIX_VR4122:
-      mips_fix_4122_bugs = 0;
+    case OPTION_NO_FIX_VR4120:
+      mips_fix_vr4120 = 0;
       break;
 
     case OPTION_RELAX_BRANCH:
@@ -14373,6 +14373,7 @@ MIPS options:\n\
 -mips16			generate mips16 instructions\n\
 -no-mips16		do not generate mips16 instructions\n"));
   fprintf (stream, _("\
+-mfix-vr4120		work around certain VR4120 errata\n\
 -mgp32			use 32-bit GPRs, regardless of the chosen ISA\n\
 -mfp32			use 32-bit FPRs, regardless of the chosen ISA\n\
 -O0			remove unneeded NOPs, do not swap branches\n\
Index: gas/testsuite/gas/mips/vr4122.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/mips/vr4122.d,v
retrieving revision 1.2
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.2 vr4122.d
--- gas/testsuite/gas/mips/vr4122.d	7 May 2003 05:08:20 -0000	1.2
+++ gas/testsuite/gas/mips/vr4122.d	13 Apr 2004 11:57:13 -0000
@@ -1,6 +1,6 @@
 #objdump: -dz --prefix-addresses -m mips:4120
-#as: -32 -march=vr4120 -mtune=vr4120 -mfix-vr4122-bugs
-#name: MIPS vr4122 workarounds
+#as: -32 -march=vr4120 -mfix-vr4120
+#name: MIPS vr4120 workarounds
 
 .*: +file format .*mips.*
 
Index: gas/testsuite/gas/mips/vr4122.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/mips/vr4122.s,v
retrieving revision 1.1
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.1 vr4122.s
--- gas/testsuite/gas/mips/vr4122.s	30 Sep 2002 12:04:54 -0000	1.1
+++ gas/testsuite/gas/mips/vr4122.s	13 Apr 2004 11:57:13 -0000
@@ -1,4 +1,4 @@
-# Test that certain vr4122 hardware bugs are worked around.
+# Test workarounds selected by -mfix-vr4120.
 # Note that we only work around bugs gcc may generate.
 
 r21:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]