diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2015-11-16 12:17:51 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2015-11-16 12:17:51 +0000 |
commit | c0f39947f8683a23223c85277cd4766b48f0db2d (patch) | |
tree | c92c5dedb4292b972e908762801483ceeab67240 /gcc | |
parent | 16c6f54ffa4bcb6321f998723d2ef1da73b44499 (diff) | |
download | gcc-c0f39947f8683a23223c85277cd4766b48f0db2d.zip gcc-c0f39947f8683a23223c85277cd4766b48f0db2d.tar.gz gcc-c0f39947f8683a23223c85277cd4766b48f0db2d.tar.bz2 |
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.
From-SVN: r230413
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 35 |
2 files changed, 21 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index de7c21c..04c4d5e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2015-11-16 Eric Botcazou <ebotcazou@adacore.com> + * config/rs6000/rs6000.c (rs6000_emit_probe_stack_rang): Adjust. + (output_probe_stack_range): Rotate the loop and simplify. + +2015-11-16 Eric Botcazou <ebotcazou@adacore.com> + * config/i386/i386.c (ix86_adjust_stack_and_probe): Adjust and use an lea instruction when possible. (output_adjust_stack_and_probe): Rotate the loop and simplify. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 3e02d5c..5d0a022 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -24233,11 +24233,12 @@ rs6000_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. */ @@ -24263,39 +24264,35 @@ 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[2]; - 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. */ + /* TEST_ADDR = TEST_ADDR + PROBE_INTERVAL. */ xops[0] = reg1; + xops[1] = GEN_INT (-PROBE_INTERVAL); + output_asm_insn ("addi %0,%0,%1", xops); + + /* Probe at TEST_ADDR. */ + xops[1] = gen_rtx_REG (Pmode, 0); + output_asm_insn ("stw %1,0(%0)", xops); + + /* Test if TEST_ADDR == LAST_ADDR. */ xops[1] = reg2; if (TARGET_64BIT) output_asm_insn ("cmpd 0,%0,%1", xops); else output_asm_insn ("cmpw 0,%0,%1", xops); - fputs ("\tbeq 0,", 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 ("addi %0,%0,%1", xops); - - /* Probe at TEST_ADDR and branch. */ - xops[1] = gen_rtx_REG (Pmode, 0); - output_asm_insn ("stw %1,0(%0)", xops); - fprintf (asm_out_file, "\tb "); + /* Branch. */ + fputs ("\tbne 0,", asm_out_file); assemble_name_raw (asm_out_file, loop_lab); fputc ('\n', asm_out_file); - ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, end_lab); - return ""; } |