Extract/Insert Java API Modifications for VectorAPI

Rukmannagari, Shravya shravya.rukmannagari at intel.com
Tue Apr 7 00:18:48 UTC 2020


Hi Vladimir,
Please find the webrev below with the updated patch.
http://cr.openjdk.java.net/~srukmannagar/VectorAPI_vectorExtractInsert/webrev.05/

Thanks,
Shravya.

-----Original Message-----
From: Vladimir Ivanov <vladimir.x.ivanov at oracle.com> 
Sent: Friday, April 3, 2020 4:18 PM
To: Rukmannagari, Shravya <shravya.rukmannagari at intel.com>; Paul Sandoz <paul.sandoz at oracle.com>
Cc: panama-dev <panama-dev at openjdk.java.net>
Subject: Re: Extract/Insert Java API Modifications for VectorAPI


> http://cr.openjdk.java.net/~srukmannagar/VectorAPI_vectorExtractInsert
> /webrev.03/

Looks good!

One more suggestion: you can remove the bounds checks and throw IllegalArgumentException from the default case right away.

Additional assert can validate that the switch size agrees with vector length (VLENGTH).

Best regards,
Vladimir Ivanov

> JBS Bug Entry:
> https://bugs.openjdk.java.net/browse/JDK-8242144
> 
> Thanks,
> Shravya.
> 
> 
> -----Original Message-----
> From: Vladimir Ivanov <vladimir.x.ivanov at oracle.com>
> Sent: Wednesday, April 1, 2020 12:20 AM
> To: Rukmannagari, Shravya <shravya.rukmannagari at intel.com>; Paul 
> Sandoz <paul.sandoz at oracle.com>
> Cc: panama-dev <panama-dev at openjdk.java.net>
> Subject: Re: Extract/Insert Java API Modifications for VectorAPI
> 
> 
>> http://cr.openjdk.java.net/~srukmannagar/VectorAPI_vectorExtractInser
>> t
>> /webrev.02/
> 
> +        switch (i) {
> +            case 0: return VectorSupport.insert(VCLASS, ETYPE, 
> + VLENGTH,
> this, 0, (long)e, (v, ix, bits) -> { int[] res = v.vec().clone(); 
> res[ix] = (int)bits; return v.vectorFactory(res); });
> +            case 1: return VectorSupport.insert(VCLASS, ETYPE, 
> + VLENGTH,
> this, 1, (long)e, (v, ix, bits) -> { int[] res = v.vec().clone(); 
> res[ix] = (int)bits; return v.vectorFactory(res); });
> +            default: throw new InternalError();
> +        }
> 
> What about introducing a helper method, put the intrinsic call there, and call it with different indices from the switch?
> 
> It should significantly reduce amount of duplicated code.
> 
> Best regards,
> Vladimir Ivanov
> 
>> -----Original Message-----
>> From: Paul Sandoz <paul.sandoz at oracle.com>
>> Sent: Tuesday, March 31, 2020 2:48 PM
>> To: Rukmannagari, Shravya <shravya.rukmannagari at intel.com>
>> Cc: panama-dev <panama-dev at openjdk.java.net>
>> Subject: Re: Extract/Insert Java API Modifications for VectorAPI
>>
>> Can we leave the existing code in place for *MaxVector?
>>
>> Paul.
>>
>>> On Mar 31, 2020, at 2:06 PM, Rukmannagari, Shravya <shravya.rukmannagari at intel.com> wrote:
>>>
>>> Hi Paul,
>>> Thanks a lot for the review. There seems to be no easy solution to handle MaxVector with the current patch. We can drop this for now and handle it in the future updates.
>>>
>>> Thanks,
>>> Shravya.
>>>
>>> -----Original Message-----
>>> From: Paul Sandoz <paul.sandoz at oracle.com>
>>> Sent: Tuesday, March 31, 2020 1:04 PM
>>> To: Rukmannagari, Shravya <shravya.rukmannagari at intel.com>
>>> Cc: panama-dev <panama-dev at openjdk.java.net>
>>> Subject: Re: Extract/Insert Java API Modifications for VectorAPI
>>>
>>> Hi,
>>>
>>> Will the Java implementation fail for *MaxVector for lanes > 8?
>>>
>>> Reducing the horizontal line-length would help for review purposes.  Perhaps place the lambda argument at the end on a new line.
>>>
>>> Paul.
>>>
>>>> On Mar 31, 2020, at 12:40 PM, Rukmannagari, Shravya <shravya.rukmannagari at intel.com> wrote:
>>>>
>>>> Hi All,
>>>> Please find the webrev below which modifies the definition of extract and insert. These are currently intrinsified on x86 platforms for a constant value idx, whereas the API provides a runtime variable to the function call.
>>>> http://cr.openjdk.java.net/~srukmannagar/VectorAPI_vectorExtractIns
>>>> e
>>>> rt/webrev.01/
>>>>
>>>> Thanks,
>>>> Shravya.
>>>>
>>>
>>


More information about the panama-dev mailing list