* dwarf2.c: Convert to C90, remove unneeded casts and prototypes.
[deliverable/binutils-gdb.git] / gas / config / tc-d30v.c
index d1ab8f49efdf7731f83dd4b1775bbbfdf31d59cc..7507c46cf3ede6428474ef1c39de1cc1b700de89 100644 (file)
@@ -101,7 +101,7 @@ static int d30v_current_align;
 static segT d30v_current_align_seg;
 
 /* The last seen label in the current section.  This is used to auto-align
-   labels preceeding instructions.  */
+   labels preceding instructions.  */
 static symbolS *d30v_last_label;
 
 /* Two nops.  */
@@ -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;
     }
 }
 
@@ -797,7 +796,7 @@ write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx)
       return 1;
     }
 
-  /* Note: we do not have to worry about subroutine calls occuring
+  /* Note: we do not have to worry about subroutine calls occurring
      in the right hand container.  The return address is always
      aligned to the next 64 bit boundary, be that 64 or 32 bit away.  */
   switch (exec_type)
@@ -1565,7 +1564,7 @@ do_assemble (str, opcode, shortp, is_parallel)
 
   insn = build_insn (opcode, myops);
 
-  /* Propigate multiply status.  */
+  /* Propagate multiply status.  */
   if (insn != -1)
     {
       if (is_parallel && prev_mul32_p)
@@ -2052,8 +2051,6 @@ check_size (value, bits, file, line)
 
   if (tmp > max)
     as_bad_where (file, line, _("value too large to fit in %d bits"), bits);
-
-  return;
 }
 
 /* d30v_frob_label() is called when after a label is recognized.  */
@@ -2110,7 +2107,7 @@ d30v_align (n, pfill, label)
 
   /* Do not assume that if 'd30v_current_align >= n' and
      '! switched_seg_p' that it is safe to avoid performing
-     this alignement request.  The alignment of the current frag
+     this alignment 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);
This page took 0.024388 seconds and 4 git commands to generate.