[parisc-linux] Re: Fwd: Re: Any hppa gurus?

John David Anglin dave@hiauly1.hia.nrc.ca
Sat, 30 Mar 2002 16:32:23 -0500 (EST)


> It's clear that you can't pass 8 words, since the 32-Bit ABI says that
> only the first 4 words are passed in registers as parameters for a function (2-26).
> 
> I'm not sure what's implied by the need for 4 words of "spill over" in the stack

I some situations, the callee needs to save the argument registers on
the stack.  There are 4 words reserved for this.

> for the first 4 arguments to the function call.
> 
> int,int,float produces:
> 
> 	Produced	Produced		Expected
> 
> 	int	gr26	fr7	-----		===	float
> 	int	gr25	fr6	float		===	-----
> 	---	gr24	fr5	-----		---	-----
> 	---	gr23	fr4	-----		---	-----

You've got the order of the float registers reversed.  They are allocated
in order of increasing number starting with fr4.

> Lately I was thrown by the call to printf (vararg):
> 
> char*,int,double,int,float,int,float:
> 
> 	Produced		Produced	
> 
>         char		gr26	fr7	doubleH
>         int		gr25	fr6	doubleL
>         doubleH		gr24	fr5	-----
>         doubleL		gr23	fr4	-----
> 
> Which really leaves me scratching my head, since gr24 and gr23
> shouldn't be used for relocation in this case? I guess varargs
> are another cute case :}

Again, reverse the order of the float regs and it makes more sense.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)