This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] libffi: Add MIPS64 support.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]