[vector] Intrinsics for fromByteArray, fromByteBuffer, intoByteArray, intoByteBuffer
Paul Sandoz
paul.sandoz at oracle.com
Wed May 16 23:08:11 UTC 2018
This looks ok to make progress, but i think we should take a swing at improving it in a further iteration by passing the buffer instance to the intrinsic method, which is further passed to the lambda expression, and thus supporting uniform buffer access, so will improve support in general and also simplify the default implementation. Then we can make the method in the super class abstract so we only have one default implementation.
Paul.
> On May 16, 2018, at 3:56 PM, Lupusoru, Razvan A <razvan.a.lupusoru at intel.com> wrote:
>
> I have created a fix for this issue here:
> http://cr.openjdk.java.net/~rlupusoru/panama/webrev_intoarraycapture_00/
>
> I do confirm that before boxing occurred - and now it no longer does. Thanks for catching this!
>
> --Razvan
>
> -----Original Message-----
> From: Vladimir Ivanov [mailto:vladimir.x.ivanov at oracle.com]
> Sent: Wednesday, May 16, 2018 1:29 AM
> To: Lupusoru, Razvan A <razvan.a.lupusoru at intel.com>
> Cc: panama-dev at openjdk.java.net
> Subject: Re: [vector] Intrinsics for fromByteArray, fromByteBuffer, intoByteArray, intoByteBuffer
>
>
>
> On 5/15/18 16:38, Vladimir Ivanov wrote:
>>
>>> Do you know if this applies to all of the cases that call a super
>>> method? Or is it something specific to intoArray that causes this
>>> problem?
>>
>> It's the former: all (from|into)Byte(Array|Buffer) are affected. No
>> vector instances should be captured by lambdas representing default
>> implementations. Calling a super instance method captures this, so it
>> should be avoided.
>
> To correct myself, from* methods don't matter here because they are declared on species.
>
> Best regards,
> Vladimir Ivanov
>
>>> -----Original Message-----
>>> From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On
>>> Behalf Of Lupusoru, Razvan A
>>> Sent: Tuesday, May 15, 2018 9:42 AM
>>> To: Vladimir Ivanov <vladimir.x.ivanov at oracle.com>;
>>> panama-dev at openjdk.java.net
>>> Subject: RE: [vector] Intrinsics for fromByteArray, fromByteBuffer,
>>> intoByteArray, intoByteBuffer
>>>
>>> Good catch - looks like something that should be fixed. If you don't
>>> get to it, I will try to fix it later in the week. Thanks!
>>>
>>> --Razvan
>>>
>>> -----Original Message-----
>>> From: Vladimir Ivanov [mailto:vladimir.x.ivanov at oracle.com]
>>> Sent: Monday, May 14, 2018 4:45 PM
>>> To: Lupusoru, Razvan A <razvan.a.lupusoru at intel.com>;
>>> panama-dev at openjdk.java.net
>>> Subject: Re: [vector] Intrinsics for fromByteArray, fromByteBuffer,
>>> intoByteArray, intoByteBuffer
>>>
>>>
>>>> http://cr.openjdk.java.net/~rlupusoru/panama/webrev_frombytearr_01/
>>>
>>> src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorB
>>> its.java.template
>>>
>>>
>>> - (arr, idx, v) -> v.forEach((i, a_) ->
>>> (($type$[])arr)[idx + i] = a_));
>>> + (arr, idx) ->
>>> +super.intoArray(($type$[])
>>> arr, idx));
>>>
>>> After that change C2 can't eliminate vector box anymore in
>>> Vector.intoArray() case: the lambda captures "this" vector and,
>>> though the lambda isn't used and goes away during EA, that usage
>>> keeps the box from elimination.
>>>
>>> Best regards,
>>> Vladimir Ivanov
>>>
More information about the panama-dev
mailing list