Unsafe.{get,put}-X-Unaligned; Efficient array comparison intrinsics

Paul Sandoz paul.sandoz at oracle.com
Wed Feb 25 12:34:04 UTC 2015

On Feb 25, 2015, at 12:47 PM, Andrew Haley <aph at redhat.com> wrote:

> On 02/25/2015 11:26 AM, Paul Sandoz wrote:
>> I think it simpler just to have one method with a boolean parameter
>> whose default false value means native and true means
>> BigEndian. Otherwise, even simpler, just support native only (like
>> the existing access impls) and let the caller reverse as/when
>> required.
> There have to be different big- and little-endian versions of the
> get/put methods because of the different way that subwords are merged.
> See hotspot/src/cpu/ppc/vm/bytes_ppc.hpp, with its two versions of
> these methods.  

Ah, i just looked at the x86 and sparc versions.

> So we're going to need big and little versions for
> hardware with no unaligned access.  Any given machine will only use
> one set of these methods.

I am a little confused about the bi-endianess of PPC. The supported endianess in bytes_ppc.hpp is defined at compile time via the flag VM_LITTLE_ENDIAN. So is "native" whatever hotspot is compiled to in this case?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20150225/7903d8dd/signature.asc>

More information about the hotspot-compiler-dev mailing list