X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=opcodes%2Farc-dis.c;h=ac7379d7b7b2bec7f44f85eca0c060c7c00b77d1;hb=3f26eb3af95d6f59c98b1df1de4342bfd6523bfa;hp=b4cc241615fc939860212db1e49857a9845e5b3f;hpb=c7e2358a8849d7540212543e1a2acbac648cb973;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c index b4cc241615..ac7379d7b7 100644 --- a/opcodes/arc-dis.c +++ b/opcodes/arc-dis.c @@ -1,6 +1,6 @@ /* Instruction printing code for the ARC. - Copyright 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2005, 2007, 2009, 2010 - Free Software Foundation, Inc. + Copyright 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2005, 2007, 2009, + 2010, 2012 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). This file is part of libopcodes. @@ -60,15 +60,14 @@ typedef enum } a4_decoding_class; #define BIT(word,n) ((word) & (1 << n)) -#define BITS(word,s,e) (((word) << (31 - e)) >> (s + (31 - e))) +#define BITS(word,s,e) (((word) >> s) & ((1 << (e + 1 - s)) - 1)) #define OPCODE(word) (BITS ((word), 27, 31)) #define FIELDA(word) (BITS ((word), 21, 26)) #define FIELDB(word) (BITS ((word), 15, 20)) #define FIELDC(word) (BITS ((word), 9, 14)) -/* FIELD D is signed in all of its uses, so we make sure argument is - treated as signed for bit shifting purposes: */ -#define FIELDD(word) (BITS (((signed int)word), 0, 8)) +/* FIELD D is signed. */ +#define FIELDD(word) ((BITS ((word), 0, 8) ^ 0x100) - 0x100) #define PUT_NEXT_WORD_IN(a) \ do \