Intrinsics For Vector API

Deshpande, Vivek R vivek.r.deshpande at intel.com
Thu Aug 17 00:40:13 UTC 2017


Hi Vladimir

I have updated the patch with  the things you suggested for flags.
The webrev is here:
 http://cr.openjdk.java.net/~vdeshpande/Panama/webrev.02/
Would you please to take a look and sponsor the patch in the mean time in the panama sources.

I have been working on more of the Vector APIs intrinsics. I am also looking at logic for Vbox and using it for VectorBox for safepoints and other cases.
I am looking at case where vector is created using broadcast and used inside a loop and handle the VectorBox with LoopPredicates.

Regards,
Vivek


-----Original Message-----
From: Vladimir Ivanov [mailto:vladimir.x.ivanov at oracle.com] 
Sent: Friday, August 11, 2017 3:46 AM
To: Deshpande, Vivek R <vivek.r.deshpande at intel.com>
Cc: Paul Sandoz <paul.sandoz at oracle.com>; Viswanathan, Sandhya <sandhya.viswanathan at intel.com>; panama-dev at openjdk.java.net
Subject: Re: Intrinsics For Vector API

Nice work, Vivek & Razvan!

Overall, looks really nice.

VectorBox is almost the same as VBox, except there's no vector box instance associated with it. I'm curious what happens if vector box is
needed: either it "escapes" or an identity-sensitive operation is performed on it. In some cases, intrinsification is disabled, but I don't think it is always possible to say in advance the box is needed or not.

Also, I suggest to look at VBox usages and consider adding corresponding logic for VectorBox. For example, there are special cases in deoptimization logic which avoid vector boxing at safepoints by keeping the vector values alive across safepoints and performing lazy rematerialization when deoptimization is needed.

Some other suggestions:

+  diagnostic(bool, UseVectorApiIntrinsics, true,
     +          "Enables intrinsification of Vector API") 
          + 
               +  diagnostic(bool, DebugVectorApi, false, 
                    +          "Enables printing of debug messages for 
Vector API")              + 


In a longer term, experimental (w/ default = false) for UseVectorApiIntrinsics is a better option. But while it's baking in Panama, just a product flag is fine.

Also, DebugVectorApi is actually notproduct (the tracing code isn't part of release build):

+#ifndef PRODUCT
+  if (DebugVectorApi) {
+    tty->print_cr("Trying to intrinsify vector op %s", 
+NodeClassNames[op]);
+  }
+#endif

Best regards,
Vladimir Ivanov

On 8/9/17 7:40 AM, Deshpande, Vivek R wrote:
> Hi Paul
> 
> I have uploaded the rebased patch at this location:
>   http://cr.openjdk.java.net/~vdeshpande/Panama/webrev.01/
> Please take a look and let us know.
> 
> Regards,
> Vivek
> 
> -----Original Message-----
> From: Paul Sandoz [mailto:paul.sandoz at oracle.com]
> Sent: Thursday, August 03, 2017 3:22 PM
> To: Deshpande, Vivek R <vivek.r.deshpande at intel.com>
> Cc: panama-dev at openjdk.java.net; Viswanathan, Sandhya 
> <sandhya.viswanathan at intel.com>
> Subject: Re: Intrinsics For Vector API
> 
> Hi,
> 
> Nice work.
> 
> Would you mind updating the patch to be in sync with the recent refactoring i made to the draft spec API?
> 
> Notably, all classes are now under one package, com.oracle.vector, and the methods to create vector instance have been moved to the species e.g.:
> 
> FloatVector.FloatSpecies<Shapes.S256Bit> species = (FloatVector.FloatSpecies<Shapes.S256Bit>)
>    Vector.speciesInstance(Float.class, Shapes.S_256_BIT); for (int i = 0; i < a.length; i += species.length()) {
>      FloatVector<Shapes.S256Bit> av = species.fromArray(a, i);
>      FloatVector<Shapes.S256Bit> bv = species.fromArray(b, i);
>      av.add(bv).intoArray(c, i);
> }
> 
> Thanks,
> Paul.
> 
>> On 1 Aug 2017, at 17:12, Deshpande, Vivek R <vivek.r.deshpande at intel.com> wrote:
>>
>> Hi All
>>
>> We would like to share the webrev for the Intrinsics for Vector APIs, which add the partial intrinsification support to the APIs.
>> Webrev: http://cr.openjdk.java.net/~vdeshpande/Panama/webrev.00/
>> Code Contributed by:
>> Razvan Lupusoru
>> (razvan.a.lupusoru at intel.com<mailto:razvan.a.lupusoru at intel.com>)
>> Vivek Deshpande(vivek.r.deshpande at intel.com)
>>
>> The AddTest.java in jdk\test\panama\vector-draft-spec\src\test\java can be run like this:
>> java -XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation 
>> -XX:-CheckIntrinsics -XX:TypeProfileLevel=121 
>> -XX:+UseVectorApiIntrinsics -XX:+DebugVectorApi AddTest
>>
>> Thanks.
>> Regards,
>> Vivek
>>
>>
>>
> 


More information about the panama-dev mailing list