From: "Carlos O'Donell Jr." <carlos@baldric.uwo.ca>
To: parisc-linux@lists.parisc-linux.org
Subject: [parisc-linux] [carlos@baldric.uwo.ca: Re: Any hppa gurus?]
Date: Thu, 28 Mar 2002 12:28:48 -0500 [thread overview]
Message-ID: <20020328122848.H12094@systemhalted> (raw)
Just a heads-up to see if anyone is having fp issues in
any of their adventures :)
I hope I got all the fp passing stuff right since I'm
no 'hppa guru' ;)
c.
----- Forwarded message from "Carlos O'Donell Jr." <carlos@baldric.uwo.ca> -----
Date: Thu, 28 Mar 2002 12:24:45 -0500
From: "Carlos O'Donell Jr." <carlos@baldric.uwo.ca>
To: Will Newton <will@misconception.org.uk>, debian-hppa@lists.debian.org
Cc: willy@debian.org, dave@hiauly1.hia.nrc.ca
Subject: Re: Any hppa gurus?
User-Agent: Mutt/1.2.5.1i
In-Reply-To: <E16qbcu-0005v7-00.2002-03-28-15-15-45@cmailg3.svr.pol.co.uk>; from will@misconception.org.uk on Thu, Mar 28, 2002 at 03:15:29PM +0000
X-Useless-Header: oooohhmmm, chant the email mantra...
X-Mailer: Patched Mutt OS 1.2.5 - Neural Implant (0% Sync Ratio [..........])
> 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.
avcall-hppa.c:
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 }
69
70 if (l->rtype == __AVstruct) /* push struct return address */
71 sret = l->raddr;
72
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]);
76
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
register.
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.
Cheers,
Carlos.
----- End forwarded message -----
reply other threads:[~2002-03-28 17:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020328122848.H12094@systemhalted \
--to=carlos@baldric.uwo.ca \
--cc=parisc-linux@lists.parisc-linux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.