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

John David Anglin dave@hiauly1.hia.nrc.ca
Sat, 30 Mar 2002 12:36:09 -0500 (EST)


> > 
> > So, are the first four floats/doubles in an arg list always passed in 
> > registers?

No.  Although it might seem that you could pass 4 floats and 4 ints, this
is not done.  The 32-bit linux ABI is exactly the same as the 32-bit hpux ABI
except that argument relocations aren't done.  There are situations (e.g.,
indirect calls) where an argument is passed in both general and floating
registers under hpux because the linker doesn't know how to relocate
the arguments for the call.  Thus, you can't use gr24 for an int argument
and fr5 for a different float argument.

This isn't going to change as changing the ABI would require recompilation
of everthing, as well as modifications to gcc, binutils, gdb and the
runtime documentation.  You can find the HP runtime documents here:
<http://h21007.www2.hp.com/dspp/tech/tech_TechTypeListingPage_IDX/1,1704,10403,00.html>.

> > 
> > How about func(int, float, int, double, int, float)?
> > 
> >
> 
> A float fits into a single fr register.
> A double fits into two fr registers (fr7 (uses fr6),fr5 (uses fr4)) 
> 
> 
> 	int    gr26 - fr7    ===
> 	===    gr25 - fr6    ===
> 	int    gr24 - fr5    float
> 	===    gr23 - fr4    ===

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