]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - opcodes/visium-dis.c
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / opcodes / visium-dis.c
index c71f8cf25ab3aea3270aa711ede5df5f6cb529c8..d27aef53ef14c1ea9bb3d3c1c68b97803216ce0b 100644 (file)
@@ -1,6 +1,6 @@
 /* Single instruction disassembler for the Visium.
 
-   Copyright (C) 2002-2019 Free Software Foundation, Inc.
+   Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
    This file is part of the GNU opcodes library.
 
@@ -94,7 +94,7 @@ disassem_class0 (disassemble_info *info, unsigned int ins)
       /* BRR instruction.  */
       {
        unsigned cbf = (ins >> 27) & 0x000f;
-       int displacement = ((int) (ins << 16)) >> 16;
+       int displacement = ((ins & 0xffff) ^ 0x8000) - 0x8000;
 
        if (ins == 0)
          (*info->fprintf_func) (info->stream, "nop");
@@ -166,7 +166,7 @@ disassem_class0 (disassemble_info *info, unsigned int ins)
     }
   return 0;
 
-illegal_opcode:
+ illegal_opcode:
   return -1;
 }
 
@@ -421,7 +421,7 @@ disassem_class1 (disassemble_info *info, unsigned int ins)
 
   return 0;
 
-illegal_opcode:
+ illegal_opcode:
   return -1;
 }
 
@@ -518,7 +518,7 @@ disassem_class2 (disassemble_info *info, unsigned int ins)
 
   return 0;
 
-illegal_opcode:
+ illegal_opcode:
   return -1;
 }
 
@@ -747,7 +747,7 @@ disassem_class3 (disassemble_info *info, unsigned int ins)
 
   return 0;
 
-illegal_opcode:
+ illegal_opcode:
   return -1;
 
 }
@@ -789,7 +789,7 @@ print_insn_visium (bfd_vma addr, disassemble_info *info)
 
   /* Get 32-bit instruction word.  */
   FETCH_DATA (info, buffer + 4);
-  ins = buffer[0] << 24;
+  ins = (unsigned) buffer[0] << 24;
   ins |= buffer[1] << 16;
   ins |= buffer[2] << 8;
   ins |= buffer[3];