Commit Graph

130 Commits

Author SHA1 Message Date
Thiemo Seufer 438c16b875 * config/tc-mips.c (macro_build_jalr): New Function.
(md_begin): NewABI uses big GOTs.
	(macro_build): Recognize BFD_RELOC_MIPS_GOT_DISP,
	BFD_RELOC_MIPS_GOT_PAGE, BFD_RELOC_MIPS_GOT_OFST as valid.
	(load_address): Add some NewABI PIC support.
	(macro): Likewise.
	(md_apply_fix): Special handling for BFD_RELOC_MIPS_JALR.
	(tc_gen_reloc): Don't encode NewABI vtables in REL relocations.
2002-05-30 23:32:47 +00:00
Thiemo Seufer f7ea7ef2ee * config/tc-mips.c (load_address): Use mips_gp_register instead
of hardcoded value. Remove dbl parameter, use HAVE_32BIT_ADDRESSES
	instead.
	(macro): Use mips_gp_register instead of hardcoded value.
2002-05-30 22:29:20 +00:00
Thiemo Seufer def2e0dd82 * config/tc-mips.c (mips_gprel_offset): New variable.
(s_gpvalue): Use it.
2002-05-30 21:06:14 +00:00
Thiemo Seufer c99147661e * config/tc-mips.c: Replace GP in comments by $gp.
(mips_big_got): Initialize.
	(mips_trap): Initialize.
	(load_address): Use mips_gp_register instead of hardcoded value.
	Remove dbl parameter, use HAVE_32BIT_ADDRESSES instead.
	(macro): Use mips_gp_register instead of hardcoded value.
	(macro2): Change load_address calls.
	(md_pcrel_from): Comment formatting.
	(s_cpload): Use mips_gp_register instead of hardcoded value.
	(s_cprestore): Likewise. Comment formatting.
	(s_gpword): Fix data type.
	(s_cpadd): Use mips_gp_register instead of hardcoded value.
	(nopic_need_relax): Replace GP in comments by $gp.
	(mips_elf_final_processing): Better comment.
2002-05-28 19:23:09 +00:00
Thiemo Seufer f9419b056f * config/tc-mips.c (mips_emit_delays): Replace magic constant for RA
by the define. Remove superfluous check of mips_opts.mips16.
	(append_insn): Likewise. Canonicalize variable increments.
	(macro_build): Canonicalize variable increments.
	(macro_build_lui): Likewise.
	(load_register): Likewise.
	(load_address): Move pointer initialization.
	(macro): Move pointer to a more local scope. Canonicalize variable
	increments. Better comments. Replace magic constant for RA by the
	define.
	(macro2): Replace magic constant for RA by the define. Canonicalize
	variable increments.
	(mips_ip): Canonicalize variable increments.
	(mips16_ip): Replace magic constant for RA by the define.
	(my_getSmallParser): Canonicalize variable increments/decrements.
	(my_getPercentOp): Likewise.
	(my_getSmallExpression): Likewise.
	(s_align): Likewise.
	(s_mipsset): Likewise.
	(s_cpsetup): Likewise.
	(s_insn): Remove superfluous check of mips_opts.mips16.
	(s_mips_stab): Likewise.
	(mips_handle_align): Canonicalize variable increments.
	(s_mips_ent): Likewise.
	(s_mips_end): Add comment.
2002-05-26 18:46:37 +00:00
Thiemo Seufer c90bbe5b9e * config/tc-mips.c (macro): Relax warning, it's toot strict for
embedded-PIC.
2002-05-22 00:13:13 +00:00
Thiemo Seufer 771c7ce4bc ? gas/testsuite/gas/mips/rol64.d
? gas/testsuite/gas/mips/rol64.s
Index: gas/ChangeLog
===================================================================
RCS file: /cvs/src/src/gas/ChangeLog,v
retrieving revision 1.1334
diff -u -p -r1.1334 ChangeLog
--- gas/ChangeLog	21 May 2002 20:01:51 -0000	1.1334
+++ gas/ChangeLog	21 May 2002 23:32:51 -0000
@@ -1,3 +1,8 @@
+2002-05-22  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+	* config/tc-mips.c (macro2): Add 64 bit drol, dror macros.
+	Optimize the rotate by zero case.
+
 2002-05-21  Nick Clifton  <nickc@cambridge.redhat.com>

 	* configure.in: Remove accidental enabling of bfd_gas=yes for
Index: gas/config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.123
diff -u -p -r1.123 tc-mips.c
--- gas/config/tc-mips.c	14 May 2002 23:35:59 -0000	1.123
+++ gas/config/tc-mips.c	21 May 2002 23:32:52 -0000
@@ -6686,6 +6686,17 @@ macro2 (ip)
       --mips_opts.noreorder;
       break;

