X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=opcodes%2Ftilepro-opc.c;h=6449945aa4f4388d5cb973452030b180ccee5e62;hb=abb78b78c4184d2ac968362229adae268385a21c;hp=eca72808cbc6547c1bebb221f2691d3bc537067a;hpb=5eb3690ee9d6bf3a5d60d2853bc6c1be8c251f06;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/tilepro-opc.c b/opcodes/tilepro-opc.c index eca72808cb..6449945aa4 100644 --- a/opcodes/tilepro-opc.c +++ b/opcodes/tilepro-opc.c @@ -1,6 +1,6 @@ /* TILEPro opcode information. - Copyright 2011 Free Software Foundation, Inc. + Copyright (C) 2011-2020 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. */