Dealing with Complex memory values
Ty Young
youngty1997 at gmail.com
Mon Jan 20 11:42:32 UTC 2020
On 1/20/20 5:16 AM, Maurizio Cimadamore wrote:
> For now these are not supported - but not because we'd like to leave
> this to higher level (in some cases I don't think the higher level
> even can -as passing these constants require special handling, such as
> using special registers such as x87 ones).
Thanks for the clarification.
>
> The main issue is with the fact that we don't have big enough (read
> 128 bits) carriers in Java to be used in conjunction with the memory
> access API. But, thankfully, Valhalla will allow us to define any kind
> of additional carriers we need, of any size.
Didn't know that was part of Valhalla. Is Valhalla's progress required
for Memory Access to be complete or can all that be added after the fact?
And can these new carriers be user defined, or do they need to be baked
into the JDK itself? If baked into the JDK, will there be updates to
expand the list of carrier types?
>
> So, the way I see this really ending up is, to use an inline type like
> long128, and use it to model constants like long_double and the likes
> (on Linux).
>
> If this becomes a problem, we could start adding support for long[]
> carriers in the memory access API, and treat values that are too big
> to fit in a Java long as long[] - but I'm less sure that Hotspot will
> be able to optimize VarHandles with long[] efficiently (because of the
> allocation).
That sounds really hacky, ugly, and unrepresentative even ignoring the
optimization issue.
I'm not familiar with the technical details so apologizes if this is a
dumb question but... would it still not be possible to define these
types now butinterpreted using a hacky workaround behind the scenes and
then implement them properly later when Vahlhalla is finished?
>
> Maurizio
>
>
> On 18/01/2020 21:25, Ty Young wrote:
>> Hi,
>>
>>
>> What features, if any, are there currently or going to be to deal
>> with Complex memory values based on SysV's C_COMPLEX_LONGDOUBLE or
>> similar? Or is dealing with such things going to be the
>> responsibility of high level abstractions?
>>
More information about the panama-dev
mailing list