2004-08-10 Andrew Cagney <cagney@gnu.org>
[deliverable/binutils-gdb.git] / opcodes / frv-asm.c
index 1d24b28d405db6f7147b39fd44ece35632c433bf..98df36bf45864685d435e7c293e3fa5681e44cc5 100644 (file)
@@ -110,7 +110,66 @@ parse_ulo16 (cd, strp, opindex, valuep)
          ++*strp;
          if (errmsg == NULL
              && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
-           value >>= 16;
+           value &= 0xffff;
+         *valuep = value;
+         return errmsg;
+       }
+      else if (strncasecmp (*strp + 1, "gotlo(", 6) == 0)
+       {
+         *strp += 7;
+         errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_FRV_GOTLO,
+                                      &result_type, &value);
+         if (**strp != ')')
+           return "missing ')'";
+         ++*strp;
+         if (errmsg == NULL
+             && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
+           value &= 0xffff;
+         *valuep = value;
+         return errmsg;
+       }
+      else if (strncasecmp (*strp + 1, "gotfuncdesclo(", 14) == 0)
+       {
+         *strp += 15;
+         errmsg = cgen_parse_address (cd, strp, opindex,
+                                      BFD_RELOC_FRV_FUNCDESC_GOTLO,
+                                      &result_type, &value);
+         if (**strp != ')')
+           return "missing ')'";
+         ++*strp;
+         if (errmsg == NULL
+             && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
+           value &= 0xffff;
+         *valuep = value;
+         return errmsg;
+       }
+      else if (strncasecmp (*strp + 1, "gotofflo(", 9) == 0)
+       {
+         *strp += 10;
+         errmsg = cgen_parse_address (cd, strp, opindex,
+                                      BFD_RELOC_FRV_GOTOFFLO,
+                                      &result_type, &value);
+         if (**strp != ')')
+           return "missing ')'";
+         ++*strp;
+         if (errmsg == NULL
+             && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
+           value &= 0xffff;
+         *valuep = value;
+         return errmsg;
+       }
+      else if (strncasecmp (*strp + 1, "gotofffuncdesclo(", 17) == 0)
+       {
+         *strp += 18;
+         errmsg = cgen_parse_address (cd, strp, opindex,
+                                      BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
+                                      &result_type, &value);
+         if (**strp != ')')
+           return "missing ')'";
+         ++*strp;
+         if (errmsg == NULL
+             && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
+           value &= 0xffff;
          *valuep = value;
          return errmsg;
        }
@@ -159,6 +218,65 @@ parse_uslo16 (cd, strp, opindex, valuep)
          *valuep = value;
          return errmsg;
        }
+      else if (strncasecmp (*strp + 1, "gotlo(", 6) == 0)
+       {
+         *strp += 7;
+         errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_FRV_GOTLO,
+                                      &result_type, &value);
+         if (**strp != ')')
+           return "missing ')'";
+         ++*strp;
+         if (errmsg == NULL
+             && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
+           value &= 0xffff;
+         *valuep = value;
+         return errmsg;
+       }
+      else if (strncasecmp (*strp + 1, "gotfuncdesclo(", 14) == 0)
+       {
+         *strp += 15;
+         errmsg = cgen_parse_address (cd, strp, opindex,
+                                      BFD_RELOC_FRV_FUNCDESC_GOTLO,
+                                      &result_type, &value);
+         if (**strp != ')')
+           return "missing ')'";
+         ++*strp;
+         if (errmsg == NULL
+             && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
+           value &= 0xffff;
+         *valuep = value;
+         return errmsg;
+       }
+      else if (strncasecmp (*strp + 1, "gotofflo(", 9) == 0)
+       {
+         *strp += 10;
+         errmsg = cgen_parse_address (cd, strp, opindex,
+                                      BFD_RELOC_FRV_GOTOFFLO,
+                                      &result_type, &value);
+         if (**strp != ')')
+           return "missing ')'";
+         ++*strp;
+         if (errmsg == NULL
+             && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
+           value &= 0xffff;
+         *valuep = value;
+         return errmsg;
+       }
+      else if (strncasecmp (*strp + 1, "gotofffuncdesclo(", 17) == 0)
+       {
+         *strp += 18;
+         errmsg = cgen_parse_address (cd, strp, opindex,
+                                      BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
+                                      &result_type, &value);
+         if (**strp != ')')
+           return "missing ')'";
+         ++*strp;
+         if (errmsg == NULL
+             && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
+           value &= 0xffff;
+         *valuep = value;
+         return errmsg;
+       }
     }
   return cgen_parse_unsigned_integer (cd, strp, opindex, valuep);
 }
@@ -204,6 +322,65 @@ parse_uhi16 (cd, strp, opindex, valuep)
          *valuep = value;
          return errmsg;
        }
+      else if (strncasecmp (*strp + 1, "gothi(", 6) == 0)
+       {
+         *strp += 7;
+         errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_FRV_GOTHI,
+                                      &result_type, &value);
+         if (**strp != ')')
+           return "missing ')'";
+         ++*strp;
+         if (errmsg == NULL
+             && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
+           value >>= 16;
+         *valuep = value;
+         return errmsg;
+       }
+      else if (strncasecmp (*strp + 1, "gotfuncdeschi(", 14) == 0)
+       {
+         *strp += 15;
+         errmsg = cgen_parse_address (cd, strp, opindex,
+                                      BFD_RELOC_FRV_FUNCDESC_GOTHI,
+                                      &result_type, &value);
+         if (**strp != ')')
+           return "missing ')'";
+         ++*strp;
+         if (errmsg == NULL
+             && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
+           value >>= 16;
+         *valuep = value;
+         return errmsg;
+       }
+      else if (strncasecmp (*strp + 1, "gotoffhi(", 9) == 0)
+       {
+         *strp += 10;
+         errmsg = cgen_parse_address (cd, strp, opindex,
+                                      BFD_RELOC_FRV_GOTOFFHI,
+                                      &result_type, &value);
+         if (**strp != ')')
+           return "missing ')'";
+         ++*strp;
+         if (errmsg == NULL
+             && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
+           value >>= 16;
+         *valuep = value;
+         return errmsg;
+       }
+      else if (strncasecmp (*strp + 1, "gotofffuncdeschi(", 17) == 0)
+       {
+         *strp += 18;
+         errmsg = cgen_parse_address (cd, strp, opindex,
+                                      BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
+                                      &result_type, &value);
+         if (**strp != ')')
+           return "missing ')'";
+         ++*strp;
+         if (errmsg == NULL
+             && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
+           value >>= 16;
+         *valuep = value;
+         return errmsg;
+       }
     }
   return cgen_parse_unsigned_integer (cd, strp, opindex, valuep);
 }
@@ -286,6 +463,53 @@ parse_d12 (cd, strp, opindex, valuep)
           *valuep = value;
           return errmsg;
         }
+      else if (strncasecmp (*strp + 1, "got12(", 6) == 0)
+       {
+         *strp += 7;
+         errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_FRV_GOT12,
+                                      &result_type, &value);
+         if (**strp != ')')
+           return "missing ')'";
+         ++*strp;
+         *valuep = value;
+         return errmsg;
+       }
+      else if (strncasecmp (*strp + 1, "gotfuncdesc12(", 14) == 0)
+       {
+         *strp += 15;
+         errmsg = cgen_parse_address (cd, strp, opindex,
+                                      BFD_RELOC_FRV_FUNCDESC_GOT12,
+                                      &result_type, &value);
+         if (**strp != ')')
+           return "missing ')'";
+         ++*strp;
+         *valuep = value;
+         return errmsg;
+       }
+      else if (strncasecmp (*strp + 1, "gotoff12(", 9) == 0)
+       {
+         *strp += 10;
+         errmsg = cgen_parse_address (cd, strp, opindex,
+                                      BFD_RELOC_FRV_GOTOFF12,
+                                      &result_type, &value);
+         if (**strp != ')')
+           return "missing ')'";
+         ++*strp;
+         *valuep = value;
+         return errmsg;
+       }
+      else if (strncasecmp (*strp + 1, "gotofffuncdesc12(", 17) == 0)
+       {
+         *strp += 18;
+         errmsg = cgen_parse_address (cd, strp, opindex,
+                                      BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
+                                      &result_type, &value);
+         if (**strp != ')')
+           return "missing ')'";
+         ++*strp;
+         *valuep = value;
+         return errmsg;
+       }
     }
   return cgen_parse_signed_integer (cd, strp, opindex, valuep);
 }
