"thread apply 1 -- -" vs "frame apply level 0 -- -"
[deliverable/binutils-gdb.git] / gas / config / xtensa-relax.c
index 779c9076a424e354b0ab61aefd0ffeaf7e4bf098..daf15d52c259ef7d2f257bebd3d26b6b316ccf45 100644 (file)
@@ -1,11 +1,11 @@
 /* Table of relaxations for Xtensa assembly.
-   Copyright 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2003-2019 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
    GAS is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    GAS is distributed in the hope that it will be useful,
    when the first and second operands are not the same as specified
    by the "| %at!=%as" precondition clause.
    {"l32i %at,%as,%imm | %at!=%as",
-   "LITERAL %imm; l32r %at,%LITERAL; add %at,%at,%as; l32i %at,%at,0"}
-
-   There is special case for loop instructions here, but because we do
-   not currently have the ability to represent the difference of two
-   symbols, the conversion requires special code in the assembler to
-   write the operands of the addi/addmi pair representing the
-   difference of the old and new loop end label.  */
+   "LITERAL %imm; l32r %at,%LITERAL; add %at,%at,%as; l32i %at,%at,0"}  */
 
 #include "as.h"
 #include "xtensa-isa.h"
@@ -247,7 +241,7 @@ struct string_pattern_pair_struct
      addi.n a4, 0x1010
      => addi a4, 0x1010
      => addmi a4, 0x1010
-     => addmi a4, 0x1000, addi a4, 0x10.  
+     => addmi a4, 0x1000, addi a4, 0x10.
 
    See the comments in xg_assembly_relax for some important details
    regarding how these chains must be built.  */
@@ -306,44 +300,83 @@ static string_pattern_pair widen_spec_list[] =
   {"l32i %at,%as,%imm | %at!=%as ? IsaUseConst16",
    "const16 %at,HI16U(%imm); const16 %at,LOW16U(%imm); add %at,%at,%as; l32i %at,%at,0"},
 
