A plan for eliminating cc0
tm_gccmail@kloo.net
tm_gccmail@kloo.net
Tue Mar 29 05:25:00 GMT 2005
On 25 Mar 2005, Ian Lance Taylor wrote:
> Paul Schlie <schlie@comcast.net> writes:
>
> > > 2) Reload requires the ability to insert arbitrary instructions
> > > between any pair of instructions. The instructions inserted by
> > > reload will load registers from memory, store registers to memory,
> > > and possibly, depending on the port, move values between different
> > > classes of registers and add constants to base registers. If
> > > reload can't do that without affecting the dependencies between
> > > instructions, then it will break. And I don't think reload will be
> > > able to do that between your two instructions above, on a typical
> > > cc0 machine in which every move affects the condition codes.
> >
> > - Understood, however along a similar line of though; it would seem "safe"
> > to simply "save/restore" the global condition-state around all potentially
> > destructive memory operations.
>
> Safe but very costly. It assumes that every processor has a cheap way
> to save and restore the condition codes in user mode, which is not
> necessarily the case. And it assumes that the save and restore can be
> removed when not required, which is not obvious to me.
Not necessarily.
You need the ability to regenerate the condition code. There's at least
two ways of doing this:
1. Saving/restoring the condition code
2. Rematerializing the condition code. This would usually be a simple load
which is faster than the save/load combo of #1.
Toshi
More information about the Gcc
mailing list