gdb.base/completion.exp: Fix comment typo
[deliverable/binutils-gdb.git] / opcodes / v850-dis.c
index 648846b1644560ebcd9fc9a4cfcd6e5e9f2d97b5..84cf2d39a6ecd9927c414ccfdde28de69f89c831 100644 (file)
@@ -1,5 +1,5 @@
 /* Disassemble V850 instructions.
-   Copyright 1996-2013 Free Software Foundation, Inc.
+   Copyright (C) 1996-2019 Free Software Foundation, Inc.
 
    This file is part of the GNU opcodes library.
 
@@ -23,7 +23,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "opcode/v850.h"
-#include "dis-asm.h"
+#include "disassemble.h"
 #include "opintl.h"
 
 static const char *const v850_reg_names[] =
@@ -73,7 +73,7 @@ static const char *const v850_cacheop_names[] =
   "chbwbd", "cibid", "cibiwbd", "cibwbd", "cfald", "cistd", "cildd"
 };
 
-static const int const v850_cacheop_codes[] =
+static const int v850_cacheop_codes[] =
 {
   0x00, 0x20, 0x40, 0x60, 0x61, 0x04, 0x06,
   0x07, 0x24, 0x26, 0x27, 0x44, 0x64, 0x65, -1
@@ -82,7 +82,7 @@ static const int const v850_cacheop_codes[] =
 static const char *const v850_prefop_names[] =
 { "prefi", "prefd" };
 
-static const int const v850_prefop_codes[] =
+static const int v850_prefop_codes[] =
 { 0x00, 0x04, -1};
 
 static void
@@ -94,6 +94,9 @@ print_value (int flags,
   if (flags & V850_PCREL)
     {
       bfd_vma addr = value + memaddr;
+
+      if (flags & V850_INVERSE_PCREL)
+       addr = memaddr - value;
       info->print_address_func (addr, info);
     }
   else if (flags & V850_OPERAND_DISP)
@@ -149,7 +152,7 @@ get_operand_value (const struct v850_operand *operand,
          if (operand->flags & V850E_IMMEDIATE16HI)
            value <<= 16;
          else if (value & 0x8000)
-           value |= (-1L << 16);
+           value |= (-1UL << 16);
 
          return value;
        }
@@ -402,7 +405,7 @@ disassemble (bfd_vma memaddr,
                {
                  info->fprintf_func (info->stream, ", %s[", prefix);
                  square = TRUE;
-               }               
+               }
              else if (opnum > 1)
                info->fprintf_func (info->stream, ", %s", prefix);
 
@@ -447,7 +450,8 @@ disassemble (bfd_vma memaddr,
                      case 0xffe00001: regs = list12_regs; break;
                      default:
                        /* xgettext:c-format */
-                       fprintf (stderr, _("unknown operand shift: %x\n"), operand->shift);
+                       opcodes_error_handler (_("unknown operand shift: %x"),
+                                              operand->shift);
                        abort ();
                      }
 
@@ -457,10 +461,17 @@ disassemble (bfd_vma memaddr,
                          {
                            switch (regs[ i ])
                              {
-                             default: mask |= (1 << regs[ i ]); break;
+                             default:
+                               mask |= (1 << regs[ i ]);
+                               break;
+                             case 0:
                                /* xgettext:c-format */
-                             case 0:  fprintf (stderr, _("unknown reg: %d\n"), i ); abort ();
-                             case -1: pc = 1; break;
+                               opcodes_error_handler (_("unknown reg: %d"), i);
+                               abort ();
+                               break;
+                             case -1:
+                               pc = 1;
+                               break;
                              }
                          }
                      }
This page took 0.025881 seconds and 4 git commands to generate.