
Thanks. I think the decision here is to do the safe thing
and mask the return results ourselves, since it's only one
extra insn. This won't make it into 5.02, tho.
J
| -----Original Message-----
| From: Sigbjorn Finne [mailto:sof@galconn.com]
| Sent: Saturday, September 08, 2001 4:27 PM
| To: Julian Seward (Intl Vendor)
| Cc: partain@dcs.gla.ac.uk; Ashley Yakeley; GHC List
| Subject: Re: GHC FFI Return Type Bug
|
|
| Here's another data point on this topic - I asked around
| inside of MS, and the consensus is that the contents of the
| unused portions of EAX is undefined upon return (upper 3
| bytes for byte-sized return values, upper 2 for 16-bit
| values). This is invariant of x86 calling convention on Win32
| (cdecl,stdcall,fastcall). Still no known doc/spec which
| spells this out.
|
| ==> GHC's NCG and C backends need to know the sizes of the
| unboxed Ints and Words involved in CCalls to generate correct code.
|
| --sigbjorn
|
| ----- Original Message -----
| From: "Sigbjorn Finne"

Hi! On Mon, 10 Sep 2001, Julian Seward (Intl Vendor) wrote:
[..] extra insn. This won't make it into 5.02, tho.
Speaking of 5.02 . Could someone enlighten us that are not on the CVS mailing list about the state of things? When can we expect the release? /Josef

Thanks. I think the decision here is to do the safe thing and mask the return results ourselves, since it's only one extra insn. This won't make it into 5.02, tho.
So GHC's Int/Word implementation is different from Hugs'? Hugs represents Word8 (say) by a 32 bit int but doesn't guarantee that the top 24 bits are all zero. Instead we either use an 8-bit operation when we operate on a word8 or we mask the arguments and use the 32-bit operation (for *, /, ==, etc.) or we don't mask and use the 32-bit operation (works for and, or, +, and some of the shifts) -- Alastair Reid reid@cs.utah.edu http://www.cs.utah.edu/~reid/
participants (3)
-
Alastair David Reid
-
Josef Svenningsson
-
Julian Seward (Intl Vendor)