]> Git Repo - binutils.git/blobdiff - gas/config/tc-a29k.c
* main.c: Move entire file except for #ifndef MAIN_OVERRIDE code
[binutils.git] / gas / config / tc-a29k.c
index 72b61f78b82a84f1df98ff1bea4eee4d5140b347..5fa85bbc1c83333da87c6afff80516f5c01ac23e 100644 (file)
@@ -168,7 +168,6 @@ s_use (ignore)
 
   as_bad ("Unknown segment type");
   demand_empty_rest_of_line ();
-  return;
 }
 
 static void
@@ -176,7 +175,6 @@ s_data1 ()
 {
   subseg_set (SEG_DATA, 1);
   demand_empty_rest_of_line ();
-  return;
 }
 
 #endif /* OBJ_COFF */
@@ -292,8 +290,10 @@ md_begin ()
 
       if (!strcmp (name, machine_opcodes[i + 1].name))
        {
-         if ((machine_opcodes[i].opcode ^ machine_opcodes[i + 1].opcode)
-             != 0x01000000)
+         if ((machine_opcodes[i].opcode & 0x01000000) != 0
+             || (machine_opcodes[i + 1].opcode & 0x01000000) == 0
+             || ((machine_opcodes[i].opcode | 0x01000000)
+                 != machine_opcodes[i + 1].opcode))
            goto bad_table;
          strend = machine_opcodes[i].args + strlen (machine_opcodes[i].args) - 1;
          strend2 = machine_opcodes[i + 1].args + strlen (machine_opcodes[i + 1].args) - 1;
@@ -303,18 +303,10 @@ md_begin ()
              if (*strend2 != 'i')
                goto bad_table;
              break;
-           case 'i':
-             if (*strend2 != 'b')
-               goto bad_table;
-             break;
            case 'P':
              if (*strend2 != 'A')
                goto bad_table;
              break;
-           case 'A':
-             if (*strend2 != 'P')
-               goto bad_table;
-             break;
            default:
            bad_table:
              fprintf (stderr, "internal error: can't handle opcode %s\n",
@@ -325,10 +317,7 @@ md_begin ()
          /* OK, this is an i/b or A/P pair.  We skip the
             higher-valued one, and let the code for operand checking
             handle OR-ing in the bit.  */
-         if (machine_opcodes[i].opcode & 1)
-           continue;
-         else
-           skipnext = 1;
+         skipnext = 1;
        }
 
       retval = hash_insert (op_hash, name, (PTR) &machine_opcodes[i]);
@@ -355,12 +344,6 @@ md_begin ()
   define_some_regs ();
 }
 
-void
-md_end ()
-{
-  return;
-}
-
 /* Assemble a single instruction.  Its label has already been handled
    by the generic front end.  We just parse opcode and operands, and
    produce the bytes of data and relocation.  */
@@ -512,6 +495,10 @@ machine_ip (str)
          if (operand->X_op == O_register)
            goto general_reg;
 
+         /* Make sure the 'i' case really exists.  */
+         if ((insn->opcode | IMMEDIATE_BIT) != (insn + 1)->opcode)
+           break;
+
          opcode |= IMMEDIATE_BIT;
          if (operand->X_op == O_constant)
            {
@@ -594,6 +581,9 @@ machine_ip (str)
             opcode table entries together.  */
          if (operand->X_op == O_constant)
            {
+             /* Make sure the 'A' case really exists.  */
+             if ((insn->opcode | ABSOLUTE_BIT) != (insn + 1)->opcode)
+               break;
              opcode |= ABSOLUTE_BIT |
                (operand->X_add_number & 0x0003FC00) << 6 |
                ((operand->X_add_number & 0x000003FC) >> 2);
@@ -766,7 +756,7 @@ md_atof (type, litP, sizeP)
       md_number_to_chars (litP, (valueT) (*wordP++), sizeof (LITTLENUM_TYPE));
       litP += sizeof (LITTLENUM_TYPE);
     }
-  return "";
+  return 0;
 }
 
 /*
@@ -778,23 +768,7 @@ md_number_to_chars (buf, val, n)
      valueT val;
      int n;
 {
-
-  switch (n)
-    {
-
-    case 4:
-      *buf++ = val >> 24;
-      *buf++ = val >> 16;
-    case 2:
-      *buf++ = val >> 8;
-    case 1:
-      *buf = val;
-      break;
-
-    default:
-      as_fatal ("failed sanity check.");
-    }
-  return;
+  number_to_chars_bigendian (buf, val, n);
 }
 
 void
@@ -892,7 +866,6 @@ md_apply_fix (fixP, val)
       as_bad ("bad relocation type: 0x%02x", fixP->fx_r_type);
       break;
     }
-  return;
 }
 
 #ifdef OBJ_COFF
@@ -1018,7 +991,6 @@ print_insn (insn)
   fprintf (stderr, "\t\tX_add_number = %d\n",
           insn->exp.X_add_number);
   fprintf (stderr, "}\n");
-  return;
 }
 
 #endif
This page took 0.028134 seconds and 4 git commands to generate.