@@ -314,6 +538,56 @@ parse_s12 (cd, strp, opindex, valuep)
       *valuep = value;
       return errmsg;
     }
+  else if ((**strp == '#' || **strp == '%')
+          && strncasecmp (*strp + 1, "got12(", 6) == 0)
+    {
+      *strp += 7;
+      errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_FRV_GOT12,
+                                  &result_type, &value);
+      if (**strp != ')')
+       return "missing ')'";
+      ++*strp;
+      *valuep = value;
+      return errmsg;
+    }
+  else if ((**strp == '#' || **strp == '%')
+          && strncasecmp (*strp + 1, "gotfuncdesc12(", 14) == 0)
+    {
+      *strp += 15;
+      errmsg = cgen_parse_address (cd, strp, opindex,
+                                  BFD_RELOC_FRV_FUNCDESC_GOT12,
+                                  &result_type, &value);
+      if (**strp != ')')
+       return "missing ')'";
+      ++*strp;
+      *valuep = value;
+      return errmsg;
+    }
+  else if ((**strp == '#' || **strp == '%')
+          && strncasecmp (*strp + 1, "gotoff12(", 9) == 0)
+    {
+      *strp += 10;
+      errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_FRV_GOTOFF12,
+                                  &result_type, &value);
+      if (**strp != ')')
+       return "missing ')'";
+      ++*strp;
+      *valuep = value;
+      return errmsg;
+    }
+  else if ((**strp == '#' || **strp == '%')
+          && strncasecmp (*strp + 1, "gotofffuncdesc12(", 17) == 0)
+    {
+      *strp += 18;
+      errmsg = cgen_parse_address (cd, strp, opindex,
+                                  BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
+                                  &result_type, &value);
+      if (**strp != ')')
+       return "missing ')'";
+      ++*strp;
+      *valuep = value;
+      return errmsg;
+    }
   else
     {
       if (**strp == '#')
@@ -476,7 +750,7 @@ frv_cgen_parse_operand (cd, opindex, strp, fields)
       errmsg = cgen_parse_keyword (cd, strp, & frv_cgen_opval_cccr_names, & fields->f_CCi);
       break;
     case FRV_OPERAND_CPRDOUBLEK :
-      errmsg = cgen_parse_keyword (cd, strp, & frv_cgen_opval_cpr_names, & fields->f_CPRk);
+      errmsg = parse_even_register (cd, strp, & frv_cgen_opval_cpr_names, & fields->f_CPRk);
       break;
     case FRV_OPERAND_CPRI :
       errmsg = cgen_parse_keyword (cd, strp, & frv_cgen_opval_cpr_names, & fields->f_CPRi);
@@ -515,13 +789,13 @@ frv_cgen_parse_operand (cd, opindex, strp, fields)
       errmsg = cgen_parse_keyword (cd, strp, & frv_cgen_opval_fccr_names, & fields->f_FCCk);
       break;
     case FRV_OPERAND_FRDOUBLEI :
-      errmsg = cgen_parse_keyword (cd, strp, & frv_cgen_opval_fr_names, & fields->f_FRi);
+      errmsg = parse_even_register (cd, strp, & frv_cgen_opval_fr_names, & fields->f_FRi);
       break;
     case FRV_OPERAND_FRDOUBLEJ :
-      errmsg = cgen_parse_keyword (cd, strp, & frv_cgen_opval_fr_names, & fields->f_FRj);
+      errmsg = parse_even_register (cd, strp, & frv_cgen_opval_fr_names, & fields->f_FRj);
       break;
     case FRV_OPERAND_FRDOUBLEK :
-      errmsg = cgen_parse_keyword (cd, strp, & frv_cgen_opval_fr_names, & fields->f_FRk);
+      errmsg = parse_even_register (cd, strp, & frv_cgen_opval_fr_names, & fields->f_FRk);
       break;
     case FRV_OPERAND_FRI :
       errmsg = cgen_parse_keyword (cd, strp, & frv_cgen_opval_fr_names, & fields->f_FRi);
@@ -557,7 +831,7 @@ frv_cgen_parse_operand (cd, opindex, strp, fields)
       errmsg = cgen_parse_keyword (cd, strp, & frv_cgen_opval_fr_names, & fields->f_FRk);
       break;
     case FRV_OPERAND_GRDOUBLEK :
-      errmsg = cgen_parse_keyword (cd, strp, & frv_cgen_opval_gr_names, & fields->f_GRk);
+      errmsg = parse_even_register (cd, strp, & frv_cgen_opval_gr_names, & fields->f_GRk);
       break;
     case FRV_OPERAND_GRI :
       errmsg = cgen_parse_keyword (cd, strp, & frv_cgen_opval_gr_names, & fields->f_GRi);
@@ -586,6 +860,21 @@ frv_cgen_parse_operand (cd, opindex, strp, fields)
     case FRV_OPERAND_LI :
       errmsg = cgen_parse_unsigned_integer (cd, strp, FRV_OPERAND_LI, &fields->f_LI);
       break;
+    case FRV_OPERAND_LRAD :
+      errmsg = cgen_parse_unsigned_integer (cd, strp, FRV_OPERAND_LRAD, &fields->f_LRAD);
+      break;
+    case FRV_OPERAND_LRAE :
+      errmsg = cgen_parse_unsigned_integer (cd, strp, FRV_OPERAND_LRAE, &fields->f_LRAE);
+      break;
+    case FRV_OPERAND_LRAS :
+      errmsg = cgen_parse_unsigned_integer (cd, strp, FRV_OPERAND_LRAS, &fields->f_LRAS);
+      break;
+    case FRV_OPERAND_TLBPRL :
+      errmsg = cgen_parse_unsigned_integer (cd, strp, FRV_OPERAND_TLBPRL, &fields->f_TLBPRL);
+      break;
+    case FRV_OPERAND_TLBPROPX :
+      errmsg = cgen_parse_unsigned_integer (cd, strp, FRV_OPERAND_TLBPROPX, &fields->f_TLBPRopx);
+      break;
     case FRV_OPERAND_AE :
       errmsg = cgen_parse_unsigned_integer (cd, strp, FRV_OPERAND_AE, &fields->f_ae);
       break;
This page took 0.027009 seconds and 4 git commands to generate.