From c916764078fa06f8fc24de28714d1462835b513b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 5 Feb 1997 16:12:04 +0000 Subject: [PATCH] * config/tc-mips.c (mips16_ip): Accept floating point registers in the operand of the exit instruction. --- gas/ChangeLog | 5 +++++ gas/config/tc-mips.c | 40 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 91dd54a75ae..855c2ebff78 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +Wed Feb 5 11:11:06 1997 Ian Lance Taylor + + * config/tc-mips.c (mips16_ip): Accept floating point registers in + the operand of the exit instruction. + Tue Feb 4 14:12:39 1997 Ian Lance Taylor * symbols.c (resolve_symbol_value): If we leave an equated symbol diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 52f8c0ba461..d1dd07e25d4 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -7217,7 +7217,7 @@ mips16_ip (str, ip) mask = 7 << 3; while (*s != '\0') { - int reg1, reg2; + int freg, reg1, reg2; while (*s == ' ' || *s == ',') ++s; @@ -7227,6 +7227,13 @@ mips16_ip (str, ip) break; } ++s; + if (*s != 'f') + freg = 0; + else + { + freg = 1; + ++s; + } reg1 = 0; while (isdigit (*s)) { @@ -7244,6 +7251,16 @@ mips16_ip (str, ip) if (*s != '$') break; ++s; + if (freg) + { + if (*s == 'f') + ++s; + else + { + as_bad ("invalid register list"); + break; + } + } reg2 = 0; while (isdigit (*s)) { @@ -7252,15 +7269,32 @@ mips16_ip (str, ip) ++s; } } - if (reg1 == 4 && reg2 >= 4 && reg2 <= 7 && c != 'L') + if (freg && reg1 == 0 && reg2 == 0 && c == 'L') + { + mask &= ~ (7 << 3); + mask |= 5 << 3; + } + else if (freg && reg1 == 0 && reg2 == 1 && c == 'L') + { + mask &= ~ (7 << 3); + mask |= 6 << 3; + } + else if (reg1 == 4 && reg2 >= 4 && reg2 <= 7 && c != 'L') mask |= (reg2 - 3) << 3; else if (reg1 == 16 && reg2 >= 16 && reg2 <= 17) mask |= (reg2 - 15) << 1; else if (reg1 == 31 && reg2 == 31) mask |= 1; else - as_bad ("invalid register list"); + { + as_bad ("invalid register list"); + break; + } } + /* The mask is filled in in the opcode table for the + benefit of the disassembler. We remove it before + applying the actual mask. */ + ip->insn_opcode &= ~ ((7 << 3) << MIPS16OP_SH_IMM6); ip->insn_opcode |= mask << MIPS16OP_SH_IMM6; } continue; -- 2.30.2