aboutsummaryrefslogtreecommitdiff
path: root/opcodes/ppc-dis.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-11-15 01:08:53 +0000
committerAlan Modra <amodra@gmail.com>2001-11-15 01:08:53 +0000
commit802a735ed9198edde076bc37ef7234d319e41759 (patch)
tree4d9f93607a463fda60a1caa7d2ebba29bb39525a /opcodes/ppc-dis.c
parent025eb37b3961035d9c99ae207e8e8123273f7301 (diff)
downloadgdb-802a735ed9198edde076bc37ef7234d319e41759.zip
gdb-802a735ed9198edde076bc37ef7234d319e41759.tar.gz
gdb-802a735ed9198edde076bc37ef7234d319e41759.tar.bz2
binutils/ChangeLog
* doc/binutils.texi (objdump): Document ppc -M options. gas/ChangeLog * config/tc-ppc.c (ppc_insert_operand): Pass (ppc_cpu | ppc_size) to operand->insert. (md_assemble): Likewise. gas/testsuite/ChangeLog * gas/ppc/booke.d: Modify reloc and target matches for powerpc64. include/opcode/ChangeLog * ppc.h (struct powerpc_operand <insert, extract>): Add dialect param. opcodes/ChangeLog * ppc-opc.c (PPC64): Revert 2001-10-12. Do include PPC_OPCODE_PPC. (insert_bat, extract_bat, insert_bba, extract_bba, insert_bd, extract_bd, insert_bdm, extract_bdm, insert_bdp, extract_bdp, valid_bo, insert_bo, extract_bo, insert_boe, extract_boe, insert_ds, extract_ds, insert_de, extract_de, insert_des, extract_des, insert_li, extract_li, insert_mbe, extract_mbe, insert_mb6, extract_mb6, insert_nb, extract_nb, insert_nsi, extract_nsi, insert_ral, insert_ram, insert_ras, insert_rbs, extract_rbs, insert_sh6, extract_sh6, insert_spr, extract_spr, insert_tbr, extract_tbr): Add dialect param. (extract_bd, extract_bdm, extract_bdp, extract_ds, extract_des, extract_li, extract_nsi): Implement sign extension without conditional. (insert_bdm, extract_bdm, insert_bdp, extract_bdp, valid_bo): Handle 64 bit branch hints. (extract_bdm, extract_bdp): Correct 32 bit validation. (AT1_MASK, AT2_MASK): Define. (BBOAT_MASK): Define. (BBOATCB_MASK, BBOAT2CB_MASK, BBOATBI_MASK): Define. (BOFM64, BOFP64, BOTM64, BOTP64): Define. (BODNZM64, BODNZP64, BODZM64, BODZP64): Define. (PPCCOM32, PPCCOM64): Define. (powerpc_opcodes): Modify existing 32 bit insns with branch hints and add new patterns to implement 64 bit branches with hints. Move booke instructions so they match before ppc64. * ppc-dis.c (powerpc_dialect): Set PPC_OPCODE_64 in dialect for 64 bit default targets, and parse "32" and "64" in options. Formatting fixes. (print_insn_powerpc): Pass dialect to operand->extract.
Diffstat (limited to 'opcodes/ppc-dis.c')
-rw-r--r--opcodes/ppc-dis.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c
index bb6c0ca..5d654c0 100644
--- a/opcodes/ppc-dis.c
+++ b/opcodes/ppc-dis.c
@@ -44,13 +44,25 @@ powerpc_dialect(info)
{
int dialect = PPC_OPCODE_PPC | PPC_OPCODE_ALTIVEC;
- if (info->disassembler_options &&
- (strcmp(info->disassembler_options, "booke") == 0 ||
- strcmp(info->disassembler_options, "booke32") == 0 ||
- strcmp(info->disassembler_options, "booke64") == 0))
+ if (BFD_DEFAULT_TARGET_SIZE == 64)
+ dialect |= PPC_OPCODE_64;
+
+ if (info->disassembler_options
+ && (strcmp (info->disassembler_options, "booke") == 0
+ || strcmp (info->disassembler_options, "booke32") == 0
+ || strcmp (info->disassembler_options, "booke64") == 0))
dialect |= PPC_OPCODE_BOOKE | PPC_OPCODE_BOOKE64;
else
dialect |= PPC_OPCODE_403 | PPC_OPCODE_601;
+
+ if (info->disassembler_options)
+ {
+ if (strstr (info->disassembler_options, "32") != NULL)
+ dialect &= ~PPC_OPCODE_64;
+ else if (strstr (info->disassembler_options, "64") != NULL)
+ dialect |= PPC_OPCODE_64;
+ }
+
return dialect;
}
@@ -145,7 +157,7 @@ print_insn_powerpc (memaddr, info, bigendian, dialect)
{
operand = powerpc_operands + *opindex;
if (operand->extract)
- (*operand->extract) (insn, &invalid);
+ (*operand->extract) (insn, dialect, &invalid);
}
if (invalid)
continue;
@@ -172,7 +184,7 @@ print_insn_powerpc (memaddr, info, bigendian, dialect)
/* Extract the value from the instruction. */
if (operand->extract)
- value = (*operand->extract) (insn, (int *) NULL);
+ value = (*operand->extract) (insn, dialect, (int *) NULL);
else
{
value = (insn >> operand->shift) & ((1 << operand->bits) - 1);