Commit f74e6550 by Eric Botcazou Committed by Eric Botcazou

mips.c (mips_emit_probe_stack_range): Adjust.

	* config/mips/mips.c (mips_emit_probe_stack_range): Adjust.
	(mips_output_probe_stack_range): Rotate the loop and simplify.

From-SVN: r231188
parent 202d0c11
2015-12-02 Eric Botcazou <ebotcazou@adacore.com>
* config/mips/mips.c (mips_emit_probe_stack_range): Adjust.
(mips_output_probe_stack_range): Rotate the loop and simplify.
2015-12-02 David Sherwood <david.sherwood@arm.com> 2015-12-02 David Sherwood <david.sherwood@arm.com>
* config/aarch64/aarch64.md: New pattern. * config/aarch64/aarch64.md: New pattern.
...@@ -11364,11 +11364,12 @@ mips_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size) ...@@ -11364,11 +11364,12 @@ mips_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
/* Step 3: the loop /* Step 3: the loop
while (TEST_ADDR != LAST_ADDR) do
{ {
TEST_ADDR = TEST_ADDR + PROBE_INTERVAL TEST_ADDR = TEST_ADDR + PROBE_INTERVAL
probe at TEST_ADDR probe at TEST_ADDR
} }
while (TEST_ADDR != LAST_ADDR)
probes at FIRST + N * PROBE_INTERVAL for values of N from 1 probes at FIRST + N * PROBE_INTERVAL for values of N from 1
until it is equal to ROUNDED_SIZE. */ until it is equal to ROUNDED_SIZE. */
...@@ -11394,38 +11395,31 @@ const char * ...@@ -11394,38 +11395,31 @@ const char *
mips_output_probe_stack_range (rtx reg1, rtx reg2) mips_output_probe_stack_range (rtx reg1, rtx reg2)
{ {
static int labelno = 0; static int labelno = 0;
char loop_lab[32], end_lab[32], tmp[64]; char loop_lab[32], tmp[64];
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. */
xops[0] = reg1;
xops[1] = reg2;
strcpy (tmp, "%(%<beq\t%0,%1,");
output_asm_insn (strcat (tmp, &end_lab[1]), xops);
/* TEST_ADDR = TEST_ADDR + PROBE_INTERVAL. */ /* TEST_ADDR = TEST_ADDR + PROBE_INTERVAL. */
xops[0] = reg1;
xops[1] = GEN_INT (-PROBE_INTERVAL); xops[1] = GEN_INT (-PROBE_INTERVAL);
if (TARGET_64BIT && TARGET_LONG64) if (TARGET_64BIT && TARGET_LONG64)
output_asm_insn ("daddiu\t%0,%0,%1", xops); output_asm_insn ("daddiu\t%0,%0,%1", xops);
else else
output_asm_insn ("addiu\t%0,%0,%1", xops); output_asm_insn ("addiu\t%0,%0,%1", xops);
/* Probe at TEST_ADDR and branch. */ /* Probe at TEST_ADDR, test if TEST_ADDR == LAST_ADDR and branch. */
fprintf (asm_out_file, "\tb\t"); xops[1] = reg2;
assemble_name_raw (asm_out_file, loop_lab); strcpy (tmp, "%(%<bne\t%0,%1,");
fputc ('\n', asm_out_file); output_asm_insn (strcat (tmp, &loop_lab[1]), xops);
if (TARGET_64BIT) if (TARGET_64BIT)
output_asm_insn ("sd\t$0,0(%0)%)", xops); output_asm_insn ("sd\t$0,0(%0)%)", xops);
else else
output_asm_insn ("sw\t$0,0(%0)%)", xops); output_asm_insn ("sw\t$0,0(%0)%)", 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