public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Fix CRX disassembler for 64bit hosts
@ 2006-05-22 11:44 Nick Clifton
  0 siblings, 0 replies; only message in thread
From: Nick Clifton @ 2006-05-22 11:44 UTC (permalink / raw)
  To: binutils

Hi Guys,

  I am going to check in the patch below to fix a small problem with
  the disassembler for the CRX target when it is running on a 64-bit
  host.  The EXTRACT macro was assuming that ~0L was the equivalent of
  a number with 32 bits set in it, when of course this does not have
  to be the case.

  Discovered whilst examining crx-elf linker test results, and tested
  the same way - it eliminates two unexpected failures.

Cheers
  Nick

opcodes/ChangeLog
2006-05-22  Nick Clifton  <nickc@redhat.com>

	* crx-dis.c (EXTRACT): Make macro work on 64-bit hosts.

Index: opcodes/crx-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/crx-dis.c,v
retrieving revision 1.11
diff -c -3 -p -r1.11 crx-dis.c
*** opcodes/crx-dis.c	7 Jul 2005 19:27:48 -0000	1.11
--- opcodes/crx-dis.c	22 May 2006 08:36:05 -0000
***************
*** 30,36 ****
  
  /* Extract 'n_bits' from 'a' starting from offset 'offs'.  */
  #define EXTRACT(a, offs, n_bits)	    \
!   (n_bits == 32 ? (((a) >> (offs)) & ~0L)   \
    : (((a) >> (offs)) & ((1 << (n_bits)) -1)))
  
  /* Set Bit Mask - a mask to set all bits starting from offset 'offs'.  */
--- 30,36 ----
  
  /* Extract 'n_bits' from 'a' starting from offset 'offs'.  */
  #define EXTRACT(a, offs, n_bits)	    \
!   (n_bits == 32 ? (((a) >> (offs)) & 0xffffffffL)   \
    : (((a) >> (offs)) & ((1 << (n_bits)) -1)))
  
  /* Set Bit Mask - a mask to set all bits starting from offset 'offs'.  */


  

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-05-22  8:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-22 11:44 Fix CRX disassembler for 64bit hosts Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).