+    case M_DROL:
+      macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "dsubu",
+		   "d,v,t", AT, 0, treg);
+      macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "dsrlv",
+		   "d,t,s", AT, sreg, AT);
+      macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "dsllv",
+		   "d,t,s", dreg, sreg, treg);
+      macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "or",
+		   "d,v,t", dreg, dreg, AT);
+      break;
+
     case M_ROL:
       macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "subu",
 		   "d,v,t", AT, 0, treg);
@@ -6697,15 +6708,55 @@ macro2 (ip)
 		   "d,v,t", dreg, dreg, AT);
       break;

+    case M_DROL_I:
+      {
+	unsigned int rot;
+	char *l, *r;
+
+	if (imm_expr.X_op != O_constant)
+	  as_bad (_("rotate count too large"));
+	rot = imm_expr.X_add_number & 0x3f;
+	if (! rot)
+	  break;
+	l = (rot < 0x20) ? "dsll" : "dsll32";
+	r = ((0x40 - rot) < 0x20) ? "dsrl" : "dsrl32";
+	rot &= 0x1f;
+	macro_build ((char *) NULL, &icnt, (expressionS *) NULL, l,
+		     "d,w,<", AT, sreg, rot);
+	macro_build ((char *) NULL, &icnt, (expressionS *) NULL, r,
+		     "d,w,<", dreg, sreg, (0x20 - rot) & 0x1f);
+	macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "or",
+		     "d,v,t", dreg, dreg, AT);
+      }
+      break;
+
     case M_ROL_I:
-      if (imm_expr.X_op != O_constant)
-	as_bad (_("rotate count too large"));
-      macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "sll", "d,w,<",
-		   AT, sreg, (int) (imm_expr.X_add_number & 0x1f));
-      macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "srl", "d,w,<",
-		   dreg, sreg, (int) ((0 - imm_expr.X_add_number) & 0x1f));
-      macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "or", "d,v,t",
-		   dreg, dreg, AT);
+      {
+	unsigned int rot;
+
+	if (imm_expr.X_op != O_constant)
+	  as_bad (_("rotate count too large"));
+	rot = imm_expr.X_add_number & 0x1f;
+	if (! rot)
+	  break;
+	macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "sll",
+		     "d,w,<", AT, sreg, rot);
+	macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "srl",
+		     "d,w,<", dreg, sreg, (0x20 - rot) & 0x1f);
+	macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "or",
+		     "d,v,t", dreg, dreg, AT);
+      }
+      break;
+
+    case M_DROR:
+      macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "dsubu",
+		   "d,v,t", AT, 0, treg);
+      macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "dsllv",
+		   "d,t,s", AT, sreg, AT);
+      macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "dsrlv",
+		   "d,t,s", dreg, sreg, treg);
+      macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "or",
+		   "d,v,t", dreg, dreg, AT);
       break;

     case M_ROR:
@@ -6719,15 +6770,44 @@ macro2 (ip)
 		   "d,v,t", dreg, dreg, AT);
       break;

+    case M_DROR_I:
+      {
+	unsigned int rot;
+	char *l, *r;
+
+	if (imm_expr.X_op != O_constant)
+	  as_bad (_("rotate count too large"));
+	rot = imm_expr.X_add_number & 0x3f;
+	if (! rot)
+	  break;
+	r = (rot < 0x20) ? "dsrl" : "dsrl32";
+	l = ((0x40 - rot) < 0x20) ? "dsll" : "dsll32";
+	rot &= 0x1f;
+	macro_build ((char *) NULL, &icnt, (expressionS *) NULL, r,
+		     "d,w,<", AT, sreg, rot);
+	macro_build ((char *) NULL, &icnt, (expressionS *) NULL, l,
+		     "d,w,<", dreg, sreg, (0x20 - rot) & 0x1f);
+	macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "or",
+		     "d,v,t", dreg, dreg, AT);
+      }
+      break;
+
     case M_ROR_I:
