RFR: 8073093: AARCH64: C2 generates poor code for ByteBuffer accesses

Vladimir Kozlov vladimir.kozlov at oracle.com
Sat Feb 14 00:05:20 UTC 2015


x86 has flag UseUnalignedLoadStores which is set to true depending on 
which version of CPU VM runs. The CPU version is determined based on 
CPUID instruction results.

Does AARCH64 has something similar?

Regards,
Vladimir

On 2/13/15 3:41 PM, Dean Long wrote:
> On 2/13/2015 3:04 PM, christos at zoulas.com wrote:
>> On Feb 13,  2:52pm, dean.long at oracle.com (Dean Long) wrote:
>> -- Subject: Re: RFR: 8073093: AARCH64: C2 generates poor code for
>> ByteBuffer
>>
>> | My understanding is that whether or not aarch64 allows unaligned=20
>> | accesses is based on a
>> | system setting, so this change is too simplistic.  I would prefer
>> that=20
>> | this was controlled with
>> | something more flexible, like "sun.cpu.unaligned".
>>
>> So does x86_64 and you can ask the CPU if it is enabled... I am not sure
>> if a variable setting makes sense because if alignment is required you
>> get a signal (BUS error -- hi linux, SEGV), or incorrect results.
>>
>> christos
>
> So it sounds like we need to determine if unaligned accesses are
> supported during startup,
> in a platform-specific way.  This could be exposed through a property
> like I suggested,
> or perhaps a new Unsafe method.
>
> Regarding x86_64, there may be places in the JVM that already assume
> unaligned accesses
> are allowed, so disabling them may completely break the JVM until those
> assumptions
> are fixed.
>
> dl



More information about the core-libs-dev mailing list