Handle multiple target events before commit resume
[deliverable/binutils-gdb.git] / opcodes / aarch64-gen.c
index d2685dc3d1dea71afaec13adc0ae95d79295b27c..5b31e0ac4555af229edfc809f35831cc7b5ac706 100644 (file)
@@ -1,6 +1,6 @@
 /* aarch64-gen.c -- Generate tables and routines for opcode lookup and
    instruction encoding and decoding.
-   Copyright (C) 2012-2017 Free Software Foundation, Inc.
+   Copyright (C) 2012-2019 Free Software Foundation, Inc.
    Contributed by ARM Ltd.
 
    This file is part of the GNU opcodes library.
@@ -393,6 +393,9 @@ print_decision_tree_1 (unsigned int indent, struct bittree* bittree)
 {
   /* PATTERN is only used to generate comment in the code.  */
   static char pattern[33] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
+  /* Low bits in PATTERN will be printed first which then look as the high
+     bits in comment.  We need to reverse the index to get correct print.  */
+  unsigned int msb = sizeof (pattern) - 2;
   assert (bittree != NULL);
 
   /* Leaf node located.  */
@@ -412,15 +415,15 @@ print_decision_tree_1 (unsigned int indent, struct bittree* bittree)
   /* Walk down the decoder tree.  */
   indented_print (indent, "if (((word >> %d) & 0x1) == 0)\n", bittree->bitno);
   indented_print (indent, "  {\n");
-  pattern[bittree->bitno] = '0';
+  pattern[msb - bittree->bitno] = '0';
   print_decision_tree_1 (indent + 4, bittree->bits[0]);
   indented_print (indent, "  }\n");
   indented_print (indent, "else\n");
   indented_print (indent, "  {\n");
-  pattern[bittree->bitno] = '1';
+  pattern[msb - bittree->bitno] = '1';
   print_decision_tree_1 (indent + 4, bittree->bits[1]);
   indented_print (indent, "  }\n");
-  pattern[bittree->bitno] = 'x';
+  pattern[msb - bittree->bitno] = 'x';
 }
 
 /* Generate aarch64_opcode_lookup in C code to the standard output.  */
@@ -981,10 +984,11 @@ print_operand_inserter (void)
     printf ("Enter print_operand_inserter\n");
 
   printf ("\n");
-  printf ("const char*\n");
+  printf ("bfd_boolean\n");
   printf ("aarch64_insert_operand (const aarch64_operand *self,\n\
                           const aarch64_opnd_info *info,\n\
-                          aarch64_insn *code, const aarch64_inst *inst)\n");
+                          aarch64_insn *code, const aarch64_inst *inst,\n\
+                          aarch64_operand_error *errors)\n");
   printf ("{\n");
   printf ("  /* Use the index as the key.  */\n");
   printf ("  int key = self - aarch64_operands;\n");
@@ -1014,7 +1018,7 @@ print_operand_inserter (void)
                  opnd2->processed = 1;
                }
            }
-         printf ("      return aarch64_%s (self, info, code, inst);\n",
+         printf ("      return aarch64_%s (self, info, code, inst, errors);\n",
                  opnd->inserter);
        }
     }
@@ -1037,10 +1041,11 @@ print_operand_extractor (void)
     printf ("Enter print_operand_extractor\n");
 
   printf ("\n");
-  printf ("int\n");
+  printf ("bfd_boolean\n");
   printf ("aarch64_extract_operand (const aarch64_operand *self,\n\
                           aarch64_opnd_info *info,\n\
-                          aarch64_insn code, const aarch64_inst *inst)\n");
+                          aarch64_insn code, const aarch64_inst *inst,\n\
+                          aarch64_operand_error *errors)\n");
   printf ("{\n");
   printf ("  /* Use the index as the key.  */\n");
   printf ("  int key = self - aarch64_operands;\n");
@@ -1070,7 +1075,7 @@ print_operand_extractor (void)
                  opnd2->processed = 1;
                }
            }
-         printf ("      return aarch64_%s (self, info, code, inst);\n",
+         printf ("      return aarch64_%s (self, info, code, inst, errors);\n",
                  opnd->extractor);
        }
     }
@@ -1241,7 +1246,7 @@ main (int argc, char **argv)
     print_divide_result (decoder_tree);
 
   printf ("/* This file is automatically generated by aarch64-gen.  Do not edit!  */\n");
-  printf ("/* Copyright (C) 2012-2017 Free Software Foundation, Inc.\n\
+  printf ("/* Copyright (C) 2012-2019 Free Software Foundation, Inc.\n\
    Contributed by ARM Ltd.\n\
 \n\
    This file is part of the GNU opcodes library.\n\
This page took 0.033261 seconds and 4 git commands to generate.