-      if (imm_expr.X_op != O_constant)
-	as_bad (_("rotate count too large"));
-      macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "srl", "d,w,<",
-		   AT, sreg, (int) (imm_expr.X_add_number & 0x1f));
-      macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "sll", "d,w,<",
-		   dreg, sreg, (int) ((0 - imm_expr.X_add_number) & 0x1f));
-      macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "or", "d,v,t",
-		   dreg, dreg, AT);
+      {
+	unsigned int rot;
+
+	if (imm_expr.X_op != O_constant)
+	  as_bad (_("rotate count too large"));
+	rot = imm_expr.X_add_number & 0x1f;
+	if (! rot)
+	  break;
+	macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "srl",
+		     "d,w,<", AT, sreg, rot);
+	macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "sll",
+		     "d,w,<", dreg, sreg, (0x20 - rot) & 0x1f);
+	macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "or",
+		     "d,v,t", dreg, dreg, AT);
+      }
       break;

     case M_S_DOB:
Index: gas/testsuite/ChangeLog
===================================================================
RCS file: /cvs/src/src/gas/testsuite/ChangeLog,v
retrieving revision 1.315
diff -u -p -r1.315 ChangeLog
--- gas/testsuite/ChangeLog	20 May 2002 17:05:34 -0000	1.315
+++ gas/testsuite/ChangeLog	21 May 2002 23:32:54 -0000
@@ -1,3 +1,9 @@
+2002-05-22  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+	* gas/mips/rol64.s: New file, test of drol, dror macros.
+	* gas/mips/rol64.d: Likewise.
+	* gas/mips/mips.exp: Add new test.
+
 2002-05-20  Nick Clifton  <nickc@cambridge.redhat.com>

 	* gas/arm/arm.exp: Replace deprecated command line switches
Index: gas/testsuite/gas/mips/mips.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/mips/mips.exp,v
retrieving revision 1.32
diff -u -p -r1.32 mips.exp
--- gas/testsuite/gas/mips/mips.exp	4 Apr 2002 08:23:30 -0000	1.32
+++ gas/testsuite/gas/mips/mips.exp	21 May 2002 23:32:54 -0000
@@ -122,6 +122,7 @@ if { [istarget mips*-*-*] } then {
 	run_dump_test "mul"
     }
     run_dump_test "rol"
+    run_dump_test "rol64"
     if !$aout { run_dump_test "sb" }
     run_dump_test "trunc"
     if !$aout { run_dump_test "ulh" }
Index: include/opcode/ChangeLog
===================================================================
RCS file: /cvs/src/src/include/opcode/ChangeLog,v
retrieving revision 1.167
diff -u -p -r1.167 ChangeLog
--- include/opcode/ChangeLog	17 May 2002 19:01:03 -0000	1.167
+++ include/opcode/ChangeLog	21 May 2002 23:32:57 -0000
@@ -1,3 +1,7 @@
+2002-05-22  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+	* mips.h: Add M_DROL, M_DROL_I, M_DROR, M_DROR_I macro cases.
+
 2002-05-17  Andrey Volkov  <avolkov@sources.redhat.com>

         * h8300.h: Corrected defs of all control regs
Index: include/opcode/mips.h
===================================================================
RCS file: /cvs/src/src/include/opcode/mips.h,v
retrieving revision 1.24
diff -u -p -r1.24 mips.h
--- include/opcode/mips.h	16 Mar 2002 03:09:18 -0000	1.24
+++ include/opcode/mips.h	21 May 2002 23:32:57 -0000
@@ -526,9 +526,13 @@ enum
   M_REM_3I,
   M_REMU_3,
   M_REMU_3I,
+  M_DROL,
   M_ROL,
+  M_DROL_I,
   M_ROL_I,
+  M_DROR,
   M_ROR,
+  M_DROR_I,
   M_ROR_I,
   M_S_DA,
   M_S_DOB,
Index: opcodes/ChangeLog
===================================================================
RCS file: /cvs/src/src/opcodes/ChangeLog,v
retrieving revision 1.447
diff -u -p -r1.447 ChangeLog
--- opcodes/ChangeLog	17 May 2002 14:36:45 -0000	1.447
+++ opcodes/ChangeLog	21 May 2002 23:33:00 -0000
@@ -1,3 +1,7 @@
+2002-05-22  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+	* mips-opc.c (mips_builtin_opcodes): Add drol, dror macros.
+
 Fri May 17 14:26:44 2002  J"orn Rennecke <joern.rennecke@superh.com>

 	* disassemble.c (disassembler): Just use print_insn_sh for bfd_arch_sh.
Index: opcodes/mips-opc.c
===================================================================
RCS file: /cvs/src/src/opcodes/mips-opc.c,v
retrieving revision 1.32
diff -u -p -r1.32 mips-opc.c
--- opcodes/mips-opc.c	17 Mar 2002 02:42:25 -0000	1.32
+++ opcodes/mips-opc.c	21 May 2002 23:33:00 -0000
@@ -492,6 +492,10 @@ const struct mips_opcode mips_builtin_op
 {"dremu",   "z,s,t",    0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO,      I3      },
 {"dremu",   "d,v,t",	3,    (int) M_DREMU_3,	INSN_MACRO,		I3	},
 {"dremu",   "d,v,I",	3,    (int) M_DREMU_3I,	INSN_MACRO,		I3	},
