Support for Toshiba MeP and for complex relocations.
[deliverable/binutils-gdb.git] / cpu / m32r.opc
index afe12eb7b6c7edb27e953eb29c486826f15ec3ca..ab69d078c8648bfdae89ebc77197c38c8ef16308 100644 (file)
@@ -127,7 +127,10 @@ parse_hi16 (CGEN_CPU_DESC cd,
       ++*strp;
       if (errmsg == NULL
          && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
-       value >>= 16;
+       {
+         value >>= 16;
+         value &= 0xffff;
+       }
       *valuep = value;
       return errmsg;
     }
@@ -142,8 +145,9 @@ parse_hi16 (CGEN_CPU_DESC cd,
       if (errmsg == NULL
          && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
         {
-          value = value + (value & 0x8000 ? 0x10000 : 0);
+          value += 0x8000;
           value >>= 16;
+         value &= 0xffff;
         }
       *valuep = value;
       return errmsg;
@@ -179,11 +183,7 @@ parse_slo16 (CGEN_CPU_DESC cd,
       ++*strp;
       if (errmsg == NULL
          && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
-        {
-         value &= 0xffff;
-          if (value & 0x8000)
-           value |= ~0xffff;
-        }
+       value = ((value & 0xffff) ^ 0x8000) - 0x8000;    
       *valuep = value;
       return errmsg;
     }
This page took 0.027211 seconds and 4 git commands to generate.