static rtx walk_alter_subreg PARAMS ((rtx));
static void output_asm_name PARAMS ((void));
static tree get_decl_from_op PARAMS ((rtx, int *));
+static void output_asm_operand_names PARAMS ((rtx *, int *, int));
static void output_operand PARAMS ((rtx, int));
#ifdef LEAF_REGISTERS
static void leaf_renumber_regs PARAMS ((rtx));
return inner_addressp ? 0 : decl;
}
+/* Output operand names for assembler instructions. OPERANDS is the
+ operand vector, OPORDER is the order to write the operands, and NOPS
+ is the number of operands to write. */
+
+static void
+output_asm_operand_names (operands, oporder, nops)
+ rtx *operands;
+ int *oporder;
+ int nops;
+{
+ int wrote = 0;
+ int i;
+
+ for (i = 0; i < nops; i++)
+ {
+ int addressp;
+ tree decl = get_decl_from_op (operands[oporder[i]], &addressp);
+
+ if (decl && DECL_NAME (decl))
+ {
+ fprintf (asm_out_file, "%s %s%s",
+ wrote ? "," : ASM_COMMENT_START, addressp ? "*" : "",
+ IDENTIFIER_POINTER (DECL_NAME (decl)));
+ wrote = 1;
+ }
+ }
+}
+
/* Output text from TEMPLATE to the assembler output file,
obeying %-directions to substitute operands taken from
the vector OPERANDS.
int dialect = 0;
#endif
int oporder[MAX_RECOG_OPERANDS];
+ char opoutput[MAX_RECOG_OPERANDS];
int ops = 0;
/* An insn may return a null string template
if (*template == 0)
return;
+ memset (opoutput, 0, sizeof opoutput);
p = template;
putc ('\t', asm_out_file);
switch (c)
{
case '\n':
+ if (flag_verbose_asm)
+ output_asm_operand_names (operands, oporder, ops);
if (flag_print_asm_name)
output_asm_name ();
+ ops = 0;
+ memset (opoutput, 0, sizeof opoutput);
+
putc (c, asm_out_file);
#ifdef ASM_OUTPUT_OPCODE
while ((c = *p) == '\t')
else
output_operand (operands[c], letter);
- oporder[ops++] = c;
+ if (!opoutput[c])
+ oporder[ops++] = c;
+ opoutput[c] = 1;
while ((c = *p) >= '0' && c <= '9')
p++;
else
output_operand (operands[c], 0);
- oporder[ops++] = c;
+ if (!opoutput[c])
+ oporder[ops++] = c;
+ opoutput[c] = 1;
+
while ((c = *p) >= '0' && c <= '9')
p++;
}
/* Write out the variable names for operands, if we know them. */
if (flag_verbose_asm)
- {
- int wrote = 0;
- int i;
-
- for (i = 0; i < ops; i++)
- {
- int addressp;
- tree decl = get_decl_from_op (operands[oporder[i]], &addressp);
-
- if (decl && DECL_NAME (decl))
- {
- fprintf (asm_out_file, "%s %s%s",
- wrote ? "," : ASM_COMMENT_START,
- addressp ? "*" : "",
- IDENTIFIER_POINTER (DECL_NAME (decl)));
- wrote = 1;
- }
- }
- }
-
+ output_asm_operand_names (operands, oporder, ops);
if (flag_print_asm_name)
output_asm_name ();