Reload work in progress

Geoff Keating
Wed Sep 13 22:54:00 GMT 2000

One other thing which would help to make reload easier to use in a new
port would be to reduce or eliminate the SECONDARY_* macros.

All the information needed to eliminate these macros is already
available in the constraints in every port that doesn't have
reload_{in,out}* patterns.  For instance, for rs6000 movsi, we have:

"=r,r,r,m,r,r,r,r, r,*q,*c*l,*h"
" r,U,m,r,I,L,n,R,*h, r,   r, 0"
(I've added spaces to make the constraints line up.)

so suppose reload wants to move from a class 'c' register into memory.
It sees that there is no 'c' -> 'm' move, but there is a 'c' -> 'r'
and 'r' -> 'm', so it knows it needs a secondary reload of the class
of registers that matches 'r' (which happens to be GENERAL_REGS).

Likewise, for movdf we have:

"  r,  m,r, G, H, F,f,m,f"

and reload ought to be able to deduce from that the way to copy
between registers of classes 'f' and 'r' is to create a temporary of
class 'm'.

Of course, it should precompute all this once at the start of
compilation, for speed.
- Geoffrey Keating <>

More information about the Gcc mailing list