Commit ca83de6b by Eric Botcazou Committed by Eric Botcazou

final.c (output_in_slot): New global variable.

	* final.c (output_in_slot): New global variable.
	(final_scan_insn): Add new state '2' to the 'nopeepholes' parameter.
	Pass 2 as 'nopeepholes' to self for insns in a SEQUENCE.  Set
	'output_in_slot' before invoking output_asm_insn.
	(output_asm_insn): Add a space after the tab if 'output_in_slot'
	is set.
	* config/sparc/sparc.c (output_return): Pass 2 as 'nopeepholes' to
	final_scan_insn.
	(output_sibcall): Likewise.

From-SVN: r87056
parent 37e6d6fe
2004-09-03 Eric Botcazou <ebotcazou@libertysurf.fr>
* final.c (output_in_slot): New global variable.
(final_scan_insn): Add new state '2' to the 'nopeepholes' parameter.
Pass 2 as 'nopeepholes' to self for insns in a SEQUENCE. Set
'output_in_slot' before invoking output_asm_insn.
(output_asm_insn): Add a space after the tab if 'output_in_slot'
is set.
* config/sparc/sparc.c (output_return): Pass 2 as 'nopeepholes' to
final_scan_insn.
(output_sibcall): Likewise.
2004-09-03 Jan Hubicka <jh@suse.cz> 2004-09-03 Jan Hubicka <jh@suse.cz>
* tree-ssa-operands.c (fini_ssa_operands): ggc_free unused arrays. * tree-ssa-operands.c (fini_ssa_operands): ggc_free unused arrays.
......
...@@ -4707,7 +4707,7 @@ output_return (rtx insn) ...@@ -4707,7 +4707,7 @@ output_return (rtx insn)
if (! delay) if (! delay)
abort (); abort ();
final_scan_insn (delay, asm_out_file, 1, 0, 1, NULL); final_scan_insn (delay, asm_out_file, 1, 0, 2, NULL);
PATTERN (delay) = gen_blockage (); PATTERN (delay) = gen_blockage ();
INSN_CODE (delay) = -1; INSN_CODE (delay) = -1;
} }
...@@ -4756,7 +4756,7 @@ output_return (rtx insn) ...@@ -4756,7 +4756,7 @@ output_return (rtx insn)
epilogue_renumber (&pat, 0); epilogue_renumber (&pat, 0);
fprintf (asm_out_file, "\treturn\t%%i7+%d\n", fprintf (asm_out_file, "\treturn\t%%i7+%d\n",
sparc_skip_caller_unimp ? 12 : 8); sparc_skip_caller_unimp ? 12 : 8);
final_scan_insn (delay, asm_out_file, 1, 0, 1, NULL); final_scan_insn (delay, asm_out_file, 1, 0, 2, NULL);
} }
else else
{ {
...@@ -4817,7 +4817,7 @@ output_sibcall (rtx insn, rtx call_operand) ...@@ -4817,7 +4817,7 @@ output_sibcall (rtx insn, rtx call_operand)
output_asm_insn ("sethi\t%%hi(%a0), %%g1", operands); output_asm_insn ("sethi\t%%hi(%a0), %%g1", operands);
output_asm_insn ("jmp\t%%g1 + %%lo(%a0)", operands); output_asm_insn ("jmp\t%%g1 + %%lo(%a0)", operands);
final_scan_insn (delay, asm_out_file, 1, 0, 1, NULL); final_scan_insn (delay, asm_out_file, 1, 0, 2, NULL);
PATTERN (delay) = gen_blockage (); PATTERN (delay) = gen_blockage ();
INSN_CODE (delay) = -1; INSN_CODE (delay) = -1;
......
...@@ -200,6 +200,10 @@ static int app_on; ...@@ -200,6 +200,10 @@ static int app_on;
rtx final_sequence; rtx final_sequence;
/* True if we are outputting insns in a delay slot. This is used
to prettify the assembly. */
static bool output_in_slot;
#ifdef ASSEMBLER_DIALECT #ifdef ASSEMBLER_DIALECT
/* Number of the assembler dialect to use, starting at 0. */ /* Number of the assembler dialect to use, starting at 0. */
...@@ -1663,8 +1667,11 @@ scan_ahead_for_unlikely_executed_note (rtx insn) ...@@ -1663,8 +1667,11 @@ scan_ahead_for_unlikely_executed_note (rtx insn)
is the insn being scanned. is the insn being scanned.
Value returned is the next insn to be scanned. Value returned is the next insn to be scanned.
NOPEEPHOLES is the flag to disallow peephole processing (currently NOPEEPHOLES is used to disallow peephole processing:
used for within delayed branch sequence output). - 0: peepholes are allowed,
- 1: peepholes are not allowed,
- 2: peepholes are not allowed and we are in the
slot of a delayed branch.
SEEN is used to track the end of the prologue, for emitting SEEN is used to track the end of the prologue, for emitting
debug information. We force the emission of a line note after debug information. We force the emission of a line note after
...@@ -1674,8 +1681,7 @@ scan_ahead_for_unlikely_executed_note (rtx insn) ...@@ -1674,8 +1681,7 @@ scan_ahead_for_unlikely_executed_note (rtx insn)
rtx rtx
final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
int prescan, int nopeepholes ATTRIBUTE_UNUSED, int prescan, int nopeepholes, int *seen)
int *seen)
{ {
#ifdef HAVE_cc0 #ifdef HAVE_cc0
rtx set; rtx set;
...@@ -2195,7 +2201,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -2195,7 +2201,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
/* We loop in case any instruction in a delay slot gets /* We loop in case any instruction in a delay slot gets
split. */ split. */
do do
insn = final_scan_insn (insn, file, 0, prescan, 1, seen); insn = final_scan_insn (insn, file, 0, prescan, 2, seen);
while (insn != next); while (insn != next);
} }
#ifdef DBR_OUTPUT_SEQEND #ifdef DBR_OUTPUT_SEQEND
...@@ -2527,7 +2533,9 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -2527,7 +2533,9 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
#endif #endif
/* Output assembler code from the template. */ /* Output assembler code from the template. */
output_in_slot = (nopeepholes > 1);
output_asm_insn (template, recog_data.operand); output_asm_insn (template, recog_data.operand);
output_in_slot = false;
/* If necessary, report the effect that the instruction has on /* If necessary, report the effect that the instruction has on
the unwind info. We've already done this for delay slots the unwind info. We've already done this for delay slots
...@@ -2988,6 +2996,8 @@ output_asm_insn (const char *template, rtx *operands) ...@@ -2988,6 +2996,8 @@ output_asm_insn (const char *template, rtx *operands)
memset (opoutput, 0, sizeof opoutput); memset (opoutput, 0, sizeof opoutput);
p = template; p = template;
putc ('\t', asm_out_file); putc ('\t', asm_out_file);
if (output_in_slot)
putc (' ', asm_out_file);
#ifdef ASM_OUTPUT_OPCODE #ifdef ASM_OUTPUT_OPCODE
ASM_OUTPUT_OPCODE (asm_out_file, p); ASM_OUTPUT_OPCODE (asm_out_file, p);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment