Vector API unboxing and masking support

Paul Sandoz paul.sandoz at oracle.com
Sun Sep 24 22:42:47 UTC 2017


> On 24 Sep 2017, at 15:14, Viswanathan, Sandhya <sandhya.viswanathan at intel.com> wrote:
> 
> Hi Razvan,
> 
> The files FloatVector.java and DoubleVector.java are generated from the template X-Vector.java.template. Please change the template instead of changing these files directly.
> 

+1

Razvan, i can help if need be. If so we could probably speed this up if we chat directly on Monday if you are free?

Some other comments:

- for the true/false masks we could add constants to the concrete species, same as we do for zero(), and you only need to do this once in the template X-VectorBits.java.template

- I am not entirely confident about the correctness of the core reshape/cast implementations in relation to any AVX counter part. I dunno if you really want to use rebracket instead? then you don’t need the additional cast method.

Paul.

> Thanks,
> Sandhya
> 
> -----Original Message-----
> From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On Behalf Of Lupusoru, Razvan A
> Sent: Sunday, September 24, 2017 9:43 AM
> To: panama-dev at openjdk.java.net
> Subject: Vector API unboxing and masking support
> 
> Hi everyone,
> 
> Please review the following patch which adds more enhancements to the Vector API:
> http://cr.openjdk.java.net/~vdeshpande/VectorAPI/vectorapi.00/
> 
> Changes in hotspot:
> 
> *         Adds support to generate vptest and a node that represents these semantics. This is used for mask checking methods "anyTrue" and "allTrue"
> 
> *         Added enum bounds for Vector API methods to improve robustness in checking whether a method is Vector API
> 
> *         The intrinsics generator can now see which call node it is replacing (if one exists). This was needed to add in future functionality to analyze graph for boxing generation.
> 
> *         Fixed a bug related to wrong class being set for Vector Box. Namely, the receiver type was always set as the class but in reality, the return type is the correct type.
> 
> *         Added some support around masks and some double methods.
> 
> *         Cleaned up intrinsics code and created common methods for getting vector operands and setting output.
> 
> *         Added some support for Vector unboxing:
> 
> o   In cases where VectorBox nodes feed into phis used by a vector unbox, a new vector phi is created that merge vector values
> 
> o   In all the rest of cases, a vector load is generated to get vector value.
> 
> *         Added a flag to be able to turn off unstable_if speculation named "DisableUnstableIfOpt". This is useful because there is no vector boxing support yet and the speculation makes it so that if there is branching inside vector loop, some values live to runtime which cannot be created.
> 
> Changes in jdk:
> 
> *         Adds capability to generate true and false masks directly without going through constantMask call. This makes it easier to initialize masks.
> 
> *         Marks more methods as being hotspot intrinsic
> 
> *         Creates a copy of cast in FloatVector due to some limitations in the intrinsics matching technology being used. In future this can probably be removed but I needed it to show how to support on compiler side.
> 
> Let me know if you have any comments or questions.
> 
> Thanks,
> Razvan



More information about the panama-dev mailing list