-  /* This is only PART of the loop instruction.  In addition,
-     hardcoded into its use is a modification of the final operand in
-     the instruction in bytes 9 and 12.  */
-  {"loop %as,%label | %as!=1 ? IsaUseLoops",
+  /* Widening loops with literals.  */
+  {"loop %as,%label | %as!=1 ? IsaUseLoops ? IsaUseL32R",
    "loop %as,%LABEL;"
    "rsr.lend    %as;"          /* LEND */
    "wsr.lbeg    %as;"          /* LBEG */
-   "addi    %as, %as, 0;"      /* lo8(%label-%LABEL1) */
-   "addmi   %as, %as, 0;"      /* mid8(%label-%LABEL1) */
+   "LITERAL     %label;"
+   "l32r        %as, %LITERAL;"
+   "nop;"
    "wsr.lend    %as;"
    "isync;"
    "rsr.lcount    %as;"                /* LCOUNT */
-   "addi    %as, %as, 1;"      /* density -> addi.n %as, %as, 1 */
+   "addi    %as, %as, 1;"
    "LABEL"},
-  {"loopgtz %as,%label | %as!=1 ? IsaUseLoops",
+  {"loopgtz %as,%label | %as!=1 ? IsaUseLoops ? IsaUseL32R",
    "beqz    %as,%label;"
    "bltz    %as,%label;"
    "loopgtz %as,%LABEL;"
    "rsr.lend    %as;"          /* LEND */
    "wsr.lbeg    %as;"          /* LBEG */
-   "addi    %as, %as, 0;"      /* lo8(%label-%LABEL1) */
-   "addmi   %as, %as, 0;"      /* mid8(%label-%LABEL1) */
+   "LITERAL     %label;"
+   "l32r        %as, %LITERAL;"
+   "nop;"
    "wsr.lend    %as;"
    "isync;"
    "rsr.lcount    %as;"                /* LCOUNT */
-   "addi    %as, %as, 1;"      /* density -> addi.n %as, %as, 1 */
+   "addi    %as, %as, 1;"
    "LABEL"},
-  {"loopnez %as,%label | %as!=1 ? IsaUseLoops",
+  {"loopnez %as,%label | %as!=1 ? IsaUseLoops ? IsaUseL32R",
    "beqz     %as,%label;"
    "loopnez %as,%LABEL;"
    "rsr.lend    %as;"          /* LEND */
    "wsr.lbeg    %as;"          /* LBEG */
-   "addi    %as, %as, 0;"      /* lo8(%label-%LABEL1) */
-   "addmi   %as, %as, 0;"      /* mid8(%label-%LABEL1) */
+   "LITERAL     %label;"
+   "l32r        %as, %LITERAL;"
+   "nop;"
    "wsr.lend    %as;"
    "isync;"
    "rsr.lcount    %as;"                /* LCOUNT */
-   "addi    %as, %as, 1;"      /* density -> addi.n %as, %as, 1 */
+   "addi    %as, %as, 1;"
+   "LABEL"},
+
+  /* Widening loops with const16.  */
+  {"loop %as,%label | %as!=1 ? IsaUseLoops ? IsaUseConst16",
+   "loop %as,%LABEL;"
+   "rsr.lend    %as;"          /* LEND */
+   "wsr.lbeg    %as;"          /* LBEG */
+   "const16     %as,HI16U(%label);"
+   "const16     %as,LOW16U(%label);"
+   "wsr.lend    %as;"
+   "isync;"
+   "rsr.lcount    %as;"                /* LCOUNT */
+   "addi    %as, %as, 1;"
+   "LABEL"},
+  {"loopgtz %as,%label | %as!=1 ? IsaUseLoops ? IsaUseConst16",
+   "beqz    %as,%label;"
+   "bltz    %as,%label;"
+   "loopgtz %as,%LABEL;"
+   "rsr.lend    %as;"          /* LEND */
+   "wsr.lbeg    %as;"          /* LBEG */
+   "const16     %as,HI16U(%label);"
+   "const16     %as,LOW16U(%label);"
+   "wsr.lend    %as;"
+   "isync;"
+   "rsr.lcount    %as;"                /* LCOUNT */
+   "addi    %as, %as, 1;"
+   "LABEL"},
+  {"loopnez %as,%label | %as!=1 ? IsaUseLoops ? IsaUseConst16",
+   "beqz     %as,%label;"
+   "loopnez %as,%LABEL;"
+   "rsr.lend    %as;"          /* LEND */
+   "wsr.lbeg    %as;"          /* LBEG */
+   "const16     %as,HI16U(%label);"
+   "const16     %as,LOW16U(%label);"
+   "wsr.lend    %as;"
+   "isync;"
+   "rsr.lcount    %as;"                /* LCOUNT */
+   "addi    %as, %as, 1;"
    "LABEL"},
 
   /* Relaxing to wide branches.  Order is important here.  With wide
@@ -351,7 +384,7 @@ static string_pattern_pair widen_spec_list[] =
      out-of-range branch.  Put the wide branch relaxations first in the
      table since they are more efficient than the branch-around
      relaxations.  */
-  
+
   {"beqz %as,%label ? IsaUseWideBranches", "WIDE.beqz %as,%label"},
   {"bnez %as,%label ? IsaUseWideBranches", "WIDE.bnez %as,%label"},
   {"bgez %as,%label ? IsaUseWideBranches", "WIDE.bgez %as,%label"},
@@ -376,7 +409,7 @@ static string_pattern_pair widen_spec_list[] =
   {"bnall %as,%at,%label ? IsaUseWideBranches", "WIDE.bnall %as,%at,%label"},
   {"bbc %as,%at,%label ? IsaUseWideBranches", "WIDE.bbc %as,%at,%label"},
   {"bbs %as,%at,%label ? IsaUseWideBranches", "WIDE.bbs %as,%at,%label"},
-  
+
   /* Widening branch comparisons eq/ne to zero.  Prefer relaxing to narrow
      branches if the density option is available.  */
   {"beqz %as,%label ? IsaUseDensityInstruction", "bnez.n %as,%LABEL;j %label;LABEL"},
@@ -463,7 +496,14 @@ static string_pattern_pair widen_spec_list[] =
   {"call8 %label,%ar8 ? IsaUseConst16",
    "const16 a8,HI16U(%label); const16 a8,LOW16U(%label); callx8 a8,%ar8"},
   {"call12 %label,%ar12 ? IsaUseConst16",
-   "const16 a12,HI16U(%label); const16 a12,LOW16U(%label); callx12 a12,%ar12"}
+   "const16 a12,HI16U(%label); const16 a12,LOW16U(%label); callx12 a12,%ar12"},
+
+  /* Expanding j.l with literals.  */
+  {"j %label ? FREEREG ? IsaUseL32R",
+   "LITERAL %label; l32r FREEREG,%LITERAL; jx FREEREG"},
+  /* Expanding j.l with const16.  */
+  {"j %label ? FREEREG ? IsaUseConst16",
+   "const16 FREEREG,HI16U(%label); const16 FREEREG,LOW16U(%label); jx FREEREG"},
 };
 
 #define WIDEN_COUNT (sizeof (widen_spec_list) / sizeof (string_pattern_pair))
@@ -515,11 +555,11 @@ append_transition (TransitionTable *tt,
                   TransitionRule *t,
                   transition_cmp_fn cmp)
 {
-  TransitionList *tl = (TransitionList *) xmalloc (sizeof (TransitionList));
+  TransitionList *tl = XNEW (TransitionList);
   TransitionList *prev;
   TransitionList **t_p;
-  assert (tt != NULL);
-  assert (opcode < tt->num_opcodes);
+  gas_assert (tt != NULL);
+  gas_assert (opcode < tt->num_opcodes);
 
   prev = tt->table[opcode];
   tl->rule = t;
@@ -547,8 +587,7 @@ append_transition (TransitionTable *tt,
 static void
 append_condition (TransitionRule *tr, Precondition *cond)
 {
-  PreconditionList *pl =
-    (PreconditionList *) xmalloc (sizeof (PreconditionList));
+  PreconditionList *pl = XNEW (PreconditionList);
   PreconditionList *prev = tr->conditions;
   PreconditionList *nxt;
 
@@ -575,7 +614,7 @@ append_value_condition (TransitionRule *tr,
                        unsigned op1,
                        unsigned op2)
 {
-  Precondition *cond = (Precondition *) xmalloc (sizeof (Precondition));
+  Precondition *cond = XNEW (Precondition);
 
   cond->cmp = cmp;
   cond->op_num = op1;
@@ -591,7 +630,7 @@ append_constant_value_condition (TransitionRule *tr,
                                 unsigned op1,
                                 unsigned cnst)
 {
-  Precondition *cond = (Precondition *) xmalloc (sizeof (Precondition));
+  Precondition *cond = XNEW (Precondition);
 
   cond->cmp = cmp;
   cond->op_num = op1;
@@ -645,13 +684,13 @@ append_op (BuildInstr *bi, BuildOp *b_op)
 
 
 static void
-append_literal_op (BuildInstr *bi, unsigned op1)
+append_literal_op (BuildInstr *bi, unsigned op1, unsigned src_op)
 {
-  BuildOp *b_op = (BuildOp *) xmalloc (sizeof (BuildOp));
+  BuildOp *b_op = XNEW (BuildOp);
 
   b_op->op_num = op1;
   b_op->typ = OP_LITERAL;
-  b_op->op_data = 0;
+  b_op->op_data = src_op;
   b_op->next = NULL;
   append_op (bi, b_op);
 }
@@ -660,7 +699,7 @@ append_literal_op (BuildInstr *bi, unsigned op1)
 static void
 append_label_op (BuildInstr *bi, unsigned op1)
 {
-  BuildOp *b_op = (BuildOp *) xmalloc (sizeof (BuildOp));
+  BuildOp *b_op = XNEW (BuildOp);
 
   b_op->op_num = op1;
   b_op->typ = OP_LABEL;
@@ -673,7 +712,7 @@ append_label_op (BuildInstr *bi, unsigned op1)
 static void
 append_constant_op (BuildInstr *bi, unsigned op1, unsigned cnst)
 {
-  BuildOp *b_op = (BuildOp *) xmalloc (sizeof (BuildOp));
+  BuildOp *b_op = XNEW (BuildOp);
 
   b_op->op_num = op1;
   b_op->typ = OP_CONSTANT;
@@ -686,7 +725,7 @@ append_constant_op (BuildInstr *bi, unsigned op1, unsigned cnst)
 static void
 append_field_op (BuildInstr *bi, unsigned op1, unsigned src_op)
 {
-  BuildOp *b_op = (BuildOp *) xmalloc (sizeof (BuildOp));
+  BuildOp *b_op = XNEW (BuildOp);
 
   b_op->op_num = op1;
   b_op->typ = OP_OPERAND;
@@ -704,7 +743,7 @@ append_user_fn_field_op (BuildInstr *bi,
                         OpType typ,
                         unsigned src_op)
 {
-  BuildOp *b_op = (BuildOp *) xmalloc (sizeof (BuildOp));
+  BuildOp *b_op = XNEW (BuildOp);
 
   b_op->op_num = op1;
   b_op->typ = typ;
@@ -812,10 +851,8 @@ enter_opname_n (const char *name, int len)
          && strncmp (op->opname, name, len) == 0)
        return op->opname;
     }
-  op = (opname_e *) xmalloc (sizeof (opname_e));
-  op->opname = (char *) xmalloc (len + 1);
-  strncpy (op->opname, name, len);
-  op->opname[len] = '\0';
+  op = XNEW (opname_e);
+  op->opname = xmemdup0 (name, len);
   return op->opname;
 }
 
@@ -830,7 +867,7 @@ enter_opname (const char *name)
       if (strcmp (op->opname, name) == 0)
        return op->opname;
     }
-  op = (opname_e *) xmalloc (sizeof (opname_e));
+  op = XNEW (opname_e);
   op->opname = xstrdup (name);
   return op->opname;
 }
@@ -862,7 +899,7 @@ clear_opname_map (opname_map *m)
 static bfd_boolean
 same_operand_name (const opname_map_e *m1, const opname_map_e *m2)
 {
-  if (m1->operand_name == NULL || m1->operand_name == NULL)
+  if (m1->operand_name == NULL || m2->operand_name == NULL)
     return FALSE;
   return (m1->operand_name == m2->operand_name);
 }
@@ -892,7 +929,7 @@ op_is_constant (const opname_map_e *m1)
 static unsigned
 op_get_constant (const opname_map_e *m1)
 {
-  assert (m1->operand_name == NULL);
+  gas_assert (m1->operand_name == NULL);
   return m1->constant_value;
 }
 
@@ -1017,7 +1054,7 @@ parse_special_fn (const char *name,
                  const char **fn_name_p,
                  const char **arg_name_p)
 {
-  char *p_start;
+  const char *p_start;
   const char *p_end;
 
   p_start = strchr (name, '(');
@@ -1100,7 +1137,7 @@ split_string (split_rec *rec,
   if (rec->count == 0)
     return;
 
-  rec->vec = (char **) xmalloc (sizeof (char *) * cnt);
+  rec->vec = XNEWVEC (char *, cnt);
   for (i = 0; i < cnt; i++)
     rec->vec[i] = 0;
 
@@ -1120,9 +1157,7 @@ split_string (split_rec *rec,
       else
        {
          len = p - q;
-         rec->vec[i] = (char *) xmalloc (sizeof (char) * (len + 1));
-         strncpy (rec->vec[i], q, len);
-         rec->vec[i][len] = '\0';
+         rec->vec[i] = xmemdup0 (q, len);
          p++;
        }
 
@@ -1186,7 +1221,7 @@ parse_insn_templ (const char *s, insn_templ *t)
   for (i = 0; i < oprec.count; i++)
     {
       const char *opname = oprec.vec[i];
-      opname_map_e *e = (opname_map_e *) xmalloc (sizeof (opname_map_e));
+      opname_map_e *e = XNEW (opname_map_e);
       e->next = NULL;
       e->operand_name = NULL;
       e->constant_value = 0;
@@ -1304,7 +1339,7 @@ clone_req_or_option_list (ReqOrOption *req_or_option)
   if (req_or_option == NULL)
     return NULL;
 
-  new_req_or_option = (ReqOrOption *) xmalloc (sizeof (ReqOrOption));
+  new_req_or_option = XNEW (ReqOrOption);
   new_req_or_option->option_name = xstrdup (req_or_option->option_name);
   new_req_or_option->is_true = req_or_option->is_true;
   new_req_or_option->next = NULL;
@@ -1321,7 +1356,7 @@ clone_req_option_list (ReqOption *req_option)
   if (req_option == NULL)
     return NULL;
 
-  new_req_option = (ReqOption *) xmalloc (sizeof (ReqOption));
+  new_req_option = XNEW (ReqOption);
   new_req_option->or_option_terms = NULL;
   new_req_option->next = NULL;
   new_req_option->or_option_terms =
@@ -1365,7 +1400,7 @@ parse_option_cond (const char *s, ReqOption *option)
       else
        option_name = xstrdup (option_name);
 
-      req = (ReqOrOption *) xmalloc (sizeof (ReqOrOption));
+      req = XNEW (ReqOrOption);
       req->option_name = option_name;
       req->is_true = is_true;
       req->next = NULL;
@@ -1433,7 +1468,7 @@ parse_insn_pattern (const char *in, insn_pattern *insn)
 
   for (i = 1; i < rec.count; i++)
     {
-      precond_e *cond = (precond_e *) xmalloc (sizeof (precond_e));
+      precond_e *cond = XNEW (precond_e);
 
       if (!parse_precond (rec.vec[i], cond))
        {
@@ -1452,7 +1487,7 @@ parse_insn_pattern (const char *in, insn_pattern *insn)
     {
       /* Handle the option conditions.  */
       ReqOption **r_p;
-      ReqOption *req_option = (ReqOption *) xmalloc (sizeof (ReqOption));
+      ReqOption *req_option = XNEW (ReqOption);
       req_option->or_option_terms = NULL;
       req_option->next = NULL;
 
@@ -1489,7 +1524,7 @@ parse_insn_repl (const char *in, insn_repl *r_p)
 
   for (i = 0; i < rec.count; i++)
     {
-      insn_repl_e *e = (insn_repl_e *) xmalloc (sizeof (insn_repl_e));
+      insn_repl_e *e = XNEW (insn_repl_e);
 
       e->next = NULL;
 
@@ -1536,9 +1571,12 @@ transition_applies (insn_pattern *initial_insn,
          else if (!strcmp (option_name, "Loops"))
            option_available = (XCHAL_HAVE_LOOPS == 1);
          else if (!strcmp (option_name, "WideBranches"))
-           option_available = (XCHAL_HAVE_WIDE_BRANCHES == 1);
+           option_available
+             = (XCHAL_HAVE_WIDE_BRANCHES == 1 && produce_flix == FLIX_ALL);
          else if (!strcmp (option_name, "PredictedBranches"))
-           option_available = (XCHAL_HAVE_PREDICTED_BRANCHES == 1);
+           option_available
+             = (XCHAL_HAVE_PREDICTED_BRANCHES == 1
+                && produce_flix == FLIX_ALL);
          else if (!strcmp (option_name, "Booleans"))
            option_available = (XCHAL_HAVE_BOOLEANS == 1);
          else
@@ -1562,7 +1600,7 @@ transition_applies (insn_pattern *initial_insn,
 
 static bfd_boolean
 wide_branch_opcode (const char *opcode_name,
-                   char *suffix,
+                   const char *suffix,
                    xtensa_opcode *popcode)
 {
   xtensa_isa isa = xtensa_default_isa;
@@ -1594,6 +1632,7 @@ build_transition (insn_pattern *initial_insn,
   TransitionRule *tr = NULL;
   xtensa_opcode opcode;
   xtensa_isa isa = xtensa_default_isa;
+  BuildInstr *literal_bi;
 
   opname_map_e *op1;
   opname_map_e *op2;
@@ -1601,7 +1640,7 @@ build_transition (insn_pattern *initial_insn,
   precond_e *precond;
   insn_repl_e *r;
 
-  if (!wide_branch_opcode (initial_insn->t.opcode_name, ".w18", &opcode) 
+  if (!wide_branch_opcode (initial_insn->t.opcode_name, ".w18", &opcode)
       && !wide_branch_opcode (initial_insn->t.opcode_name, ".w15", &opcode))
     opcode = xtensa_opcode_lookup (isa, initial_insn->t.opcode_name);
 
@@ -1621,7 +1660,7 @@ build_transition (insn_pattern *initial_insn,
       return NULL;
     }
 
-  tr = (TransitionRule *) xmalloc (sizeof (TransitionRule));
+  tr = XNEW (TransitionRule);
   tr->opcode = opcode;
   tr->conditions = NULL;
   tr->to_instr = NULL;
@@ -1677,7 +1716,7 @@ build_transition (insn_pattern *initial_insn,
          op2 = get_opmatch (&initial_insn->t.operand_map, precond->opname2);
          if (op2 == NULL)
            as_fatal (_("opcode '%s': no bound opname '%s' "
-                       "for precondition in %s"),
+                       "for precondition in '%s'"),
                      xtensa_opcode_name (isa, opcode),
                      precond->opname2, from_string);
        }
@@ -1706,6 +1745,7 @@ build_transition (insn_pattern *initial_insn,
      can be used before they are defined.  Also there are a number of
      special operands (e.g., HI24S).  */
 
+  literal_bi = NULL;
   for (r = replace_insns->head; r != NULL; r = r->next)
     {
       BuildInstr *bi;
@@ -1715,7 +1755,7 @@ build_transition (insn_pattern *initial_insn,
       const char *fn_name;
       const char *operand_arg_name;
 
-      bi = (BuildInstr *) xmalloc (sizeof (BuildInstr));
+      bi = XNEW (BuildInstr);
       append_build_insn (tr, bi);
 
       bi->opcode = XTENSA_UNDEFINED;
@@ -1730,6 +1770,7 @@ build_transition (insn_pattern *initial_insn,
          bi->typ = INSTR_LITERAL_DEF;
          if (operand_count != 1)
            as_fatal (_("expected one operand for generated literal"));
+         literal_bi = bi;
        }
       else if (strcmp (opcode_name, "LABEL") == 0)
        {
@@ -1756,7 +1797,9 @@ build_transition (insn_pattern *initial_insn,
          /* Check for the right number of ops.  */
          if (xtensa_opcode_num_operands (isa, bi->opcode)
              != (int) operand_count)
-           as_fatal (_("opcode '%s': replacement does not have %d ops"),
+           as_fatal (ngettext ("opcode '%s': replacement does not have %d op",
+                               "opcode '%s': replacement does not have %d ops",
+                               xtensa_opcode_num_operands (isa, bi->opcode)),
                      opcode_name,
                      xtensa_opcode_num_operands (isa, bi->opcode));
        }
@@ -1768,7 +1811,13 @@ build_transition (insn_pattern *initial_insn,
          if (op_is_constant (op))
            append_constant_op (bi, op->operand_num, op_get_constant (op));
          else if (strcmp (op->operand_name, "%LITERAL") == 0)
-           append_literal_op (bi, op->operand_num);
+           {
+             if (! literal_bi || ! literal_bi->ops || literal_bi->ops->next)
+               as_fatal (_("opcode '%s': cannot find literal definition"),
+                         opcode_name);
+             append_literal_op (bi, op->operand_num,
+                                literal_bi->ops->op_data);
+           }
          else if (strcmp (op->operand_name, "%LABEL") == 0)
            append_label_op (bi, op->operand_num);
          else if (op->operand_name[0] == 'a'
@@ -1780,10 +1829,14 @@ build_transition (insn_pattern *initial_insn,
              orig_op = get_opmatch (&initial_insn->t.operand_map,
                                     op->operand_name);
              if (orig_op == NULL)
-               as_fatal (_("opcode %s: unidentified operand '%s' in '%s'"),
+               as_fatal (_("opcode '%s': unidentified operand '%s' in '%s'"),
                          opcode_name, op->operand_name, to_string);
              append_field_op (bi, op->operand_num, orig_op->operand_num);
            }
+         else if (strcmp (op->operand_name, "FREEREG") == 0)
+           {
+             append_user_fn_field_op (bi, op->operand_num, OP_FREEREG, 0);
+           }
          else if (parse_special_fn (op->operand_name,
                                     &fn_name, &operand_arg_name))
            {
@@ -1806,13 +1859,13 @@ build_transition (insn_pattern *initial_insn,
              orig_op = get_opmatch (&initial_insn->t.operand_map,
                                     operand_arg_name);
              if (orig_op == NULL)
-               as_fatal (_("opcode %s: unidentified operand '%s' in '%s'"),
+               as_fatal (_("opcode '%s': unidentified operand '%s' in '%s'"),
                          opcode_name, op->operand_name, to_string);
              append_user_fn_field_op (bi, op->operand_num,
                                       typ, orig_op->operand_num);
            }
          else
-           as_fatal (_("opcode %s: could not parse operand '%s' in '%s'"),
+           as_fatal (_("opcode '%s': could not parse operand '%s' in '%s'"),
                      opcode_name, op->operand_name, to_string);
        }
     }
@@ -1834,10 +1887,9 @@ build_transition_table (const string_pattern_pair *transitions,
     return table;
 
   /* Otherwise, build it now.  */
-  table = (TransitionTable *) xmalloc (sizeof (TransitionTable));
+  table = XNEW (TransitionTable);
   table->num_opcodes = num_opcodes;
-  table->table =
-    (TransitionList **) xmalloc (sizeof (TransitionTable *) * num_opcodes);
+  table->table = XNEWVEC (TransitionList *, num_opcodes);
 
   for (i = 0; i < num_opcodes; i++)
     table->table[i] = NULL;
This page took 0.043891 seconds and 4 git commands to generate.