aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorPeter Bergner <bergner@linux.ibm.com>2019-05-09 09:09:47 -0500
committerPeter Bergner <bergner@linux.ibm.com>2019-05-09 09:09:47 -0500
commitbda678b9e5e4a343a9bb2b0fd20cf52035bad78e (patch)
tree84824e7309d19e73d36a41bcc5c0c2045106b66f /opcodes
parent8de09632ff6683a48b8acfb05d3b35b4ab4507fe (diff)
downloadgdb-bda678b9e5e4a343a9bb2b0fd20cf52035bad78e.zip
gdb-bda678b9e5e4a343a9bb2b0fd20cf52035bad78e.tar.gz
gdb-bda678b9e5e4a343a9bb2b0fd20cf52035bad78e.tar.bz2
Update printing of optional operands during disassembly.
opcodes/ * ppc-dis.c (skip_optional_operands): Change return type and returns. (print_insn_powerpc) <skip_optional>: Change type. Call skip_optional_operands if we have not skipped any operands. gas/ * testsuite/gas/ppc/476.d: Update expected output. * testsuite/gas/ppc/power6.d: Likewise.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ppc-dis.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c
index cb10b23..d9ae42a 100644
--- a/opcodes/ppc-dis.c
+++ b/opcodes/ppc-dis.c
@@ -479,7 +479,7 @@ operand_value_powerpc (const struct powerpc_operand *operand,
/* Determine whether the optional operand(s) should be printed. */
-static int
+static bfd_boolean
skip_optional_operands (const unsigned char *opindex,
uint64_t insn, ppc_cpu_t dialect)
{
@@ -490,7 +490,7 @@ skip_optional_operands (const unsigned char *opindex,
{
operand = &powerpc_operands[*opindex];
if ((operand->flags & PPC_OPERAND_NEXT) != 0)
- return 0;
+ return FALSE;
if ((operand->flags & PPC_OPERAND_OPTIONAL) != 0)
{
/* Negative count is used as a flag to extract function. */
@@ -498,11 +498,11 @@ skip_optional_operands (const unsigned char *opindex,
if (operand_value_powerpc (operand, insn, dialect)
!= ppc_optional_operand_value (operand, insn, dialect,
num_optional))
- return 0;
+ return FALSE;
}
}
- return 1;
+ return TRUE;
}
/* Find a match for INSN in the opcode table, given machine DIALECT. */
@@ -731,7 +731,7 @@ print_insn_powerpc (bfd_vma memaddr,
need_7spaces = 7,
need_paren
} op_separator;
- int skip_optional;
+ bfd_boolean skip_optional;
int spaces;
(*info->fprintf_func) (info->stream, "%s", opcode->name);
@@ -742,7 +742,7 @@ print_insn_powerpc (bfd_vma memaddr,
/* Now extract and print the operands. */
op_separator = spaces;
- skip_optional = -1;
+ skip_optional = FALSE;
for (opindex = opcode->operands; *opindex != 0; opindex++)
{
int64_t value;
@@ -753,9 +753,8 @@ print_insn_powerpc (bfd_vma memaddr,
then don't print any of them. */
if ((operand->flags & PPC_OPERAND_OPTIONAL) != 0)
{
- if (skip_optional < 0)
- skip_optional = skip_optional_operands (opindex, insn,
- dialect);
+ if (!skip_optional)
+ skip_optional = skip_optional_operands (opindex, insn, dialect);
if (skip_optional)
continue;
}