Automatic date update in version.in
[deliverable/binutils-gdb.git] / opcodes / tilegx-opc.c
index 682dd1b1aab3e7b9b1bd1b084636bc4b62aa237e..cc9ce861b9a506cececa8c4f72fad563b443e47b 100644 (file)
@@ -1,6 +1,6 @@
 /* TILE-Gx opcode information.
 
-   Copyright 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2019 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
     Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
     MA 02110-1301, USA.  */
 
+#include "sysdep.h"
+
 /* This define is BFD_RELOC_##x for real bfd, or -1 for everyone else.  */
 #define BFD_RELOC(x) BFD_RELOC_##x
-
 #include "bfd.h"
 
 /* Special registers.  */
@@ -8101,8 +8102,8 @@ parse_insn_tilegx (tilegx_bundle_bits bits,
          if (op->is_signed)
            {
              /* Sign-extend the operand.  */
-             int shift = (int)((sizeof(int) * 8) - op->num_bits);
-             raw_opval = (raw_opval << shift) >> shift;
+             unsigned int sign = 1u << (op->num_bits - 1);
+             raw_opval = ((raw_opval & (sign + sign - 1)) ^ sign) - sign;
            }
 
          /* Adjust PC-relative scaled branch offsets.  */
This page took 0.023557 seconds and 4 git commands to generate.