(obj_coff_section [BEF_ASSEMBLER]): Make 'r' mean readonly data.
[deliverable/binutils-gdb.git] / gas / config / tc-d30v.c
index 4b547b370b7c3ce135449d553e3e7bbc82bf3352..ff15eb8454b35f5ded91970c4659a95b748899ec 100644 (file)
@@ -252,32 +252,31 @@ check_range (num, bits, flags)
         Allow either.  */
       min = -((unsigned long) 1 << (bits - 1));
       max = ((unsigned long) 1 << bits) - 1;
-      return (long)num < min || (long)num > max;
+      return (long) num < min || (long) num > max;
     }
 
   if (flags & OPERAND_SHIFT)
     {
       /* We know that all shifts are right by three bits.  */
+      num >>= 3;
 
       if (flags & OPERAND_SIGNED)
-       num = (unsigned long) ((long) num >= 0)
-               ? (((long) num) >> 3)
-               : ((num >> 3) | ~(~(unsigned long) 0 >> 3));
-      else
-       num >>= 3;
+       {
+         unsigned long sign_bit = ((unsigned long) -1L >> 4) + 1;
+         num = (num ^ sign_bit) - sign_bit;
+       }
     }
 
   if (flags & OPERAND_SIGNED)
     {
       max = ((unsigned long) 1 << (bits - 1)) - 1;
       min = - ((unsigned long) 1 << (bits - 1));
-      return (long)num > max || (long)num < min;
+      return (long) num > max || (long) num < min;
     }
   else
     {
       max = ((unsigned long) 1 << bits) - 1;
-      min = 0;
-      return num > max || num < min;
+      return num > (unsigned long) max;
     }
 }
 
@@ -296,7 +295,7 @@ md_show_usage (stream)
 int
 md_parse_option (c, arg)
      int c;
-     char *arg;
+     char *arg ATTRIBUTE_UNUSED;
 {
   switch (c)
     {
@@ -332,7 +331,7 @@ md_parse_option (c, arg)
 
 symbolS *
 md_undefined_symbol (name)
-     char *name;
+     char *name ATTRIBUTE_UNUSED;
 {
   return 0;
 }
@@ -382,9 +381,9 @@ md_atof (type, litP, sizeP)
 
 void
 md_convert_frag (abfd, sec, fragP)
-     bfd *abfd;
-     asection *sec;
-     fragS *fragP;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
+     fragS *fragP ATTRIBUTE_UNUSED;
 {
   abort ();
 }
@@ -653,7 +652,7 @@ build_insn (opcode, opers)
 
       /* Truncate to the proper number of bits.  */
       if ((opers[i].X_op == O_constant) && check_range (number, bits, flags))
-       as_bad (_("operand out of range: %d"), number);
+       as_bad (_("operand out of range: %ld"), number);
       if (bits < 31)
        number &= 0x7FFFFFFF >> (31 - bits);
       if (flags & OPERAND_SHIFT)
@@ -677,7 +676,7 @@ build_insn (opcode, opers)
 
 static void
 write_long (opcode, insn, fx)
-     struct d30v_insn *opcode;
+     struct d30v_insn *opcode ATTRIBUTE_UNUSED;
      long long insn;
      Fixups *fx;
 {
@@ -793,7 +792,7 @@ write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx)
         we are not optimizing, then we have been asked to produce
         an error about such constructs.  For the purposes of this
         test, subroutine calls are considered to be branches.  */
-      write_1_short (opcode1, insn1, fx->next, false);
+      write_1_short (opcode1, insn1, fx->next, FALSE);
       return 1;
     }
 
@@ -833,14 +832,14 @@ write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx)
          /* We must treat repeat instructions likewise, since the
             following instruction has to be separate from the repeat
             in order to be repeated.  */
-         write_1_short (opcode1, insn1, fx->next, false);
+         write_1_short (opcode1, insn1, fx->next, FALSE);
          return 1;
        }
       else if (prev_left_kills_right_p)
        {
          /* The left instruction kils the right slot, so we
             must leave it empty.  */
-         write_1_short (opcode1, insn1, fx->next, false);
+         write_1_short (opcode1, insn1, fx->next, FALSE);
          return 1;
        }
       else if (opcode1->op->unit == IU)
@@ -850,7 +849,7 @@ write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx)
              /* Case 103810 is a request from Mitsubishi that opcodes
                 with EITHER_BUT_PREFER_MU should not be executed in
                 reverse sequential order.  */
-             write_1_short (opcode1, insn1, fx->next, false);
+             write_1_short (opcode1, insn1, fx->next, FALSE);
              return 1;
            }
 
@@ -1243,7 +1242,7 @@ md_assemble (str)
 
   if ((prev_insn != -1) && prev_seg
       && ((prev_seg != now_seg) || (prev_subseg != now_subseg)))
-    d30v_cleanup (false);
+    d30v_cleanup (FALSE);
 
   if (d30v_current_align < 3)
     d30v_align (3, NULL, d30v_last_label);
@@ -1282,7 +1281,7 @@ md_assemble (str)
 
          /* If two instructions are present and we already have one saved,
             then first write it out.  */
-         d30v_cleanup (false);
+         d30v_cleanup (FALSE);
 
          /* Assemble first instruction and save it.  */
          prev_insn = do_assemble (str, &prev_opcode, 1, 0);
