aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Romig-Koch <gavin@redhat.com>1997-04-15 22:46:58 +0000
committerGavin Romig-Koch <gavin@redhat.com>1997-04-15 22:46:58 +0000
commit68952421e6fb8a161faf40861d122f35a1e058fc (patch)
tree08ec15fa4f110cc63b4dc8dd351df0115ec4dbfb
parentded64db806029988b6429ddb8817980733d62069 (diff)
downloadgdb-68952421e6fb8a161faf40861d122f35a1e058fc.zip
gdb-68952421e6fb8a161faf40861d122f35a1e058fc.tar.gz
gdb-68952421e6fb8a161faf40861d122f35a1e058fc.tar.bz2
Correct test for fpr pairs.
-rw-r--r--gas/ChangeLog4
-rw-r--r--gas/config/tc-mips.c10
-rw-r--r--gas/testsuite/ChangeLog8
-rw-r--r--gas/testsuite/gas/mips/delay.d20
-rw-r--r--gas/testsuite/gas/mips/delay.s8
-rw-r--r--gas/testsuite/gas/mips/mips.exp62
-rw-r--r--gas/testsuite/gas/mips/nodelay.d19
7 files changed, 126 insertions, 5 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 6b85cb6..db9744a 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,7 @@
+Tue Apr 15 18:11:44 1997 Gavin Koch <gavin@cygnus.com>
+
+ * config/tc-mips.c (insn_uses_reg): Correct test for fpr pairs.
+
Tue Apr 15 13:04:47 1997 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in (srcroot): Remove.
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index d518741..3f314ae 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -1211,11 +1211,11 @@ insn_uses_reg (ip, reg, class)
because there is no instruction that sets both $f0 and $f1
and requires a delay. */
if ((ip->insn_mo->pinfo & INSN_READ_FPR_S)
- && (((ip->insn_opcode >> OP_SH_FS) & OP_MASK_FS)
+ && ((((ip->insn_opcode >> OP_SH_FS) & OP_MASK_FS) &~(unsigned)1)
== (reg &~ (unsigned) 1)))
return 1;
if ((ip->insn_mo->pinfo & INSN_READ_FPR_T)
- && (((ip->insn_opcode >> OP_SH_FT) & OP_MASK_FT)
+ && ((((ip->insn_opcode >> OP_SH_FT) & OP_MASK_FT) &~(unsigned)1)
== (reg &~ (unsigned) 1)))
return 1;
}
@@ -1306,7 +1306,7 @@ mips16_mark_labels ()
for (l = insn_labels; l != NULL; l = l->next)
{
-#ifdef S_SET_OTHER
+#ifdef OBJ_ELF
if (OUTPUT_FLAVOR == bfd_target_elf_flavour)
S_SET_OTHER (l->label, STO_MIPS16);
#endif
@@ -8711,7 +8711,7 @@ md_apply_fix (fixP, valueP)
/* If we aren't adjusting this fixup to be against the section
symbol, we need to adjust the value. */
-#ifdef S_GET_OTHER
+#ifdef OBJ_ELF
if (fixP->fx_addsy != NULL
&& OUTPUT_FLAVOR == bfd_target_elf_flavour
&& S_GET_OTHER (fixP->fx_addsy) == STO_MIPS16)
@@ -10100,7 +10100,7 @@ mips_fix_adjustable (fixp)
return 0;
if (fixp->fx_addsy == NULL)
return 1;
-#ifdef S_GET_OTHER
+#ifdef OBJ_ELF
if (OUTPUT_FLAVOR == bfd_target_elf_flavour
&& S_GET_OTHER (fixp->fx_addsy) == STO_MIPS16
&& fixp->fx_subsy == NULL)
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index e6562c5..ee4d2fa 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+Tue Apr 15 18:10:01 1997 Gavin Koch <gavin@cygnus.com>
+
+ * gas/mips/{delay.d,nodelay.d}: added.
+
+Mon Apr 7 12:57:45 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * gas/m32r/allinsn.d: Update to new objdump output style.
+
Fri Apr 4 13:19:39 1997 Ian Lance Taylor <ian@cygnus.com>
* gas/all/float.s: Put a tab before .text, to keep the PA happy.
diff --git a/gas/testsuite/gas/mips/delay.d b/gas/testsuite/gas/mips/delay.d
new file mode 100644
index 0000000..faf1717
--- /dev/null
+++ b/gas/testsuite/gas/mips/delay.d
@@ -0,0 +1,20 @@
+#objdump: -dr --prefix-addresses
+#name: MIPS delay
+#as: -mips3
+
+#
+# Gas should produce nop's after mtc1 and related
+# insn's if the target fpr is used in the
+# immediatly following insn. See also nodelay.d.
+#
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> mtc1 \$zero,\$f0
+0+0004 <[^>]*> nop
+0+0008 <[^>]*> cvt.d.w \$f0,\$f0
+0+000c <[^>]*> mtc1 \$zero,\$f1
+0+0010 <[^>]*> nop
+0+0014 <[^>]*> cvt.d.w \$f1,\$f1
+ ...
diff --git a/gas/testsuite/gas/mips/delay.s b/gas/testsuite/gas/mips/delay.s
new file mode 100644
index 0000000..5ee2f00
--- /dev/null
+++ b/gas/testsuite/gas/mips/delay.s
@@ -0,0 +1,8 @@
+# Source file used to test the abs macro.
+foo:
+ mtc1 $0,$f0
+ cvt.d.w $f0,$f0
+ mtc1 $0,$f1
+ cvt.d.w $f1,$f1
+ .space 8
+
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
new file mode 100644
index 0000000..895ca2c
--- /dev/null
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -0,0 +1,62 @@
+#
+# Some generic MIPS tests
+#
+if [istarget mips*-*-*] then {
+ set svr4pic [expr [istarget *-*-elf*] || [istarget *-*-irix5*] ]
+ set empic [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ]
+ set aout [expr [istarget *-*-bsd*] || [istarget *-*-netbsd*]]
+ set ilocks [expr [istarget mips64vr4300*-*-*] || [istarget mips64vr4100*-*-*]]
+
+ run_dump_test "abs"
+ run_dump_test "add"
+ run_dump_test "and"
+ run_dump_test "beq"
+ run_dump_test "bge"
+ run_dump_test "bgeu"
+ run_dump_test "blt"
+ run_dump_test "bltu"
+ if !$ilocks { run_dump_test "div" } else { run_dump_test "div-ilocks" }
+ run_dump_test "dli"
+ run_dump_test "jal"
+ if $svr4pic { run_dump_test "jal-svr4pic" }
+ if $svr4pic { run_dump_test "jal-xgot" }
+ if $empic { run_dump_test "jal-empic" }
+ if !$aout { run_dump_test "la" }
+ if $svr4pic { run_dump_test "la-svr4pic" }
+ if $svr4pic { run_dump_test "la-xgot" }
+ if $empic { run_dump_test "la-empic" }
+ if !$aout { run_dump_test "lb" }
+ if $svr4pic { run_dump_test "lb-svr4pic" }
+ if $svr4pic { run_dump_test "lb-xgot" }
+ if $empic { run_dump_test "lb-empic" }
+ if !$aout { run_dump_test "ld" }
+ if $svr4pic { run_dump_test "ld-svr4pic" }
+ if $svr4pic { run_dump_test "ld-xgot" }
+ if $empic { run_dump_test "ld-empic" }
+ run_dump_test "li"
+ if !$aout { run_dump_test "lifloat" }
+ if $svr4pic { run_dump_test "lif-svr4pic" }
+ if $svr4pic { run_dump_test "lif-xgot" }
+ if $empic { run_dump_test "lif-empic" }
+ run_dump_test "mips4"
+ if !$ilocks { run_dump_test "mul" } else { run_dump_test "mul-ilocks" }
+ run_dump_test "rol"
+ if !$aout { run_dump_test "sb" }
+ run_dump_test "trunc"
+ if !$aout { run_dump_test "ulh" }
+ if $svr4pic { run_dump_test "ulh-svr4pic" }
+ if $svr4pic { run_dump_test "ulh-xgot" }
+ if $empic { run_dump_test "ulh-empic" }
+ if !$aout {
+ run_dump_test "ulw"
+ run_dump_test "uld"
+ run_dump_test "ush"
+ run_dump_test "usw"
+ run_dump_test "usd"
+ }
+ # The mips16 test can only be run on ELF, because only ELF
+ # supports the necessary mips16 reloc.
+ if $svr4pic { run_dump_test "mips16" }
+ run_dump_test "delay"
+ run_dump_test "nodelay"
+}
diff --git a/gas/testsuite/gas/mips/nodelay.d b/gas/testsuite/gas/mips/nodelay.d
new file mode 100644
index 0000000..ec65de9
--- /dev/null
+++ b/gas/testsuite/gas/mips/nodelay.d
@@ -0,0 +1,19 @@
+#objdump: -dr --prefix-addresses
+#name: MIPS nodelay
+#as: -mips4
+#source: delay.s
+
+# For -mips4
+# Gas should *not* produce nop's after mtc1 and related
+# insn's if the target fpr is used in the immediatly
+# following insn. See also delay.d.
+#
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> mtc1 \$zero,\$f0
+0+0004 <[^>]*> cvt.d.w \$f0,\$f0
+0+0008 <[^>]*> mtc1 \$zero,\$f1
+0+000c <[^>]*> cvt.d.w \$f1,\$f1
+ ...