[vector] unsigned operations
Viswanathan, Sandhya
sandhya.viswanathan at intel.com
Mon Apr 5 19:57:46 UTC 2021
Hi Paul,
Your changes look good to me and it could be committed as is.
On the specific questions you asked on next steps for hotspot changes, my thoughts are as follows:
1) Do we need to enhance arch_supports_vector to check if it supports unsigned comparisons? It might make it easier initially to add support separately for different CPU architectures.
All the architectures should support vector unsigned comparison as it is needed by other languages.
For the time being, we could add a function Matcher::supports_unsigned_vector_comparison() which could return false for an architecture till the backend work is completed for it.
2) I suspect I will need to push the unsigned bit into VectorMaskCmpNode and then, at least on x86, update the matching vector compare instruction methods to pass the signed bit to the instruction macros, which are updated accordingly.
Yes, you could pass the cond values as is to the IR node and let the x86.ad file handle it.
e.g. booltest_pred_to_comparison_pred() in x86.ad will need to be updated to handle the additional cond codes and rest should work.
Best Regards,
Sandhya
-----Original Message-----
From: panama-dev <panama-dev-retn at openjdk.java.net> On Behalf Of Paul Sandoz
Sent: Friday, April 02, 2021 3:43 PM
To: panama-dev at openjdk.java.net' <panama-dev at openjdk.java.net>
Subject: [vector] unsigned operations
Hi
Here is an initial attempt to add unsigned operations:
https://github.com/openjdk/panama-vector/compare/vectorIntrinsics...PaulSandoz:unsigned-comparison-operators?expand=1
An extra control bit is added, that when set, signifies unsigned comparison.
At the moment the compare intrinsic bails out if this bit is set:
I need some guidance on next steps to further update HotSpot:
- Do we need to enhance arch_supports_vector to check if it supports unsigned comparisons? It might make it easier initially to add support separately for different CPU architectures.
- I suspect I will need to push the unsigned bit into VectorMaskCmpNode and then, at least on x86, update the matching vector compare instruction methods to pass the signed bit to the instruction macros, which are updated accordingly.
Paul.
More information about the panama-dev
mailing list