+{"drol",    "d,v,t",	0,    (int) M_DROL,	INSN_MACRO,		I3	},
+{"drol",    "d,v,I",	0,    (int) M_DROL_I,	INSN_MACRO,		I3	},
+{"dror",    "d,v,t",	0,    (int) M_DROR,	INSN_MACRO,		I3	},
+{"dror",    "d,v,I",	0,    (int) M_DROR_I,	INSN_MACRO,		I3	},
 {"dsllv",   "d,t,s",	0x00000014, 0xfc0007ff,	WR_d|RD_t|RD_s,		I3	},
 {"dsll32",  "d,w,<",	0x0000003c, 0xffe0003f, WR_d|RD_t,		I3	},
 {"dsll",    "d,w,s",	0x00000014, 0xfc0007ff,	WR_d|RD_t|RD_s,		I3	}, /* dsllv */
2002-05-21 23:54:48 +00:00
Thiemo Seufer 3bec30a830 * config/tc-mips.c (macro): Warn about wrong la/dla use. 2002-05-14 23:35:59 +00:00
Thiemo Seufer 8586fc660d * config/tc_mips.c (s_cpsetup): Fix completely bogus code which had
worked sometimes by accident. Fix copy&paste comment.
2002-05-14 23:29:23 +00:00
Thiemo Seufer 195325d290 * config/tc-mips.c (md_begin): Fix .reginfo and .MIPS.option section
alignment for NewABI. Let n32 use .reginfo. Remove useless casts.
	(mips_elf_final_processing): Let n32 use .reginfo.
2002-05-14 23:27:35 +00:00
Thiemo Seufer 4db1a35d12 * config/tc-mips.c (append_insn): Fix too small range of variable. 2002-05-14 23:19:39 +00:00
Kazu Hirata 98d3f06fa0 * config/tc-mips.c: Fix formatting.
* config/tc-s390.c: Likewise.
	* config/tc-s390.h: Likewise.
2002-05-04 17:38:00 +00:00
Chris Demetriou af55c2e6c3 2002-04-24 Chris G. Demetriou <cgd@broadcom.com>
* config/tc-mips.c (macro_build): Do _not_ allow MIPS-3D
        instructions to be generated by macros.
2002-04-24 21:52:47 +00:00
Chris Demetriou 2b2e39bfa5 2002-04-22 Chris Demetriou <cgd@broadcom.com>
* config/tc-mips.c (macro_build): Add close-parenthesis missing
        from previous change.

(also, fix ChangeLog entry for previous patch.)
2002-04-22 21:50:44 +00:00
Eric Christopher 80cc45a581 2002-04-22 Eric Christopher <echristo@redhat.com>
* config/tc-mips.c: Add warning if macro instructions are expanded
	into a branch delay slot.
2002-04-22 21:21:06 +00:00
Thiemo Seufer 874e898605 * config/tc-mips.c (mips16_macro_build): Cast type mismatch.
(mips_ip): Remove unused variable.
	(md_apply_fix3): Cast signed/unsignes mismatches. Replace
	unsigned char with bfd_byte.
	(s_file): Remove unused variable.
	(s_mips_ent): Likewise.
2002-04-04 07:43:11 +00:00
Alexandre Oliva 177b4a6ad0 * config/tc-mips.c (md_estimate_size_before_relax): Do not modify
the EXTENDED bit here; report the estimate according to the
current size.
2002-03-18 18:56:18 +00:00
Chris Demetriou 1f25f5d300 [ gas/ChangeLog ]
2002-03-15  Chris G. Demetriou  <cgd@broadcom.com>

	* config/tc-mips.c (mips_set_options): New "ase_mips3d" member.
	(mips_opts): Initialize "ase_mips3d" member.
	(file_ase_mips3d): New variable.
	(CPU_HAS_MIPS3D): New macro.
	(md_begin): Initialize mips_opts.ase_mips3d and file_ase_mips3d
	based on command line options and configuration defaults.
	(macro_build, mips_ip): Accept MIPS-3D instructions if
	mips_opts.ase_mips3d is set.
	(OPTION_MIPS3D, OPTION_NO_MIPS3D, md_longopts, md_parse_option):
	Add support for "-mips3d" and "-no-mips3d" options.
	(OPTION_ELF_BASE): Move to accomodate new options.
	(s_mipsset): Support ".set mips3d" and ".set nomips3d".
	(mips_elf_final_processing): Add a comment indicating that a
	MIPS-3D ASE ELF header flag should be set, when one exists.
	* doc/as.texinfo: Document -mips3d and -no-mips3d options.
	* doc/c-mips.texi: Likewise, and document ".set mips3d" and ".set
	nomips3d" directives.

