* config/tc-mips.c (mips16_ip): Accept floating point registers in
authorIan Lance Taylor <ian@airs.com>
Wed, 5 Feb 1997 16:12:04 +0000 (16:12 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 5 Feb 1997 16:12:04 +0000 (16:12 +0000)
the operand of the exit instruction.

gas/ChangeLog
gas/config/tc-mips.c

index 91dd54a75aea91145ee423ac4ef53ae8b97dfceb..855c2ebff7890e7d646a041d03001b85377b8be9 100644 (file)
@@ -1,3 +1,8 @@
+Wed Feb  5 11:11:06 1997  Ian Lance Taylor  <ian@cygnus.com>
+
+       * 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  <ian@cygnus.com>
 
        * symbols.c (resolve_symbol_value): If we leave an equated symbol
index 52f8c0ba46181bda5063912f9220ad753e6698ec..d1dd07e25d403d9deb398f2e4e73e73ed060a8b3 100644 (file)
@@ -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;