aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-09-09 18:37:10 +0000
committerIan Lance Taylor <ian@airs.com>1996-09-09 18:37:10 +0000
commitd31a3f5e7603380ee267051c89d5ef69aff00ddb (patch)
treed292ff0affb7e120e7a56e488671edb06784b2fd /gas
parent30b1724cc85565e85601b6997969b4bfd4098dc0 (diff)
downloadgdb-d31a3f5e7603380ee267051c89d5ef69aff00ddb.zip
gdb-d31a3f5e7603380ee267051c89d5ef69aff00ddb.tar.gz
gdb-d31a3f5e7603380ee267051c89d5ef69aff00ddb.tar.bz2
* config/tc-mips.c (append_insn): Don't swap an instruction which
sets a condition code with an instruction which uses a condition code. (mips_ip): In cases 'N' and 'M', look for $fccN rather than an immediate value.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-mips.c31
2 files changed, 26 insertions, 11 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 7c6858c..2084da5 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,11 @@
Mon Sep 9 10:57:42 1996 Ian Lance Taylor <ian@cygnus.com>
+ * config/tc-mips.c (append_insn): Don't swap an instruction which
+ sets a condition code with an instruction which uses a condition
+ code.
+ (mips_ip): In cases 'N' and 'M', look for $fccN rather than an
+ immediate value.
+
* config/tc-mips.c (md_begin): Recognize r5000 for cpu. If
mips_cpu is 5000, set interlocks and cop_interlocks.
(mips_ip): Give a better error message if the ISA level is wrong.
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 6d6d408..4185adb 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -1417,7 +1417,13 @@ append_insn (place, ip, address_expr, reloc_type, unmatched_hi)
&& insn_uses_reg (ip,
((prev_prev_insn.insn_opcode >> OP_SH_RT)
& OP_MASK_RT),
- 0)))
+ 0))
+ /* If one instruction sets a condition code and the
+ other one uses a condition code, we can not swap. */
+ || ((pinfo & INSN_READ_COND_CODE)
+ && (prev_pinfo & INSN_WRITE_COND_CODE))
+ || ((pinfo & INSN_WRITE_COND_CODE)
+ && (prev_pinfo & INSN_READ_COND_CODE)))
{
/* We could do even better for unconditional branches to
portions of this object file; we could pick up the
@@ -5891,20 +5897,23 @@ mips_ip (str, ip)
case 'N': /* 3 bit branch condition code */
case 'M': /* 3 bit compare condition code */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number > 7)
+ if (strncmp (s, "$fcc", 4) != 0)
+ break;
+ s += 4;
+ regno = 0;
+ do
{
- as_warn ("Condition code > 7 (%ld)",
- (long) imm_expr.X_add_number);
- imm_expr.X_add_number &= 7;
+ regno *= 10;
+ regno += *s - '0';
+ ++s;
}
+ while (isdigit (*s));
+ if (regno > 7)
+ as_bad ("invalid condition code register $fcc%d", regno);
if (*args == 'N')
- ip->insn_opcode |= imm_expr.X_add_number << OP_SH_BCC;
+ ip->insn_opcode |= regno << OP_SH_BCC;
else
- ip->insn_opcode |= imm_expr.X_add_number << OP_SH_CCC;
- imm_expr.X_op = O_absent;
- s = expr_end;
+ ip->insn_opcode |= regno << OP_SH_CCC;
continue;
default: