[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Any hppa gurus?

> I am still seeing a very similar problem with latest unstable gcc.
> The first four floats (or first two doubles) passed to an indirect function 
> are always 0.0.
> > I could help out with any questions you might have
> > (or coerce the information out of others I know ;)
> Any help would be much appreciated. I have attached the code (it is quite 
> small). It's aim is to take an array of arguments and pass them to a native 
> function. Unfortunately the function does not work for doubles and there also 
> seems to be a crash for some reason (stack corruption?) after several calls.


     64   {
     65     int i;
     66     for (i = -arglen; i < -4; i++)      /* push function args onto stack */
     67       argframe[i] = l->args[__AV_ALIST_WORDS+i];
     68   }
     70   if (l->rtype == __AVstruct)           /* push struct return address */
     71     sret = l->raddr;
     73                                 /* call function, pass 4 args in registers */
     74   i = (*l->func)(l->args[__AV_ALIST_WORDS-1], l->args[__AV_ALIST_WORDS-2],
     75                  l->args[__AV_ALIST_WORDS-3], l->args[__AV_ALIST_WORDS-4]);

64-68 - Great, pass it on the stack
75-75 - Need to check argument type, if float/double it needs to passed
        via fr4-fr7 else gr23-gr26.

It's been decided to go with the ~"64-bit HPUX ABI" and stop passing floating 
point values in general registers (since this requires proper CALL info 
and relocating stubs from the linker).

Which means you can no longer place float/double arguments into general

What does the av_alist structure look like? If it has a 'type' per argument,
it it shouldn't be too hard to write the code.

Current way it's done:
No Arguments in general registers:

1 Double  - fr7 (fr7 hi, fr6 low)
2 Doubles - fr7,fr5
3 Doubles - fr7,fr5,Stack...

1 Float   - fr7
2 Floats  - fr7,fr6
3 Floats  - fr7,fr6,fr5
4 Floats  - fr7,fr6,fr5,fr4
5 Floats  - fr7,fr6,fr5,fr4,Stack...

And then some old stuff due to 'thinking its doing relocation':

2 Doubles with argument in the first 1-2 general 
(gr25,26) register:
	- fr7(fr7 hi, fr6 low),Stack...

2 Doubles with arugment in the first 3-4 general 
(gr23,24,25,26) registers:
	- Stack...

And so on... most of this is due to thinking:
- Is there enough space for the argument in the general registers?
	- No -> Stack
	- Yes -> Pass as fp argument in fr's.


To UNSUBSCRIBE, email to debian-hppa-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: