Commit 632b0921 by Eric Botcazou Committed by Eric Botcazou

sparc.c (sparc_emit_probe_stack_range): Adjust.

	* config/sparc/sparc.c (sparc_emit_probe_stack_range): Adjust.
	(output_probe_stack_range): Rotate the loop and simplify.

From-SVN: r230414
parent c0f39947
2015-11-16 Eric Botcazou <ebotcazou@adacore.com> 2015-11-16 Eric Botcazou <ebotcazou@adacore.com>
* config/sparc/sparc.c (sparc_emit_probe_stack_range): Adjust.
(output_probe_stack_range): Rotate the loop and simplify.
2015-11-16 Eric Botcazou <ebotcazou@adacore.com>
* config/rs6000/rs6000.c (rs6000_emit_probe_stack_rang): Adjust. * config/rs6000/rs6000.c (rs6000_emit_probe_stack_rang): Adjust.
(output_probe_stack_range): Rotate the loop and simplify. (output_probe_stack_range): Rotate the loop and simplify.
...@@ -5058,9 +5058,9 @@ sparc_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size) ...@@ -5058,9 +5058,9 @@ sparc_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
emit_stack_probe (plus_constant (Pmode, g1, -size)); emit_stack_probe (plus_constant (Pmode, g1, -size));
} }
/* The run-time loop is made up of 10 insns in the generic case while the /* The run-time loop is made up of 9 insns in the generic case while the
compile-time loop is made up of 4+2*(n-2) insns for n # of intervals. */ compile-time loop is made up of 4+2*(n-2) insns for n # of intervals. */
else if (size <= 5 * PROBE_INTERVAL) else if (size <= 4 * PROBE_INTERVAL)
{ {
HOST_WIDE_INT i; HOST_WIDE_INT i;
...@@ -5147,41 +5147,33 @@ const char * ...@@ -5147,41 +5147,33 @@ const char *
output_probe_stack_range (rtx reg1, rtx reg2) output_probe_stack_range (rtx reg1, rtx reg2)
{ {
static int labelno = 0; static int labelno = 0;
char loop_lab[32], end_lab[32]; char loop_lab[32];
rtx xops[2]; rtx xops[2];
ASM_GENERATE_INTERNAL_LABEL (loop_lab, "LPSRL", labelno); ASM_GENERATE_INTERNAL_LABEL (loop_lab, "LPSRL", labelno++);
ASM_GENERATE_INTERNAL_LABEL (end_lab, "LPSRE", labelno++);
/* Loop. */
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, loop_lab); ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, loop_lab);
/* Jump to END_LAB if TEST_ADDR == LAST_ADDR. */ /* TEST_ADDR = TEST_ADDR + PROBE_INTERVAL. */
xops[0] = reg1; xops[0] = reg1;
xops[1] = GEN_INT (-PROBE_INTERVAL);
output_asm_insn ("add\t%0, %1, %0", xops);
/* Test if TEST_ADDR == LAST_ADDR. */
xops[1] = reg2; xops[1] = reg2;
output_asm_insn ("cmp\t%0, %1", xops); output_asm_insn ("cmp\t%0, %1", xops);
if (TARGET_ARCH64)
fputs ("\tbe,pn\t%xcc,", asm_out_file);
else
fputs ("\tbe\t", asm_out_file);
assemble_name_raw (asm_out_file, end_lab);
fputc ('\n', asm_out_file);
/* TEST_ADDR = TEST_ADDR + PROBE_INTERVAL. */
xops[1] = GEN_INT (-PROBE_INTERVAL);
output_asm_insn (" add\t%0, %1, %0", xops);
/* Probe at TEST_ADDR and branch. */ /* Probe at TEST_ADDR and branch. */
if (TARGET_ARCH64) if (TARGET_ARCH64)
fputs ("\tba,pt\t%xcc,", asm_out_file); fputs ("\tbne,pt\t%xcc,", asm_out_file);
else else
fputs ("\tba\t", asm_out_file); fputs ("\tbne\t", asm_out_file);
assemble_name_raw (asm_out_file, loop_lab); assemble_name_raw (asm_out_file, loop_lab);
fputc ('\n', asm_out_file); fputc ('\n', asm_out_file);
xops[1] = GEN_INT (SPARC_STACK_BIAS); xops[1] = GEN_INT (SPARC_STACK_BIAS);
output_asm_insn (" st\t%%g0, [%0+%1]", xops); output_asm_insn (" st\t%%g0, [%0+%1]", xops);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, end_lab);
return ""; return "";
} }
......
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