Vector API unboxing and masking support
sandhya.viswanathan at intel.com
Sun Sep 24 22:14:33 UTC 2017
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.
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
Please review the following patch which adds more enhancements to the Vector API:
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.
More information about the panama-dev