opcodes:
[deliverable/binutils-gdb.git] / gas / config / tc-d10v.c
index 33926fb9f918a9235ab2b9e3b16a62dfadb0ed94..d20ae10475fe73cc779e18c8408c5894702ae307 100644 (file)
@@ -196,10 +196,19 @@ check_range (num, bits, flags)
 
   if (flags & OPERAND_SIGNED)
     {
-      max = (1 << (bits - 1))-1; 
-      min = - (1 << (bits - 1));  
-      if (((long)num > max) || ((long)num < min))
-       retval = 1;
+      /* Signed 3-bit integers are restricted to the (-2, 3) range */
+      if (flags & RESTRICTED_NUM3)
+       {
+         if ((long) num < -2 || (long) num > 3)
+           retval = 1;
+       }
+      else
+       {
+         max = (1 << (bits - 1)) - 1; 
+         min = - (1 << (bits - 1));  
+         if (((long) num > max) || ((long) num < min))
+           retval = 1;
+       }
     }
   else
     {
@@ -1244,7 +1253,7 @@ find_opcode (opcode, myops)
                    value = S_GET_VALUE(myops[opnum].X_add_symbol) - value -
                      (obstack_next_free(&frchain_now->frch_obstack) - frag_now->fr_literal);
                  else
-                   value = S_GET_VALUE(myops[opnum].X_add_symbol);
+                   value += S_GET_VALUE(myops[opnum].X_add_symbol);
 
                  if (AT_WORD_P (&myops[opnum]))
                    {
@@ -1305,7 +1314,7 @@ find_opcode (opcode, myops)
                  ((flags & OPERAND_PLUS)    && ((X_op != O_absent) || (num != OPERAND_PLUS))) ||
                  ((flags & OPERAND_ATMINUS) && ((X_op != O_absent) || (num != OPERAND_ATMINUS))) ||
                  ((flags & OPERAND_ATPAR)   && ((X_op != O_absent) || (num != OPERAND_ATPAR))) ||
-                 ((flags & OPERAND_ATSIGN)  && ((X_op != O_absent) || (num != OPERAND_ATSIGN))))
+                 ((flags & OPERAND_ATSIGN)  && ((X_op != O_absent) || ((num != OPERAND_ATSIGN) && (num != OPERAND_ATPAR)))))
                {
                  match = 0;
                  break;
This page took 0.024929 seconds and 4 git commands to generate.