aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/xmon/ppc-dis.c
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2006-11-22 18:46:47 -0500
committerPaul Mackerras <paulus@samba.org>2006-12-04 04:40:36 -0500
commit897f112bb42ed9e220ce441e7e52aba3a144a7d6 (patch)
treea4cfa727731319721cfd6fe3702d6b6f5ea85e06 /arch/powerpc/xmon/ppc-dis.c
parent0b8e2e131094d162a836e2afe86e52acbfa05703 (diff)
[POWERPC] Import updated version of ppc disassembly code for xmon
This includes: * version 1.24 of ppc-dis.c * version 1.88 of ppc-opc.c * version 1.23 of ppc.h I can't vouch for the accuracy etc. of these changes, but it brings us into line with binutils - and from a cursory test appears to work fine. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'arch/powerpc/xmon/ppc-dis.c')
-rw-r--r--arch/powerpc/xmon/ppc-dis.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/arch/powerpc/xmon/ppc-dis.c b/arch/powerpc/xmon/ppc-dis.c
index 08652742fa77..89098f320ad5 100644
--- a/arch/powerpc/xmon/ppc-dis.c
+++ b/arch/powerpc/xmon/ppc-dis.c
@@ -1,5 +1,6 @@
1/* ppc-dis.c -- Disassemble PowerPC instructions 1/* ppc-dis.c -- Disassemble PowerPC instructions
2 Copyright 1994 Free Software Foundation, Inc. 2 Copyright 1994, 1995, 2000, 2001, 2002, 2003, 2004, 2005, 2006
3 Free Software Foundation, Inc.
3 Written by Ian Lance Taylor, Cygnus Support 4 Written by Ian Lance Taylor, Cygnus Support
4 5
5This file is part of GDB, GAS, and the GNU binutils. 6This file is part of GDB, GAS, and the GNU binutils.
@@ -16,8 +17,9 @@ the GNU General Public License for more details.
16 17
17You should have received a copy of the GNU General Public License 18You should have received a copy of the GNU General Public License
18along with this file; see the file COPYING. If not, write to the Free 19along with this file; see the file COPYING. If not, write to the Free
19Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 20Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
20 21
22#include <asm/cputable.h>
21#include "nonstdio.h" 23#include "nonstdio.h"
22#include "ansidecl.h" 24#include "ansidecl.h"
23#include "ppc.h" 25#include "ppc.h"
@@ -36,6 +38,15 @@ print_insn_powerpc (unsigned long insn, unsigned long memaddr)
36 dialect = PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_COMMON 38 dialect = PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_COMMON
37 | PPC_OPCODE_64 | PPC_OPCODE_POWER4 | PPC_OPCODE_ALTIVEC; 39 | PPC_OPCODE_64 | PPC_OPCODE_POWER4 | PPC_OPCODE_ALTIVEC;
38 40
41 if (cpu_has_feature(CPU_FTRS_POWER5))
42 dialect |= PPC_OPCODE_POWER5;
43
44 if (cpu_has_feature(CPU_FTRS_CELL))
45 dialect |= PPC_OPCODE_CELL | PPC_OPCODE_ALTIVEC;
46
47 if (cpu_has_feature(CPU_FTRS_POWER6))
48 dialect |= PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_ALTIVEC;
49
39 /* Get the major opcode of the instruction. */ 50 /* Get the major opcode of the instruction. */
40 op = PPC_OP (insn); 51 op = PPC_OP (insn);
41 52
@@ -120,7 +131,8 @@ print_insn_powerpc (unsigned long insn, unsigned long memaddr)
120 } 131 }
121 132
122 /* Print the operand as directed by the flags. */ 133 /* Print the operand as directed by the flags. */
123 if ((operand->flags & PPC_OPERAND_GPR) != 0) 134 if ((operand->flags & PPC_OPERAND_GPR) != 0
135 || ((operand->flags & PPC_OPERAND_GPR_0) != 0 && value != 0))
124 printf("r%ld", value); 136 printf("r%ld", value);
125 else if ((operand->flags & PPC_OPERAND_FPR) != 0) 137 else if ((operand->flags & PPC_OPERAND_FPR) != 0)
126 printf("f%ld", value); 138 printf("f%ld", value);
@@ -136,7 +148,7 @@ print_insn_powerpc (unsigned long insn, unsigned long memaddr)
136 else 148 else
137 { 149 {
138 if (operand->bits == 3) 150 if (operand->bits == 3)
139 printf("cr%d", value); 151 printf("cr%ld", value);
140 else 152 else
141 { 153 {
142 static const char *cbnames[4] = { "lt", "gt", "eq", "so" }; 154 static const char *cbnames[4] = { "lt", "gt", "eq", "so" };