Update printing of optional operands during disassembly.
authorPeter Bergner <bergner@linux.ibm.com>
Thu, 9 May 2019 14:09:47 +0000 (09:09 -0500)
committerPeter Bergner <bergner@linux.ibm.com>
Thu, 9 May 2019 14:09:47 +0000 (09:09 -0500)
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.

gas/testsuite/gas/ppc/476.d
gas/testsuite/gas/ppc/power6.d
opcodes/ppc-dis.c

index d9df9ca..7818b86 100644 (file)
@@ -322,11 +322,11 @@ Disassembly of section \.text:
  4e0:  (fc 0c 55 8e|8e 55 0c fc)       mtfsf   6,f10
  4e4:  (fc 0c 55 8e|8e 55 0c fc)       mtfsf   6,f10
  4e8:  (fc 0d 55 8e|8e 55 0d fc)       mtfsf   6,f10,0,1
- 4ec:  (fe 0c 55 8e|8e 55 0c fe)       mtfsf   6,f10,1,0
+ 4ec:  (fe 0c 55 8e|8e 55 0c fe)       mtfsf   6,f10,1
  4f0:  (fc 0c 5d 8f|8f 5d 0c fc)       mtfsf\.  6,f11
  4f4:  (fc 0c 5d 8f|8f 5d 0c fc)       mtfsf\.  6,f11
  4f8:  (fc 0d 5d 8f|8f 5d 0d fc)       mtfsf\.  6,f11,0,1
- 4fc:  (fe 0c 5d 8f|8f 5d 0c fe)       mtfsf\.  6,f11,1,0
+ 4fc:  (fe 0c 5d 8f|8f 5d 0c fe)       mtfsf\.  6,f11,1
  500:  (ff 00 01 0c|0c 01 00 ff)       mtfsfi  6,0
  504:  (ff 00 01 0c|0c 01 00 ff)       mtfsfi  6,0
  508:  (ff 00 01 0c|0c 01 00 ff)       mtfsfi  6,0
index 2397861..8f74265 100644 (file)
@@ -58,8 +58,8 @@ Disassembly of section \.text:
   c0:  (fc 0c 5d 8f|8f 5d 0c fc)       mtfsf.  6,f11
   c4:  (fc 0d 55 8e|8e 55 0d fc)       mtfsf   6,f10,0,1
   c8:  (fc 0d 5d 8f|8f 5d 0d fc)       mtfsf.  6,f11,0,1
-  cc:  (fe 0c 55 8e|8e 55 0c fe)       mtfsf   6,f10,1,0
-  d0:  (fe 0c 5d 8f|8f 5d 0c fe)       mtfsf.  6,f11,1,0
+  cc:  (fe 0c 55 8e|8e 55 0c fe)       mtfsf   6,f10,1
+  d0:  (fe 0c 5d 8f|8f 5d 0c fe)       mtfsf.  6,f11,1
   d4:  (ff 00 01 0c|0c 01 00 ff)       mtfsfi  6,0
   d8:  (ff 00 f1 0d|0d f1 00 ff)       mtfsfi. 6,15
   dc:  (ff 00 01 0c|0c 01 00 ff)       mtfsfi  6,0
index cb10b23..d9ae42a 100644 (file)
@@ -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;
            }