X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=opcodes%2Ftilegx-opc.c;h=cc9ce861b9a506cececa8c4f72fad563b443e47b;hb=fb46334198d8d4f82133033758cb75f086d864ad;hp=b1b427e249e72663ef184c6d968f6b87ee0187bc;hpb=219d1afa89d0d53ca93a684cac341f16470f3ca0;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/tilegx-opc.c b/opcodes/tilegx-opc.c index b1b427e249..cc9ce861b9 100644 --- a/opcodes/tilegx-opc.c +++ b/opcodes/tilegx-opc.c @@ -1,6 +1,6 @@ /* TILE-Gx opcode information. - Copyright (C) 2011-2018 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 @@ -8102,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. */