aboutsummaryrefslogtreecommitdiff
path: root/opcodes/ppc-dis.c
diff options
context:
space:
mode:
authorPeter Bergner <bergner@vnet.ibm.com>2009-04-02 13:30:56 +0000
committerPeter Bergner <bergner@vnet.ibm.com>2009-04-02 13:30:56 +0000
commit70dc4e324b9aecad6c9732ebedd0eeb66eb2e176 (patch)
treeb539b11cb2008f64cbfea4bc4bf6e07e73e3c7c9 /opcodes/ppc-dis.c
parent5b19eaba0d7d5d8da864c0569543a61ec1eacaa4 (diff)
downloadfsf-binutils-gdb-70dc4e324b9aecad6c9732ebedd0eeb66eb2e176.zip
fsf-binutils-gdb-70dc4e324b9aecad6c9732ebedd0eeb66eb2e176.tar.gz
fsf-binutils-gdb-70dc4e324b9aecad6c9732ebedd0eeb66eb2e176.tar.bz2
opcodes/
* ppc-dis.c (powerpc_init_dialect): Do not choose a default dialect due to -many/-Many. (print_insn_powerpc): Make sure we only deprecate instructions using the original dialect and not a modified dialect due to -Many handling. Move the handling of the condition register and default operands to the end of the if/else if/else chain. * ppc-opc.c (powerpc_opcodes): Reorder the opcode table so that instructions from newer processors are listed before older ones. <"icblce", "sync", "eieio", "tlbld">: Deprecate for processors that have instructions with conflicting opcodes.
Diffstat (limited to 'opcodes/ppc-dis.c')
-rw-r--r--opcodes/ppc-dis.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c
index 2cbbec8..8511345 100644
--- a/opcodes/ppc-dis.c
+++ b/opcodes/ppc-dis.c
@@ -226,15 +226,12 @@ powerpc_init_dialect (struct disassemble_info *info)
arg = end;
}
- if ((dialect & ~(PPC_OPCODE_ANY | PPC_OPCODE_32 | PPC_OPCODE_64)) == 0)
+ if ((dialect & ~(PPC_OPCODE_32 | PPC_OPCODE_64)) == 0)
{
- if ((dialect & (PPC_OPCODE_32 | PPC_OPCODE_64)) == 0)
- {
- if (info->mach == bfd_mach_ppc64)
- dialect |= PPC_OPCODE_64;
- else
- dialect |= PPC_OPCODE_32;
- }
+ if (info->mach == bfd_mach_ppc64)
+ dialect |= PPC_OPCODE_64;
+ else
+ dialect |= PPC_OPCODE_32;
/* Choose a reasonable default. */
dialect |= (PPC_OPCODE_PPC | PPC_OPCODE_COMMON | PPC_OPCODE_CLASSIC
| PPC_OPCODE_601 | PPC_OPCODE_ALTIVEC);
@@ -338,6 +335,7 @@ print_insn_powerpc (bfd_vma memaddr,
const struct powerpc_opcode *opcode;
const struct powerpc_opcode *opcode_end;
unsigned long op;
+ ppc_cpu_t dialect_orig = dialect;
status = (*info->read_memory_func) (memaddr, buffer, 4, info);
if (status != 0)
@@ -376,7 +374,7 @@ print_insn_powerpc (bfd_vma memaddr,
if ((insn & opcode->mask) != opcode->opcode
|| (opcode->flags & dialect) == 0
- || (opcode->deprecated & dialect) != 0)
+ || (opcode->deprecated & dialect_orig) != 0)
continue;
/* Make two passes over the operands. First see if any of them
@@ -447,16 +445,14 @@ print_insn_powerpc (bfd_vma memaddr,
(*info->print_address_func) (memaddr + value, info);
else if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0)
(*info->print_address_func) ((bfd_vma) value & 0xffffffff, info);
- else if ((operand->flags & PPC_OPERAND_CR) == 0
- || (dialect & PPC_OPCODE_PPC) == 0)
- (*info->fprintf_func) (info->stream, "%ld", value);
else if ((operand->flags & PPC_OPERAND_FSL) != 0)
(*info->fprintf_func) (info->stream, "fsl%ld", value);
else if ((operand->flags & PPC_OPERAND_FCR) != 0)
(*info->fprintf_func) (info->stream, "fcr%ld", value);
else if ((operand->flags & PPC_OPERAND_UDI) != 0)
(*info->fprintf_func) (info->stream, "%ld", value);
- else
+ else if ((operand->flags & PPC_OPERAND_CR) != 0
+ && (dialect & PPC_OPCODE_PPC) != 0)
{
if (operand->bitm == 7)
(*info->fprintf_func) (info->stream, "cr%ld", value);
@@ -473,6 +469,8 @@ print_insn_powerpc (bfd_vma memaddr,
(*info->fprintf_func) (info->stream, "%s", cbnames[cc]);
}
}
+ else
+ (*info->fprintf_func) (info->stream, "%ld", value);
if (need_paren)
{