SH: use register names instead of numbers

Michael Meissner meissner@cygnus.com
Tue Nov 21 20:01:00 GMT 2000


On Sat, Nov 21, 1970 at 10:47:26PM -0500, Richard Kenner wrote:
>     I think not.  Rather that we'd now define STACK_POINTER_REGNUM
>     in the md file and _not_ directly in tm.h.
> 
> I disagree with that.  Very few md files explicitly reference the stak
> pointer, so they need not have such a constant.  If it can be done in either
> place, then some ports will do it in tm.h and some in the md file and I
> think that's confusing.

Off the top of my head, any md file that has to deal with push and pop insns
need to deal with the stack pointer to spell out the push insns.  I've seen md
files include a (use <sp>) in the return insn as well due to (previously?)
existing bugs in the scheduler.  Setting the PIC pointer is another case where
a MD file wants to deal with a specific hard register.  I'm sure I could think
up more cases.

>     Are you suggesting that we force tm.h to do
> 
>       #define STACK_POINTER_REGNUM  MD_REG_SP
> 
> No, but we could do a #define the other way in some default
> place, so an md file that needed to reference it could do it easily.

-- 
Michael Meissner, Red Hat, Inc.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482


More information about the Gcc-patches mailing list