[foreign] RFR: 8223808: initial port for AArch64

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue May 28 11:25:06 UTC 2019


Actually, a cleaner way to get there is:

public static LayoutType<Short> SHORT = pick(LittleEndian.SysVABI.SHORT, 
LittleEndian.WinABI.SHORT, LittleEndian.AArch64.SHORT);

and then define the logic inside pick() to select the right value 
depending on platform/os.

At least that way the code will appear less cluttered - and if we make 
pick() a varargs it can scale to any number of platform/os - as long as 
we keep some uniformity between the order of arguments being passed.

Another way would be to do a reflective lookup of a constant name - but 
not sure we need all that.

Maurizio

On 28/05/2019 12:20, Maurizio Cimadamore wrote:
>
> On 28/05/2019 11:36, Nick Gasson wrote:
>> Hi Maurizio,
>>
>> On 28/05/2019 16:48, Maurizio Cimadamore wrote:
>>>
>>> * don't you need some extra set of constants under NativeTypes (for 
>>> aarch platform?)
>>
>> Yes, we ought to. I think I reused the LittleEndian.SysVABI ones 
>> initially as they almost exactly match except for long double.
>>
>> For definitions like this:
>>
>>     public static LayoutType<Short> SHORT = isWindows ?
>>             LittleEndian.WinABI.SHORT : LittleEndian.SysVABI.SHORT;
>>
>> Do you want me to change it into something like:
>>
>>    public static LayoutType<Short> SHORT = isX86 ?
>>             (isWindows ?
>>              LittleEndian.WinABI.SHORT : LittleEndian.SysVABI.SHORT)
>>             : LittleEndian.AArch64.SHORT;
>>
>> I can see this getting quite messy as we add more platform combinations.
>
> For now we don't have many choices. Once we get switch expressions we 
> can refactor to nicer code.
>
> Maurizio
>
>>
>>>
>>> * UnalignedStructTest - why doesn't it work? There's an f128 there 
>>> but we're not actually reading/setting it - it's mostly there to 
>>> force alignment a certain way
>>>
>>
>> I think it disabled it at one point because it was failing and saw it 
>> used long double so just assumed that was the cause. But I just went 
>> back and tested it and it passes so must be have been something else 
>> I fixed later. I'll re-enable it.
>>
>> Thanks,
>> Nick


More information about the panama-dev mailing list