diff options
author | Nick Clifton <nickc@redhat.com> | 2011-12-15 10:21:48 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2011-12-15 10:21:48 +0000 |
commit | 39febd9d58bcbbd4223b95369921e5d6224ea963 (patch) | |
tree | c317f3a9d1a0ee319f88131c3fdfb4a4b9f874b2 /cpu | |
parent | 2d084f7531b246cb9ecfa81566eff2ea54b54a94 (diff) | |
download | binutils-redhat-39febd9d58bcbbd4223b95369921e5d6224ea963.tar.gz |
* frv.opc (parse_uhi16): Fix handling of %hi operator on 64-bit
hosts.
* cgen-asm.c (cgen_parse_signed_integer): Add code to handle the
sign extension of negative values on a 64-bit host.
* frv-asm.c: Regenerate.
* gas/frv/immediates.s: New test file - checks assembly of
constant values.
* gas/frv/immediates.d: Expected disassmbly.
* gas/frv/allinsn.exp: Run the new test.
Diffstat (limited to 'cpu')
-rw-r--r-- | cpu/ChangeLog | 5 | ||||
-rw-r--r-- | cpu/frv.opc | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/cpu/ChangeLog b/cpu/ChangeLog index d04a554a71..1f5418714d 100644 --- a/cpu/ChangeLog +++ b/cpu/ChangeLog @@ -1,3 +1,8 @@ +2011-12-15 Nick Clifton <nickc@redhat.com> + + * frv.opc (parse_uhi16): Fix handling of %hi operator on 64-bit + hosts. + 2011-10-26 Joern Rennecke <joern.rennecke@embecosm.com> * epiphany.opc (parse_branch_addr): Fix type of valuep. diff --git a/cpu/frv.opc b/cpu/frv.opc index f81cef0d60..869155d67a 100644 --- a/cpu/frv.opc +++ b/cpu/frv.opc @@ -1343,11 +1343,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; |