X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=opcodes%2Ftilepro-opc.c;h=c71da3df8a11c04796cbbe0d45426614884cf0e6;hb=99a5596592eda72c5c60b45cdfabb47e426132d5;hp=08bf6112fecee3434a1a42623cdb45e428ddaf8c;hpb=6f2750feaf2827ef8a1a0a5b2f90c1e9a6cabbd1;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/tilepro-opc.c b/opcodes/tilepro-opc.c index 08bf6112fe..c71da3df8a 100644 --- a/opcodes/tilepro-opc.c +++ b/opcodes/tilepro-opc.c @@ -1,6 +1,6 @@ /* TILEPro opcode information. - Copyright (C) 2011-2016 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 @@ -10220,8 +10220,8 @@ parse_insn_tilepro (tilepro_bundle_bits bits, if (op->is_signed) { /* Sign-extend the operand. */ - int shift = (int)((sizeof(int) * 8) - op->num_bits); - opval = (opval << shift) >> shift; + unsigned int sign = 1u << (op->num_bits - 1); + opval = ((opval & (sign + sign - 1)) ^ sign) - sign; } /* Adjust PC-relative scaled branch offsets. */