[ gas/testsuite/ChangeLog ]
2002-03-15  Chris G. Demetriou  <cgd@broadcom.com>

	* gas/mips/mips64-mips3d.s: New file.
	* gas/mips/mips64-mips3d.d: Likewise.
	* gas/mips/mips.exp: Run new "mips64-mips3d" test.

[ include/opcode/ChangeLog ]
2002-03-15  Chris G. Demetriou  <cgd@broadcom.com>

	* mips.h (INSN_MIPS3D): New definition used to mark MIPS-3D
	instructions.
	(OPCODE_IS_MEMBER): Adjust comments to indicate that ASE bit masks
	may be passed along with the ISA bitmask.

[ opcodes/ChangeLog ]
2002-03-15  Chris G. Demetriou  <cgd@broadcom.com>

	* mips-dis.c (mips_isa_type): Add MIPS3D instructions to the ISA
	bit masks for bfd_mach_mips_sb1 and bfd_mach_mipsisa64.  Add
	comments for bfd_mach_mipsisa32 and bfd_mach_mipsisa64 that
	indicate that they should dissassemble all applicable
	MIPS-specified ASEs.
	* mips-opc.c: Add support for MIPS-3D instructions.
	(M3D): New definition.

	* mips-opc.c: Update copyright years.
2002-03-16 03:09:19 +00:00
Chris Demetriou b25a253ca8 2002-02-26 Chris Demetriou <cgd@broadcom.com>
* config/tc-mips.c (mips_need_elf_addend_fixup): For embedded-PIC
        only, undo the changes made on 2001-06-08, with the
        effect being that common or extern symbols are
        adjusted for embedded-PIC, but weak symbols are not.
        (md_estimate_size_before_relax: Likewise, with the effect
        that extern symbols are treated the same as weak symbols
        only if not embedded-PIC.
        (mips_fix_adjustable) Likewise, with the effect that
        weak or extern symbols are not adjusted for embedded-PIC.
        (md_apply_fix3): Tweak so that the case where value is zero
        is handled more correctly for embedded-PIC code.
2002-02-26 22:18:51 +00:00
Thiemo Seufer 4d34fb5fed * config/tc-mips.c (set_at): Fix handling of 64bit register loads.
(macro): Likewise. Fix la/dla address expansions for EMBEDDED_PIC
	and NO_PIC cases. Code cleanup.
	(macro2): Fix handling of 64bit register loads.
	* mips-gp64-fp32-pic.d: Fix test of 64bit register loads.
	* mips-gp64-fp32-pic.s: Likewise.
	* mips-gp64-fp32.d: Likewise.
	* mips-gp64-fp32.s: Likewise.
	* mips-gp64-fp64-pic.d: Likewise.
	* mips-gp64-fp64-pic.s: Likewise.
	* mips-gp64-fp64.d: Likewise.
	* mips-gp64-fp64.s: Likewise.
2002-02-25 13:21:38 +00:00
Thiemo Seufer da0e507f3d * config/tc-mips.c (md_parse_option): Complain about invalid -mabi
option input.
2002-02-19 22:59:30 +00:00
Chris Demetriou 9151e8bfc2 2002-02-15 Chris Demetriou <cgd@broadcom.com>
* config/tc-mips.c (md_estimate_size_before_relax): Really
        make sure we treat weak like extern only for ELF.  (Fixes
        patch from 2001-07-25.)
2002-02-15 23:00:34 +00:00
Chris Demetriou 2d2bf3e0e3 2002-02-13 Chris Demetriou <cgd@broadcom.com>
* config/tc-mips.c (mips_need_elf_addend_fixup): Restructure into
        a sequence of indpendent 'if' statements for easier debugging
        and future modification.
2002-02-14 07:29:22 +00:00
Chris Demetriou 6373ee5479 2002-02-08 Chris Demetriou <cgd@broadcom.com>
* config/tc-mips.c (IS_SEXT_32BIT_NUM): New macro to
        determine if a number is a sign-extended 32-bit number.
        (load_register): Use IS_SEXT_32BIT_NUM.
        (macro): Check if load/store macro handling is using a
        constant 32-bit address on 64-bit address systems, and if
        so optimize the generation of that address.
2002-02-08 22:25:36 +00:00
Chris Demetriou 4514d474ed 2002-01-29 Chris Demetriou <cgd@broadcom.com>
* config/tc-mips.c (tc_gen_reloc): Arrange for
        BFD_RELOC_PCREL_HI16_S relocations to be output relative to
        their LO16 parts, even for ELF.
2002-01-30 02:14:19 +00:00
Thiemo Seufer 394f9b3adb * config/tc-mips.c (percent_op): Ensure longer percent_op's are
matched before the shorter ones.
	(my_getSmallParser): Fix handling of nested parentheses in
	percent_op's. Code cleanup.
	(my_getPercentOp): New function, code from my_getSmallParser.
	(my_getSmallExpression): Fix handling of closing parentheses.
	Code cleanup. Better comments.
2002-01-16 21:30:47 +00:00
Daniel Jacobowitz 7a62114442 2002-01-05 Daniel Jacobowitz <drow@mvista.com>
* tc-mips.c (mips_cprestore_valid): New flag.
        (mips_frame_reg_valid): New flag.
        (macro) [M_JAL_2]: Check both flags.
        [M_JAL_A]: Likewise.
        (s_cprestore): Set mips_cprestore_valid.
        (tc_get_register): If setting mips_frame_reg, set
        mips_frame_reg_valid and clear mips_cprestore_valid.
        (s_mips_ent): Clear both flags.
        (s_mips_end): Clear both flags.

2002-01-05  Daniel Jacobowitz  <drow@mvista.com>

        * gas/mips/jal-svr4pic.s: Add .ent and .frame directives.
        * gas/mips/mips-abi32-pic.s: Add .frame directive.
        * gas/mips/mips-gp32-fp32-pic.s: Likewise.
        * gas/mips/mips-gp32-fp64-pic.s: Likewise.
        * gas/mips/mips-gp64-fp32-pic.s: Likewise.
        * gas/mips/mips-gp64-fp64-pic.s: Likewise.
2002-01-05 19:06:52 +00:00
Daniel Jacobowitz a8e8e86325 2001-12-20 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
Daniel Jacobowitz <drow@mvista.com>

        * config/tc-mips.c (file_mips_gp32): Initialize to invalid value.
        (file_mips_fp32): Likewise.
        (md_begin): Compatibility handling for -mipsN option.
2001-12-20 21:11:26 +00:00
Thiemo Seufer 956cd1d64d * config.bfd: Remove trailing blanks.
* elf32-mips.c (gprel16_with_gp): Remove superfluous casts.
	* strings.c (get_char): Initialize value.
	* config/tc-mips.c (mips_cpreturn_offset): Better comment.
	(load_register): Better error message. Cast away signedness
	mismatches. Add casts needed for varargs.
	(load_address): Replace checks of HAVE_64BIT_ADDRESS with dbl.
	Remove superfluous casts.
	(macro): Cast away signedness mismatches. Remove superfluous casts.
	(s_cpload): Fix wrong comment.
	(s_mips_weakext): Standardize output message.
	(get_number): Likewise.
2001-12-04 14:38:48 +00:00
Thiemo Seufer 7496292d88 * config/tc-mips.c (append_insn): Add jump address range overflow
check.
2001-12-04 14:05:54 +00:00
Thiemo Seufer 34ba82a8bb * config/tc-mips.c (md_parse_option): Fix comment. Allow -mabi option
for ELF only.
	(show): Document -mabi option.
2001-12-04 13:27:56 +00:00
Eric Christopher d11008e15f 2001-12-03 Eric Christopher <echristo@redhat.com>
* config/tc-mips.c (tc_gen_reloc): One missed BFD_RELOC_MIPS_GPREL.
2001-12-04 00:51:33 +00:00
Thiemo Seufer cdf6fd85e6 * coff-mips.c (mips_bfd_reloc_type_lookup): Replace
BFD_RELOC_MIPS_GPREL by BFD_RELOC_GPREL16.
	* pe-mips.c (mips_bfd_reloc_type_lookup): Likewise.
	* elf32-mips.c (mips_reloc_map): Likewise. Replace
	BFD_RELOC_MIPS_GPREL32 by BFD_RELOC_GPREL32.
	* elf64-mips.c (mips_reloc_map): Likewise.
	* reloc.c (BFD_RELOC_MIPS_GPREL): Remove.
	(BFD_RELOC_MIPS_GPREL32): Remove.
	* config/tc-mips.c (macro_build): Replace BFD_RELOC_MIPS_GPREL
	by BFD_RELOC_GPREL16.
	(load_address): Likewise.
	(macro): Likewise.
	(md_apply_fix): Likewise. Replace BFD_RELOC_MIPS_GPREL32 by
	BFD_RELOC_GPREL32.
	(s_gpword): Replace BFD_RELOC_MIPS_GPREL32 by BFD_RELOC_GPREL32.
	(tc_gen_reloc): Replace BFD_RELOC_MIPS_GPREL by BFD_RELOC_GPREL16.
	*config/tc-mips.h: Replace BFD_RELOC_MIPS_GPREL by BFD_RELOC_GPREL16.
2001-12-02 13:14:48 +00:00
Richard Sandiford add55e1f31 * config/tc-mips.c (mips_need_elf_addend_fixup): New, extracted from...
(md_apply_fix3): ...here.  Don't prevent the symbol value being
	subtracted twice from GPREL addends.
	(tc_gen_reloc): Add the symbol value to a GPREL addend if it was
	subtracted by the previous function.
2001-11-21 11:24:13 +00:00
Nick Clifton 94f592af1b Update all uses of md_apply_fix to use md_apply_fix3. Make it a void function. 2001-11-15 21:29:00 +00:00
Thiemo Seufer 645dc66c72 * config/tc-mips.c (mips_ip): Re-allow %hi() op for non-ELF assembler. 2001-11-15 09:50:00 +00:00
Thiemo Seufer ae948b86fe * config/tc-mips.c (support_64bit_objects): Define for OBJ_ELF only.
(md_longopts): Allow OPTION_MABI for ELF compilation only. RE-allow
	OPTION_GP32, OPTION_GP64, OPTION_FP32 for non-ELF compilation.
	Sort options a bit more logical.
	(md_parse_option): Allow OPTION_32, OPTION_N32, OPTION_N64,
	OPTION_MABI only for elf targets.
	* gas/mips/mips.exp: Change naming of some conditionals to reflect
	the object format they actually mean. Don't try mips-abi32 and
	mips-abi32-pic tests for ecoff.
2001-11-12 22:22:20 +00:00
Thiemo Seufer 2396cfb964 * config/tc-mips.c (set_at): Add cast needed for varargs.
(load_register): Likewise.
	(macro): Likewise. Some code reformatting.
	(macro2): Add cast needed for varargs.
	(mips16_macro): Likewise.
2001-11-12 22:20:44 +00:00
Thiemo Seufer c4e7957cc8 * config/tc-mips.c (md_assemble): Remove superflous casts.
(append_insn): Likewise.
	(mips16_macro_build): Likewise.
	(macro): Likewise.
	(mips16_ip): Likewise.
	(s_cpload): Likewise.
	(mips_relax_frag): Likewise.
2001-11-12 22:19:30 +00:00
Thiemo Seufer a325df1d97 * config/tc-mips.c (mips_abi_level): Move in front of
mips_set_options.
	(mips_set_options): Add members gp32, fp32, abi.
	(file_mips_gp32): New flag.
	(file_mips_fp32): New flag.
	(mips_opts): Initialize the new members.
	(mips_gp32): Remove.
	(mips_fp32): Remove.
	(HAVE_32BIT_GPRS): Use the new values from mips_opts.
	(HAVE_32BIT_FPRS): Likewise.
	(HAVE_NEWABI): Likewise.
	(HAVE_64BIT_OBJECTS): Likewise.
	(md_begin): Likewise. Save default (file) values.
	(md_parse_option): Use the new values from mips_opts.
	(s_mipsset): Likewise. Fix logic to keep the ABI selection if
	possible. Let .set mipsN work together with .set push/pop.
	Enhance error messages.
	(mips_elf_final_processing): Use file_mips_* for header processing.
2001-11-12 16:54:54 +00:00
Thiemo Seufer d993a84ec2 * config/tc-mips.c (mips_force_relocation): Remove duplicate code. 2001-11-08 19:32:24 +00:00
Eric Christopher 76b3015fc1 2001-11-06 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* config/tc-mips.c (my_getSmallParser): Fix small parser bug.
2001-11-06 21:39:09 +00:00
Chris Demetriou afdbd6d03b [ bfd/ChangeLog ]
2001-10-31  Chris Demetriou  <cgd@demetriou.com>

	* elf32-mips.c (_bfd_mips_elf_hi16_reloc): Handle PC-relative
	relocations properly.

[ gas/ChangeLog ]
2001-10-31  Chris Demetriou  <cgd@broadcom.com>

	* config/tc-mips.c (HAVE_32BIT_ADDRESSES): If compiling embedded
	PIC code, assume pointers the same size as GPRs.
	(macro): In M_LA_AB handling for embedded PIC code, support
	"la $treg,foo-bar($breg)".  In load/store handling
	(label ld_st) support "<op> $treg,<sym>-<local_sym>($breg)"
	which is used by the compiler for switch statements.
	In load/store double multi-instruction macro handling
	(label ldd_std) add a comment that no special handling
	is currently done for embedded PIC.
	(mips_ip): In 'o' (16-bit offset) case, only accept 16
	bit offsets.

[ gas/testsuite/ChangeLog ]
2001-10-31  Chris Demetriou  <cgd@broadcom.com>

	* gas/mips/empic.s: Undo damage inflicted on 2000-12-02.
	* gas/mips/empic.d: Likewise.
	* gas/mips/elempic.d: Likewise (it was copied into other files).
	* gas/mips/telempic.d: Likewise.
	* gas/mips/tempic.d: Likewise.

	* gas/mips/empic2.s: New test to check new 'la' and 'lw' (and
	related ops) syntax, test loads with large offsets.
	* gas/mips/emcic2.d: Likewise.
	* gas/mips/mips.exp: Run the new test on ELF platforms.
2001-11-01 01:33:47 +00:00
Chris Demetriou 0a758a1221 2001-10-24 Chris Demetriou <cgd@broadcom.com>
* config/tc-mips.c (hilo_interlocks, cop_interlocks): Make
        these evaluate to true if mips_arch indicates SB-1.
2001-10-24 21:08:34 +00:00
Chris Demetriou 2e4acd247e 2001-10-20 Chris Demetriou <cgd@broadcom.com>
* config/tc-mips.c (md_show_usage): Print "sb1" for Broadcom
        SB-1 CPU for consistency.
        (mips_cpu_info_table): Tweak comment about SB-1.
2001-10-21 05:58:55 +00:00
Alan Modra d3ecfc599f * bit_fix.h: Comment typo fix.
* config/tc-mips.c: Likewise.
	* config/tc-sh.c: Likewise.
	* config/tc-arc.c (arc_code_symbol): Remove unnecessary test.
2001-10-17 05:51:12 +00:00
Thiemo Seufer e369bcce27 * config/tc-mips.c (md_apply_fix): Preliminary handling of NewABI
relocations.
2001-10-15 19:48:04 +00:00
Kazu Hirata b6ff326eba * config/tc-alpha.c: Fix comment typos.
* config/tc-cris.c: Likewise.
	* config/tc-hppa.c: Likewise.
	* config/tc-i370.c: Likewise.
	* config/tc-mips.c: Likewise.
	* config/tc-mn10200.c: Likewise.
	* config/tc-mn10300.c: Likewise.
	* config/tc-sh.c: Likewise.
	* config/tc-tahoe.c: Likewise.
	* config/tc-v850.c: Likewise.
2001-10-11 23:56:33 +00:00
Thiemo Seufer 6478892d2e * config/tc-mips.c (mips_cpreturn_offset): New variable.
(mips_cpreturn_register): Likewise.
	(mips_gp_register): Likewise.
	(s_cpsetup): New function prototype.
	(s_cplocal): Likewise.
	(s_cpreturn): Likewise.
	(s_gpvalue): Likewise.
	(mips_pseudo_table): Add .cpsetup, .cplocal, .cpreturn, .gpvalue
	pseudo-ops.
	(macro): Don't warn about .cprestore for NewABI.
	(md_pcrel_from): Code cleanup.
	(mips_force_relocation): Force output of some NewABI relocations even
	without a defined symbol.
	(s_cpload): Ignore .cpload for NewABI.
	(s_cpsetup): Handle .cpsetup.
	(s_cplocal): Handle .cplocal.
	(s_cprestore): Ignore .cprestore for NewABI.
	(s_cpreturn): Handle .cpreturn.
	(s_gpvalue): Handle .gpvalue.
	(s_cpadd): Ignore .cpadd for NewABI.
	(nopic_need_relax): Take g_switch_value into account as gp
	optimization.
	(tc_gen_reloc): Don't handle BFD_RELOC_MIPS_{CALL,GOT}* for NewABI.
2001-10-10 01:08:35 +00:00
Thiemo Seufer ad8d3bb3cf * config/tc-mips.c (my_getSmallParser): New function prototype.
(small_ex_type): Named this enum, more return values for
	my_getSmallExpression.
	(mips_ip): Allow SPC and HT between arguments. Handle some NewABI
	triple relocations. Protect some parts with ifdef OBJ_ELF.
	(percent_op_match): New struct, lookup table for %some_reloc().
	(my_getSmallParser): New function, parses nested percent_ops also.
	(my_getSmallExpression): Rewite to support nested percent_ops.
2001-10-10 00:54:53 +00:00