This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: BCT optimization
- To: law at cygnus dot com
- Subject: Re: BCT optimization
- From: Michael Hayes <m dot hayes at elec dot canterbury dot ac dot nz>
- Date: Thu, 01 Oct 1998 10:18:53 +1200 (NZST)
- Cc: David Edelsohn <dje at watson dot ibm dot com>, Michael Hayes <m dot hayes at elec dot canterbury dot ac dot nz>, egcs at cygnus dot com
- References: <"9809291910.AA33794"@marc.watson.ibm.com><3205.907182662@hurl.cygnus.com>
Jeffrey A Law writes:
> Get rid of the magic COUNT_REGISTER_REGNUM stuff. There's no reason to use a
> hard register. Use a pseudo and let the register allocators and reload DTRT.
That's the first thing I got rid of. I suggested to David that we
emit a pattern at the start of a BCT loop, tentatively named
init_branch_on_count, that sets up the loop count (and possibly emits
the looping instruction for targets that have such an instruction at
the top of a loop). The operands for this pattern would include a
label marking the start of the loop; a label marking the end of the
loop; an iteration count; and possibly a loop depth count (for
architectures that support nested zero overhead looping constructs,
e.g, the ADI SHARC).
At the end of the loop we emit another named pattern
decrement_and_branch_on_count. Now this pattern needs to be tightly
coupled with init_branch_on_count since it needs to know what register
has been assigned the iteration count, for example. The more I think
about this, the best way appears to be using static variables in the
backend, in a similar manner to compare and jump patterns.
Michael.