Extract/Insert Java API Modifications for VectorAPI

Rukmannagari, Shravya shravya.rukmannagari at intel.com
Fri Apr 3 22:14:57 UTC 2020


Hi Vladimir,
Please find the updated webrev below which now calls a helper method. Please let me know if you have any questions or comments.
http://cr.openjdk.java.net/~srukmannagar/VectorAPI_vectorExtractInsert/webrev.03/

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_vectorExtractInsert
> /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_vectorExtractInse
>>> rt/webrev.01/
>>>
>>> Thanks,
>>> Shravya.
>>>
>>
> 


More information about the panama-dev mailing list