This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [Patch] libffi: Add MIPS64 support.
- From: David Daney <ddaney at avtrex dot com>
- To: David Daney <ddaney at avtrex dot com>, GCJ-patches <java-patches at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>, richard at codesourcery dot com
- Date: Thu, 09 Aug 2007 08:48:36 -0700
- Subject: Re: [Patch] libffi: Add MIPS64 support.
- References: <46BA9F13.2090003@avtrex.com> <87r6mddo7z.fsf@firetop.home>
Richard Sandiford wrote:
David Daney <ddaney@avtrex.com> writes:
+ /* The size of a pointer depends on the ABI */
+ if (type == FFI_TYPE_POINTER)
+ type =
+ (ecif->cif->abi == FFI_N64) ? FFI_TYPE_UINT64 : FFI_TYPE_UINT32;
Was there a reason for preferring UINT to SINT here? Naively, I'd have
expected to see pointers treated as signed, especially for n32. I can well
imagine it makes no practical difference. I just thought I'd ask.
That sequence happens twice.
In the first case, you are probably correct. We are copying the pointer
into a wider type. In practice it does not matter because all valid
user space pointers have the high bit clear so there would never be a
case where the not sign extending would produce a different result than
if you did sign extend.
In the second case the bits are copied to a location of the same width
as a pointer so sign extension is not an issue.
I will look at this again and perhaps change it before committing.
David Daney.