summaryrefslogtreecommitdiffstats
path: root/binutils-2.22/opcodes/frv-asm.c
diff options
context:
space:
mode:
Diffstat (limited to 'binutils-2.22/opcodes/frv-asm.c')
-rw-r--r--binutils-2.22/opcodes/frv-asm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/binutils-2.22/opcodes/frv-asm.c b/binutils-2.22/opcodes/frv-asm.c
index dffa059..3da8261 100644
--- a/binutils-2.22/opcodes/frv-asm.c
+++ b/binutils-2.22/opcodes/frv-asm.c
@@ -465,11 +465,11 @@ parse_uhi16 (CGEN_CPU_DESC cd,
if (errmsg == NULL
&& result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
{
- /* If bfd_vma is wider than 32 bits, but we have a sign-
- or zero-extension, truncate it. */
- if (value >= - ((bfd_vma)1 << 31)
- || value <= ((bfd_vma)1 << 31) - (bfd_vma)1)
- value &= (((bfd_vma)1 << 16) << 16) - 1;
+ /* If value is wider than 32 bits then be
+ careful about how we extract bits 16-31. */
+ if (sizeof (value) > 4)
+ value &= (((bfd_vma)1 << 16) << 16) - 1;
+
value >>= 16;
}
*valuep = value;