@@ -1343,13 +1342,13 @@ md_assemble (str)
             of NOPs for us.  */
 
          if (prev_insn != -1 && (strcmp (prev_opcode.op->name, "nop") == 0))
-           d30v_cleanup (false);
+           d30v_cleanup (FALSE);
          else
            {
              char *f;
 
              if (prev_insn != -1)
-               d30v_cleanup (true);
+               d30v_cleanup (TRUE);
              else
                {
                  f = frag_more (8);
@@ -1374,7 +1373,7 @@ md_assemble (str)
     {
       /* Can't parallelize, flush current instruction and add a
          sequential NOP.  */
-      write_1_short (&opcode, (long) insn, fixups->next->next, true);
+      write_1_short (&opcode, (long) insn, fixups->next->next, TRUE);
 
       /* Make the previous instruction the current one.  */
       extype = EXEC_UNKNOWN;
@@ -1393,7 +1392,7 @@ md_assemble (str)
     {
       if (extype != EXEC_UNKNOWN)
        as_bad (_("Instruction uses long version, so it cannot be mixed as specified"));
-      d30v_cleanup (false);
+      d30v_cleanup (FALSE);
       write_long (&opcode, insn, fixups);
       prev_insn = -1;
     }
@@ -1792,7 +1791,7 @@ find_format (opcode, myops, fsize, cmp_hack)
 
 arelent *
 tc_gen_reloc (seg, fixp)
-     asection *seg;
+     asection *seg ATTRIBUTE_UNUSED;
      fixS *fixp;
 {
   arelent *reloc;
@@ -1815,8 +1814,8 @@ tc_gen_reloc (seg, fixp)
 
 int
 md_estimate_size_before_relax (fragp, seg)
-     fragS *fragp;
-     asection *seg;
+     fragS *fragp ATTRIBUTE_UNUSED;
+     asection *seg ATTRIBUTE_UNUSED;
 {
   abort ();
   return 0;
@@ -1838,7 +1837,7 @@ void
 md_apply_fix3 (fixP, valP, seg)
      fixS *fixP;
      valueT *valP;
-     segT seg;
+     segT seg ATTRIBUTE_UNUSED;
 {
   char *where;
   unsigned long insn, insn2;
@@ -1863,7 +1862,7 @@ md_apply_fix3 (fixP, valP, seg)
        as_bad (_("line %d: unable to place address of symbol '%s' into a byte"),
                fixP->fx_line, S_GET_NAME (fixP->fx_addsy));
       else if (((unsigned)value) > 0xff)
-       as_bad (_("line %d: unable to place value %x into a byte"),
+       as_bad (_("line %d: unable to place value %lx into a byte"),
                fixP->fx_line, value);
       else
        *(unsigned char *) where = value;
@@ -1874,7 +1873,7 @@ md_apply_fix3 (fixP, valP, seg)
        as_bad (_("line %d: unable to place address of symbol '%s' into a short"),
                fixP->fx_line, S_GET_NAME (fixP->fx_addsy));
       else if (((unsigned)value) > 0xffff)
-       as_bad (_("line %d: unable to place value %x into a short"),
+       as_bad (_("line %d: unable to place value %lx into a short"),
                fixP->fx_line, value);
       else
        bfd_putb16 ((bfd_vma) value, (unsigned char *) where);
@@ -1999,7 +1998,7 @@ d30v_cleanup (use_sequential)
       subseg_set (seg, subseg);
       prev_insn = -1;
       if (use_sequential)
-       prev_mul32_p = false;
+       prev_mul32_p = FALSE;
     }
 
   return 1;
@@ -2031,7 +2030,7 @@ d30v_start_line ()
     c++;
 
   if (*c == '.')
-    d30v_cleanup (false);
+    d30v_cleanup (FALSE);
 }
 
 static void
@@ -2063,7 +2062,7 @@ d30v_frob_label (lab)
      symbolS *lab;
 {
   /* Emit any pending instructions.  */
-  d30v_cleanup (false);
+  d30v_cleanup (FALSE);
 
   /* Update the label's address with the current output pointer.  */
   symbol_set_frag (lab, frag_now);
@@ -2113,7 +2112,7 @@ d30v_align (n, pfill, label)
      this alignement request.  The alignment of the current frag
      can be changed under our feet, for example by a .ascii
      directive in the source code.  cf testsuite/gas/d30v/reloc.s  */
-  d30v_cleanup (false);
+  d30v_cleanup (FALSE);
 
   if (pfill == NULL)
     {
@@ -2140,7 +2139,7 @@ d30v_align (n, pfill, label)
   if (label != NULL)
     {
       symbolS     *sym;
-      int          label_seen = false;
+      int          label_seen = FALSE;
       struct frag *old_frag;
       valueT       old_value;
       valueT       new_value;
@@ -2167,7 +2166,7 @@ d30v_align (n, pfill, label)
          if (symbol_get_frag (sym) == old_frag
              && S_GET_VALUE (sym) == old_value)
            {
-             label_seen = true;
+             label_seen = TRUE;
              symbol_set_frag (sym, frag_now);
              S_SET_VALUE (sym, new_value);
            }
@@ -2184,7 +2183,7 @@ d30v_align (n, pfill, label)
 
 static void
 s_d30v_align (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   int align;
   char fill, *pfill = NULL;
This page took 0.028811 seconds and 4 git commands to generate.