[Patch] libffi: Add MIPS64 support.
David Daney
ddaney@avtrex.com
Thu Aug 9 15:50:00 GMT 2007
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.
More information about the Java-patches
mailing list