diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-08 08:55:51 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-08 08:55:51 +0000 |
commit | 46d5e21ea710016364601e071a7a5818201db98f (patch) | |
tree | 4a3cea7d7207a1b11b6834a5b1c5bb94bbe04983 /gcc/config/ia64 | |
parent | 93bb3cf80c2b8302a5d8a4563d6be8846965f971 (diff) | |
download | gcc-46d5e21ea710016364601e071a7a5818201db98f.tar.gz |
* config/ia64/ia64.c (ia64_emit_probe_stack_range): Adjust.
(output_probe_stack_range): Rotate the loop and simplify.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231398 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/ia64')
-rw-r--r-- | gcc/config/ia64/ia64.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 08e9cb66cbf..f48cebc4036 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -3293,7 +3293,7 @@ ia64_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size, else if (size <= PROBE_INTERVAL) emit_stack_probe (r2); - /* The run-time loop is made up of 8 insns in the generic case while this + /* The run-time loop is made up of 9 insns in the generic case while this compile-time loop is made up of 5+2*(n-2) insns for n # of intervals. */ else if (size <= 4 * PROBE_INTERVAL) { @@ -3356,11 +3356,12 @@ ia64_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size, /* Step 3: the loop - while (TEST_ADDR != LAST_ADDR) + do { TEST_ADDR = TEST_ADDR + PROBE_INTERVAL probe at TEST_ADDR } + while (TEST_ADDR != LAST_ADDR) probes at FIRST + N * PROBE_INTERVAL for values of N from 1 until it is equal to ROUNDED_SIZE. */ @@ -3391,36 +3392,33 @@ const char * output_probe_stack_range (rtx reg1, rtx reg2) { static int labelno = 0; - char loop_lab[32], end_lab[32]; + char loop_lab[32]; rtx xops[3]; - ASM_GENERATE_INTERNAL_LABEL (loop_lab, "LPSRL", labelno); - ASM_GENERATE_INTERNAL_LABEL (end_lab, "LPSRE", labelno++); + ASM_GENERATE_INTERNAL_LABEL (loop_lab, "LPSRL", labelno++); + /* Loop. */ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, loop_lab); - /* Jump to END_LAB if TEST_ADDR == LAST_ADDR. */ - xops[0] = reg1; - xops[1] = reg2; - xops[2] = gen_rtx_REG (BImode, PR_REG (6)); - output_asm_insn ("cmp.eq %2, %I2 = %0, %1", xops); - fprintf (asm_out_file, "\t(%s) br.cond.dpnt ", reg_names [REGNO (xops[2])]); - assemble_name_raw (asm_out_file, end_lab); - fputc ('\n', asm_out_file); - /* TEST_ADDR = TEST_ADDR + PROBE_INTERVAL. */ + xops[0] = reg1; xops[1] = GEN_INT (-PROBE_INTERVAL); output_asm_insn ("addl %0 = %1, %0", xops); fputs ("\t;;\n", asm_out_file); - /* Probe at TEST_ADDR and branch. */ + /* Probe at TEST_ADDR. */ output_asm_insn ("probe.w.fault %0, 0", xops); - fprintf (asm_out_file, "\tbr "); + + /* Test if TEST_ADDR == LAST_ADDR. */ + xops[1] = reg2; + xops[2] = gen_rtx_REG (BImode, PR_REG (6)); + output_asm_insn ("cmp.eq %2, %I2 = %0, %1", xops); + + /* Branch. */ + fprintf (asm_out_file, "\t(%s) br.cond.dpnt ", reg_names [PR_REG (7)]); assemble_name_raw (asm_out_file, loop_lab); fputc ('\n', asm_out_file); - ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, end_lab); - return ""; } |