This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
64-bit host failures, arc
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Mon, 27 Feb 2012 17:01:37 +1030
- Subject: 64-bit host failures, arc
- Authentication-results: mr.google.com; spf=pass (google.com: domain of amodra@gmail.com designates 10.68.73.138 as permitted sender) smtp.mail=amodra@gmail.com; dkim=pass header.i=amodra@gmail.com
This is the first of a patch series fixing numerous places in binutils
that aren't 64-bit clean. In this case the problem was an assumption
that "long" was exactly 32 bits wide, leading to a bunch of testsuite
failures when that wasn't so.
arc-elf +FAIL: gas/arc/ld
arc-elf +FAIL: gas/arc/ld2
arc-elf +FAIL: gas/arc/st
arc-elf +FAIL: gas/arc/flag
arc-elf +FAIL: gas/arc/brk
arc-elf +FAIL: gas/arc/sleep
arc-elf +FAIL: gas/arc/swi
arc-elf +FAIL: gas/arc/asr
arc-elf +FAIL: gas/arc/lsr
arc-elf +FAIL: gas/arc/ror
arc-elf +FAIL: gas/arc/rrc
arc-elf +FAIL: gas/arc/sexb
arc-elf +FAIL: gas/arc/sexw
arc-elf +FAIL: gas/arc/extb
arc-elf +FAIL: gas/arc/extw
arc-elf +FAIL: gas/arc/b
arc-elf +FAIL: gas/arc/bl
arc-elf +FAIL: gas/arc/lp
arc-elf +FAIL: gas/arc/j
arc-elf +FAIL: gas/arc/jl
arc-elf +FAIL: gas/arc/add
arc-elf +FAIL: gas/arc/asl
arc-elf +FAIL: gas/arc/adc
arc-elf +FAIL: gas/arc/rlc
arc-elf +FAIL: gas/arc/sub
arc-elf +FAIL: gas/arc/sbc
arc-elf +FAIL: gas/arc/and
arc-elf +FAIL: gas/arc/mov
arc-elf +FAIL: gas/arc/or
arc-elf +FAIL: gas/arc/bic
arc-elf +FAIL: gas/arc/xor
arc-elf +FAIL: gas/arc/extensions
* arc-dis.c (BITS): Don't use shifts to mask off bits.
(FIELDD): Sign extend with xor,sub.
Index: opcodes/arc-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/arc-dis.c,v
retrieving revision 1.15
diff -u -p -r1.15 arc-dis.c
--- opcodes/arc-dis.c 27 Jun 2010 04:07:55 -0000 1.15
+++ opcodes/arc-dis.c 26 Feb 2012 03:50:08 -0000
@@ -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 \
--
Alan Modra
Australia Development Lab, IBM